diff --git a/bin/ast b/bin/ast index 5f12d5d8bd1..2ce305c077f 100755 --- a/bin/ast +++ b/bin/ast @@ -191,7 +191,7 @@ def ir_setup(root) JRuby::IR.compiler_debug = true - builder = org.jruby.ir.IRBuilder + builder = org.jruby.ir.builder.IRBuilderAST scope = builder.build_root(manager, root).scope scope.prepare_for_compilation diff --git a/core/pom.rb b/core/pom.rb index f98e1c1fdf1..50397f47bf7 100644 --- a/core/pom.rb +++ b/core/pom.rb @@ -53,7 +53,7 @@ jar 'org.jruby.joni:joni:2.2.1' jar 'org.jruby.jcodings:jcodings:1.0.58' - jar 'org.jruby:dirgra:0.3' + jar 'org.jruby:dirgra:0.5' jar 'com.headius:invokebinder:1.13' jar 'com.headius:options:1.6' diff --git a/core/pom.xml b/core/pom.xml index 1f276707474..f13d9ab4488 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -159,7 +159,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby dirgra - 0.3 + 0.5 com.headius diff --git a/core/src/main/java/org/jruby/ObjectFlags.java b/core/src/main/java/org/jruby/ObjectFlags.java index e3cf10bb4ae..4b25eb54da8 100644 --- a/core/src/main/java/org/jruby/ObjectFlags.java +++ b/core/src/main/java/org/jruby/ObjectFlags.java @@ -22,6 +22,7 @@ public interface ObjectFlags { int IS_OVERLAID_F = registry.newFlag(RubyModule.class); int OMOD_SHARED = registry.newFlag(RubyModule.class); int INCLUDED_INTO_REFINEMENT = registry.newFlag(RubyModule.class); + int TEMPORARY_NAME = registry.newFlag(RubyModule.class); int CR_7BIT_F = registry.newFlag(RubyString.class); int CR_VALID_F = registry.newFlag(RubyString.class); diff --git a/core/src/main/java/org/jruby/RubyBasicObject.java b/core/src/main/java/org/jruby/RubyBasicObject.java index 15646d75bbe..87e4ca665a1 100644 --- a/core/src/main/java/org/jruby/RubyBasicObject.java +++ b/core/src/main/java/org/jruby/RubyBasicObject.java @@ -840,7 +840,10 @@ private static void initCopy(ThreadContext context, IRubyObject clone, IRubyObje original.copySpecialInstanceVariables(clone); - if (original.hasVariables()) clone.syncVariables(original); + if (original.hasVariables()) { + clone.syncVariables(original); + ((RubyBasicObject) clone).dupFinalizer(); + } if (original instanceof RubyModule) { RubyModule cloneMod = (RubyModule)clone; cloneMod.syncConstants((RubyModule)original); @@ -897,19 +900,16 @@ public IRubyObject rbClone(ThreadContext context, IRubyObject maybeOpts) { return rbCloneInternal(context, kwfreeze); } - // freeze (false, true, nil) - private RubyBasicObject rbCloneInternal(ThreadContext context, IRubyObject freeze) { - - // MRI: immutable_obj_clone - if (isSpecialObject()) { - final Ruby runtime = context.runtime; - if (freeze == runtime.getFalse()) throw runtime.newArgumentError(str(runtime, "can't unfreeze ", types(runtime, getType()))); + // MRI: rb_dup_setup + protected RubyBasicObject dupSetup(ThreadContext context, RubyBasicObject dup) { + initCopy(context, dup, this); + sites(context).initialize_dup.call(context, dup, dup, this); - return this; - } + return dup; + } - // We're cloning ourselves, so we know the result should be a RubyObject - RubyBasicObject clone = (RubyBasicObject) metaClass.getRealClass().allocate(); + // MRI: rb_clone_setup + protected RubyBasicObject cloneSetup(ThreadContext context, RubyBasicObject clone, IRubyObject freeze) { clone.setMetaClass(getSingletonClassCloneAndAttach(clone)); initCopy(context, clone, this); @@ -930,6 +930,24 @@ private RubyBasicObject rbCloneInternal(ThreadContext context, IRubyObject freez } + // freeze (false, true, nil) + private RubyBasicObject rbCloneInternal(ThreadContext context, IRubyObject freeze) { + + // MRI: immutable_obj_clone + if (isSpecialObject()) { + final Ruby runtime = context.runtime; + if (freeze == runtime.getFalse()) throw runtime.newArgumentError(str(runtime, "can't unfreeze ", types(runtime, getType()))); + + return this; + } + + // We're cloning ourselves, so we know the result should be a RubyObject + RubyBasicObject clone = (RubyBasicObject) metaClass.getRealClass().allocate(); + + return cloneSetup(context, clone, freeze); + } + + protected RubyClass getSingletonClassClone() { return getSingletonClassCloneAndAttach(null); } @@ -1226,14 +1244,7 @@ public boolean eql(IRubyObject other) { public void addFinalizer(IRubyObject f) { Finalizer finalizer = (Finalizer) getInternalVariable("__finalizer__"); if (finalizer == null) { - // since this is the first time we're registering a finalizer, we - // must also register this object in ObjectSpace, so that future - // calls to undefine_finalizer, which takes an object symbol, can - // locate the object properly. See JRUBY-4839. - long id = getObjectId(); - IRubyObject fixnumId = id(); - - getRuntime().getObjectSpace().registerObjectId(id, this); + IRubyObject fixnumId = registerWithObjectSpace(); finalizer = new Finalizer(fixnumId); setInternalVariable("__finalizer__", finalizer); @@ -1242,6 +1253,34 @@ public void addFinalizer(IRubyObject f) { finalizer.addFinalizer(f); } + private IRubyObject registerWithObjectSpace() { + // since this is the first time we're registering a finalizer, we + // must also register this object in ObjectSpace, so that future + // calls to undefine_finalizer, which takes an object symbol, can + // locate the object properly. See JRUBY-4839. + long id = getObjectId(); + IRubyObject fixnumId = id(); + + getRuntime().getObjectSpace().registerObjectId(id, this); + return fixnumId; + } + + /** + * Stange method. We will dup the __finalizer__ variable in a freshly dup'd object, + * but it needs to be set to this objects __finalizer__. + */ + protected void dupFinalizer() { + Finalizer finalizer = (Finalizer) getInternalVariable("__finalizer__"); + if (finalizer != null) { + // We need ObjectSpace to make this object reachable for the finalization + IRubyObject fixnumId = registerWithObjectSpace(); + + finalizer = new Finalizer(fixnumId, finalizer); + setInternalVariable("__finalizer__", finalizer); + getRuntime().addFinalizer(finalizer); + } + } + /** * Remove all the finalizers for this object. */ @@ -1870,6 +1909,17 @@ public Finalizer(RubyFixnum id) { this((IRubyObject) id); } + /** + * Cloning finalizer needs new copy with its own id. + * @param id + * @param original + */ + public Finalizer(IRubyObject id, Finalizer original) { + this(id); + this.firstFinalizer = original.firstFinalizer; + this.finalizers = original.finalizers == null ? null : new ArrayList<>(original.finalizers); + } + Finalizer(IRubyObject id) { this.id = id; this.finalized = new AtomicBoolean(false); @@ -1879,7 +1929,7 @@ public void addFinalizer(IRubyObject finalizer) { if (firstFinalizer == null) { firstFinalizer = finalizer; } else { - if (finalizers == null) finalizers = new ArrayList(4); + if (finalizers == null) finalizers = new ArrayList<>(4); finalizers.add(finalizer); } } diff --git a/core/src/main/java/org/jruby/RubyBignum.java b/core/src/main/java/org/jruby/RubyBignum.java index 08ebc536ca6..b0a443d4077 100644 --- a/core/src/main/java/org/jruby/RubyBignum.java +++ b/core/src/main/java/org/jruby/RubyBignum.java @@ -50,6 +50,8 @@ import org.jruby.runtime.marshal.MarshalStream; import org.jruby.runtime.marshal.UnmarshalStream; +import static org.jruby.RubyFixnum.zero; + /** * * @author jpetersen @@ -224,9 +226,9 @@ public static double big2dbl(RubyBignum val) { } private RubyFixnum checkShiftDown(ThreadContext context, RubyBignum other) { - if (other.value.signum() == 0) return RubyFixnum.zero(context.runtime); + if (other.value.signum() == 0) return zero(context.runtime); if (value.compareTo(LONG_MIN) < 0 || value.compareTo(LONG_MAX) > 0) { - return other.value.signum() >= 0 ? RubyFixnum.zero(context.runtime) : RubyFixnum.minus_one(context.runtime); + return other.value.signum() >= 0 ? zero(context.runtime) : RubyFixnum.minus_one(context.runtime); } return null; } @@ -332,47 +334,30 @@ public IRubyObject truncate(ThreadContext context, IRubyObject arg){ @Override public RubyArray digits(ThreadContext context, IRubyObject base) { BigInteger self = value; - Ruby runtime = context.runtime; - if (self.compareTo(BigInteger.ZERO) == -1) { - throw runtime.newMathDomainError("out of domain"); - } - if (!(base instanceof RubyInteger)) { - try { - base = base.convertToInteger(); - } catch (ClassCastException e) { - String cname = getMetaClass(base).getRealClass().getName(); - throw runtime.newTypeError("wrong argument type " + cname + " (expected Integer)"); - } - } - BigInteger bigBase; - if (base instanceof RubyBignum) { - bigBase = ((RubyBignum) base).value; - } else { - bigBase = long2big( ((RubyFixnum) base).value ); - } + if (self.compareTo(BigInteger.ZERO) == -1) throw context.runtime.newMathDomainError("out of domain"); - if (bigBase.signum() == -1) { - throw runtime.newArgumentError("negative radix"); - } - if (bigBase.compareTo(BigInteger.valueOf(2)) == -1) { - throw runtime.newArgumentError("invalid radix: " + bigBase); - } + base = base.convertToInteger(); - RubyArray res = RubyArray.newArray(context.runtime, 0); + BigInteger bigBase = base instanceof RubyBignum ? + ((RubyBignum) base).value : long2big(((RubyFixnum) base).value); + + if (bigBase.signum() == -1) throw context.runtime.newArgumentError("negative radix"); + if (bigBase.compareTo(BigInteger.valueOf(2)) == -1) throw context.runtime.newArgumentError("invalid radix: " + bigBase); if (self.signum() == 0) { - res.append(RubyFixnum.newFixnum(context.getRuntime(), 0)); - return res; - } + return RubyArray.newArray(context.runtime, zero(context.runtime)); + } else { + RubyArray res = RubyArray.newArray(context.runtime, 0); - while (self.signum() > 0) { - BigInteger q = self.mod(bigBase); - res.append(RubyBignum.newBignum(context.getRuntime(), q)); - self = self.divide(bigBase); - } + while (self.signum() > 0) { + BigInteger q = self.mod(bigBase); + res.append(RubyBignum.newBignum(context.runtime, q)); + self = self.divide(bigBase); + } - return res; + return res; + } } /** rb_big_to_s @@ -716,11 +701,11 @@ public IRubyObject quo(ThreadContext context, IRubyObject other) { @JRubyMethod(name = {"**", "power"}) public IRubyObject op_pow(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; - if (other == RubyFixnum.zero(runtime)) return RubyFixnum.one(runtime); + if (other == zero(runtime)) return RubyFixnum.one(runtime); final double d; if (other instanceof RubyFloat) { d = ((RubyFloat) other).value; - if (compareTo(RubyFixnum.zero(runtime)) == -1 && d != Math.round(d)) { + if (compareTo(zero(runtime)) == -1 && d != Math.round(d)) { RubyComplex complex = RubyComplex.newComplexRaw(context.runtime, this); return sites(context).op_exp.call(context, complex, complex, other); } @@ -848,7 +833,7 @@ public IRubyObject op_lshift(ThreadContext context, IRubyObject other) { if (shift < 0) { if (value.bitLength() <= -shift ) { if (value.signum() >= 0) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } else { return RubyFixnum.minus_one(context.runtime); } @@ -857,7 +842,7 @@ public IRubyObject op_lshift(ThreadContext context, IRubyObject other) { break; } else if (other instanceof RubyBignum) { if (value.signum() == 0) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } RubyBignum otherBignum = (RubyBignum) other; @@ -882,7 +867,7 @@ public IRubyObject op_lshift(ThreadContext context, IRubyObject other) { @Override public RubyInteger op_lshift(ThreadContext context, long shift) { if (value.signum() == 0) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } if (shift > Integer.MAX_VALUE) { @@ -904,7 +889,7 @@ public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { shift = ((RubyFixnum) other).value; if (value.bitLength() <= shift ) { if (value.signum() >= 0) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } else { return RubyFixnum.minus_one(context.runtime); } @@ -912,7 +897,7 @@ public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { break; } else if (other instanceof RubyBignum) { if (value == BigInteger.ZERO) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } RubyBignum otherBignum = (RubyBignum) other; @@ -937,7 +922,7 @@ public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { @Override public RubyInteger op_rshift(ThreadContext context, long shift) { if (value.signum() == 0) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } if (shift < Integer.MIN_VALUE) { @@ -968,17 +953,17 @@ protected IRubyObject op_aref_subclass(ThreadContext context, IRubyObject other) if (other instanceof RubyBignum) { // '!=' for negative value if ((((RubyBignum) other).value.signum() >= 0) != (value.signum() == -1)) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } return RubyFixnum.one(context.runtime); } } long position = num2long(other); if (position < 0 || position > Integer.MAX_VALUE) { - return RubyFixnum.zero(context.runtime); + return zero(context.runtime); } - return value.testBit((int)position) ? RubyFixnum.one(context.runtime) : RubyFixnum.zero(context.runtime); + return value.testBit((int)position) ? RubyFixnum.one(context.runtime) : zero(context.runtime); } private enum BIGNUM_OP_T { @@ -1086,7 +1071,7 @@ private IRubyObject float_cmp(ThreadContext context, RubyFloat y) { yf = yd - yi; IRubyObject rel = op_cmp(context, newBignorm(runtime, yi)); - if (yf == 0.0 || !rel.equals(RubyFixnum.zero(runtime))) { + if (yf == 0.0 || !rel.equals(zero(runtime))) { return rel; } if (yf < 0.0) { @@ -1335,7 +1320,7 @@ public IRubyObject isNegative(ThreadContext context) { if (op_lt_site.isBuiltin(metaClass)) { return RubyBoolean.newBoolean(context, value.signum() < 0); } - return op_lt_site.call(context, this, this, RubyFixnum.zero(context.runtime)); + return op_lt_site.call(context, this, this, zero(context.runtime)); } @Override @@ -1344,7 +1329,7 @@ public IRubyObject isPositive(ThreadContext context) { if (op_gt_site.isBuiltin(metaClass)) { return RubyBoolean.newBoolean(context, value.signum() > 0); } - return op_gt_site.call(context, this, this, RubyFixnum.zero(context.runtime)); + return op_gt_site.call(context, this, this, zero(context.runtime)); } @Override diff --git a/core/src/main/java/org/jruby/RubyFixnum.java b/core/src/main/java/org/jruby/RubyFixnum.java index 1d68a68c5b9..1c73bd4067f 100644 --- a/core/src/main/java/org/jruby/RubyFixnum.java +++ b/core/src/main/java/org/jruby/RubyFixnum.java @@ -372,44 +372,30 @@ public IRubyObject truncate(ThreadContext context, IRubyObject arg) { */ @Override public RubyArray digits(ThreadContext context, IRubyObject base) { - final Ruby runtime = context.runtime; - long value = getLongValue(); - if (value < 0) { - throw runtime.newMathDomainError("out of domain"); - } - if (!(base instanceof RubyInteger)) { - try { - base = base.convertToInteger(); - } catch (ClassCastException e) { - String cname = getMetaClass(base).getRealClass().getName(); - throw runtime.newTypeError("wrong argument type " + cname + " (expected Integer)"); - } - } - if (base instanceof RubyBignum){ - return RubyArray.newArray(context.runtime, newFixnum(runtime, value)); - } + if (value < 0) throw context.runtime.newMathDomainError("out of domain"); + + base = base.convertToInteger(); + + if (base instanceof RubyBignum) return RubyArray.newArray(context.runtime, newFixnum(context.runtime, value)); + long longBase = ((RubyFixnum) base).value; - if (longBase < 0) { - throw runtime.newArgumentError("negative radix"); - } - if (longBase < 2) { - throw runtime.newArgumentError("invalid radix: " + longBase); - } + if (longBase < 0) throw context.runtime.newArgumentError("negative radix"); + if (longBase < 2) throw context.runtime.newArgumentError("invalid radix: " + longBase); if (value == 0) { - return RubyArray.newArray(context.runtime, zero(runtime)); - } + return RubyArray.newArray(context.runtime, zero(context.runtime)); + } else { + RubyArray res = RubyArray.newArray(context.runtime, 0); - RubyArray res = RubyArray.newArray(context.runtime, 0); + while (value > 0) { + res.append(newFixnum(context.runtime, value % longBase)); + value /= longBase; + } - while (value > 0) { - res.append(newFixnum(runtime, value % longBase)); - value /= longBase; + return res; } - - return res; } diff --git a/core/src/main/java/org/jruby/RubyIO.java b/core/src/main/java/org/jruby/RubyIO.java index b514700441c..6f44424df8f 100644 --- a/core/src/main/java/org/jruby/RubyIO.java +++ b/core/src/main/java/org/jruby/RubyIO.java @@ -2573,6 +2573,9 @@ public IRubyObject getline(ThreadContext context, RubyIO self, IRubyObject rs, i private static final Getline.Callback GETLINE_YIELD = new Getline.Callback() { @Override public RubyIO getline(ThreadContext context, RubyIO self, IRubyObject rs, int limit, boolean chomp, Block block) { + if (limit == 0) { + throw context.runtime.newArgumentError("invalid limit: 0 for foreach"); + } IRubyObject line; while ((line = self.getlineImpl(context, rs, limit, chomp)) != context.nil) { @@ -3837,9 +3840,6 @@ private static IRubyObject foreachInternal(ThreadContext context, IRubyObject re case 3: Getline.getlineCall(context, GETLINE_YIELD, io, io.getReadEncoding(context), args[1], args[2], block); break; - case 4: - Getline.getlineCall(context, GETLINE_YIELD, io, io.getReadEncoding(context), args[1], args[2], args[3], block); - break; } } finally { io.close(); @@ -4344,7 +4344,7 @@ static IRubyObject seekBeforeAccess(ThreadContext context, RubyIO io, IRubyObjec } // rb_io_s_readlines - @JRubyMethod(name = "readlines", required = 1, optional = 3, checkArity = false, meta = true) + @JRubyMethod(name = "readlines", required = 1, optional = 2, checkArity = false, meta = true) public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock) { IRubyObject opt = ArgsUtil.getOptionsArg(context.runtime, args); final RubyIO io = openKeyArgs(context, recv, args, opt); @@ -4359,11 +4359,8 @@ public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRu case 3: if (opt != context.nil) return io.readlines(context, args[1], opt); return io.readlines(context, args[1], args[2]); - case 4: - if (opt != context.nil) return io.readlines(context, args[1], args[2], opt); - return io.readlines(context, args[1], args[2], args[3]); default: - Arity.raiseArgumentError(context, args.length, 1, 4); + Arity.raiseArgumentError(context, args.length, 1, 3); throw new AssertionError("BUG"); } } finally { io.close(); } diff --git a/core/src/main/java/org/jruby/RubyMethod.java b/core/src/main/java/org/jruby/RubyMethod.java index 2bc9e876dad..b109a525abe 100644 --- a/core/src/main/java/org/jruby/RubyMethod.java +++ b/core/src/main/java/org/jruby/RubyMethod.java @@ -214,9 +214,16 @@ private long hashCodeImpl() { @Override public RubyMethod rbClone() { RubyMethod newMethod = newMethod(implementationModule, methodName, originModule, originName, entry, receiver); - newMethod.setMetaClass(getMetaClass()); - if (isFrozen()) newMethod.setFrozen(true); - return newMethod; + ThreadContext context = getRuntime().getCurrentContext(); + + return (RubyMethod) cloneSetup(context, newMethod, context.nil); + } + + @JRubyMethod + public RubyMethod dup(ThreadContext context) { + RubyMethod newMethod = newMethod(implementationModule, methodName, originModule, originName, entry, receiver); + + return (RubyMethod) dupSetup(context, newMethod); } /** Create a Proc object. diff --git a/core/src/main/java/org/jruby/RubyModule.java b/core/src/main/java/org/jruby/RubyModule.java index f4df06cdd17..5c34f3e5497 100644 --- a/core/src/main/java/org/jruby/RubyModule.java +++ b/core/src/main/java/org/jruby/RubyModule.java @@ -166,6 +166,7 @@ public class RubyModule extends RubyObject { public static final int IS_OVERLAID_F = ObjectFlags.IS_OVERLAID_F; public static final int OMOD_SHARED = ObjectFlags.OMOD_SHARED; public static final int INCLUDED_INTO_REFINEMENT = ObjectFlags.INCLUDED_INTO_REFINEMENT; + public static final int TEMPORARY_NAME = ObjectFlags.TEMPORARY_NAME; public static final String BUILTIN_CONSTANT = ""; @@ -687,7 +688,7 @@ private RubyString calculateRubyName() { if (getBaseName() == null) return calculateAnonymousRubyName(); // no name...anonymous! - if (!IdUtil.isValidConstantName(baseName)) { // temporary name + if (usingTemporaryName()) { // temporary name cachedRubyName = getRuntime().newSymbol(baseName).toRubyString(getRuntime().getCurrentContext()); return cachedRubyName; } @@ -831,6 +832,8 @@ public IRubyObject set_temporary_name(ThreadContext context, IRubyObject arg) { if (name.length() == 0) throw context.runtime.newArgumentError("empty class/module name"); if (isValidConstantPath(name)) throw context.runtime.newArgumentError("the temporary name must not be a constant path to avoid confusion"); + setFlag(TEMPORARY_NAME, true); + // We make sure we generate ISO_8859_1 String and also guarantee when we want to print this name // later it does not lose track of the orignal encoding. RubySymbol symbol = context.runtime.newSymbol(name.getByteList()); @@ -4570,6 +4573,13 @@ private IRubyObject getRefinedClassOrThrow(ThreadContext context, boolean nameIs } return refinedClass; } + + @JRubyMethod(name = "used_refinements") + public IRubyObject used_refinements(ThreadContext context) { + // TODO: not implemented + return RubyArray.newEmptyArray(context.runtime); + } + // ////////////////// CLASS VARIABLE API METHODS //////////////// // @@ -5006,7 +5016,7 @@ private void setParentForModule(final String name, final IRubyObject value) { // if adding a module under a constant name, set that module's basename to the constant name if ( value instanceof RubyModule ) { RubyModule module = (RubyModule) value; - if (module != this && module.getBaseName() == null) { + if (module != this && (module.getBaseName() == null || module.usingTemporaryName())) { module.setBaseName(name); module.setParent(this); } @@ -5990,6 +6000,10 @@ public boolean isRefinement() { return getFlag(REFINED_MODULE_F); } + public boolean usingTemporaryName() { + return getFlag(TEMPORARY_NAME); + } + public boolean isIncludedIntoRefinement() { return getFlag(INCLUDED_INTO_REFINEMENT); } diff --git a/core/src/main/java/org/jruby/RubyProc.java b/core/src/main/java/org/jruby/RubyProc.java index de19cf61d30..ace8ac3c197 100644 --- a/core/src/main/java/org/jruby/RubyProc.java +++ b/core/src/main/java/org/jruby/RubyProc.java @@ -219,16 +219,12 @@ private void setup(Block procBlock) { @JRubyMethod(name = "clone") public IRubyObject rbClone(ThreadContext context) { - RubyProc clone = procDup(); - sites(context).initialize_clone.call(context, clone, clone, this); - return clone; + return cloneSetup(context, procDup(), context.nil); } @JRubyMethod(name = "dup") public IRubyObject dup(ThreadContext context) { - RubyProc dup = procDup(); - sites(context).initialize_dup.call(context, dup, dup, this); - return dup; + return dupSetup(context, procDup()); } private RubyProc procDup() { diff --git a/core/src/main/java/org/jruby/RubyRange.java b/core/src/main/java/org/jruby/RubyRange.java index edcc40929c5..08f9cc56fa8 100644 --- a/core/src/main/java/org/jruby/RubyRange.java +++ b/core/src/main/java/org/jruby/RubyRange.java @@ -1167,6 +1167,13 @@ public IRubyObject call(ThreadContext ctx, IRubyObject larg, Block blk) { public IRubyObject count(ThreadContext context, Block block) { if (isBeginless || isEndless) return RubyFloat.newFloat(context.runtime, RubyFloat.INFINITY); + if (begin instanceof RubyInteger) { + IRubyObject size = size(context); + if (!size.isNil()) { + return size; + } + } + return RubyEnumerable.count(context, this, block); } diff --git a/core/src/main/java/org/jruby/RubyUnboundMethod.java b/core/src/main/java/org/jruby/RubyUnboundMethod.java index 3e19a9f81bd..1ab01988511 100644 --- a/core/src/main/java/org/jruby/RubyUnboundMethod.java +++ b/core/src/main/java/org/jruby/RubyUnboundMethod.java @@ -147,11 +147,18 @@ private CacheEntry convertUnboundMethodToCallableEntry(ThreadContext context, Ru } @JRubyMethod(name = "clone") - @Override public RubyUnboundMethod rbClone() { RubyUnboundMethod unboundMethod = newUnboundMethod(implementationModule, methodName, originModule, originName, entry); - if (isFrozen()) unboundMethod.setFrozen(true); - return unboundMethod; + ThreadContext context = getRuntime().getCurrentContext(); + + return (RubyUnboundMethod) cloneSetup(context, unboundMethod, context.nil); + } + + @JRubyMethod + public RubyUnboundMethod dup(ThreadContext context) { + RubyUnboundMethod unboundMethod = newUnboundMethod(implementationModule, methodName, originModule, originName, entry); + + return (RubyUnboundMethod) dupSetup(context, unboundMethod); } @JRubyMethod(required = 1, rest = true, checkArity = false, keywords = true) diff --git a/core/src/main/java/org/jruby/ast/ErrorNode.java b/core/src/main/java/org/jruby/ast/ErrorNode.java new file mode 100644 index 00000000000..1275f9cba72 --- /dev/null +++ b/core/src/main/java/org/jruby/ast/ErrorNode.java @@ -0,0 +1,31 @@ +package org.jruby.ast; + +import org.jruby.ast.visitor.NodeVisitor; +import org.jruby.parser.ProductionState; + +import java.util.List; + +public class ErrorNode extends Node { + ProductionState loc; + // FIXME: Perhaps we can store real location object and not just leak production state. + public ErrorNode(ProductionState loc) { + super(loc.start(), false); + + this.loc = loc; + } + + @Override + public T accept(NodeVisitor visitor) { + return null; + } + + @Override + public List childNodes() { + return null; + } + + @Override + public NodeType getNodeType() { + return null; + } +} diff --git a/core/src/main/java/org/jruby/ast/Node.java b/core/src/main/java/org/jruby/ast/Node.java index 5021a0bb50f..80e6f9122e5 100644 --- a/core/src/main/java/org/jruby/ast/Node.java +++ b/core/src/main/java/org/jruby/ast/Node.java @@ -39,7 +39,6 @@ import java.util.List; import org.jruby.ast.types.INameNode; -import org.jruby.ast.visitor.AbstractNodeVisitor; import org.jruby.ast.visitor.NodeVisitor; /** @@ -192,9 +191,9 @@ public String toString(boolean indent, int indentation) { /** * Overridden by nodes that have additional internal state to be displated in toString. - * + *

* For nodes that have it, name is handled separately, by implementing INameNode. - * + *

* Child nodes are handled via iterating #childNodes. * * @return A string representing internal node state, or null if none. @@ -204,9 +203,7 @@ protected String toStringInternal() { } private static void indent(int indentation, StringBuilder builder) { - for (int n = 0; n < indentation; n++) { - builder.append(" "); - } + builder.append(" ".repeat(Math.max(0, indentation))); } protected String getNodeName() { @@ -214,21 +211,6 @@ protected String getNodeName() { return name.substring(name.lastIndexOf('.') + 1); } - public T findFirstChild(final Class nodeClass) { - return accept(new AbstractNodeVisitor() { - - @Override - protected T defaultVisit(Node node) { - if (nodeClass.isAssignableFrom(node.getClass())) { - return (T) node; - } else { - return visitFirstChild(node); - } - } - - }); - } - /** * @return the nodeId */ diff --git a/core/src/main/java/org/jruby/ast/visitor/AbstractNodeVisitor.java b/core/src/main/java/org/jruby/ast/visitor/AbstractNodeVisitor.java index 5b7b2d0ae97..881ffeeba62 100644 --- a/core/src/main/java/org/jruby/ast/visitor/AbstractNodeVisitor.java +++ b/core/src/main/java/org/jruby/ast/visitor/AbstractNodeVisitor.java @@ -249,6 +249,11 @@ public T visitEnsureNode(EnsureNode node) { return defaultVisit(node); } + @Override + public T visitErrorNode(ErrorNode node) { + return defaultVisit(node); + } + @Override public T visitEvStrNode(EvStrNode node) { return defaultVisit(node); diff --git a/core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java b/core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java index 7cfddbcfc38..e9e1d5c83f5 100644 --- a/core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java +++ b/core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java @@ -80,6 +80,7 @@ public interface NodeVisitor { T visitDotNode(DotNode iVisited); T visitEncodingNode(EncodingNode iVisited); T visitEnsureNode(EnsureNode iVisited); + T visitErrorNode(ErrorNode iVisited); T visitEvStrNode(EvStrNode iVisited); T visitFCallNode(FCallNode iVisited); T visitFalseNode(FalseNode iVisited); diff --git a/core/src/main/java/org/jruby/ext/ripper/RubyLexer.java b/core/src/main/java/org/jruby/ext/ripper/RubyLexer.java index 7a6188f4105..599067cd3fd 100644 --- a/core/src/main/java/org/jruby/ext/ripper/RubyLexer.java +++ b/core/src/main/java/org/jruby/ext/ripper/RubyLexer.java @@ -401,7 +401,7 @@ protected void set_yylval_val(ByteList name) { public int tokenize_ident(int result) { String value = createTokenString(); - if (!isLexState(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(value) >= 0) { + if (!IS_lex_state(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(value) >= 0) { setState(EXPR_END); } @@ -1071,9 +1071,9 @@ private int yylex() throws IOException { /* fall through */ case '\n': { this.tokenSeen = tokenSeen; - boolean normalArg = isLexState(lex_state, EXPR_BEG | EXPR_CLASS | EXPR_FNAME | EXPR_DOT) && - !isLexState(lex_state, EXPR_LABELED); - if (normalArg || isLexStateAll(lex_state, EXPR_ARG | EXPR_LABELED)) { + boolean normalArg = IS_lex_state(lex_state, EXPR_BEG | EXPR_CLASS | EXPR_FNAME | EXPR_DOT) && + !IS_lex_state(lex_state, EXPR_LABELED); + if (normalArg || IS_lex_state_all(lex_state, EXPR_ARG | EXPR_LABELED)) { if (!fallthru) dispatchScanEvent(tIGNORED_NL); fallthru = false; if (!normalArg && getLexContext().in_kwarg) { @@ -1162,7 +1162,7 @@ private int yylex() throws IOException { } } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); c = nextc(); if (c == '=') { @@ -1276,7 +1276,7 @@ private RubySymbol symbol(ByteList name) { } private int identifierToken(int last_state, int result, String value) { - if (result == tIDENTIFIER && !isLexState(last_state, EXPR_DOT|EXPR_FNAME) && + if (result == tIDENTIFIER && !IS_lex_state(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(value) >= 0) { setState(EXPR_END|EXPR_LABEL); } @@ -1314,16 +1314,16 @@ private int ampersand(boolean spaceSeen) { } pushback(c); - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (isVerbose()) warning("`&' interpreted as argument prefix"); c = tAMPER; - } else if (isBEG()) { + } else if (IS_BEG()) { c = warn_balanced(c, spaceSeen, tAMPER, "&", "argument prefix"); } else { c = '&'; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); yaccValue = AMPERSAND; return c; @@ -1339,7 +1339,7 @@ private int at() { } else { result = tIVAR; } - setState(isLexState(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END); + setState(IS_lex_state(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END); if (c == EOF || !isIdentifierChar(c)) { if (result == tIVAR) { @@ -1370,11 +1370,11 @@ private int at() { private int backtick(boolean commandState) { yaccValue = BACKTICK; - if (isLexState(lex_state, EXPR_FNAME)) { + if (IS_lex_state(lex_state, EXPR_FNAME)) { setState(EXPR_ENDFN); return '`'; } - if (isLexState(lex_state, EXPR_DOT)) { + if (IS_lex_state(lex_state, EXPR_DOT)) { setState(commandState ? EXPR_CMDARG : EXPR_ARG); return '`'; @@ -1387,7 +1387,7 @@ private int backtick(boolean commandState) { private int bang() { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = BANG; @@ -1424,7 +1424,7 @@ private int caret() { return tOP_ASGN; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); pushback(c); return '^'; @@ -1434,7 +1434,7 @@ private int colon(boolean spaceSeen) { int c = nextc(); if (c == ':') { - if (isBEG() || isLexState(lex_state, EXPR_CLASS) || (isARG() && spaceSeen)) { + if (IS_BEG() || IS_lex_state(lex_state, EXPR_CLASS) || (IS_ARG() && spaceSeen)) { setState(EXPR_BEG); yaccValue = COLON_COLON; return tCOLON3; @@ -1445,7 +1445,7 @@ private int colon(boolean spaceSeen) { return tCOLON2; } - if (isEND() || Character.isWhitespace(c) || c == '#') { + if (IS_END() || Character.isWhitespace(c) || c == '#') { pushback(c); setState(EXPR_BEG); yaccValue = COLON; @@ -1481,7 +1481,7 @@ private int doKeyword(int state) { if (conditionState.set_p()) return keyword_do_cond; - if (cmdArgumentState.set_p() && !isLexState(state, EXPR_CMDARG)) { + if (cmdArgumentState.set_p() && !IS_lex_state(state, EXPR_CMDARG)) { return keyword_do_block; } @@ -1544,7 +1544,7 @@ private int dollar() { case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ // Explicit reference to these vars as symbols... - if (isLexState(last_state, EXPR_FNAME)) { + if (IS_lex_state(last_state, EXPR_FNAME)) { identValue = "$" + (char) c; set_yylval_name(new ByteList(new byte[] {'$', (byte) c})); return tGVAR; @@ -1559,7 +1559,7 @@ private int dollar() { c = nextc(); } while (Character.isDigit(c)); pushback(c); - if (isLexState(last_state, EXPR_FNAME)) { + if (IS_lex_state(last_state, EXPR_FNAME)) { identValue = createTokenString().intern(); set_yylval_name(new ByteList(new byte[] {'$', (byte) c})); return tGVAR; @@ -1602,7 +1602,7 @@ private int dollar() { private int dot() { int c; - boolean isBeg = isBEG(); + boolean isBeg = IS_BEG(); setState(EXPR_BEG); if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { @@ -1616,7 +1616,7 @@ private int dot() { if (parenNest == 0 && isLookingAtEOL()) { warn("... at EOL, should be parenthesized?"); } else if (getLeftParenBegin() >= 0 && getLeftParenBegin() + 1 == parenNest) { - if (isLexState(last_state, EXPR_LABEL)) { + if (IS_lex_state(last_state, EXPR_LABEL)) { return tDOT3; } } @@ -1638,14 +1638,14 @@ private int dot() { } private int doubleQuote(boolean commandState) { - int label = isLabelPossible(commandState) ? str_label : 0; + int label = IS_LABEL_POSSIBLE(commandState) ? str_label : 0; lex_strterm = new StringTerm(str_dquote|label, '\0', '"', ruby_sourceline); yaccValue = QQ; return tSTRING_BEG; } private int greaterThan() { - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); int c = nextc(); @@ -1711,7 +1711,7 @@ private int identifier(int c, boolean commandState) { result = tFID; tempVal = createTokenString(); } else { - if (isLexState(lex_state, EXPR_FNAME)) { + if (IS_lex_state(lex_state, EXPR_FNAME)) { if ((c = nextc()) == '=') { int c2 = nextc(); @@ -1736,8 +1736,8 @@ private int identifier(int c, boolean commandState) { } } - if (isLabelPossible(commandState)) { - if (isLabelSuffix()) { + if (IS_LABEL_POSSIBLE(commandState)) { + if (IS_LABEL_SUFFIX()) { setState(EXPR_ARG|EXPR_LABELED); yaccValue = tempVal; identValue = tempVal.intern(); @@ -1755,17 +1755,17 @@ private int identifier(int c, boolean commandState) { setState(keyword.state); set_yylval_name(createTokenByteList()); - if (isLexState(state, EXPR_FNAME)) { + if (IS_lex_state(state, EXPR_FNAME)) { setState(EXPR_ENDFN); identValue = tempVal; return keyword.id0; } - if (isLexState(lex_state, EXPR_BEG)) commandStart = true; + if (IS_lex_state(lex_state, EXPR_BEG)) commandStart = true; if (keyword.id0 == keyword_do) return doKeyword(state); - if (isLexState(state, EXPR_BEG|EXPR_LABELED)) { + if (IS_lex_state(state, EXPR_BEG|EXPR_LABELED)) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) setState(EXPR_BEG|EXPR_LABEL); @@ -1774,7 +1774,7 @@ private int identifier(int c, boolean commandState) { } } - if (isLexState(lex_state, EXPR_BEG_ANY|EXPR_ARG_ANY|EXPR_DOT)) { + if (IS_lex_state(lex_state, EXPR_BEG_ANY|EXPR_ARG_ANY|EXPR_DOT)) { setState(commandState ? EXPR_CMDARG : EXPR_ARG); } else if (lex_state == EXPR_FNAME) { setState(EXPR_ENDFN); @@ -1788,7 +1788,7 @@ private int identifier(int c, boolean commandState) { private int leftBracket(boolean spaceSeen) { parenNest++; int c = '['; - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { if ((c = nextc()) == ']') { setState(EXPR_ARG); if (peek('=')) { @@ -1803,7 +1803,7 @@ private int leftBracket(boolean spaceSeen) { setState(EXPR_ARG|EXPR_LABEL); yaccValue = LBRACKET; return '['; - } else if (isBEG() || (isARG() && (spaceSeen || isLexState(lex_state, EXPR_LABELED)))) { + } else if (IS_BEG() || (IS_ARG() && (spaceSeen || IS_lex_state(lex_state, EXPR_LABELED)))) { c = tLBRACK; } @@ -1819,11 +1819,11 @@ private int leftCurly() { char c; if (isLambdaBeginning()) { c = tLAMBEG; - } else if (isLexState(lex_state, EXPR_LABELED)) { + } else if (IS_lex_state(lex_state, EXPR_LABELED)) { c = tLBRACE; - } else if (isLexState(lex_state, EXPR_ARG_ANY|EXPR_END|EXPR_ENDFN)) { // block (primary) + } else if (IS_lex_state(lex_state, EXPR_ARG_ANY|EXPR_END|EXPR_ENDFN)) { // block (primary) c = '{'; - } else if (isLexState(lex_state, EXPR_ENDARG)) { // block (expr) + } else if (IS_lex_state(lex_state, EXPR_ENDARG)) { // block (expr) c = tLBRACE_ARG; } else { // hash c = tLBRACE; @@ -1847,13 +1847,13 @@ private int leftCurly() { private int leftParen(boolean spaceSeen) { int result; - if (isBEG()) { + if (IS_BEG()) { result = tLPAREN; } else if (!spaceSeen) { result = '('; - } else if (isARG() || isLexStateAll(lex_state, EXPR_END|EXPR_LABEL)) { + } else if (IS_ARG() || IS_lex_state_all(lex_state, EXPR_END|EXPR_LABEL)) { result = tLPAREN_ARG; - } else if (isLexState(lex_state, EXPR_ENDFN) && !isLambdaBeginning()) { + } else if (IS_lex_state(lex_state, EXPR_ENDFN) && !isLambdaBeginning()) { warn("parentheses after method name is interpreted as an argument list, not a decomposed argument"); result = '('; } else { @@ -1871,17 +1871,17 @@ private int leftParen(boolean spaceSeen) { private int lessThan(boolean spaceSeen) { last_state = lex_state; int c = nextc(); - if (c == '<' && !isLexState(lex_state, EXPR_DOT|EXPR_CLASS) && - !isEND() && (!isARG() || isLexState(lex_state, EXPR_LABELED) || spaceSeen)) { + if (c == '<' && !IS_lex_state(lex_state, EXPR_DOT|EXPR_CLASS) && + !IS_END() && (!IS_ARG() || IS_lex_state(lex_state, EXPR_LABELED) || spaceSeen)) { int tok = hereDocumentIdentifier(); if (tok != 0) return tok; } - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); } else { - if (isLexState(lex_state, EXPR_CLASS)) commandStart = true; + if (IS_lex_state(lex_state, EXPR_CLASS)) commandStart = true; setState(EXPR_BEG); } @@ -1913,7 +1913,7 @@ private int lessThan(boolean spaceSeen) { private int minus(boolean spaceSeen) { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = MINUS_AT; @@ -1934,7 +1934,7 @@ private int minus(boolean spaceSeen) { yaccValue = MINUS_GT; return tLAMBDA; } - if (isBEG() || (isSpaceArg(c, spaceSeen) && arg_ambiguous('-'))) { + if (IS_BEG() || (IS_SPCARG(c, spaceSeen) && arg_ambiguous('-'))) { setState(EXPR_BEG); pushback(c); yaccValue = MINUS_AT; @@ -1951,7 +1951,7 @@ private int minus(boolean spaceSeen) { } private int percent(boolean spaceSeen) { - if (isBEG()) return parseQuote(nextc()); + if (IS_BEG()) return parseQuote(nextc()); int c = nextc(); @@ -1962,9 +1962,9 @@ private int percent(boolean spaceSeen) { return tOP_ASGN; } - if (isSpaceArg(c, spaceSeen) || (isLexState(lex_state, EXPR_FITEM) && c == 's')) return parseQuote(c); + if (IS_SPCARG(c, spaceSeen) || (IS_lex_state(lex_state, EXPR_FITEM) && c == 's')) return parseQuote(c); - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); pushback(c); yaccValue = PERCENT; @@ -1984,7 +1984,7 @@ private int pipe() { return tOP_ASGN; } pushback(c); - if (isLexStateAll(last_state, EXPR_BEG)) { + if (IS_lex_state_all(last_state, EXPR_BEG)) { yaccValue = OR; pushback('|'); return '|'; @@ -1997,7 +1997,7 @@ private int pipe() { set_yylval_id(OR); return tOP_ASGN; default: - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL); pushback(c); yaccValue = OR; @@ -2007,7 +2007,7 @@ private int pipe() { private int plus(boolean spaceSeen) { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = PLUS_AT; @@ -2026,7 +2026,7 @@ private int plus(boolean spaceSeen) { return tOP_ASGN; } - if (isBEG() || (isSpaceArg(c, spaceSeen) && arg_ambiguous('+'))) { + if (IS_BEG() || (IS_SPCARG(c, spaceSeen) && arg_ambiguous('+'))) { setState(EXPR_BEG); pushback(c); if (Character.isDigit(c)) { @@ -2051,7 +2051,7 @@ private int plus(boolean spaceSeen) { private int questionMark() throws IOException { int c; - if (isEND()) { + if (IS_END()) { setState(EXPR_VALUE); yaccValue = QUESTION; return '?'; @@ -2064,7 +2064,7 @@ private int questionMark() throws IOException { } if (Character.isWhitespace(c)){ - if (!isARG()) { + if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': @@ -2164,7 +2164,7 @@ private int rightParen() { } private int singleQuote(boolean commandState) { - int label = isLabelPossible(commandState) ? str_label : 0; + int label = IS_LABEL_POSSIBLE(commandState) ? str_label : 0; lex_strterm = new StringTerm(str_squote|label, '\0', '\'', ruby_sourceline); yaccValue = Q; @@ -2172,7 +2172,7 @@ private int singleQuote(boolean commandState) { } private int slash(boolean spaceSeen) { - if (isBEG()) { + if (IS_BEG()) { lex_strterm = new StringTerm(str_regexp, '\0', '/', ruby_sourceline); return tREGEXP_BEG; } @@ -2185,13 +2185,13 @@ private int slash(boolean spaceSeen) { return tOP_ASGN; } pushback(c); - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { arg_ambiguous('/'); lex_strterm = new StringTerm(str_regexp, '\0', '/', ruby_sourceline); return tREGEXP_BEG; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); return warn_balanced(c, spaceSeen, '/', "/", "regexp literal"); } @@ -2211,10 +2211,10 @@ private int star(boolean spaceSeen) { pushback(c); yaccValue = STAR_STAR; - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (isVerbose() && Options.PARSER_WARN_ARGUMENT_PREFIX.load()) warning("`**' interpreted as argument prefix"); c = tDSTAR; - } else if (isBEG()) { + } else if (IS_BEG()) { c = tDSTAR; } else { c = warn_balanced(c, spaceSeen, tPOW, "**", "argument prefix"); @@ -2227,10 +2227,10 @@ private int star(boolean spaceSeen) { return tOP_ASGN; default: pushback(c); - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (isVerbose() && Options.PARSER_WARN_ARGUMENT_PREFIX.load()) warning("`*' interpreted as argument prefix"); c = tSTAR; - } else if (isBEG()) { + } else if (IS_BEG()) { c = tSTAR; } else { c = warn_balanced(c, spaceSeen, '*', "*", "argument prefix"); @@ -2238,14 +2238,14 @@ private int star(boolean spaceSeen) { yaccValue = STAR; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); return c; } private int tilde() { int c; - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { if ((c = nextc()) != '@') pushback(c); setState(EXPR_ARG); } else { diff --git a/core/src/main/java/org/jruby/ext/ripper/StringTerm.java b/core/src/main/java/org/jruby/ext/ripper/StringTerm.java index 9b5872ec9a8..3291d284686 100644 --- a/core/src/main/java/org/jruby/ext/ripper/StringTerm.java +++ b/core/src/main/java/org/jruby/ext/ripper/StringTerm.java @@ -97,7 +97,7 @@ private int endFound(RubyLexer lexer) throws IOException { return RipperParser.tREGEXP_END; } - if ((flags & STR_FUNC_LABEL) != 0 && lexer.isLabelSuffix()) { + if ((flags & STR_FUNC_LABEL) != 0 && lexer.IS_LABEL_SUFFIX()) { lexer.nextc(); lexer.setState(EXPR_BEG | EXPR_LABEL); return RipperParser.tLABEL_END; diff --git a/core/src/main/java/org/jruby/ext/tracepoint/TracePoint.java b/core/src/main/java/org/jruby/ext/tracepoint/TracePoint.java index 5d551900f19..60b5f2a34ce 100644 --- a/core/src/main/java/org/jruby/ext/tracepoint/TracePoint.java +++ b/core/src/main/java/org/jruby/ext/tracepoint/TracePoint.java @@ -80,10 +80,11 @@ public IRubyObject initialize(ThreadContext context, IRubyObject[] _events, fina if (!block.isGiven()) throw runtime.newArgumentError("must be called with a block"); + final ThreadContext threadToTrace = context; hook = new EventHook() { @Override public void event(ThreadContext context, RubyEvent event, String file, int line, String name, IRubyObject type) { - if (!enabled || context.isWithinTrace()) return; + if (!enabled || threadToTrace != context || context.isWithinTrace()) return; synchronized (this) { inside = true; diff --git a/core/src/main/java/org/jruby/ir/builder/IRBuilder.java b/core/src/main/java/org/jruby/ir/builder/IRBuilder.java index 11f601345e9..43fa13bba21 100644 --- a/core/src/main/java/org/jruby/ir/builder/IRBuilder.java +++ b/core/src/main/java/org/jruby/ir/builder/IRBuilder.java @@ -70,10 +70,10 @@ public abstract class IRBuilder { private final IRManager manager; protected final IRScope scope; - protected final IRBuilder parent; + protected final IRBuilder parent; protected final List instructions; protected int coverageMode; - protected IRBuilder variableBuilder; + protected IRBuilder variableBuilder; protected List argumentDescriptions; public boolean executesOnce = true; int temporaryVariableIndex = -1; @@ -140,7 +140,7 @@ enum LineInfo { private boolean selfUsed = false; private boolean currentModuleUsed = false; - public IRBuilder(IRManager manager, IRScope scope, IRBuilder parent, IRBuilder variableBuilder, Encoding encoding) { + public IRBuilder(IRManager manager, IRScope scope, IRBuilder parent, IRBuilder variableBuilder, Encoding encoding) { this.manager = manager; this.scope = scope; this.parent = parent; @@ -457,8 +457,8 @@ protected Operand protectCodeWithRescue(CodeBlock protectedCode, CodeBlock rescu // Protected region code addInstr(new LabelInstr(rBeginLabel)); addInstr(new ExceptionRegionStartMarkerInstr(rescueLabel)); - Object v1 = protectedCode.run(); // YIELD: Run the protected code block - addInstr(new CopyInstr(rv, (Operand)v1)); + Operand v1 = protectedCode.run(); // YIELD: Run the protected code block + addInstr(new CopyInstr(rv, v1)); addInstr(new JumpInstr(rEndLabel)); addInstr(new ExceptionRegionEndMarkerInstr()); @@ -523,9 +523,7 @@ private TemporaryVariable createIntVariable() { // FIXME: Add this to clone on branch instrs so if something changes (like an inline) it will replace with opted branch/jump/nop. public static Instr createBranch(Operand v1, Operand v2, Label jmpTarget) { - if (v2 instanceof Boolean) { - Boolean lhs = (Boolean) v2; - + if (v2 instanceof Boolean lhs) { if (lhs.isTrue()) { if (v1.isTruthyImmediate()) return new JumpInstr(jmpTarget); if (v1.isFalseyImmediate()) return NopInstr.NOP; @@ -667,8 +665,7 @@ protected static void extractCallOperands(List callArgs, List(Symbol.KW_REST_ARG_DUMMY, ((ReceiveArgBase) instr).getResult())); - } else if (instr instanceof ReceiveKeywordArgInstr) { - ReceiveKeywordArgInstr receiveKwargInstr = (ReceiveKeywordArgInstr) instr; + } else if (instr instanceof ReceiveKeywordArgInstr receiveKwargInstr) { keywordArgs.add(new KeyValuePair<>(new Symbol(receiveKwargInstr.getKey()), receiveKwargInstr.getResult())); } else if (instr instanceof ReceiveRestArgInstr) { callArgs.add(new Splat(((ReceiveRestArgInstr) instr).getResult())); @@ -733,13 +730,13 @@ protected void handleNonlocalReturnInMethod() { addInstr(new LabelInstr(rEndLabel)); } - private Operand receiveBreakException(Operand block, CodeBlock codeBlock) { + private void receiveBreakException(Operand block, CodeBlock codeBlock) { // Check if we have to handle a break - if (block == null || - !(block instanceof WrappedIRClosure) || + if (!(block instanceof WrappedIRClosure) || !(((WrappedIRClosure) block).getClosure()).hasBreakInstructions()) { // No protection needed -- add the call and return - return codeBlock.run(); + codeBlock.run(); + return; } Label rBeginLabel = getNewLabel(); @@ -764,8 +761,6 @@ private Operand receiveBreakException(Operand block, CodeBlock codeBlock) { // End addInstr(new LabelInstr(rEndLabel)); - - return callResult; } // for simple calls without splats or keywords @@ -895,14 +890,6 @@ protected Nil nil() { return manager.getNil(); } - private boolean hackCheckUSASCII(byte[] bytes) { - for (int i = 0; i < bytes.length; i++) { - if (bytes[i] < 0) return false; - } - - return true; - } - protected RubySymbol symbol(String id) { return manager.runtime.newSymbol(id); } @@ -977,9 +964,7 @@ protected Label getNewLabel(String labelName) { } protected Variable getValueInTemporaryVariable(Operand val) { - if (val != null && val instanceof TemporaryVariable) return (Variable) val; - - return copy(val); + return val instanceof TemporaryVariable ? (Variable) val : copy(val); } /** @@ -1008,7 +993,7 @@ protected static Operand[] getZSuperCallOperands(IRScope scope, List ca return args; } - return callArgs.toArray(new Operand[callArgs.size()]); + return callArgs.toArray(new Operand[0]); } @@ -1057,17 +1042,17 @@ protected Operand buildAlias(Operand newName, Operand oldName) { // Note: passing NORMAL just removes ability to remove a branch and will be semantically correct. protected Operand buildAnd(Operand left, CodeBlock right, BinaryType truth) { - switch(truth) { - case LeftTrue: // left is statically true so we return whatever right expr is. - return right.run(); - case LeftFalse: // left is already false. we done. - return left; - } + return switch (truth) { + // left is statically true so we return whatever right expr is. + case LeftTrue -> right.run(); + // left is already false. we done. + case LeftFalse -> left; + default -> tap(getValueInTemporaryVariable(left), (ret) -> + label("and", (label) -> + cond(label, left, fals(), () -> + copy((Variable) ret, right.run())))); + }; - return tap(getValueInTemporaryVariable(left), (ret) -> - label("and", (label) -> - cond(label, left, fals(), () -> - copy((Variable) ret, right.run())))); } protected Operand buildBreak(CodeBlock value, int line) { @@ -1335,7 +1320,7 @@ protected Operand buildFlip(U begin, U end, boolean isExclusive) { Fixnum s2 = manager.newFixnum(2); // Create a variable to hold the flip state - IRBuilder nearestNonClosureBuilder = getNearestFlipVariableScopeBuilder(); + IRBuilder nearestNonClosureBuilder = getNearestFlipVariableScopeBuilder(); // Flip is completely broken atm and it was semi-broken in its last incarnation. // Method and closures (or evals) are not built at the same time and if -X-C or JIT or AOT @@ -1526,7 +1511,7 @@ protected Operand buildIter(U var, U body, StaticScope staticScope, Signature si return new WrappedIRClosure(buildSelf(), closure); } - protected InterpreterContext buildIterInner(RubySymbol methodName, U var, U body, int endLine) { + protected void buildIterInner(RubySymbol methodName, U var, U body, int endLine) { long time = 0; if (PARSER_TIMING) time = System.nanoTime(); this.methodName = methodName; @@ -1563,11 +1548,9 @@ protected InterpreterContext buildIterInner(RubySymbol methodName, U var, U body if (!forNode) handleBreakAndReturnsInLambdas(); computeScopeFlagsFrom(instructions); - InterpreterContext ic = scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); + scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); if (PARSER_TIMING) manager.getRuntime().getParserManager().getParserStats().addIRBuildTime(System.nanoTime() - time); - - return ic; } public Operand buildLambda(U args, U body, StaticScope staticScope, Signature signature, int line) { @@ -1582,7 +1565,7 @@ public Operand buildLambda(U args, U body, StaticScope staticScope, Signature si return lambda; } - protected InterpreterContext buildLambdaInner(U blockArgs, U body) { + protected void buildLambdaInner(U blockArgs, U body) { long time = 0; if (PARSER_TIMING) time = System.nanoTime(); @@ -1598,11 +1581,9 @@ protected InterpreterContext buildLambdaInner(U blockArgs, U body) { handleBreakAndReturnsInLambdas(); computeScopeFlagsFrom(instructions); - InterpreterContext ic = scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); + scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); if (PARSER_TIMING) manager.getRuntime().getParserManager().getParserStats().addIRBuildTime(System.nanoTime() - time); - - return ic; } protected Operand buildLocalVariableAssign(RubySymbol name, int depth, U valueNode) { @@ -1724,7 +1705,7 @@ protected Operand buildModule(ByteList name, U cpath, U bodyNode, StaticScope sc return bodyResult; } - protected InterpreterContext buildModuleOrClassBody(U body, int startLine, int endLine) { + protected void buildModuleOrClassBody(U body, int startLine, int endLine) { addInstr(new TraceInstr(RubyEvent.CLASS, getCurrentModuleVariable(), null, getFileName(), startLine + 1)); Operand bodyReturnValue = build(body); @@ -1739,7 +1720,7 @@ protected InterpreterContext buildModuleOrClassBody(U body, int startLine, int e prependUsedImplicitState(null); computeScopeFlagsFrom(instructions); - return scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); + scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); } protected Operand buildNext(final Operand rv, int line) { @@ -2104,7 +2085,7 @@ protected void buildFindPattern(Label testEnd, Variable result, Variable deconst Variable errorString) { if (constant != null) buildPatternConstant(testEnd, result, constant, obj, isSinglePattern, errorString); - label("deconstruct_end", deconstructCheck -> { + label("deconstruct_end", deconstructCheck -> cond_ne(deconstructCheck, deconstructed, nil(), () -> { buildPatternDeconstructRespondTo(testEnd, result, obj, isSinglePattern, errorString, "deconstruct"); @@ -2113,8 +2094,8 @@ protected void buildFindPattern(Label testEnd, Variable result, Variable deconst addInstr(new EQQInstr(scope, result, getManager().getArrayClass(), deconstructed, false, false)); cond(arrayCheck, result, tru(), () -> type_error("deconstruct must return Array")); }); - }); - }); + }) + ); Variable length = addResultInstr(new RuntimeHelperCall(intTemp(), ARRAY_LENGTH, new Operand[]{deconstructed})); int fixedArgsLength = args.length; @@ -2312,12 +2293,12 @@ protected void buildPatternEachHash(Label testEnd, Variable result, Operand orig protected abstract boolean isNilRest(U rest); - protected Operand buildPatternLocal(Operand value, RubySymbol name, int line, int depth, boolean inAlternation) { + protected void buildPatternLocal(Operand value, RubySymbol name, int line, int depth, boolean inAlternation) { if (inAlternation && name.idString().charAt(0) != '_') { throwSyntaxError(line, str(getManager().getRuntime(), "illegal variable in alternative pattern (", name, ")")); } - return copy(getLocalVariable(name, depth), value); + copy(getLocalVariable(name, depth), value); } protected void buildPatternOr(Label testEnd, Operand original, Variable result, Variable deconstructed, Operand value, U left, @@ -2362,7 +2343,7 @@ protected Operand buildPostExe(U body, int line) { return nil(); } - private InterpreterContext buildPrePostExeInner(U body) { + private void buildPrePostExeInner(U body) { build(body); // END does not have either explicit or implicit return, so we add one @@ -2371,7 +2352,7 @@ private InterpreterContext buildPrePostExeInner(U body) { prependUsedImplicitState(null); computeScopeFlagsFrom(instructions); - return scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); + scope.allocateInterpreterContext(instructions, temporaryVariableIndex + 1, flags); } protected Operand buildPreExe(U body) { @@ -2443,8 +2424,8 @@ protected void buildRescueBodyInternal(U[] exceptions, U body, X consequent, Var if (exceptions == null || exceptions.length == 0) { outputExceptionCheck(getManager().getStandardError(), exc, caughtLabel); } else { - for (int i = 0; i < exceptions.length; i++) { - outputExceptionCheck(build(exceptions[i]), exc, caughtLabel); + for (U exception: exceptions) { + outputExceptionCheck(build(exception), exc, caughtLabel); } } @@ -2797,7 +2778,7 @@ protected Operand buildZSuper(Variable result, Operand block) { if (keywordArgs.size() == 1 && keywordArgs.get(0).getKey().equals(Symbol.KW_REST_ARG_DUMMY)) { flags[0] |= (CALL_KEYWORD | CALL_KEYWORD_REST); Operand keywordRest = keywordArgs.get(0).getValue(); - Operand[] args = callArgs.toArray(new Operand[callArgs.size()]); + Operand[] args = callArgs.toArray(new Operand[0]); Variable test = addResultInstr(new RuntimeHelperCall(temp(), IS_HASH_EMPTY, new Operand[] { keywordRest })); if_else(test, tru(), () -> receiveBreakException(block, @@ -2815,7 +2796,7 @@ protected Operand buildZSuper(Variable result, Operand block) { protected Operand buildZSuperIfNest(Variable result, final Operand block) { int depthFrom = 0; - IRBuilder superBuilder = this; + IRBuilder superBuilder = this; IRScope superScope = scope; boolean defineMethod = false; @@ -2842,7 +2823,7 @@ protected Operand buildZSuperIfNest(Variable result, final Operand block) { if (keywordArgs.size() == 1 && keywordArgs.get(0).getKey().equals(Symbol.KW_REST_ARG_DUMMY)) { flags[0] |= (CALL_KEYWORD | CALL_KEYWORD_REST); Operand keywordRest = ((DepthCloneable) keywordArgs.get(0).getValue()).cloneForDepth(depthFromSuper); - Operand[] args = adjustVariableDepth(callArgs.toArray(new Operand[callArgs.size()]), depthFromSuper); + Operand[] args = adjustVariableDepth(callArgs.toArray(new Operand[0]), depthFromSuper); Variable test = addResultInstr(new RuntimeHelperCall(temp(), IS_HASH_EMPTY, new Operand[]{keywordRest})); if_else(test, tru(), () -> addInstr(new ZSuperInstr(scope, zsuperResult, buildSelf(), args, block, flags[0], scope.maybeUsingRefinements())), @@ -2887,7 +2868,7 @@ protected IRMethod defineNewMethod(LazyMethodDefinition defn, } - public InterpreterContext defineMethodInner(LazyMethodDefinition defNode, IRScope parent, int coverageMode) { + public void defineMethodInner(LazyMethodDefinition defNode, IRScope parent, int coverageMode) { long time = 0; if (PARSER_TIMING) time = System.nanoTime(); this.coverageMode = coverageMode; @@ -2922,11 +2903,9 @@ public InterpreterContext defineMethodInner(LazyMethodDefinition getNearestFlipVariableScopeBuilder() { + IRBuilder current = this; while (current != null && !current.scope.isWhereFlipFlopStateVariableIs()) { current = current.parent; diff --git a/core/src/main/java/org/jruby/ir/dataflow/FlowGraphNode.java b/core/src/main/java/org/jruby/ir/dataflow/FlowGraphNode.java index bd9b2e4cf37..114858bb242 100644 --- a/core/src/main/java/org/jruby/ir/dataflow/FlowGraphNode.java +++ b/core/src/main/java/org/jruby/ir/dataflow/FlowGraphNode.java @@ -47,7 +47,7 @@ public void init() { } * is a predecessor of the current node! The choice of "IN/OUT" is * determined by the direction of data flow. */ - public abstract void compute_MEET(Edge e, U pred); + public abstract void compute_MEET(Edge e, U pred); /** * Any setting up of state/initialization before applying transfer function @@ -118,7 +118,7 @@ public void computeDataFlowInfo(List workList, BitSet bbSet) { } public void computeDataFlowInfoBackward(List workList, BitSet bbSet) { - for (Edge e: getCFG().getOutgoingEdges(basicBlock)) { + for (Edge e: getCFG().getOutgoingEdges(basicBlock)) { compute_MEET(e, problem.getFlowGraphNode(e.getDestination().getData())); } @@ -145,7 +145,7 @@ public void computeDataFlowInfoBackward(List workList, BitSet bbSet) { } public void computeDataFlowInfoForward(List workList, BitSet bbSet) { - for (Edge e: getCFG().getIncomingEdges(basicBlock)) { + for (Edge e: getCFG().getIncomingEdges(basicBlock)) { compute_MEET(e, problem.getFlowGraphNode(e.getSource().getData())); } diff --git a/core/src/main/java/org/jruby/ir/persistence/IRDumper.java b/core/src/main/java/org/jruby/ir/persistence/IRDumper.java index 37f97cc28dd..dab8670127d 100644 --- a/core/src/main/java/org/jruby/ir/persistence/IRDumper.java +++ b/core/src/main/java/org/jruby/ir/persistence/IRDumper.java @@ -7,6 +7,7 @@ package org.jruby.ir.persistence; import org.jruby.RubySymbol; +import org.jruby.dirgra.Edge; import org.jruby.ir.IRClosure; import org.jruby.ir.IRScope; import org.jruby.ir.IRVisitor; @@ -57,6 +58,7 @@ import org.jruby.ir.operands.Variable; import org.jruby.ir.operands.WrappedIRClosure; import org.jruby.ir.representations.BasicBlock; +import org.jruby.ir.representations.CFG; import org.jruby.runtime.Signature; import org.jruby.util.KeyValuePair; import org.jruby.util.cli.Options; @@ -170,16 +172,31 @@ public void visit(IRScope scope, boolean full, boolean recurse) { for (BasicBlock bb : bbs) { printAnsi(BLOCK_COLOR, "\nblock #" + bb.getID()); - Iterable outs; - if ((outs = ic.getCFG().getOutgoingDestinations(bb)) != null && outs.iterator().hasNext()) { + Iterable> outs; + if ((outs = ic.getCFG().getOutgoingEdges(bb)) != null && outs.iterator().hasNext()) { printAnsi(BLOCK_COLOR, " (out: "); boolean first = true; - for (BasicBlock out : outs) { - if (!first) printAnsi(BLOCK_COLOR, ","); + for (Edge out : outs) { + if (!first) printAnsi(BLOCK_COLOR, ", "); first = false; - printAnsi(BLOCK_COLOR, "" + out.getID()); + CFG.EdgeType type = out.getType(); + BasicBlock block = out.getDestination().getOutgoingDestinationData(); + switch (type) { + case EXIT: + printAnsi(BLOCK_COLOR, "exit"); + break; + case REGULAR: + printAnsi(BLOCK_COLOR, "" + block.getID()); + break; + case EXCEPTION: + printAnsi(BLOCK_COLOR, block.getID() + "!"); + break; + case FALL_THROUGH: + printAnsi(BLOCK_COLOR, block.getID() + "↓"); + break; + } } printAnsi(BLOCK_COLOR, ")"); diff --git a/core/src/main/java/org/jruby/ir/representations/BasicBlock.java b/core/src/main/java/org/jruby/ir/representations/BasicBlock.java index e7bddbff5a1..b7b11ede472 100644 --- a/core/src/main/java/org/jruby/ir/representations/BasicBlock.java +++ b/core/src/main/java/org/jruby/ir/representations/BasicBlock.java @@ -144,7 +144,7 @@ public Site siteOf(long callsiteId) { } // Adds all instrs after the found instr to a new BB and removes them from the original BB - // If includeSpltpointInstr is true it will include that instr in the new BB. + // If includeSplitpointInstr is true it will include that instr in the new BB. public BasicBlock splitAtInstruction(Site splitPoint, Label newLabel, boolean includeSplitPointInstr) { BasicBlock newBB = new BasicBlock(cfg, newLabel); int idx = 0; @@ -156,7 +156,7 @@ public BasicBlock splitAtInstruction(Site splitPoint, Label newLabel, boolean in // Move instructions from split point into the new bb if (found) { - // FIXME: move includeSplit when found so we can remove consuing site id logic from here... + // FIXME: move includeSplit when found so we can remove consuming site id logic from here... if (includeSplitPointInstr || !(i instanceof Site) || ((Site) i).getCallSiteId() != splitPoint.getCallSiteId()) newBB.addInstr(i); @@ -165,7 +165,7 @@ public BasicBlock splitAtInstruction(Site splitPoint, Label newLabel, boolean in } } - if (!found) throw new RuntimeException("Cound not find split point: " + splitPoint); + if (!found) throw new RuntimeException("Could not find split point: " + splitPoint); // Remove all instructions from current bb that were moved over. for (int j = 0; j < numInstrs-idx; j++) { @@ -187,14 +187,14 @@ public BasicBlock clone(CloneInfo info, CFG newCFG) { for (Instr instr: instrs) { Instr newInstr = instr.clone(info); - // Inlining clones the original CFG/BBs and we want to maintain ipc since it is how + // Inlining clones the original CFG/BBs, and we want to maintain ipc since it is how // we find which instr we want (we clone original instr and ipc is our identity). //if (info instanceof SimpleCloneInfo && ((SimpleCloneInfo) info).shouldCloneIPC()) { // newInstr.setIPC(instr.getIPC()); // newInstr.setRPC(instr.getRPC()); //} - // All call-derived types do not clone this field. Inliner clones original instrs + // All call-derived types do not clone this field. Inliner clones original instrs, // and we need this preserved to make sure we do not endless inline the same call. if (instr instanceof CallBase && ((CallBase) instr).inliningBlocked()) { ((CallBase) newInstr).blockInlining(); @@ -248,10 +248,7 @@ public BasicBlock cloneForInlining(InlineCloneInfo ii) { @Override public int compareTo(final BasicBlock other) { - if (id == other.id) return 0; - if (id < other.id) return -1; - - return 1; + return Integer.compare(id, other.id); } @Override @@ -262,9 +259,9 @@ public String toString() { public String toStringInstrs() { StringBuilder buf = new StringBuilder(toString()); - Collection> outs = cfg.getOutgoingEdges(this); + Collection> outs = cfg.getOutgoingEdges(this); if (!outs.isEmpty()) { - for (Edge edge : outs) { + for (Edge edge : outs) { buf.append(" -").append(edge.getType()).append("->").append(edge.getDestination().getID()); } } diff --git a/core/src/main/java/org/jruby/ir/representations/CFG.java b/core/src/main/java/org/jruby/ir/representations/CFG.java index 8c80b068910..e7cf086d649 100644 --- a/core/src/main/java/org/jruby/ir/representations/CFG.java +++ b/core/src/main/java/org/jruby/ir/representations/CFG.java @@ -50,7 +50,7 @@ public enum EdgeType { private BasicBlock globalEnsureBB; /** The graph itself */ - private final DirectedGraph graph; + private final DirectedGraph graph; private int nextBBId; // Next available basic block id @@ -115,11 +115,6 @@ public Iterator getReversePostOrderTraverser() { return postOrderList().descendingIterator(); } - public void resetState() { - // SSS FIXME: anything else? - postOrderList = null; - } - public IRScope getScope() { return scope; } @@ -139,7 +134,7 @@ public Collection getSortedBasicBlocks() { return graph.getInorderData(); } - public void addEdge(BasicBlock source, BasicBlock destination, Object type) { + public void addEdge(BasicBlock source, BasicBlock destination, EdgeType type) { graph.findOrCreateVertexFor(source).addEdgeTo(destination, type); } @@ -155,15 +150,15 @@ public Iterable getIncomingSources(BasicBlock block) { return graph.findVertexFor(block).getIncomingSourcesData(); } - public Iterable> getIncomingEdges(BasicBlock block) { + public Iterable> getIncomingEdges(BasicBlock block) { return graph.findVertexFor(block).getIncomingEdges(); } - public BasicBlock getIncomingSourceOfType(BasicBlock block, Object type) { + public BasicBlock getIncomingSourceOfType(BasicBlock block, EdgeType type) { return graph.findVertexFor(block).getIncomingSourceDataOfType(type); } - public BasicBlock getOutgoingDestinationOfType(BasicBlock block, Object type) { + public BasicBlock getOutgoingDestinationOfType(BasicBlock block, EdgeType type) { return graph.findVertexFor(block).getOutgoingDestinationDataOfType(type); } @@ -171,15 +166,15 @@ public Iterable getOutgoingDestinations(BasicBlock block) { return graph.findVertexFor(block).getOutgoingDestinationsData(); } - public Iterable getOutgoingDestinationsOfType(BasicBlock block, Object type) { + public Iterable getOutgoingDestinationsOfType(BasicBlock block, EdgeType type) { return graph.findVertexFor(block).getOutgoingDestinationsDataOfType(type); } - public Iterable getOutgoingDestinationsNotOfType(BasicBlock block, Object type) { + public Iterable getOutgoingDestinationsNotOfType(BasicBlock block, EdgeType type) { return graph.findVertexFor(block).getOutgoingDestinationsDataNotOfType(type); } - public Collection> getOutgoingEdges(BasicBlock block) { + public Collection> getOutgoingEdges(BasicBlock block) { return graph.findVertexFor(block).getOutgoingEdges(); } @@ -211,7 +206,7 @@ public void setRescuerBB(BasicBlock block, BasicBlock rescuerBlock) { /** * Build the Control Flow Graph */ - public DirectedGraph build(Instr[] instrs) { + public DirectedGraph build(Instr[] instrs) { // Map of label & basic blocks which are waiting for a bb with that label Map> forwardRefs = new HashMap<>(); @@ -241,7 +236,7 @@ public DirectedGraph build(Instr[] instrs) { if (iop == Operation.LABEL) { Label l = ((LabelInstr) i).getLabel(); newBB = createBB(l, nestedExceptionRegions); - // Jump instruction bbs dont add an edge to the succeeding bb by default + // Jump instruction bbs don't add an edge to the succeeding bb by default if (nextBBIsFallThrough) graph.addEdge(currBB, newBB, EdgeType.FALL_THROUGH); currBB = newBB; bbEnded = false; @@ -256,16 +251,15 @@ public DirectedGraph build(Instr[] instrs) { } } else if (bbEnded && iop != Operation.EXC_REGION_END) { newBB = createBB(nestedExceptionRegions); - // Jump instruction bbs dont add an edge to the succeeding bb by default + // Jump instruction bbs don't add an edge to the succeeding bb by default if (nextBBIsFallThrough) graph.addEdge(currBB, newBB, EdgeType.FALL_THROUGH); // currBB cannot be null! currBB = newBB; bbEnded = false; nextBBIsFallThrough = true; } - if (i instanceof ExceptionRegionStartMarkerInstr) { - // We dont need the instruction anymore -- so it is not added to the CFG. - ExceptionRegionStartMarkerInstr ersmi = (ExceptionRegionStartMarkerInstr) i; + if (i instanceof ExceptionRegionStartMarkerInstr ersmi) { + // We don't need the instruction anymore -- so it is not added to the CFG. ExceptionRegion rr = new ExceptionRegion(ersmi.getFirstRescueBlockLabel(), currBB); rr.addBB(currBB); allExceptionRegions.add(rr); @@ -276,7 +270,7 @@ public DirectedGraph build(Instr[] instrs) { nestedExceptionRegions.push(rr); } else if (i instanceof ExceptionRegionEndMarkerInstr) { - // We dont need the instruction anymore -- so it is not added to the CFG. + // We don't need the instruction anymore -- so it is not added to the CFG. nestedExceptionRegions.pop().setEndBB(currBB); } else if (iop.endsBasicBlock()) { bbEnded = true; @@ -292,10 +286,8 @@ public DirectedGraph build(Instr[] instrs) { } else if (i instanceof JumpInstr) { tgt = ((JumpInstr) i).getJumpTarget(); } else if (iop.isReturn()) { // BREAK, RETURN, CLOSURE_RETURN - tgt = null; returnBBs.add(currBB); } else if (i instanceof ThrowExceptionInstr) { - tgt = null; exceptionBBs.add(currBB); } else { throw new RuntimeException("Unhandled case in CFG builder for basic block ending instr: " + i); @@ -344,13 +336,13 @@ public DirectedGraph build(Instr[] instrs) { public void fixupEdges(BasicBlock bb) { Instr lastInstr = bb.getLastInstr(); if (lastInstr instanceof BranchInstr) { - // We assume branches will not turn into other branches so we ignore this + // We assume branches will not turn into other branches, so we ignore this } else if (bb.getLastInstr() instanceof JumpTargetInstr) { // this is really a jump branch already covered - for (Edge edge: getOutgoingEdges(bb)) { + for (Edge edge: getOutgoingEdges(bb)) { if (edge.getType() == EdgeType.FALL_THROUGH) graph.removeEdge(edge); } } else { - for (Edge edge: getOutgoingEdges(bb)) { + for (Edge edge: getOutgoingEdges(bb)) { if (edge.getType() == EdgeType.REGULAR) graph.removeEdge(edge); } } @@ -365,12 +357,7 @@ private void addEdge(BasicBlock src, Label targetLabel, Map source - List forwardReferences = forwardRefs.get(targetLabel); - - if (forwardReferences == null) { - forwardReferences = new ArrayList<>(); - forwardRefs.put(targetLabel, forwardReferences); - } + List forwardReferences = forwardRefs.computeIfAbsent(targetLabel, k -> new ArrayList<>()); forwardReferences.add(src); } @@ -432,12 +419,12 @@ public void removeAllOutgoingEdgesForBB(BasicBlock b) { graph.findVertexFor(b).removeAllOutgoingEdges(); } - private void deleteOrphanedBlocks(DirectedGraph graph) { + private void deleteOrphanedBlocks(DirectedGraph graph) { // System.out.println("\nGraph:\n" + toStringGraph()); // System.out.println("\nInstructions:\n" + toStringInstrs()); - Queue worklist = new LinkedList(); - Set living = new HashSet(); + Queue worklist = new LinkedList<>(); + Set living = new HashSet<>(); worklist.add(entryBB); living.add(entryBB); @@ -453,8 +440,8 @@ private void deleteOrphanedBlocks(DirectedGraph graph) { } // Seems like Java should have simpler way of doing this. - // We canot just remove in this loop or we get concmodexc. - Set dead = new HashSet(); + // We cannot just remove in this loop, or we get concmodexc. + Set dead = new HashSet<>(); for (BasicBlock bb: graph.allData()) { if (!living.contains(bb)) dead.add(bb); } @@ -475,7 +462,7 @@ private boolean mergeBBs(BasicBlock a, BasicBlock b) { // NOTE: We need not check the ensure block map because all ensure blocks are already // captured in the bb rescue block map. So, if aR == bR, it is guaranteed that the // ensure blocks for the two are identical. - // 2. One of 'a' or 'b' is empty. We dont need to check for rescue block match because + // 2. One of 'a' or 'b' is empty. We don't need to check for rescue block match because // an empty basic block cannot raise an exception, can it? if (aR == bR || a.isEmpty() || b.isEmpty()) { // First, remove straight-line jump, if present @@ -487,12 +474,12 @@ private boolean mergeBBs(BasicBlock a, BasicBlock b) { // Fixup edges removeEdge(a, b); - for (Edge e : getOutgoingEdges(b)) { + for (Edge e : getOutgoingEdges(b)) { addEdge(a, e.getDestination().getData(), e.getType()); } // Move all incoming edges of b to be incoming edges of a. - for (Edge e : getIncomingEdges(b)) { + for (Edge e : getIncomingEdges(b)) { BasicBlock fixupBB = e.getSource().getData(); removeEdge(fixupBB, b); addEdge(fixupBB, a, e.getType()); @@ -528,7 +515,7 @@ public void removeBB(BasicBlock b) { } /** - * Wrapped IRClosures in dead BB are lexically rooted to that dead BB so they can + * Wrapped IRClosures in dead BB are lexically rooted to that dead BB, so they can * be removed from the parent scope if the BB they live in died. */ private void removeNestedScopesFromBB(BasicBlock bb) { @@ -548,13 +535,12 @@ public void collapseStraightLineBBs() { // // SSS FIXME: So, we need a cfg/graph API that returns an iterator over // frozen data rather than live data. - List cfgBBs = new ArrayList<>(); - for (BasicBlock b: getBasicBlocks()) cfgBBs.add(b); + List cfgBBs = new ArrayList<>(getBasicBlocks()); Set mergedBBs = new HashSet<>(); for (BasicBlock b: cfgBBs) { if (!mergedBBs.contains(b) && outDegree(b) == 1) { - for (Edge e : getOutgoingEdges(b)) { + for (Edge e : getOutgoingEdges(b)) { BasicBlock outB = e.getDestination().getData(); // 1:1 BBs can just be one since there is only one place to go. An empty entering any BB can merge @@ -582,14 +568,14 @@ public void optimize() { // // If a jump intervenes in 'x', skip over it and if merge succeeds, // delete the jump. - List> toRemove = new ArrayList<>(); + List> toRemove = new ArrayList<>(); for (BasicBlock retBB: returnBBs) { List rbInstrs = retBB.getInstrs(); Instr first = rbInstrs.get(0); if (first instanceof ReturnInstr) { Operand rv = ((ReturnInstr)first).getReturnValue(); if (rv instanceof Variable) { - for (Edge e : getIncomingEdges(retBB)) { + for (Edge e : getIncomingEdges(retBB)) { BasicBlock srcBB = e.getSource().getData(); List srcInstrs = srcBB.getInstrs(); int n = srcInstrs.size(); @@ -619,7 +605,7 @@ public void optimize() { } } } - for (Edge edge: toRemove) { + for (Edge edge: toRemove) { graph.removeEdge(edge); } @@ -733,7 +719,7 @@ public CFG clone(CloneInfo info, IRScope clonedScope) { // Part 2: Clone graph (build new edges from new BBs made in previous phase) for (BasicBlock bb: getBasicBlocks()) { BasicBlock newSource = cloneBBMap.get(bb); - for (Edge edge : getOutgoingEdges(bb)) { + for (Edge edge : getOutgoingEdges(bb)) { BasicBlock newDestination = cloneBBMap.get(edge.getDestination().getData()); newCFG.addEdge(newSource, newDestination, edge.getType()); } diff --git a/core/src/main/java/org/jruby/ir/representations/CFGLinearizer.java b/core/src/main/java/org/jruby/ir/representations/CFGLinearizer.java index 16759160e8f..a2e85486650 100644 --- a/core/src/main/java/org/jruby/ir/representations/CFGLinearizer.java +++ b/core/src/main/java/org/jruby/ir/representations/CFGLinearizer.java @@ -14,11 +14,11 @@ * This produces a linear list of BasicBlocks so that the linearized instruction * list is in executable form. In generating this list, we will also add jumps * where required and remove as many jumps as possible. - * + *

* Ordinary BasicBlocks will follow FollowThrough edges and just concatenate * together eliminating the need for executing a jump instruction during * execution. - * + *

* Notes: * 1. Basic blocks ending in branches have two edges (FollowTrough/NotTaken and Taken) * 2. All BasicBlocks can possibly have two additional edges related to exceptions: @@ -28,10 +28,10 @@ * situations where we bypass the rescue block (breaks and thread-kill). * 3. Branch, Jump, Return, and Exceptions are all boundaries for BasicBlocks * 4. Dummy Entry and Exit BasicBlocks exist in all CFGs - * + *

* NOTE: When the IR builder first builds its list, and the CFG builder builds the CFG, * the order in which BBs are created should already be a linearized list. Need to verify - * this and we might be able to skip linearization if the CFG has not been transformed + * this, and we might be able to skip linearization if the CFG has not been transformed * by any code transformation passes. This might be the case when JRuby first starts up * when we may just build the IR and start interpreting it right away without running any * opts. In that scenario, it may be worth it to not run the linearizer at all. diff --git a/core/src/main/java/org/jruby/ir/representations/ExceptionRegion.java b/core/src/main/java/org/jruby/ir/representations/ExceptionRegion.java index 52f9e885fb9..4d598e5981b 100644 --- a/core/src/main/java/org/jruby/ir/representations/ExceptionRegion.java +++ b/core/src/main/java/org/jruby/ir/representations/ExceptionRegion.java @@ -7,7 +7,7 @@ // This class is currently only used during CFG building and is hence made private. // A scope's CFG exception regions are currently not exposed anywhere after the CFG is built. -// If in future, it is useful somewhere else, this class can be made public and a scope's +// If in the future, it is useful somewhere else, this class can be made public and a scope's // exception regions can be exposed as well. class ExceptionRegion { private final Label firstRescueBlockLabel; // Label of the first rescue block @@ -20,8 +20,8 @@ class ExceptionRegion { public ExceptionRegion(Label firstRescueBlockLabel, BasicBlock startBB) { this.firstRescueBlockLabel = firstRescueBlockLabel; this.startBB = startBB; - exclusiveBBs = new ArrayList(); - nestedRegions = new ArrayList(); + exclusiveBBs = new ArrayList<>(); + nestedRegions = new ArrayList<>(); } public void setEndBB(BasicBlock bb) { diff --git a/core/src/main/java/org/jruby/ir/representations/IGVCFGVisitor.java b/core/src/main/java/org/jruby/ir/representations/IGVCFGVisitor.java index b5bd70f5f4a..55fbaefbc88 100644 --- a/core/src/main/java/org/jruby/ir/representations/IGVCFGVisitor.java +++ b/core/src/main/java/org/jruby/ir/representations/IGVCFGVisitor.java @@ -5,7 +5,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import jnr.ffi.annotations.In; import org.jruby.ir.Tuple; import org.jruby.ir.instructions.BranchInstr; import org.jruby.ir.instructions.Instr; @@ -26,9 +25,9 @@ */ public class IGVCFGVisitor { final PrintStream writer; - final Map indexOffsets = new HashMap(); - final List> instrEdges = new ArrayList(); - final List> extraInstrEdges = new ArrayList(); + final Map indexOffsets = new HashMap<>(); + final List> instrEdges = new ArrayList<>(); + final List> extraInstrEdges = new ArrayList<>(); Instr lastInstr = null; // Last instr from the previous BB. final IGVInstrListener listener; @@ -78,12 +77,12 @@ protected void visitInstrs(BasicBlock basicBlock) { // Last BB processed needs to hook up to first in next one if not a Jump (fallthrough) if (lastInstr != null && !(lastInstr instanceof JumpInstr)) { - instrEdges.add(new Tuple(System.identityHashCode(lastInstr), lastIPC)); + instrEdges.add(new Tuple<>(System.identityHashCode(lastInstr), lastIPC)); } for (int i = 1; i < size; i++) { int ipc = Instr(instrs.get(i)); - instrEdges.add(new Tuple(lastIPC, ipc)); + instrEdges.add(new Tuple<>(lastIPC, ipc)); lastIPC = ipc; } @@ -140,8 +139,8 @@ public int Instr(Instr instr) { property(writer, "label" , ipc); property(writer, "name", instr); - // We have not processed all BBs yet so we cannot resolve ipc locations of the jumps destinations. - if (instr instanceof BranchInstr) extraInstrEdges.add(new Tuple(ipc, (JumpTargetInstr) instr)); + // We have not processed all BBs yet, so we cannot resolve ipc locations of the jumps destinations. + if (instr instanceof BranchInstr) extraInstrEdges.add(new Tuple<>(ipc, (JumpTargetInstr) instr)); endTag(writer, "properties"); endTag(writer, "node"); diff --git a/core/src/main/java/org/jruby/ir/transformations/inlining/CFGInliner.java b/core/src/main/java/org/jruby/ir/transformations/inlining/CFGInliner.java index bc9adfa9899..759f7ea5c1d 100644 --- a/core/src/main/java/org/jruby/ir/transformations/inlining/CFGInliner.java +++ b/core/src/main/java/org/jruby/ir/transformations/inlining/CFGInliner.java @@ -53,7 +53,7 @@ private CFG cloneSelf(InlineCloneInfo ii) { if (b.isEntryBB() || b.isExitBB()) continue; BasicBlock rb = ii.getRenamedBB(b); - for (Edge e : cfg.getOutgoingEdges(b)) { + for (Edge e : cfg.getOutgoingEdges(b)) { BasicBlock destination = e.getDestination().getData(); if (!destination.isExitBB()) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType()); } @@ -178,7 +178,7 @@ public String inlineMethod(IRScope scopeToInline, RubyModule implClass, int clas // SSS: FIXME: We need a swallow-graph api method in cfg and graph for (BasicBlock b : selfClone.getBasicBlocks()) { cfg.addBasicBlock(b); - for (Edge e : selfClone.getOutgoingEdges(b)) { + for (Edge e : selfClone.getOutgoingEdges(b)) { cfg.addEdge(b, e.getDestination().getData(), e.getType()); } } @@ -191,7 +191,7 @@ public String inlineMethod(IRScope scopeToInline, RubyModule implClass, int clas if (x.isEntryBB() || x.isExitBB()) continue; BasicBlock rx = ii.getRenamedBB(x); - for (Edge e : methodToInline.getOutgoingEdges(x)) { + for (Edge e : methodToInline.getOutgoingEdges(x)) { BasicBlock b = e.getDestination().getData(); if (!b.isExitBB()) cfg.addEdge(rx, ii.getRenamedBB(b), e.getType()); } @@ -230,7 +230,7 @@ public String inlineMethod(IRScope scopeToInline, RubyModule implClass, int clas } // Hook up exit edges - for (Edge e : methodToInline.getIncomingEdges(methodToInline.getExitBB())) { + for (Edge e : methodToInline.getIncomingEdges(methodToInline.getExitBB())) { BasicBlock source = e.getSource().getData(); if (source.isEntryBB()) continue; @@ -302,8 +302,8 @@ public String inlineMethod(IRScope scopeToInline, RubyModule implClass, int clas throw new RuntimeException("Encountered a dynamic closure arg. Cannot inline it here! Convert the yield to a call by converting the closure into a dummy method (have to convert all frame vars to call arguments, or at least convert the frame into a call arg"); } - for (Tuple t: yieldSites) { - inlineClosureAtYieldSite(ii, ((WrappedIRClosure) closureArg).getClosure(), (BasicBlock) t.a, (YieldInstr) t.b); + for (Tuple t: yieldSites) { + inlineClosureAtYieldSite(ii, ((WrappedIRClosure) closureArg).getClosure(), t.a, t.b); } } @@ -339,7 +339,7 @@ private void addMissingJumps() { boolean fallThrough = false; Label jumpLabel = null; - for (Edge edge : cfg.getOutgoingEdges(bb)) { + for (Edge edge : cfg.getOutgoingEdges(bb)) { if (edge.getType() == EdgeType.FALL_THROUGH) { // Assume next BB will be correct fallThrough = true; } else if (edge.getType() == EdgeType.REGULAR || edge.getType() == EdgeType.EXIT) { // Not sure if we can have regular and fallthrough but only add regular if no fallthrough @@ -362,7 +362,7 @@ private void addMissingJumps() { // a new BB after the original BB and remove those from the original BB (beforeInlineBB). private void connectOuterEdges(BasicBlock beforeInlineBB, BasicBlock afterInlineBB) { cfg.addBasicBlock(afterInlineBB); - for (Edge e : cfg.getOutgoingEdges(beforeInlineBB)) { + for (Edge e : cfg.getOutgoingEdges(beforeInlineBB)) { cfg.addEdge(afterInlineBB, e.getDestination().getData(), e.getType()); } cfg.removeAllOutgoingEdgesForBB(beforeInlineBB); @@ -391,14 +391,14 @@ private void inlineClosureAtYieldSite(InlineCloneInfo ii, IRClosure cl, BasicBlo if (b.isEntryBB() || b.isExitBB()) continue; BasicBlock bClone = ii.getRenamedBB(b); - for (Edge e : closureCFG.getOutgoingEdges(b)) { + for (Edge e : closureCFG.getOutgoingEdges(b)) { BasicBlock edst = e.getDestination().getData(); if (!edst.isExitBB() && edst != closureGEB) cfg.addEdge(bClone, ii.getRenamedBB(edst), e.getType()); } } // Hook up entry edges - for (Edge e : closureCFG.getOutgoingEdges(closureCFG.getEntryBB())) { + for (Edge e : closureCFG.getOutgoingEdges(closureCFG.getEntryBB())) { BasicBlock destination = e.getDestination().getData(); if (!destination.isExitBB() && destination != closureGEB) { cfg.addEdge(beforeInlineBB, ii.getRenamedBB(destination), CFG.EdgeType.FALL_THROUGH); @@ -406,7 +406,7 @@ private void inlineClosureAtYieldSite(InlineCloneInfo ii, IRClosure cl, BasicBlo } // Hook up exit edges - for (Edge e : closureCFG.getIncomingEdges(closureCFG.getExitBB())) { + for (Edge e : closureCFG.getIncomingEdges(closureCFG.getExitBB())) { BasicBlock source = e.getSource().getData(); if (source.isEntryBB()) continue; diff --git a/core/src/main/java/org/jruby/ir/transformations/inlining/InlineCloneInfo.java b/core/src/main/java/org/jruby/ir/transformations/inlining/InlineCloneInfo.java index b3799cdfcf4..99b286ad8de 100644 --- a/core/src/main/java/org/jruby/ir/transformations/inlining/InlineCloneInfo.java +++ b/core/src/main/java/org/jruby/ir/transformations/inlining/InlineCloneInfo.java @@ -43,7 +43,7 @@ public class InlineCloneInfo extends CloneInfo { private final boolean isClosure; // true for closure inlining private Operand yieldArg; // Closure inlining only private Variable yieldResult; // Closure inlining only - private final List yieldSites = new ArrayList(); // Closure inlining only + private final List> yieldSites = new ArrayList<>(); // Closure inlining only private final IRScope scopeBeingInlined; // host scope is where we are going and this was original scope @@ -171,8 +171,7 @@ protected Variable getRenamedVariableSimple(Variable v) { // when inlining a closure, // - local var depths are reduced by 1 (to move them to the host scope) // - tmp vars are reallocated in the host scope - if (v instanceof LocalVariable) { - LocalVariable lv = (LocalVariable) v; + if (v instanceof LocalVariable lv) { int depth = lv.getScopeDepth(); return getHostScope().getLocalVariable(lv.getName(), depth > 1 ? depth - 1 : 0); } @@ -193,12 +192,12 @@ public Variable getYieldResult() { return yieldResult; } - public List getYieldSites() { + public List> getYieldSites() { return yieldSites; } public void recordYieldSite(BasicBlock bb, YieldInstr i) { - yieldSites.add(new Tuple(bb, i)); + yieldSites.add(new Tuple<>(bb, i)); } public void setupYieldArgsAndYieldResult(YieldInstr yi, BasicBlock yieldBB, int blockArityValue) { @@ -210,7 +209,7 @@ public void setupYieldArgsAndYieldResult(YieldInstr yi, BasicBlock yieldBB, int yieldArg = yieldInstrArg; // 1:1 arg match if (((Array) yieldInstrArg).size() == blockArityValue) canMapArgsStatically = true; - } else if (blockArityValue == 1 && yi.unwrapArray == false) { + } else if (blockArityValue == 1 && !yi.unwrapArray) { yieldArg = yieldInstrArg; canMapArgsStatically = true; } else { @@ -228,9 +227,9 @@ public void setupYieldArgsAndYieldResult(YieldInstr yi, BasicBlock yieldBB, int // SSS FIXME: This is a copy of a method in instructions/calladapter/CallAdapter.java // Maybe move this is to a util/Helpers class? - private static boolean containsSplat(Operand args[]) { - for (int i = 0; i < args.length; i++) { - if (args[i] instanceof Splat) return true; + private static boolean containsSplat(Operand[] args) { + for (Operand arg: args) { + if (arg instanceof Splat) return true; } return false; diff --git a/core/src/main/java/org/jruby/lexer/LexingCommon.java b/core/src/main/java/org/jruby/lexer/LexingCommon.java index 10c0d184dc4..4334ae74267 100644 --- a/core/src/main/java/org/jruby/lexer/LexingCommon.java +++ b/core/src/main/java/org/jruby/lexer/LexingCommon.java @@ -268,6 +268,10 @@ public LexContext getLexContext() { return lexContext; } + public void setLexContext(LexContext context) { + lexContext = context; + } + public int getBraceNest() { return braceNest; } @@ -888,7 +892,7 @@ public Object value() { } protected int warn_balanced(int c, boolean spaceSeen, int token, String op, String syn) { - if (!isLexState(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && spaceSeen && !Character.isWhitespace(c)) { + if (!IS_lex_state(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && spaceSeen && !Character.isWhitespace(c)) { ambiguousOperator(op, syn); } @@ -977,36 +981,44 @@ public static boolean isHexChar(int c) { return Character.isDigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'); } - public static boolean isLexState(int state, int mask) { + public static boolean IS_lex_state(int state, int mask) { return (mask & state) != 0; } - protected boolean isLexStateAll(int state, int mask) { + protected boolean IS_lex_state_all(int state, int mask) { return (mask & state) == mask; } - protected boolean isARG() { - return isLexState(lex_state, EXPR_ARG_ANY); + protected static boolean ISSPACE(int c) { + return Character.isWhitespace(c); + } + + protected boolean IS_ARG() { + return IS_lex_state(lex_state, EXPR_ARG_ANY); } - protected boolean isBEG() { - return isLexState(lex_state, EXPR_BEG_ANY) || isLexStateAll(lex_state, EXPR_ARG|EXPR_LABELED); + protected boolean IS_END() { + return IS_lex_state(lex_state, EXPR_END_ANY); } - protected boolean isEND() { - return isLexState(lex_state, EXPR_END_ANY); + protected boolean IS_BEG() { + return IS_lex_state(lex_state, EXPR_BEG_ANY) || IS_lex_state_all(lex_state, EXPR_ARG|EXPR_LABELED); } - protected boolean isLabelPossible(boolean commandState) { - return (isLexState(lex_state, EXPR_LABEL|EXPR_ENDFN) && !commandState) || isARG(); + protected boolean IS_SPCARG(int c, boolean spaceSeen) { + return IS_ARG() && spaceSeen && !ISSPACE(c); } - public boolean isLabelSuffix() { + protected boolean IS_LABEL_POSSIBLE(boolean commandState) { + return (IS_lex_state(lex_state, EXPR_LABEL|EXPR_ENDFN) && !commandState) || IS_ARG(); + } + + public boolean IS_LABEL_SUFFIX() { return peek(':') && !peek(':', 1); } - protected boolean isAfterOperator() { - return isLexState(lex_state, EXPR_FNAME|EXPR_DOT); + protected boolean IS_AFTER_OPERATOR() { + return IS_lex_state(lex_state, EXPR_FNAME|EXPR_DOT); } protected boolean isNext_identchar() throws IOException { @@ -1028,10 +1040,6 @@ public static boolean isSpace(int c) { return c == ' ' || ('\t' <= c && c <= '\r'); } - protected boolean isSpaceArg(int c, boolean spaceSeen) { - return isARG() && spaceSeen && !Character.isWhitespace(c); - } - /* MRI: magic_comment_marker */ /* This impl is a little sucky. We basically double scan the same bytelist twice. Once here * and once in parseMagicComment. diff --git a/core/src/main/java/org/jruby/lexer/yacc/LexContext.java b/core/src/main/java/org/jruby/lexer/yacc/LexContext.java index 465062a1722..d8804ee2471 100644 --- a/core/src/main/java/org/jruby/lexer/yacc/LexContext.java +++ b/core/src/main/java/org/jruby/lexer/yacc/LexContext.java @@ -3,6 +3,13 @@ import org.jruby.ast.DefHolder; public class LexContext { + public enum InRescue { + NONE, + BEFORE_RESCUE, + AFTER_RESCUE, + AFTER_ELSE, + AFTER_ENSURE + } // Is the parser currently within a class body. public boolean in_class; @@ -16,6 +23,8 @@ public class LexContext { public ShareableConstantValue shareable_constant_value; public boolean in_argdef; + public InRescue in_rescue = InRescue.NONE; + public void reset() { in_def = false; } @@ -24,7 +33,10 @@ public Object clone() { LexContext context = new LexContext(); context.in_class = in_class; context.in_def = in_def; + context.in_kwarg = in_kwarg; context.in_defined = in_defined; + context.in_rescue = in_rescue; + context.in_argdef = in_argdef; context.shareable_constant_value = shareable_constant_value; return context; @@ -33,5 +45,6 @@ public Object clone() { public void restore(DefHolder holder) { this.in_def = holder.ctxt.in_def; this.shareable_constant_value = holder.ctxt.shareable_constant_value; + this.in_rescue = holder.ctxt.in_rescue; } } diff --git a/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java b/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java index a7087c874a5..be1bb08b275 100644 --- a/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java +++ b/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java @@ -294,7 +294,7 @@ public int tokenize_ident(int result) { ByteList value = createTokenByteList(); String id = getRuntime().newSymbol(value).idString(); - if (isLexState(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(id) >= 0) { + if (IS_lex_state(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(id) >= 0) { setState(EXPR_END); } @@ -1002,9 +1002,9 @@ private int yylex() throws IOException { /* fall through */ case '\n': { this.tokenSeen = tokenSeen; - boolean normalArg = isLexState(lex_state, EXPR_BEG | EXPR_CLASS | EXPR_FNAME | EXPR_DOT) && - !isLexState(lex_state, EXPR_LABELED); - if (normalArg || isLexStateAll(lex_state, EXPR_ARG | EXPR_LABELED)) { + boolean normalArg = IS_lex_state(lex_state, EXPR_BEG | EXPR_CLASS | EXPR_FNAME | EXPR_DOT) && + !IS_lex_state(lex_state, EXPR_LABELED); + if (normalArg || IS_lex_state_all(lex_state, EXPR_ARG | EXPR_LABELED)) { if (!normalArg && getLexContext().in_kwarg) { commandStart = true; setState(EXPR_BEG); @@ -1078,7 +1078,7 @@ private int yylex() throws IOException { } } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); c = nextc(); if (c == '=') { @@ -1192,7 +1192,7 @@ private int identifierToken(int result, ByteList value) { String id = symbol.idString(); if (result == tCONSTANT && !symbol.validConstantName()) result = tIDENTIFIER; - if (result == tIDENTIFIER && !isLexState(last_state, EXPR_DOT|EXPR_FNAME) && + if (result == tIDENTIFIER && !IS_lex_state(last_state, EXPR_DOT|EXPR_FNAME) && parser.getCurrentScope().isDefined(id) >= 0) { setState(EXPR_END|EXPR_LABEL); } @@ -1234,17 +1234,17 @@ private int ampersand(boolean spaceSeen) { //if the warning is generated, the getPosition() on line 954 (this line + 18) will create //a wrong position if the "inclusive" flag is not set. int tmpLine = ruby_sourceline; - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (warnings.isVerbose() && Options.PARSER_WARN_ARGUMENT_PREFIX.load()) warning(ID.ARGUMENT_AS_PREFIX, getFile(), tmpLine, "`&' interpreted as argument prefix"); c = tAMPER; - } else if (isBEG()) { + } else if (IS_BEG()) { c = tAMPER; } else { c = warn_balanced(c, spaceSeen, '&', "&", "argument prefix"); } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); yaccValue = AMPERSAND; return c; @@ -1260,7 +1260,7 @@ private int at() { } else { result = tIVAR; } - setState(isLexState(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END); + setState(IS_lex_state(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END); if (c == EOF || !isIdentifierChar(c)) { if (result == tIVAR) { @@ -1289,11 +1289,11 @@ private int at() { private int backtick(boolean commandState) { yaccValue = BACKTICK; - if (isLexState(lex_state, EXPR_FNAME)) { + if (IS_lex_state(lex_state, EXPR_FNAME)) { setState(EXPR_ENDFN); return '`'; } - if (isLexState(lex_state, EXPR_DOT)) { + if (IS_lex_state(lex_state, EXPR_DOT)) { setState(commandState ? EXPR_CMDARG : EXPR_ARG); return '`'; @@ -1306,7 +1306,7 @@ private int backtick(boolean commandState) { private int bang() { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = BANG; @@ -1343,7 +1343,7 @@ private int caret() { return tOP_ASGN; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); pushback(c); return '^'; @@ -1353,7 +1353,7 @@ private int colon(boolean spaceSeen) { int c = nextc(); if (c == ':') { - if (isBEG() || isLexState(lex_state, EXPR_CLASS) || (isARG() && spaceSeen)) { + if (IS_BEG() || IS_lex_state(lex_state, EXPR_CLASS) || (IS_SPCARG(-1, spaceSeen))) { setState(EXPR_BEG); yaccValue = COLON_COLON; return tCOLON3; @@ -1364,7 +1364,7 @@ private int colon(boolean spaceSeen) { return tCOLON2; } - if (isEND() || Character.isWhitespace(c) || c == '#') { + if (IS_END() || ISSPACE(c) || c == '#') { pushback(c); setState(EXPR_BEG); yaccValue = COLON; @@ -1403,7 +1403,7 @@ private int doKeyword(int state) { if (conditionState.set_p()) return keyword_do_cond; - if (cmdArgumentState.set_p() && !isLexState(state, EXPR_CMDARG)) { + if (cmdArgumentState.set_p() && !IS_lex_state(state, EXPR_CMDARG)) { return keyword_do_block; } @@ -1466,7 +1466,7 @@ private int dollar() { case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ // Explicit reference to these vars as symbols... - if (isLexState(last_state, EXPR_FNAME)) { + if (IS_lex_state(last_state, EXPR_FNAME)) { yaccValue = new ByteList(new byte[] {'$', (byte) c}, USASCII_ENCODING); set_yylval_name(new ByteList(new byte[] {'$', (byte) c})); return tGVAR; @@ -1481,7 +1481,7 @@ private int dollar() { c = nextc(); } while (Character.isDigit(c)); pushback(c); - if (isLexState(last_state, EXPR_FNAME)) { + if (IS_lex_state(last_state, EXPR_FNAME)) { yaccValue = createTokenByteList(); set_yylval_name(new ByteList(new byte[] {'$', (byte) c})); return tGVAR; @@ -1523,7 +1523,7 @@ private int dollar() { private int dot() { int c; - boolean isBeg = isBEG(); + boolean isBeg = IS_BEG(); setState(EXPR_BEG); if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { @@ -1537,7 +1537,7 @@ private int dot() { if (parenNest == 0 && isLookingAtEOL()) { warn(ID.MISCELLANEOUS, "... at EOL, should be parenthesized?"); } else if (getLeftParenBegin() >= 0 && getLeftParenBegin() + 1 == parenNest) { - if (isLexState(last_state, EXPR_LABEL)) { + if (IS_lex_state(last_state, EXPR_LABEL)) { return tDOT3; } } @@ -1559,7 +1559,7 @@ private int dot() { } private int doubleQuote(boolean commandState) { - int label = isLabelPossible(commandState) ? str_label : 0; + int label = IS_LABEL_POSSIBLE(commandState) ? str_label : 0; lex_strterm = new StringTerm(str_dquote|label, '\0', '"', ruby_sourceline); yaccValue = QQ; @@ -1567,7 +1567,7 @@ private int doubleQuote(boolean commandState) { } private int greaterThan() { - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); int c = nextc(); @@ -1616,7 +1616,7 @@ private int identifier(int c, boolean commandState) { if ((c == '!' || c == '?') && !peek('=')) { result = tFID; tempVal = createTokenByteList(); - } else if (c == '=' && isLexState(lex_state, EXPR_FNAME)) { + } else if (c == '=' && IS_lex_state(lex_state, EXPR_FNAME)) { int c2 = nextc(); if (c2 != '~' && c2 != '>' && (c2 != '=' || peek('>'))) { result = tIDENTIFIER; @@ -1633,8 +1633,8 @@ private int identifier(int c, boolean commandState) { tempVal = createTokenByteList(); } - if (isLabelPossible(commandState)) { - if (isLabelSuffix()) { + if (IS_LABEL_POSSIBLE(commandState)) { + if (IS_LABEL_SUFFIX()) { setState(EXPR_ARG|EXPR_LABELED); nextc(); yaccValue = tempVal; @@ -1651,17 +1651,17 @@ private int identifier(int c, boolean commandState) { setState(keyword.state); yaccValue = keyword.bytes; - if (isLexState(state, EXPR_FNAME)) { + if (IS_lex_state(state, EXPR_FNAME)) { setState(EXPR_ENDFN); set_yylval_name(createTokenByteList()); return keyword.id0; } - if (isLexState(lex_state, EXPR_BEG)) commandStart = true; + if (IS_lex_state(lex_state, EXPR_BEG)) commandStart = true; if (keyword.id0 == keyword_do) return doKeyword(state); - if (isLexState(state, EXPR_BEG|EXPR_LABELED)) { + if (IS_lex_state(state, EXPR_BEG|EXPR_LABELED)) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) setState(EXPR_BEG|EXPR_LABEL); @@ -1670,7 +1670,7 @@ private int identifier(int c, boolean commandState) { } } - if (isLexState(lex_state, EXPR_BEG_ANY|EXPR_ARG_ANY|EXPR_DOT)) { + if (IS_lex_state(lex_state, EXPR_BEG_ANY|EXPR_ARG_ANY|EXPR_DOT)) { setState(commandState ? EXPR_CMDARG : EXPR_ARG); } else if (lex_state == EXPR_FNAME) { setState(EXPR_ENDFN); @@ -1684,7 +1684,7 @@ private int identifier(int c, boolean commandState) { private int leftBracket(boolean spaceSeen) { parenNest++; int c = '['; - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { if ((c = nextc()) == ']') { parenNest--; setState(EXPR_ARG); @@ -1700,7 +1700,7 @@ private int leftBracket(boolean spaceSeen) { setState(EXPR_ARG|EXPR_LABEL); yaccValue = LBRACKET; return '['; - } else if (isBEG() || (isARG() && (spaceSeen || isLexState(lex_state, EXPR_LABELED)))) { + } else if (IS_BEG() || (IS_ARG() && (spaceSeen || IS_lex_state(lex_state, EXPR_LABELED)))) { c = tLBRACK; } @@ -1716,11 +1716,11 @@ private int leftCurly() { char c; if (isLambdaBeginning()) { c = tLAMBEG; - } else if (isLexState(lex_state, EXPR_LABELED)) { + } else if (IS_lex_state(lex_state, EXPR_LABELED)) { c = tLBRACE; - } else if (isLexState(lex_state, EXPR_ARG_ANY|EXPR_END|EXPR_ENDFN)) { // block (primary) + } else if (IS_lex_state(lex_state, EXPR_ARG_ANY|EXPR_END|EXPR_ENDFN)) { // block (primary) c = '{'; - } else if (isLexState(lex_state, EXPR_ENDARG)) { // block (expr) + } else if (IS_lex_state(lex_state, EXPR_ENDARG)) { // block (expr) c = tLBRACE_ARG; } else { // hash c = tLBRACE; @@ -1744,13 +1744,13 @@ private int leftCurly() { private int leftParen(boolean spaceSeen) { int result; - if (isBEG()) { + if (IS_BEG()) { result = tLPAREN; } else if (!spaceSeen) { result = '('; - } else if (isARG() || isLexStateAll(lex_state, EXPR_END|EXPR_LABEL)) { + } else if (IS_ARG() || IS_lex_state_all(lex_state, EXPR_END|EXPR_LABEL)) { result = tLPAREN_ARG; - } else if (isLexState(lex_state, EXPR_ENDFN) && !isLambdaBeginning()) { + } else if (IS_lex_state(lex_state, EXPR_ENDFN) && !isLambdaBeginning()) { warnings.warn(ID.MISCELLANEOUS, "parentheses after method name is interpreted as an argument list, not a decomposed argument"); result = '('; } else { @@ -1769,17 +1769,17 @@ private int leftParen(boolean spaceSeen) { private int lessThan(boolean spaceSeen) { last_state = lex_state; int c = nextc(); - if (c == '<' && !isLexState(lex_state, EXPR_DOT|EXPR_CLASS) && - !isEND() && (!isARG() || isLexState(lex_state, EXPR_LABELED) || spaceSeen)) { + if (c == '<' && !IS_lex_state(lex_state, EXPR_DOT|EXPR_CLASS) && + !IS_END() && (!IS_ARG() || IS_lex_state(lex_state, EXPR_LABELED) || spaceSeen)) { int tok = hereDocumentIdentifier(); if (tok != 0) return tok; } - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); } else { - if (isLexState(lex_state, EXPR_CLASS)) commandStart = true; + if (IS_lex_state(lex_state, EXPR_CLASS)) commandStart = true; setState(EXPR_BEG); } @@ -1811,7 +1811,7 @@ private int lessThan(boolean spaceSeen) { private int minus(boolean spaceSeen) { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = MINUS_AT; @@ -1832,7 +1832,7 @@ private int minus(boolean spaceSeen) { yaccValue = MINUS_GT; return tLAMBDA; } - if (isBEG() || (isSpaceArg(c, spaceSeen) && arg_ambiguous('-'))) { + if (IS_BEG() || (IS_SPCARG(c, spaceSeen) && arg_ambiguous('-'))) { setState(EXPR_BEG); pushback(c); yaccValue = MINUS_AT; @@ -1849,7 +1849,7 @@ private int minus(boolean spaceSeen) { } private int percent(boolean spaceSeen) { - if (isBEG()) return parseQuote(nextc()); + if (IS_BEG()) return parseQuote(nextc()); int c = nextc(); @@ -1859,9 +1859,9 @@ private int percent(boolean spaceSeen) { return tOP_ASGN; } - if (isSpaceArg(c, spaceSeen) || (isLexState(lex_state, EXPR_FITEM) && c == 's')) return parseQuote(c); + if (IS_SPCARG(c, spaceSeen) || (IS_lex_state(lex_state, EXPR_FITEM) && c == 's')) return parseQuote(c); - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); pushback(c); yaccValue = PERCENT; @@ -1882,7 +1882,7 @@ private int pipe() { return tOP_ASGN; } pushback(c); - if (isLexStateAll(last_state, EXPR_BEG)) { + if (IS_lex_state_all(last_state, EXPR_BEG)) { yaccValue = OR; pushback('|'); return '|'; @@ -1895,7 +1895,7 @@ private int pipe() { set_yylval_id(OR); return tOP_ASGN; default: - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL); pushback(c); yaccValue = OR; @@ -1905,7 +1905,7 @@ private int pipe() { private int plus(boolean spaceSeen) { int c = nextc(); - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { setState(EXPR_ARG); if (c == '@') { yaccValue = PLUS_AT; @@ -1923,7 +1923,7 @@ private int plus(boolean spaceSeen) { return tOP_ASGN; } - if (isBEG() || (isSpaceArg(c, spaceSeen) && arg_ambiguous('+'))) { + if (IS_BEG() || (IS_SPCARG(c, spaceSeen) && arg_ambiguous('+'))) { setState(EXPR_BEG); pushback(c); if (Character.isDigit(c)) { @@ -1944,7 +1944,7 @@ private int plus(boolean spaceSeen) { private int questionMark() throws IOException { int c; - if (isEND()) { + if (IS_END()) { setState(EXPR_VALUE); yaccValue = QUESTION; return '?'; @@ -1954,7 +1954,7 @@ private int questionMark() throws IOException { if (c == EOF) compile_error("incomplete character syntax"); if (Character.isWhitespace(c)){ - if (!isARG()) { + if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': @@ -2060,7 +2060,7 @@ private int rightParen() { } private int singleQuote(boolean commandState) { - int label = isLabelPossible(commandState) ? str_label : 0; + int label = IS_LABEL_POSSIBLE(commandState) ? str_label : 0; lex_strterm = new StringTerm(str_squote|label, '\0', '\'', ruby_sourceline); yaccValue = Q; @@ -2070,7 +2070,7 @@ private int singleQuote(boolean commandState) { private int slash(boolean spaceSeen) { yaccValue = SLASH; - if (isBEG()) { + if (IS_BEG()) { lex_strterm = new StringTerm(str_regexp, '\0', '/', ruby_sourceline); return tREGEXP_BEG; } @@ -2083,13 +2083,13 @@ private int slash(boolean spaceSeen) { return tOP_ASGN; } pushback(c); - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { arg_ambiguous('/'); lex_strterm = new StringTerm(str_regexp, '\0', '/', ruby_sourceline); return tREGEXP_BEG; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); return warn_balanced(c, spaceSeen, '/', "/", "regexp literal"); } @@ -2109,11 +2109,11 @@ private int star(boolean spaceSeen) { pushback(c); // not a '=' put it back yaccValue = STAR_STAR; - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (warnings.isVerbose() && Options.PARSER_WARN_ARGUMENT_PREFIX.load()) warning(ID.ARGUMENT_AS_PREFIX, "`**' interpreted as argument prefix"); c = tDSTAR; - } else if (isBEG()) { + } else if (IS_BEG()) { c = tDSTAR; } else { c = warn_balanced(c, spaceSeen, tPOW, "**", "argument prefix"); @@ -2126,11 +2126,11 @@ private int star(boolean spaceSeen) { return tOP_ASGN; default: pushback(c); - if (isSpaceArg(c, spaceSeen)) { + if (IS_SPCARG(c, spaceSeen)) { if (warnings.isVerbose() && Options.PARSER_WARN_ARGUMENT_PREFIX.load()) warning(ID.ARGUMENT_AS_PREFIX, "`*' interpreted as argument prefix"); c = tSTAR; - } else if (isBEG()) { + } else if (IS_BEG()) { c = tSTAR; } else { c = warn_balanced(c, spaceSeen, '*', "*", "argument prefix"); @@ -2138,14 +2138,14 @@ private int star(boolean spaceSeen) { yaccValue = STAR; } - setState(isAfterOperator() ? EXPR_ARG : EXPR_BEG); + setState(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG); return c; } private int tilde() { int c; - if (isAfterOperator()) { + if (IS_AFTER_OPERATOR()) { if ((c = nextc()) != '@') pushback(c); setState(EXPR_ARG); } else { diff --git a/core/src/main/java/org/jruby/lexer/yacc/StringTerm.java b/core/src/main/java/org/jruby/lexer/yacc/StringTerm.java index be29bcd51b7..98bfd8380a3 100644 --- a/core/src/main/java/org/jruby/lexer/yacc/StringTerm.java +++ b/core/src/main/java/org/jruby/lexer/yacc/StringTerm.java @@ -85,7 +85,7 @@ private int endFound(RubyLexer lexer) throws IOException { return RubyParser.tREGEXP_END; } - if ((flags & STR_FUNC_LABEL) != 0 && lexer.isLabelSuffix()) { + if ((flags & STR_FUNC_LABEL) != 0 && lexer.IS_LABEL_SUFFIX()) { lexer.nextc(); lexer.setState(EXPR_BEG | EXPR_LABEL); return RubyParser.tLABEL_END; diff --git a/core/src/main/java/org/jruby/parser/NodeExits.java b/core/src/main/java/org/jruby/parser/NodeExits.java new file mode 100644 index 00000000000..ae3f0cc2ee7 --- /dev/null +++ b/core/src/main/java/org/jruby/parser/NodeExits.java @@ -0,0 +1,4 @@ +package org.jruby.parser; + +public class NodeExits { +} diff --git a/core/src/main/java/org/jruby/parser/RubyParser.java b/core/src/main/java/org/jruby/parser/RubyParser.java index e5eda9254e7..02da2b9dfd9 100644 --- a/core/src/main/java/org/jruby/parser/RubyParser.java +++ b/core/src/main/java/org/jruby/parser/RubyParser.java @@ -51,6 +51,7 @@ import org.jruby.util.KeyValuePair; import org.jruby.util.StringSupport; import org.jruby.lexer.yacc.LexContext; +import org.jruby.lexer.yacc.LexContext.InRescue.*; import org.jruby.lexer.yacc.RubyLexer; import org.jruby.lexer.yacc.StackState; import org.jruby.parser.ProductionState; @@ -97,14 +98,16 @@ import static org.jruby.lexer.LexingCommon.EXPR_END; import static org.jruby.lexer.LexingCommon.EXPR_LABEL; import static org.jruby.util.CommonByteLists.ANON_BLOCK; +import static org.jruby.util.CommonByteLists.FWD_ALL; import static org.jruby.util.CommonByteLists.FWD_BLOCK; +import static org.jruby.util.CommonByteLists.FWD_REST; import static org.jruby.util.CommonByteLists.FWD_KWREST; public class RubyParser extends RubyParserBase { public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jruby.parser.ParserType type) { super(runtime, source, scope, type); } - // line 108 "-" + // line 111 "-" // %token constants public static final int keyword_class = 257; public static final int keyword_module = 258; @@ -171,66 +174,68 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub public static final int tBACK_REF = 319; public static final int tSTRING_CONTENT = 320; public static final int tREGEXP_END = 321; - public static final int tUMINUS_NUM = 322; - public static final int tSP = 323; - public static final int tUPLUS = 324; - public static final int tUMINUS = 325; - public static final int tPOW = 326; - public static final int tCMP = 327; - public static final int tEQ = 328; - public static final int tEQQ = 329; - public static final int tNEQ = 330; - public static final int tGEQ = 331; - public static final int tLEQ = 332; - public static final int tANDOP = 333; - public static final int tOROP = 334; - public static final int tMATCH = 335; - public static final int tNMATCH = 336; - public static final int tDOT2 = 337; - public static final int tDOT3 = 338; - public static final int tBDOT2 = 339; - public static final int tBDOT3 = 340; - public static final int tAREF = 341; - public static final int tASET = 342; - public static final int tLSHFT = 343; - public static final int tRSHFT = 344; - public static final int tANDDOT = 345; - public static final int tCOLON2 = 346; - public static final int tCOLON3 = 347; - public static final int tOP_ASGN = 348; - public static final int tASSOC = 349; - public static final int tLPAREN = 350; - public static final int tLPAREN_ARG = 351; - public static final int tLBRACK = 352; - public static final int tLBRACE = 353; - public static final int tLBRACE_ARG = 354; - public static final int tSTAR = 355; - public static final int tDSTAR = 356; - public static final int tAMPER = 357; - public static final int tLAMBDA = 358; - public static final int tSYMBEG = 359; - public static final int tSTRING_BEG = 360; - public static final int tXSTRING_BEG = 361; - public static final int tREGEXP_BEG = 362; - public static final int tWORDS_BEG = 363; - public static final int tQWORDS_BEG = 364; - public static final int tSTRING_END = 365; - public static final int tSYMBOLS_BEG = 366; - public static final int tQSYMBOLS_BEG = 367; - public static final int tSTRING_DEND = 368; - public static final int tSTRING_DBEG = 369; - public static final int tSTRING_DVAR = 370; - public static final int tLAMBEG = 371; - public static final int tLABEL_END = 372; - public static final int tIGNORED_NL = 373; - public static final int tCOMMENT = 374; - public static final int tEMBDOC_BEG = 375; - public static final int tEMBDOC = 376; - public static final int tEMBDOC_END = 377; - public static final int tHEREDOC_BEG = 378; - public static final int tHEREDOC_END = 379; - public static final int k__END__ = 380; - public static final int tLOWEST = 381; + public static final int tDUMNY_END = 322; + public static final int tUMINUS_NUM = 323; + public static final int END_OF_INPUT = 324; + public static final int tSP = 325; + public static final int tUPLUS = 326; + public static final int tUMINUS = 327; + public static final int tPOW = 328; + public static final int tCMP = 329; + public static final int tEQ = 330; + public static final int tEQQ = 331; + public static final int tNEQ = 332; + public static final int tGEQ = 333; + public static final int tLEQ = 334; + public static final int tANDOP = 335; + public static final int tOROP = 336; + public static final int tMATCH = 337; + public static final int tNMATCH = 338; + public static final int tDOT2 = 339; + public static final int tDOT3 = 340; + public static final int tBDOT2 = 341; + public static final int tBDOT3 = 342; + public static final int tAREF = 343; + public static final int tASET = 344; + public static final int tLSHFT = 345; + public static final int tRSHFT = 346; + public static final int tANDDOT = 347; + public static final int tCOLON2 = 348; + public static final int tCOLON3 = 349; + public static final int tOP_ASGN = 350; + public static final int tASSOC = 351; + public static final int tLPAREN = 352; + public static final int tLPAREN_ARG = 353; + public static final int tLBRACK = 354; + public static final int tLBRACE = 355; + public static final int tLBRACE_ARG = 356; + public static final int tSTAR = 357; + public static final int tDSTAR = 358; + public static final int tAMPER = 359; + public static final int tLAMBDA = 360; + public static final int tSYMBEG = 361; + public static final int tSTRING_BEG = 362; + public static final int tXSTRING_BEG = 363; + public static final int tREGEXP_BEG = 364; + public static final int tWORDS_BEG = 365; + public static final int tQWORDS_BEG = 366; + public static final int tSTRING_END = 367; + public static final int tSYMBOLS_BEG = 368; + public static final int tQSYMBOLS_BEG = 369; + public static final int tSTRING_DEND = 370; + public static final int tSTRING_DBEG = 371; + public static final int tSTRING_DVAR = 372; + public static final int tLAMBEG = 373; + public static final int tLABEL_END = 374; + public static final int tIGNORED_NL = 375; + public static final int tCOMMENT = 376; + public static final int tEMBDOC_BEG = 377; + public static final int tEMBDOC = 378; + public static final int tEMBDOC_END = 379; + public static final int tHEREDOC_BEG = 380; + public static final int tHEREDOC_END = 381; + public static final int k__END__ = 382; + public static final int tLOWEST = 383; public static final int yyErrorCode = 256; /** number of final state. @@ -240,496 +245,505 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub /** parser tables. Order is mandated by jay. */ - protected static final short[] yyLhs = { -//yyLhs 820 - -1, 214, 0, 30, 31, 31, 31, 31, 32, 32, - 33, 217, 34, 34, 35, 36, 36, 36, 36, 37, - 218, 37, 219, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 75, 75, 75, 39, 39, 39, 39, 39, - 221, 222, 223, 39, 224, 225, 226, 39, 39, 27, - 28, 227, 29, 45, 228, 46, 43, 43, 82, 82, - 120, 49, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 125, 125, 131, 131, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 128, 128, 126, - 126, 130, 130, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 159, 159, 26, 26, 26, 161, 161, 161, 161, - 161, 124, 124, 99, 230, 99, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 231, 40, 40, - 40, 40, 40, 40, 40, 173, 173, 173, 173, 50, - 50, 185, 185, 47, 70, 70, 70, 70, 76, 76, - 63, 63, 63, 64, 64, 62, 62, 62, 62, 62, - 61, 61, 61, 61, 61, 233, 69, 72, 72, 71, - 71, 60, 60, 60, 60, 79, 79, 78, 78, 78, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 234, 41, 235, 41, 236, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 237, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 239, 41, - 240, 41, 41, 41, 241, 41, 243, 41, 244, 41, - 41, 41, 41, 41, 41, 41, 48, 197, 198, 211, - 207, 208, 210, 209, 193, 194, 205, 199, 200, 201, - 202, 196, 195, 203, 206, 192, 238, 238, 238, 229, - 229, 51, 51, 52, 52, 102, 102, 92, 92, 93, - 93, 94, 94, 94, 94, 94, 95, 95, 181, 181, - 246, 245, 67, 67, 67, 67, 68, 68, 183, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 104, 104, 105, 105, 112, 112, - 111, 111, 113, 113, 247, 248, 249, 250, 114, 115, - 115, 116, 116, 121, 81, 81, 81, 81, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 119, 119, 251, - 252, 253, 117, 254, 255, 256, 118, 54, 54, 54, - 54, 53, 55, 55, 257, 258, 259, 132, 133, 133, - 134, 134, 134, 135, 135, 135, 135, 135, 135, 136, - 137, 137, 138, 138, 212, 213, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 260, - 139, 139, 261, 139, 141, 141, 141, 141, 141, 141, - 141, 141, 142, 142, 143, 143, 140, 175, 175, 144, - 144, 145, 152, 152, 152, 152, 153, 153, 154, 154, - 179, 179, 176, 176, 177, 178, 178, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 148, 149, 149, 150, 151, 151, 151, - 56, 56, 57, 57, 57, 58, 58, 59, 59, 20, - 20, 2, 3, 3, 3, 4, 5, 6, 11, 16, - 16, 19, 19, 12, 13, 13, 14, 15, 17, 17, - 18, 18, 7, 7, 8, 8, 9, 9, 10, 262, - 10, 263, 264, 265, 266, 10, 101, 101, 101, 101, - 25, 25, 23, 155, 155, 155, 155, 24, 21, 21, - 184, 184, 184, 22, 22, 22, 22, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 100, 100, 267, 80, 80, 86, 86, 87, 85, - 268, 85, 65, 65, 65, 65, 65, 66, 66, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 182, 166, 166, 166, 166, 165, - 165, 169, 90, 90, 89, 89, 168, 108, 108, 110, - 110, 109, 109, 107, 107, 188, 188, 180, 167, 167, - 106, 84, 83, 83, 91, 91, 187, 187, 162, 162, - 186, 186, 163, 163, 164, 164, 1, 269, 1, 96, - 96, 97, 97, 98, 98, 98, 98, 98, 156, 156, - 156, 157, 157, 157, 157, 158, 158, 158, 174, 174, - 170, 170, 171, 171, 215, 215, 220, 220, 189, 190, - 204, 232, 232, 232, 242, 242, 216, 216, 123, 191, + protected static final int[] yyLhs = { +//yyLhs 823 + -1, 228, 0, 35, 36, 36, 36, 37, 37, 30, + 38, 231, 232, 41, 233, 41, 42, 43, 43, 43, + 44, 234, 44, 34, 216, 235, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 40, 40, 40, 83, 83, 83, + 46, 46, 46, 46, 46, 237, 46, 238, 46, 46, + 27, 28, 239, 29, 52, 52, 240, 242, 53, 50, + 50, 90, 90, 128, 57, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 133, 133, 139, + 139, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 136, 136, 134, 134, 138, 138, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 167, 167, 26, 26, 26, + 169, 169, 169, 169, 169, 132, 132, 107, 244, 107, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 39, 39, 39, 181, + 181, 181, 181, 56, 56, 193, 213, 219, 54, 78, + 78, 78, 78, 84, 84, 71, 71, 71, 72, 72, + 70, 70, 70, 70, 70, 69, 69, 69, 69, 69, + 246, 77, 80, 80, 79, 79, 67, 67, 67, 67, + 68, 68, 87, 87, 86, 86, 86, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 247, 48, + 248, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 250, 48, 251, 48, 48, 48, 252, 48, + 254, 48, 255, 48, 256, 48, 257, 48, 48, 48, + 48, 48, 55, 203, 204, 212, 31, 32, 211, 33, + 214, 215, 209, 205, 206, 217, 218, 202, 201, 207, + 210, 210, 200, 243, 249, 249, 249, 241, 241, 58, + 58, 59, 59, 110, 110, 100, 100, 101, 101, 103, + 103, 103, 103, 103, 102, 102, 189, 189, 259, 258, + 75, 75, 75, 75, 76, 76, 191, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 112, 112, 113, 113, 120, 120, 119, 119, + 121, 121, 225, 226, 227, 260, 261, 122, 126, 126, + 123, 262, 123, 129, 89, 89, 89, 89, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 127, 127, 263, + 124, 264, 125, 61, 61, 61, 61, 60, 62, 62, + 224, 223, 220, 265, 140, 141, 141, 142, 142, 142, + 143, 143, 143, 143, 143, 143, 144, 145, 145, 146, + 146, 221, 222, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 266, 147, 147, 147, + 149, 149, 149, 149, 149, 149, 150, 150, 151, 151, + 148, 183, 183, 152, 152, 153, 160, 160, 160, 160, + 161, 161, 162, 162, 187, 187, 184, 184, 185, 186, + 186, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 156, 157, 157, + 158, 159, 159, 159, 63, 63, 64, 64, 64, 65, + 65, 66, 66, 20, 20, 2, 3, 3, 3, 4, + 5, 6, 267, 267, 11, 16, 16, 19, 19, 12, + 13, 13, 14, 15, 17, 17, 18, 18, 7, 7, + 8, 8, 9, 9, 10, 268, 10, 269, 270, 271, + 272, 10, 273, 273, 109, 109, 25, 25, 23, 163, + 163, 24, 21, 21, 22, 22, 22, 22, 192, 192, + 192, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 108, 108, 274, 88, 88, + 94, 94, 95, 93, 275, 93, 73, 73, 73, 73, + 73, 74, 74, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 190, 174, + 174, 174, 174, 173, 173, 177, 98, 98, 97, 97, + 176, 116, 116, 118, 118, 117, 117, 115, 115, 196, + 196, 188, 175, 175, 114, 92, 91, 91, 99, 99, + 195, 195, 170, 170, 194, 194, 171, 171, 172, 172, + 1, 276, 1, 104, 104, 105, 105, 106, 106, 106, + 106, 106, 106, 164, 164, 164, 165, 165, 166, 166, + 166, 182, 182, 178, 178, 179, 179, 229, 229, 236, + 236, 197, 198, 208, 245, 245, 245, 253, 253, 230, + 230, 131, 199, }, yyLen = { -//yyLen 820 - 2, 0, 2, 2, 1, 1, 3, 2, 1, 2, - 3, 0, 6, 3, 2, 1, 1, 3, 2, 1, - 0, 3, 0, 4, 3, 3, 3, 2, 3, 3, - 3, 3, 3, 4, 1, 4, 4, 6, 4, 1, - 4, 4, 7, 6, 6, 6, 6, 4, 6, 4, - 6, 4, 1, 3, 1, 1, 3, 3, 3, 2, - 0, 0, 0, 6, 0, 0, 0, 6, 1, 1, - 2, 0, 5, 1, 0, 3, 1, 1, 1, 4, - 3, 1, 2, 3, 4, 5, 4, 5, 2, 2, - 2, 2, 2, 1, 3, 1, 3, 1, 2, 3, - 5, 2, 4, 2, 4, 1, 3, 1, 3, 2, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 4, 3, 3, 3, 3, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 4, 3, 3, 3, 3, 2, - 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, +//yyLen 823 + 2, 0, 2, 2, 1, 1, 3, 1, 2, 1, + 3, 0, 0, 8, 0, 5, 2, 1, 1, 3, + 1, 0, 3, 0, 2, 0, 4, 3, 3, 3, + 2, 3, 3, 3, 3, 4, 5, 1, 4, 4, + 7, 4, 1, 1, 4, 4, 7, 6, 6, 6, + 6, 4, 4, 4, 1, 4, 3, 1, 4, 1, + 1, 3, 3, 3, 2, 0, 7, 0, 7, 1, + 1, 2, 0, 5, 1, 1, 0, 0, 4, 1, + 1, 1, 4, 3, 1, 2, 3, 4, 5, 4, + 5, 6, 2, 2, 2, 2, 2, 1, 3, 1, + 3, 1, 2, 3, 5, 2, 4, 2, 4, 1, + 3, 1, 3, 2, 3, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, + 3, 3, 3, 2, 1, 1, 1, 2, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 4, 7, - 6, 6, 6, 6, 5, 4, 3, 3, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 4, 2, - 2, 3, 3, 3, 3, 1, 3, 3, 3, 3, - 3, 2, 2, 3, 3, 3, 3, 0, 4, 6, - 4, 6, 4, 6, 1, 1, 1, 1, 1, 3, - 3, 1, 1, 1, 1, 2, 4, 2, 1, 3, - 3, 5, 3, 1, 1, 1, 1, 2, 4, 2, - 1, 2, 2, 4, 1, 0, 2, 2, 1, 2, - 1, 1, 2, 3, 4, 1, 1, 3, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 4, 0, 3, 0, 4, 3, 3, 2, - 3, 3, 1, 4, 3, 1, 0, 6, 4, 3, - 2, 1, 2, 1, 6, 6, 4, 4, 0, 6, - 0, 5, 5, 6, 0, 6, 0, 7, 0, 5, - 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 7, 6, 6, 6, 6, 5, 4, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 4, 2, 2, 3, 3, 3, 3, 1, + 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, + 3, 4, 6, 4, 4, 1, 1, 4, 3, 1, + 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, + 2, 4, 2, 1, 4, 3, 5, 3, 1, 1, + 1, 1, 2, 4, 2, 1, 2, 2, 4, 1, + 0, 2, 2, 1, 2, 1, 1, 1, 3, 3, + 2, 1, 1, 1, 3, 4, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, + 0, 4, 3, 3, 2, 3, 3, 1, 4, 3, + 1, 6, 4, 3, 2, 1, 2, 1, 6, 6, + 4, 4, 0, 6, 0, 5, 5, 6, 0, 6, + 0, 7, 0, 5, 0, 5, 0, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 5, 1, 2, 1, 1, 1, 3, 1, - 3, 1, 3, 5, 1, 3, 2, 1, 1, 1, - 0, 2, 4, 2, 2, 1, 2, 0, 1, 6, - 8, 4, 6, 4, 2, 6, 2, 4, 6, 2, - 4, 2, 4, 1, 1, 1, 3, 4, 1, 4, - 1, 3, 1, 1, 0, 0, 0, 0, 7, 4, - 1, 3, 3, 3, 2, 4, 5, 5, 2, 4, + 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, + 5, 1, 2, 1, 1, 1, 3, 1, 3, 1, + 3, 5, 1, 3, 2, 1, 1, 1, 0, 2, + 4, 2, 2, 1, 2, 0, 1, 6, 8, 4, + 6, 4, 2, 6, 2, 4, 6, 2, 4, 2, + 4, 1, 1, 1, 3, 4, 1, 4, 1, 3, + 1, 1, 0, 0, 0, 0, 0, 9, 4, 1, + 3, 0, 4, 3, 2, 4, 5, 5, 2, 4, 4, 3, 3, 3, 2, 1, 4, 3, 3, 0, - 0, 0, 5, 0, 0, 0, 5, 1, 2, 3, - 4, 5, 1, 1, 0, 0, 0, 8, 1, 1, - 1, 3, 3, 1, 2, 3, 1, 1, 1, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 4, 4, - 4, 3, 4, 4, 4, 3, 3, 3, 2, 0, - 4, 2, 0, 4, 1, 1, 2, 3, 5, 2, - 4, 1, 2, 3, 1, 3, 5, 2, 1, 1, - 3, 1, 3, 1, 2, 1, 1, 3, 2, 1, - 1, 3, 2, 1, 2, 1, 1, 1, 3, 3, - 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 4, 2, 3, 1, - 6, 1, 1, 1, 1, 2, 1, 2, 1, 1, - 1, 1, 1, 1, 2, 3, 3, 3, 4, 0, - 3, 1, 2, 4, 0, 3, 4, 4, 0, 3, - 0, 3, 0, 2, 0, 2, 0, 2, 1, 0, - 3, 0, 0, 0, 0, 7, 1, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 3, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 7, 0, 7, 1, 2, 3, 4, 5, 1, 1, + 0, 0, 0, 0, 9, 1, 1, 1, 3, 3, + 1, 2, 3, 1, 1, 1, 1, 3, 1, 3, + 1, 2, 2, 1, 1, 4, 4, 4, 3, 4, + 4, 4, 3, 3, 3, 2, 0, 6, 2, 4, + 1, 1, 2, 2, 4, 1, 2, 3, 1, 3, + 5, 2, 1, 1, 3, 1, 3, 1, 2, 1, + 1, 3, 2, 1, 1, 3, 2, 1, 2, 1, + 1, 1, 3, 3, 2, 2, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 4, 2, 3, 1, 6, 1, 1, 1, 1, 2, + 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, + 3, 3, 1, 2, 4, 0, 3, 1, 2, 4, + 0, 3, 4, 4, 0, 3, 0, 3, 0, 2, + 0, 2, 0, 2, 1, 0, 3, 0, 0, 0, + 0, 7, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 4, 0, 1, 1, 3, 1, - 0, 3, 4, 2, 2, 1, 1, 2, 0, 6, - 8, 4, 6, 4, 6, 2, 4, 6, 2, 4, - 2, 4, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 3, 1, 2, 1, 2, - 1, 1, 3, 1, 3, 1, 1, 2, 2, 1, - 3, 3, 1, 3, 1, 3, 1, 1, 2, 1, - 1, 1, 2, 1, 2, 0, 1, 0, 4, 1, - 2, 1, 3, 3, 2, 1, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 1, 2, 2, - 2, 0, 1, 1, 1, 1, 1, 2, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 0, 4, 0, + 1, 1, 3, 1, 0, 3, 4, 2, 2, 1, + 1, 2, 0, 6, 8, 4, 6, 4, 6, 2, + 4, 6, 2, 4, 2, 4, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, + 1, 2, 1, 2, 1, 1, 3, 1, 3, 1, + 1, 1, 2, 1, 3, 3, 1, 3, 1, 3, + 1, 1, 2, 1, 1, 1, 2, 1, 2, 0, + 1, 0, 4, 1, 2, 1, 3, 3, 2, 1, + 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 2, 2, 2, 0, 1, 1, 1, 1, 1, + 2, 0, 0, }, yyDefRed = { -//yyDefRed 1361 - 1, 0, 0, 0, 394, 395, 396, 0, 387, 388, - 389, 392, 390, 391, 393, 0, 0, 384, 385, 405, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 673, 674, 675, 676, 622, 701, 702, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 464, 0, - 642, 644, 646, 0, 0, 0, 0, 0, 0, 331, - 0, 623, 332, 333, 334, 336, 335, 337, 330, 619, - 668, 660, 661, 620, 0, 0, 2, 0, 5, 0, - 0, 0, 0, 0, 55, 0, 0, 0, 0, 338, - 0, 34, 0, 77, 0, 363, 0, 4, 0, 0, - 93, 0, 107, 81, 0, 0, 0, 341, 0, 0, - 74, 74, 0, 0, 0, 7, 206, 217, 207, 230, - 203, 223, 213, 212, 233, 234, 228, 211, 210, 205, - 231, 235, 236, 215, 204, 218, 222, 224, 216, 209, - 225, 232, 227, 226, 219, 229, 214, 202, 221, 220, - 201, 208, 199, 200, 196, 197, 198, 156, 158, 157, - 191, 192, 187, 169, 170, 171, 178, 175, 177, 172, - 173, 193, 194, 179, 180, 184, 188, 174, 176, 166, - 167, 168, 181, 182, 183, 185, 186, 189, 190, 195, - 162, 0, 163, 159, 161, 160, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 642, 0, 0, 0, 0, - 310, 0, 0, 0, 91, 314, 0, 0, 781, 0, - 0, 92, 0, 89, 0, 0, 484, 88, 0, 807, - 0, 0, 22, 0, 0, 9, 0, 0, 382, 383, - 0, 0, 259, 0, 0, 352, 0, 0, 0, 0, - 0, 20, 0, 0, 0, 16, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 294, 0, 0, 0, 779, +//yyDefRed 1399 + 1, 0, 0, 43, 400, 401, 402, 0, 393, 394, + 395, 398, 23, 23, 23, 0, 0, 390, 391, 412, + 413, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 821, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 674, 675, 676, 677, 626, 705, 706, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 475, 0, + 648, 650, 652, 0, 0, 0, 0, 0, 0, 338, + 0, 627, 339, 340, 341, 343, 342, 344, 337, 623, + 672, 666, 667, 624, 0, 0, 76, 76, 0, 2, + 0, 5, 0, 0, 0, 0, 0, 60, 0, 0, + 0, 0, 345, 0, 37, 0, 80, 0, 367, 0, + 4, 0, 0, 97, 0, 111, 84, 0, 348, 0, + 0, 0, 0, 0, 0, 23, 0, 210, 221, 211, + 234, 207, 227, 217, 216, 237, 238, 232, 215, 214, + 209, 235, 239, 240, 219, 208, 222, 226, 228, 220, + 213, 229, 236, 231, 230, 223, 233, 218, 206, 225, + 224, 205, 212, 203, 204, 200, 201, 202, 160, 162, + 161, 195, 196, 191, 173, 174, 175, 182, 179, 181, + 176, 177, 197, 198, 183, 184, 188, 192, 178, 180, + 170, 171, 172, 185, 186, 187, 189, 190, 193, 194, + 199, 166, 0, 167, 163, 165, 164, 396, 397, 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 386, 0, - 0, 0, 465, 665, 664, 666, 0, 662, 663, 0, - 0, 0, 629, 638, 634, 640, 271, 59, 272, 624, - 0, 0, 0, 0, 707, 0, 0, 0, 814, 815, - 3, 0, 816, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 287, 288, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 0, 285, 286, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 398, - 474, 493, 397, 489, 362, 493, 801, 0, 0, 800, - 0, 478, 0, 360, 0, 0, 803, 802, 0, 0, - 0, 0, 0, 0, 0, 109, 90, 683, 682, 684, - 685, 687, 686, 688, 0, 679, 678, 0, 681, 0, - 0, 0, 0, 339, 154, 378, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 777, 0, - 70, 776, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 648, + 0, 0, 0, 0, 315, 0, 0, 0, 327, 95, + 319, 0, 0, 785, 0, 0, 96, 0, 494, 92, + 0, 0, 810, 0, 0, 25, 0, 9, 0, 8, + 295, 24, 0, 388, 389, 0, 263, 0, 0, 357, + 0, 0, 0, 0, 0, 21, 0, 0, 0, 18, + 0, 17, 0, 0, 350, 0, 0, 0, 299, 0, + 0, 0, 783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 415, 416, 0, 370, 0, 0, 164, 784, - 0, 322, 787, 317, 0, 0, 0, 0, 0, 0, - 0, 0, 311, 320, 0, 0, 312, 0, 0, 0, - 354, 0, 316, 0, 0, 306, 0, 0, 305, 0, - 0, 359, 58, 24, 26, 25, 0, 356, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 347, 14, - 0, 0, 0, 344, 0, 812, 295, 350, 0, 297, - 351, 780, 0, 669, 0, 111, 0, 709, 0, 0, - 0, 0, 466, 648, 667, 651, 649, 643, 625, 626, - 645, 627, 647, 0, 0, 0, 0, 740, 737, 736, - 735, 738, 746, 755, 734, 0, 767, 756, 771, 770, - 766, 732, 0, 0, 744, 0, 764, 0, 753, 0, - 715, 741, 739, 428, 0, 0, 429, 0, 716, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 817, 6, - 28, 29, 30, 31, 32, 56, 57, 65, 0, 0, + 0, 392, 0, 0, 0, 472, 679, 678, 680, 0, + 668, 669, 670, 0, 0, 0, 632, 0, 0, 0, + 0, 275, 64, 276, 628, 0, 384, 0, 0, 711, + 0, 386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 494, 0, 490, 0, 0, 0, 0, - 483, 0, 481, 0, 0, 0, 0, 793, 0, 482, - 0, 794, 489, 83, 0, 291, 292, 0, 791, 792, - 0, 0, 0, 0, 0, 0, 0, 110, 0, 151, - 0, 153, 703, 374, 0, 0, 0, 0, 0, 407, - 0, 0, 0, 799, 798, 71, 0, 0, 0, 0, - 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, - 0, 783, 0, 0, 0, 0, 0, 0, 0, 319, - 0, 0, 782, 0, 0, 353, 808, 0, 300, 0, - 302, 358, 23, 0, 0, 10, 33, 0, 0, 0, - 0, 21, 0, 17, 346, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 652, 0, 628, 631, 0, 0, - 636, 633, 0, 0, 637, 0, 0, 419, 0, 0, - 0, 417, 708, 0, 725, 0, 728, 0, 713, 0, - 730, 747, 0, 0, 0, 714, 772, 768, 757, 758, - 404, 380, 399, 0, 611, 0, 0, 0, 711, 381, - 0, 0, 66, 62, 0, 473, 495, 487, 491, 488, - 0, 0, 480, 0, 0, 0, 0, 0, 0, 304, - 479, 0, 303, 0, 0, 0, 0, 41, 238, 54, - 0, 0, 0, 0, 51, 245, 0, 0, 321, 0, - 40, 237, 36, 35, 0, 325, 0, 108, 0, 0, - 0, 0, 0, 0, 0, 155, 0, 0, 342, 0, - 408, 0, 0, 366, 410, 75, 409, 367, 0, 0, - 0, 0, 0, 0, 504, 0, 0, 401, 0, 0, - 0, 165, 786, 0, 0, 0, 0, 0, 324, 313, - 0, 0, 0, 244, 296, 112, 0, 0, 470, 467, - 653, 656, 657, 658, 659, 650, 630, 632, 639, 635, - 641, 0, 426, 0, 743, 0, 717, 745, 0, 0, - 0, 765, 0, 754, 774, 0, 0, 0, 742, 760, - 431, 400, 402, 13, 618, 11, 0, 0, 0, 613, - 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 87, 0, 809, 0, 0, 85, 80, 0, - 0, 0, 0, 0, 0, 476, 477, 0, 0, 0, - 0, 0, 0, 0, 486, 379, 403, 0, 411, 413, - 0, 0, 778, 72, 0, 0, 505, 372, 0, 371, - 0, 497, 0, 0, 0, 0, 0, 0, 0, 0, - 301, 357, 0, 0, 654, 418, 420, 0, 0, 0, - 721, 0, 723, 0, 729, 0, 726, 712, 731, 0, - 617, 0, 0, 616, 0, 0, 0, 0, 596, 595, - 597, 598, 600, 599, 601, 603, 609, 570, 0, 0, - 0, 542, 0, 0, 0, 642, 0, 588, 589, 590, - 591, 593, 592, 594, 587, 602, 67, 0, 519, 0, - 523, 516, 517, 526, 0, 527, 582, 583, 0, 518, - 0, 566, 0, 575, 576, 565, 0, 0, 63, 0, - 0, 0, 455, 454, 0, 46, 242, 45, 243, 0, - 43, 240, 44, 241, 0, 53, 0, 0, 0, 0, - 0, 0, 0, 0, 37, 0, 704, 375, 364, 414, - 0, 373, 0, 369, 498, 0, 0, 365, 0, 0, - 0, 0, 0, 468, 0, 0, 0, 0, 0, 0, + 0, 0, 423, 424, 817, 818, 3, 0, 819, 0, + 0, 0, 0, 821, 0, 0, 67, 0, 0, 0, + 0, 0, 291, 292, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 289, 290, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 404, 484, 501, 403, 499, + 366, 501, 804, 0, 0, 803, 0, 0, 488, 0, + 364, 821, 806, 805, 0, 821, 821, 821, 0, 0, + 0, 113, 94, 0, 75, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 683, 682, 0, 685, 781, + 0, 71, 780, 70, 0, 374, 0, 0, 687, 686, + 688, 689, 691, 690, 692, 0, 0, 0, 0, 0, + 0, 346, 158, 382, 0, 0, 93, 168, 788, 0, + 330, 791, 322, 0, 0, 0, 0, 0, 0, 0, + 0, 316, 325, 821, 0, 317, 821, 821, 0, 0, + 311, 0, 0, 310, 0, 321, 0, 363, 0, 63, + 27, 29, 28, 0, 821, 296, 0, 0, 0, 0, + 0, 821, 0, 0, 352, 16, 0, 0, 0, 0, + 815, 300, 355, 0, 302, 356, 784, 0, 673, 0, + 115, 0, 713, 0, 0, 0, 0, 473, 654, 671, + 657, 655, 649, 629, 630, 651, 631, 653, 633, 0, + 0, 0, 0, 744, 741, 740, 739, 742, 750, 759, + 738, 0, 771, 760, 775, 774, 770, 736, 0, 0, + 748, 0, 768, 0, 757, 0, 719, 745, 743, 436, + 0, 0, 761, 437, 0, 720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 615, 0, 585, - 586, 152, 607, 0, 0, 0, 0, 0, 551, 0, - 538, 541, 0, 0, 557, 0, 604, 671, 670, 672, - 0, 605, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 574, 572, 453, 0, 762, - 0, 0, 0, 751, 0, 0, 435, 0, 0, 0, - 496, 492, 42, 239, 0, 0, 377, 0, 0, 0, - 0, 499, 0, 469, 0, 0, 0, 0, 0, 722, - 0, 719, 724, 727, 12, 0, 0, 0, 0, 0, - 0, 537, 536, 0, 0, 0, 552, 810, 642, 0, - 571, 0, 520, 515, 0, 522, 578, 579, 608, 535, - 531, 0, 0, 0, 0, 0, 0, 567, 562, 0, - 559, 0, 449, 0, 446, 444, 0, 0, 433, 456, - 0, 451, 0, 0, 0, 0, 0, 434, 0, 506, - 0, 0, 500, 502, 503, 501, 462, 0, 460, 463, - 472, 471, 655, 0, 0, 0, 0, 0, 0, 610, - 543, 0, 0, 553, 0, 540, 606, 0, 529, 528, - 530, 533, 532, 534, 0, 436, 763, 0, 0, 0, - 0, 457, 752, 0, 0, 349, 0, 0, 412, 0, - 511, 512, 0, 459, 720, 0, 0, 0, 0, 560, - 556, 0, 450, 0, 447, 0, 441, 0, 443, 432, - 452, 0, 0, 0, 461, 0, 0, 0, 0, 0, - 0, 508, 509, 507, 448, 442, 0, 439, 445, 0, - 440, + 0, 76, 820, 6, 31, 32, 33, 34, 297, 0, + 61, 62, 512, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 472, 0, + 472, 0, 0, 0, 0, 493, 796, 0, 491, 0, + 0, 0, 0, 795, 0, 492, 0, 797, 0, 499, + 86, 0, 793, 794, 0, 0, 0, 0, 0, 0, + 0, 114, 0, 821, 415, 0, 0, 0, 802, 801, + 72, 0, 0, 0, 380, 155, 0, 157, 707, 378, + 0, 0, 0, 0, 0, 0, 359, 0, 0, 0, + 0, 787, 0, 0, 0, 0, 0, 0, 329, 324, + 0, 0, 786, 0, 0, 0, 305, 0, 307, 362, + 811, 26, 0, 0, 10, 0, 0, 0, 0, 0, + 22, 0, 19, 351, 0, 0, 0, 0, 0, 0, + 0, 0, 474, 658, 0, 634, 637, 0, 0, 642, + 639, 0, 0, 643, 0, 0, 427, 0, 0, 0, + 425, 712, 0, 729, 0, 732, 0, 717, 0, 734, + 751, 0, 0, 0, 718, 776, 772, 578, 762, 0, + 0, 0, 0, 0, 54, 715, 0, 0, 0, 410, + 411, 370, 418, 77, 417, 371, 0, 0, 0, 0, + 0, 0, 35, 510, 510, 0, 483, 473, 497, 473, + 498, 821, 821, 499, 490, 0, 0, 0, 0, 821, + 821, 309, 489, 0, 308, 0, 0, 0, 0, 45, + 242, 59, 0, 0, 0, 0, 53, 249, 0, 0, + 326, 0, 44, 241, 39, 38, 0, 332, 0, 112, + 0, 0, 349, 0, 0, 416, 0, 0, 512, 0, + 0, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 159, 0, 0, 0, 358, 169, 790, 0, 821, 821, + 0, 821, 821, 318, 0, 0, 0, 248, 301, 116, + 0, 23, 659, 665, 656, 664, 638, 0, 0, 0, + 0, 0, 434, 0, 0, 747, 721, 749, 0, 0, + 0, 769, 0, 758, 778, 0, 0, 0, 746, 764, + 439, 385, 0, 821, 821, 387, 78, 0, 0, 511, + 511, 0, 474, 474, 0, 0, 0, 90, 821, 812, + 0, 0, 88, 83, 821, 821, 0, 0, 0, 821, + 486, 487, 0, 0, 821, 0, 405, 0, 615, 0, + 409, 408, 0, 419, 421, 0, 0, 782, 73, 510, + 376, 0, 375, 0, 503, 0, 0, 0, 0, 0, + 496, 383, 36, 0, 0, 0, 821, 0, 0, 0, + 306, 361, 0, 660, 426, 428, 0, 0, 0, 725, + 0, 727, 0, 733, 0, 730, 716, 735, 0, 0, + 0, 0, 377, 0, 0, 0, 23, 23, 50, 246, + 49, 247, 91, 0, 47, 244, 48, 245, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 0, 0, 0, 617, 618, 368, 422, 0, 511, 373, + 504, 0, 0, 369, 0, 708, 379, 0, 0, 479, + 476, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 600, 599, 601, 602, 604, 603, 605, 607, 613, 574, + 0, 0, 0, 511, 0, 0, 0, 648, 0, 592, + 593, 594, 595, 597, 596, 598, 591, 606, 68, 0, + 526, 0, 530, 523, 524, 533, 0, 534, 586, 587, + 0, 525, 0, 570, 0, 579, 580, 569, 0, 0, + 66, 0, 0, 46, 243, 0, 58, 0, 0, 40, + 0, 406, 15, 622, 0, 0, 0, 620, 0, 0, + 0, 505, 0, 381, 0, 0, 0, 0, 726, 0, + 723, 728, 731, 589, 590, 156, 611, 0, 0, 0, + 0, 0, 555, 0, 545, 548, 821, 0, 561, 0, + 608, 0, 609, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 576, 0, 0, 463, + 462, 0, 12, 621, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, + 0, 0, 0, 0, 506, 508, 509, 507, 0, 0, + 481, 0, 477, 663, 662, 661, 0, 0, 544, 543, + 0, 0, 0, 556, 546, 813, 575, 0, 527, 522, + 0, 529, 582, 583, 612, 542, 532, 538, 531, 0, + 0, 0, 0, 0, 0, 648, 571, 566, 0, 563, + 461, 0, 766, 0, 0, 0, 755, 0, 0, 443, + 0, 0, 0, 502, 500, 0, 0, 0, 0, 0, + 0, 420, 513, 0, 0, 478, 0, 0, 0, 724, + 549, 557, 0, 0, 610, 0, 536, 535, 537, 540, + 539, 541, 0, 0, 0, 457, 0, 454, 452, 0, + 0, 441, 464, 0, 459, 0, 0, 0, 0, 0, + 442, 13, 0, 0, 0, 0, 0, 614, 0, 518, + 519, 470, 0, 468, 471, 0, 480, 0, 0, 0, + 564, 560, 444, 767, 0, 0, 0, 0, 465, 756, + 0, 0, 354, 0, 0, 0, 0, 0, 467, 482, + 0, 547, 0, 458, 0, 455, 0, 449, 0, 451, + 440, 460, 0, 0, 515, 516, 514, 469, 0, 0, + 0, 0, 456, 450, 0, 447, 453, 0, 448, }, yyDgoto = { -//yyDgoto 270 - 1, 439, 69, 70, 71, 72, 73, 316, 320, 321, - 547, 74, 75, 555, 76, 77, 553, 554, 556, 748, - 78, 79, 80, 81, 82, 83, 421, 440, 227, 228, - 86, 87, 88, 255, 592, 593, 274, 275, 276, 90, - 91, 92, 93, 94, 95, 428, 443, 231, 263, 264, - 98, 967, 968, 868, 982, 1275, 783, 928, 1012, 923, - 644, 495, 496, 640, 810, 906, 764, 1305, 1252, 243, - 283, 482, 235, 99, 236, 830, 831, 101, 832, 836, - 673, 102, 103, 1178, 1179, 331, 332, 333, 572, 573, - 574, 575, 757, 758, 759, 760, 287, 497, 238, 201, - 239, 895, 461, 1181, 1071, 1072, 576, 577, 578, 1182, - 1183, 1277, 1109, 1278, 105, 889, 1113, 634, 632, 393, - 653, 380, 240, 277, 202, 108, 109, 110, 111, 112, - 536, 279, 865, 1353, 1198, 1046, 1224, 1048, 1049, 1050, - 1051, 1146, 1147, 1148, 1249, 1149, 1053, 1054, 1055, 1056, - 1057, 1058, 1059, 1060, 1061, 317, 113, 728, 642, 424, - 643, 204, 579, 580, 768, 581, 582, 583, 584, 918, - 676, 398, 205, 378, 685, 1062, 1063, 1064, 1065, 1066, - 586, 587, 588, 1255, 1161, 657, 589, 590, 591, 490, - 805, 483, 265, 115, 116, 970, 869, 117, 118, 385, - 381, 785, 926, 971, 1151, 119, 781, 120, 121, 122, - 123, 124, 1170, 1171, 2, 340, 466, 1009, 516, 506, - 491, 621, 793, 936, 607, 792, 935, 852, 444, 855, - 697, 508, 526, 244, 426, 281, 522, 723, 680, 866, - 695, 842, 681, 840, 677, 772, 773, 312, 542, 743, - 993, 635, 798, 939, 633, 796, 938, 976, 1102, 1319, - 1153, 1143, 745, 744, 890, 994, 1114, 841, 335, 682, +//yyDgoto 277 + 1, 450, 69, 70, 71, 72, 73, 319, 324, 325, + 552, 74, 75, 561, 76, 77, 559, 560, 562, 757, + 78, 79, 80, 81, 82, 83, 469, 451, 231, 232, + 258, 86, 87, 88, 207, 89, 90, 91, 259, 791, + 792, 682, 683, 278, 279, 280, 93, 94, 95, 96, + 97, 98, 436, 343, 235, 267, 100, 268, 972, 973, + 872, 985, 1227, 967, 1052, 1146, 1142, 660, 238, 500, + 501, 655, 832, 916, 773, 1352, 1315, 249, 286, 491, + 240, 102, 241, 852, 853, 104, 854, 858, 699, 105, + 106, 1271, 1272, 336, 337, 338, 578, 579, 580, 581, + 766, 767, 768, 769, 290, 502, 243, 202, 244, 904, + 361, 1274, 1198, 1199, 582, 583, 584, 1275, 1276, 1342, + 1228, 1343, 108, 1232, 649, 647, 1070, 420, 670, 406, + 245, 260, 203, 111, 112, 113, 114, 115, 541, 283, + 869, 1386, 1222, 1108, 1240, 1110, 1111, 1112, 1113, 1170, + 1171, 1172, 1268, 1173, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 320, 116, 737, 658, 472, 659, 205, + 585, 586, 777, 587, 588, 589, 590, 928, 702, 424, + 206, 404, 690, 1124, 1125, 592, 1127, 1128, 593, 594, + 595, 1318, 322, 618, 596, 597, 598, 507, 827, 492, + 269, 975, 873, 118, 119, 411, 407, 976, 1175, 120, + 801, 121, 122, 516, 123, 124, 125, 969, 1144, 619, + 813, 1191, 1192, 1023, 939, 547, 752, 901, 2, 366, + 456, 1140, 1285, 1050, 522, 513, 508, 636, 622, 867, + 344, 803, 936, 270, 707, 531, 250, 433, 528, 685, + 870, 692, 877, 686, 875, 703, 599, 602, 781, 782, + 315, 1155, 1297, 650, 648, 1338, 1303, 327, 754, 753, + 902, 1003, 1071, 1235, 876, 340, 687, }, yySindex = { -//yySindex 1361 - 0, 0, 24270, 24896, 0, 0, 0, 27866, 0, 0, - 0, 0, 0, 0, 0, 22745, 22745, 0, 0, 0, - 165, 168, 0, 0, 0, 0, 269, 27763, 210, 183, - 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1070, 26868, 26868, - 26868, 26868, 134, 24387, 25009, 25596, 25954, 28456, 0, 28286, - 0, 0, 0, 382, 401, 471, 497, 26979, 26868, 0, - 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 509, 509, 0, 297, 0, 1387, - -119, 22639, 0, 326, 0, -12, 253, 69, 602, 0, - 302, 0, 31, 0, 320, 0, 556, 0, 671, 30397, - 0, 702, 0, 0, 22745, 30508, 30730, 0, 27091, 28186, - 0, 0, 30619, 24047, 27091, 0, 0, 0, 0, 0, +//yySindex 1399 + 0, 0, 25897, 0, 0, 0, 0, 29369, 0, 0, + 0, 0, 0, 0, 0, 26389, 26389, 0, 0, 0, + 0, 161, 0, 0, 0, 0, 313, 29264, 211, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1265, 28240, 28240, + 28240, 28240, 153, 26023, 26143, 27007, 27253, 30036, 0, 29887, + 0, 0, 0, 447, 447, 447, 447, 28357, 28240, 0, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 495, 495, 0, 0, 32130, 0, + 176, 0, 1989, 382, 29686, 0, 256, 0, 38, 179, + 270, 82, 0, 283, 0, 136, 0, 368, 0, 676, + 0, 683, 32243, 0, 562, 0, 0, 26389, 0, 27373, + 29785, 25363, 27373, 32356, 32469, 0, 692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 734, 0, 0, 0, 0, 0, 0, 0, 0, - 749, 0, 0, 0, 0, 0, 0, 0, 0, 26868, - 438, 24500, 26868, 26868, 26868, 0, 26868, 509, 509, 29541, - 0, 444, 301, 751, 0, 0, 456, 769, 0, 467, - 758, 0, 23935, 0, 22745, 25126, 0, 0, 24158, 0, - 27091, 858, 0, 802, 24270, 0, 24500, 519, 0, 0, - 165, 168, 0, 445, 69, 0, 530, 9622, 9622, 522, - 25009, 0, 24387, 838, 297, 0, 1387, 0, 0, 210, - 1387, 210, 601, 788, 693, 0, 444, 765, 693, 0, - 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, - 0, 0, 0, 1070, 587, 30841, 509, 509, 0, 464, - 0, 878, 0, 0, 0, 0, 455, 0, 0, 1074, - 1089, 1034, 0, 0, 0, 0, 0, 0, 0, 0, - 6776, 24500, 874, 0, 0, 6776, 24500, 888, 0, 0, - 0, 24666, 0, 27091, 27091, 27091, 27091, 25009, 27091, 27091, - 0, 26868, 26868, 26868, 26868, 26868, 0, 0, 26868, 26868, - 26868, 26868, 26868, 26868, 26868, 26868, 0, 26868, 0, 0, - 26868, 26868, 26868, 26868, 26868, 26868, 26868, 26868, 26868, 0, - 0, 0, 0, 0, 0, 0, 0, 28788, 22745, 0, - 29031, 0, 585, 0, 26868, 630, 0, 0, 30199, 630, - 630, 630, 24387, 28693, 933, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 27091, - 266, 958, 506, 0, 0, 0, 24500, -119, 190, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, - 0, 0, 0, 24500, 27091, 24500, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 711, 549, - 0, 745, 0, 0, 297, 0, 977, 190, 0, 0, - 522, 0, 0, 0, 942, 979, 982, 26868, 29109, 22745, - 29148, 25239, 0, 0, 630, 25708, 0, 630, 630, 210, - 0, 1015, 0, 26868, 1017, 0, 210, 1026, 0, 210, - 49, 0, 0, 0, 0, 0, 27866, 0, 26868, 952, - 961, 26868, 29109, 29148, 630, 1387, 183, 210, 0, 0, - 24779, 0, 210, 0, 25827, 0, 0, 0, 25954, 0, - 0, 0, 802, 0, 0, 0, 1038, 0, 29187, 22745, - 29226, 30841, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1183, -176, 1212, -50, 0, 0, 0, - 0, 0, 0, 0, 0, 1427, 0, 0, 0, 0, - 0, 0, 210, 1062, 0, 1077, 0, 1079, 0, 1082, - 0, 0, 0, 0, 26868, 0, 0, 1085, 0, 841, - 844, -175, 868, 913, 26979, 297, 868, 26979, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 530, 7280, - 7280, 7280, 7280, 18769, 10127, 7280, 7280, 9622, 9622, 650, - 650, 0, 21914, 140, 140, 716, 132, 132, 530, 530, - 530, 6030, 868, 0, 1076, 0, 868, 832, 0, 839, - 0, 168, 0, 0, 1155, 210, 857, 0, 862, 0, - 168, 0, 0, 0, 6030, 0, 0, 26979, 0, 0, - 168, 26979, 26073, 26073, 210, 30841, 1159, 0, -119, 0, - 0, 0, 0, 0, 29286, 22745, 29606, 24500, 868, 0, - 24500, 951, 27091, 0, 0, 0, 868, 98, 868, 0, - 29645, 22745, 29684, 0, 965, 960, 24500, 27866, 26868, 26868, - 26868, 0, 901, 911, 210, 922, 923, 26868, 444, 0, - 769, 26868, 0, 26868, 26868, 0, 0, 25373, 0, 25708, - 0, 0, 0, 27091, 29541, 0, 0, 530, 168, 168, - 26868, 0, 0, 0, 0, 693, 30841, 0, 0, 210, - 0, 0, 1038, 6557, 0, 1350, 0, 0, 126, 1215, - 0, 0, 158, 1228, 0, 1427, 1512, 0, 1230, 210, - 1232, 0, 0, 6776, 0, 6776, 0, 270, 0, 697, - 0, 0, 26868, 1222, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 394, 0, 26185, 23489, 986, 0, 0, - 23810, 988, 0, 0, 1233, 0, 0, 0, 0, 0, - 630, 630, 0, 585, 25239, 940, 1200, 630, 630, 0, - 0, 585, 0, 1184, 30234, 1012, 579, 0, 0, 0, - 320, 1252, -12, 326, 0, 0, 26868, 30234, 0, 1271, - 0, 0, 0, 0, 0, 0, 1030, 0, 1038, 30841, - 297, 27091, 24500, 0, 0, 0, 210, 868, 0, 465, - 0, 49, 28601, 0, 0, 0, 0, 0, 0, 0, - 210, 0, 0, 24500, 0, 868, 960, 0, 868, 26296, - 1064, 0, 0, 630, 630, 992, 630, 630, 0, 0, - 1302, 210, 49, 0, 0, 0, 0, 6776, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 210, 0, 1427, 0, 1325, 0, 0, 1303, 1304, - 1308, 0, 1312, 0, 0, 1085, 1051, 1308, 0, 0, - 0, 0, 0, 0, 0, 0, 24500, 0, 1009, 0, - 0, 26868, 26868, 26868, 26868, 27580, 27580, 26868, 1237, 1237, - 26979, 26979, 0, 630, 0, 26979, 26979, 0, 0, 26868, - 25009, 29723, 22745, 29762, 630, 0, 0, 0, 26408, 25009, - 1038, 24500, 297, 868, 0, 0, 0, 868, 0, 0, - 24500, 27091, 0, 0, 0, 868, 0, 0, 868, 0, - 26868, 0, 275, 868, 26868, 26868, 630, 26868, 26868, 25708, - 0, 0, 210, -143, 0, 0, 0, 1329, 1332, 6776, - 0, 697, 0, 697, 0, 697, 0, 0, 0, 24500, - 0, 30952, 190, 0, 29541, 29541, 29541, 29541, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 4327, 4327, - 466, 0, 14131, 210, 1065, 0, 1380, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 23, 0, 1255, - 0, 0, 0, 0, 555, 0, 0, 0, 84, 0, - 1336, 0, 1343, 0, 0, 0, 28055, 330, 0, 29541, - 1010, 24500, 0, 0, 24500, 0, 0, 0, 0, 26979, - 0, 0, 0, 0, 29541, 0, 832, 839, 210, 857, - 862, 26979, 26868, 0, 0, 868, 0, 0, 0, 0, - 190, 0, 27580, 0, 0, 26526, 24500, 0, 26868, 1357, - 1348, 24500, 24500, 0, 24500, 1325, 1325, 1308, 1347, 1308, - 1308, 1149, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1114, 586, 0, 0, 24500, 0, - 0, 0, 0, 28055, 1073, 210, 210, 30002, 0, 1384, - 0, 0, 1305, -110, 0, 1168, 0, 0, 0, 0, - 27091, 0, 1128, 30286, 28055, 4327, 4327, 466, 210, 210, - 27580, 27580, -110, 28055, 1073, 0, 0, 0, 1394, 0, - 1396, 210, 1398, 0, 1321, 1403, 0, 31063, 0, 1085, - 0, 0, 0, 0, 940, 0, 0, 24500, 190, 809, - 26868, 0, 277, 0, 1639, 868, 1324, 1088, 1332, 0, - 697, 0, 0, 0, 0, 0, 29801, 22745, 30121, 913, - 68, 0, 0, 17, 1073, 1419, 0, 0, 0, 210, - 0, 1409, 0, 0, 1420, 0, 0, 0, 0, 0, - 0, 210, 210, 210, 210, 210, 210, 0, 0, 1424, - 0, 6788, 0, 6788, 0, 0, 1346, 270, 0, 0, - 3196, 0, 0, 0, 1161, 739, 31063, 0, 465, 0, - 27091, 27091, 0, 0, 0, 0, 0, 706, 0, 0, - 0, 0, 0, 1308, 0, 0, 210, 0, 0, 0, - 0, 1428, 28055, 0, 642, 0, 0, 28055, 0, 0, - 0, 0, 0, 0, 30286, 0, 0, 1431, 1434, 1440, - 1445, 0, 0, 1085, 1431, 0, 30160, 739, 0, 24500, - 0, 0, 1639, 0, 0, 0, 28055, 1454, 1454, 0, - 0, 3196, 0, 3196, 0, 6788, 0, 3196, 0, 0, - 0, 0, 0, 290, 0, 1454, 28055, 1431, 1431, 1456, - 1431, 0, 0, 0, 0, 0, 3196, 0, 0, 1431, - 0, + 0, 0, 707, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, + 0, 0, 0, 28240, 517, 26143, 28240, 28240, 28240, 0, + 28240, 495, 495, 25126, 0, 482, 196, 837, 0, 0, + 0, 533, 869, 0, 588, 892, 0, 26515, 0, 0, + 26389, 25478, 0, 28470, 438, 0, 943, 0, 25897, 0, + 0, 0, 663, 0, 0, 161, 0, 213, 82, 0, + 692, 696, 10321, 10321, 666, 0, 26023, 980, 176, 0, + 1989, 0, 0, 211, 0, 330, 935, 634, 0, 482, + 915, 634, 0, 0, 0, 0, 0, 211, 0, 0, + 0, 0, 0, 0, 0, 0, 1265, 743, 32582, 495, + 495, 0, 247, 0, 1041, 0, 0, 0, 0, 880, + 0, 0, 0, 1098, 1133, 1249, 0, 1055, 1055, 1055, + 1055, 0, 0, 0, 0, 4509, 0, 1044, 0, 0, + 4509, 0, 1048, 26143, 27373, 26143, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 814, 445, + 0, 870, 0, 0, 0, 0, 0, 25651, 0, 27373, + 27373, 27373, 27373, 0, 28470, 28470, 0, 28240, 28240, 28240, + 28240, 28240, 0, 0, 28240, 28240, 28240, 28240, 28240, 28240, + 28240, 28240, 0, 28240, 0, 0, 28240, 28240, 28240, 28240, + 28240, 28240, 28240, 28240, 28240, 0, 0, 0, 0, 0, + 0, 0, 0, 30391, 26389, 0, 30582, 28240, 0, 796, + 0, 0, 0, 0, 31872, 0, 0, 0, 26023, 30294, + 1119, 0, 0, 26143, 0, 382, 149, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 46, 0, 0, 0, 176, 0, 1108, 149, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 27373, 53, 1115, + 555, 0, 0, 0, 1058, 25248, 0, 0, 0, 666, + 0, 0, 0, 996, 1125, 1130, 28240, 30647, 26389, 30714, + 26635, 0, 0, 0, 27127, 0, 0, 0, 28240, 1157, + 0, 211, 1171, 0, 211, 0, 275, 0, 1152, 0, + 0, 0, 0, 29369, 0, 0, 28240, 1092, 28240, 30755, + 30714, 0, 158, 211, 0, 0, 25776, 0, 1185, 27007, + 0, 0, 0, 27253, 0, 0, 0, 943, 0, 0, + 0, 1184, 0, 30810, 26389, 30904, 32582, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1263, + -118, 1460, 319, 0, 0, 0, 0, 0, 0, 0, + 0, 2594, 0, 0, 0, 0, 0, 0, 211, 1191, + 0, 1197, 0, 1201, 0, 1204, 0, 0, 0, 0, + 28240, 0, 0, 0, 1211, 0, 955, 957, -78, 26143, + 28587, 176, 26143, 28587, 345, 92, 345, 0, 31132, 26389, + 31226, 0, 0, 0, 0, 0, 0, 0, 0, 26269, + 0, 0, 0, 696, 4479, 4479, 4479, 4479, 11335, 10828, + 4479, 4479, 10321, 10321, 1434, 1434, 0, 24803, 1343, 1343, + 897, 105, 105, 696, 696, 696, 3225, 345, 0, 1139, + 0, 345, 917, 0, -25, 0, 0, 161, 0, 0, + 1229, 211, 926, 0, 928, 0, 161, 0, 3225, 0, + 0, 28357, 0, 0, 161, 28357, 27499, 27499, 211, 32582, + 1238, 0, 345, 0, 0, 26143, 1017, 28470, 0, 0, + 0, 1006, 1021, 26143, 0, 0, 0, 0, 0, 0, + 31267, 26389, 31311, 26143, 26143, 211, 0, 29369, 28240, 28700, + 28700, 0, 954, -14, 211, 962, 963, 482, 0, 0, + 869, 28240, 0, 28240, 28240, 26761, 0, 27127, 0, 0, + 0, 0, 28470, 25126, 0, 696, 973, 161, 161, 28240, + 0, 0, 0, 0, 634, 32582, 0, 0, 211, 0, + 0, 1184, 0, 0, 1857, 0, 0, 200, 447, 0, + 0, 200, 447, 0, 2594, 1490, 0, 1258, 1286, 211, + 0, 0, 4509, 0, 4509, 0, 422, 0, 4609, 0, + 0, 28240, 1267, 43, 0, 0, 0, 0, 0, 345, + 313, 1037, 1039, 25126, 0, 0, 345, 1037, 1039, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, + 0, 26143, 0, 0, 0, 1280, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 796, 26635, 989, 1248, 0, + 0, 0, 0, 796, 0, 1219, 23963, 1049, 639, 0, + 0, 0, 368, 1295, 38, 256, 0, 0, 28240, 23963, + 0, 1313, 0, 0, 0, 0, 0, 0, 1064, 0, + 1184, 32582, 0, 1107, 693, 0, 275, 30204, 0, 345, + 1021, 0, 345, 27619, 1102, 176, 27373, 26143, 0, 0, + 0, 211, 345, 1264, 0, 0, 0, 313, 0, 0, + 1033, 0, 0, 0, 1340, 211, 275, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1055, 1055, 1055, + 1055, 211, 0, 2594, 1890, 0, 0, 0, 1350, 1353, + 1354, 0, 1359, 0, 0, 1211, 1099, 1354, 0, 0, + 0, 0, 28587, 0, 0, 0, 0, 0, 345, 0, + 0, 28240, 0, 0, 28357, 28357, 1268, 0, 0, 0, + 28357, 28357, 0, 0, 0, 0, 31357, 26389, 31454, 0, + 0, 0, 0, 27745, 0, 1184, 0, 1102, 0, 27865, + 0, 0, 345, 0, 0, 26143, 27373, 0, 0, 0, + 0, 345, 0, 28240, 0, 114, 345, 26143, 176, 345, + 0, 0, 0, 28700, 28240, 28240, 0, 28240, 28240, 27127, + 0, 0, 3109, 0, 0, 0, 1372, 1380, 4509, 0, + 4609, 0, 4609, 0, 4609, 0, 0, 0, 1037, 1039, + 28240, 28240, 0, 31932, 31932, 25126, 0, 0, 0, 0, + 0, 0, 0, 28357, 0, 0, 0, 0, 28240, 26269, + 917, -25, 211, 926, 928, 28357, 28240, 0, 26269, 0, + 1169, 0, 1083, 0, 0, 0, 0, 149, 0, 0, + 0, 27991, 26143, 0, 345, 0, 0, 28240, 4509, 0, + 0, 26143, 1890, 1890, 1354, 1393, 1354, 1354, 25126, 25126, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5083, 5083, 709, 0, 12514, 211, 1134, 0, 1376, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, + 0, 1317, 0, 0, 0, 0, 667, 0, 0, 0, + 122, 0, 1399, 0, 1400, 0, 0, 0, 32017, 524, + 0, 1327, 1327, 0, 0, 25126, 0, 989, 0, 0, + 26143, 0, 0, 0, 26143, 32695, 149, 0, 26143, 31932, + 28240, 0, 557, 0, 211, -129, 323, 1380, 0, 4609, + 0, 0, 0, 0, 0, 0, 0, 32017, 1110, 211, + 211, 17824, 0, 1415, 0, 0, 0, 1337, 0, 1188, + 0, 27373, 0, 1162, 17824, 32017, 5083, 5083, 709, 211, + 211, 31932, 31932, 1447, 32017, 1110, 0, 1349, 26143, 0, + 0, 26143, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1165, 730, 0, 0, + 26143, 693, 149, 739, 0, 0, 0, 0, 1432, 1421, + 0, 26143, 0, 0, 0, 0, 1354, 67, 0, 0, + 1110, 1438, 1442, 0, 0, 0, 0, 211, 0, 0, + 1443, 0, 0, 0, 0, 0, 0, 0, 0, 211, + 211, 211, 211, 211, 211, 0, 0, 0, 1444, 0, + 0, 1446, 0, 1452, 211, 1453, 0, 1375, 1459, 0, + 32808, 0, 1211, 0, 0, 1169, 0, 31679, 26389, 31776, + 1107, 0, 0, 27373, 27373, 0, 2240, 26143, 1384, 0, + 0, 0, 32017, 1447, 0, 32017, 0, 0, 0, 0, + 0, 0, 448, 17824, 3725, 0, 3725, 0, 0, 1408, + 422, 0, 0, 4976, 0, 0, 0, 1224, 752, 32808, + 0, 0, 0, 0, 211, 0, 0, 0, 26143, 0, + 0, 0, 671, 0, 0, 345, 0, 1493, 211, 1493, + 0, 0, 0, 0, 1496, 1499, 1505, 1506, 0, 0, + 1211, 1496, 0, 31817, 752, 0, 73, 2240, 0, 0, + 32017, 0, 4976, 0, 4976, 0, 3725, 0, 4976, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1496, 1496, + 1509, 1496, 0, 0, 4976, 0, 0, 1496, 0, }, yyRindex = { -//yyRindex 1361 - 0, 0, 957, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17611, 17706, 0, 0, 0, - 14782, 14305, 18300, 18613, 18703, 18795, 27208, 0, 26639, 0, - 0, 19108, 19198, 19290, 14894, 5144, 19603, 19693, 15259, 19785, +//yyRindex 1399 + 0, 0, 472, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 18411, 18501, 0, 0, 0, + 0, 14689, 19103, 19418, 19508, 19600, 28817, 0, 28127, 0, + 0, 19915, 20005, 20097, 15540, 5683, 20412, 20502, 15657, 20594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 945, 668, 1412, 1382, 152, 0, 1219, + 0, 0, 0, 454, 454, 1463, 1420, 359, 0, 1501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8636, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1933, 1933, 0, 123, 0, 504, - 6725, 1771, 8950, 21514, 0, 9045, 0, 25485, 10972, 0, - 0, 0, 21592, 0, 20098, 0, 0, 0, 0, 664, - 0, 0, 0, 0, 17804, 0, 0, 0, 0, 0, - 0, 0, 0, 1248, 0, 0, 0, 0, 0, 0, + 8824, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1970, 1970, 0, 0, 0, 0, + 167, 0, 794, 12019, 22766, 9140, 22331, 0, 9235, 0, + 11677, 26881, 0, 0, 0, 22394, 0, 20909, 0, 0, + 0, 0, 776, 0, 0, 0, 0, 18605, 0, 0, + 0, 1287, 0, 0, 0, 0, 16024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -737,155 +751,159 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 7232, 0, 0, 0, 0, 6415, 6510, 6608, 6922, - 0, 7017, 7115, 7429, 4059, 7524, 7622, 4180, 7936, 3598, - 0, 945, 0, 0, 3876, 0, 0, 1933, 1933, 13838, - 0, 9359, 0, 10272, 0, 0, 0, 10272, 0, 8443, - 0, 0, 1477, 0, 0, 708, 0, 0, 1477, 0, - 0, 0, 0, 27320, 429, 0, 429, 9457, 0, 0, - 9143, 8031, 0, 0, 0, 0, 9962, 13163, 13213, 20188, - 0, 0, 945, 0, 649, 0, 845, 0, 1003, 1477, - 747, 1477, 1430, 0, 1430, 0, 0, 0, 1410, 0, - 2694, 2720, 2840, 2973, 1494, 3380, 3671, 3675, 1969, 3712, - 3916, 2701, 4034, 0, 0, 0, 1368, 1368, 0, 0, - 4155, 776, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22888, 0, 0, 0, 0, 0, 0, 0, + 6279, 6595, 6690, 6788, 0, 7104, 7199, 7297, 4348, 7613, + 7708, 4715, 7806, 3207, 0, 454, 3871, 21259, 1448, 0, + 0, 1970, 1970, 2231, 0, 21357, 0, 7007, 0, 0, + 0, 0, 7007, 0, 8631, 0, 0, 467, 0, 0, + 0, 1526, 0, 0, 0, 0, 28930, 0, 546, 0, + 0, 0, 9649, 0, 0, 8122, 0, 0, 0, 0, + 9333, 10156, 13829, 13956, 20999, 0, 454, 0, 713, 0, + 1401, 0, 933, 1526, 0, 1478, 0, 1478, 0, 0, + 0, 1449, 0, 2168, 2565, 2579, 2620, 1546, 3149, 3325, + 3363, 1259, 3707, 3900, 1800, 3907, 0, 0, 0, 1284, + 1284, 0, 0, 4321, 876, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1525, 490, 1537, + 529, 0, 0, 0, 0, 829, 0, 0, 24615, 0, + 621, 0, 0, 202, 0, 202, 302, 788, 1136, 1366, + 1508, 1656, 1674, 1285, 1744, 1816, 1967, 1904, 0, 0, + 2302, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 813, 710, 0, 23301, 0, 441, 710, 0, 0, 0, - 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 9744, 9840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9552, 9648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, - 0, 0, 10918, 0, 0, 27431, 0, 0, 0, 27431, - 26756, 26756, 945, 866, 1022, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22024, 0, 0, 22148, 0, 0, - 0, 23413, 0, 0, 0, 0, 710, 2346, 0, 6173, - 11726, 12659, 13363, 13984, 17353, 17968, 21231, 21524, 0, 0, - 0, 0, 0, 229, 0, 229, 1326, 1411, 1835, 2190, - 2278, 2381, 2437, 1920, 2537, 2632, 2186, 2788, 0, 0, - 2834, 0, 0, 0, 156, 0, 459, 0, 0, 0, - 8538, 0, 0, 0, 0, 0, 0, 0, 0, 243, - 0, 0, 0, 0, 27431, 0, 0, 27431, 27431, 1477, - 0, 0, 0, 920, 941, 0, 1477, 704, 0, 1477, - 1477, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 27431, 1591, 0, 1477, 0, 0, - 873, 109, 1477, 0, 1443, 0, 0, 0, 450, 0, - 0, 0, 0, 0, 4224, 0, 1141, 0, 0, 243, + 0, 0, 0, 0, 206, 0, 0, 0, 0, 7516, + 0, 0, 0, 0, 0, 0, 0, 0, 454, 887, + 1053, 0, 0, 863, 0, 3935, 0, 3035, 3480, 3764, + 6353, 9991, 10498, 11005, 13712, 0, 0, 14577, 0, 0, + 0, 0, 0, 0, 243, 0, 629, 0, 0, 0, + 0, 0, 0, 0, 0, 23315, 23441, 0, 0, 24729, + 0, 0, 0, 0, 0, 1526, 0, 0, 0, 8726, + 0, 0, 0, 0, 0, 0, 0, 0, 206, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 844, 883, + 0, 1526, 190, 0, 1526, 0, 1526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1526, 0, 0, 3362, 124, 0, 1494, + 0, 0, 0, 647, 0, 0, 0, 0, 0, 4502, + 0, 1087, 0, 0, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1477, 252, 0, 252, 0, 262, 0, 252, - 0, 0, 0, 0, 108, 104, 0, 262, 0, 219, - 186, 294, 0, 989, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 10057, 12215, - 12355, 12475, 12536, 12654, 13050, 12801, 12914, 13327, 13462, 3651, - 11464, 0, 1485, 11655, 11904, 11559, 11067, 11163, 10153, 10467, - 10562, 12000, 0, 0, 0, 0, 0, 15371, 5509, 16802, - 0, 25485, 0, 5626, 255, 1453, 15736, 0, 15848, 0, - 14417, 0, 0, 0, 12095, 0, 0, 0, 0, 0, - 17279, 0, 0, 0, 1477, 0, 1204, 0, 593, 0, - 22902, 0, 0, 0, 0, 243, 0, 710, 0, 0, - 956, 23014, 0, 0, 0, 0, 0, 0, 0, 2913, - 0, 243, 0, 0, 1279, 0, 442, 0, 0, 0, - 0, 0, 4545, 5991, 1453, 4662, 5027, 0, 9768, 0, - 10272, 0, 0, 0, 0, 0, 0, 944, 0, 826, - 0, 0, 0, 0, 11283, 0, 0, 10658, 0, 8129, - 0, 0, 1236, 0, 0, 1430, 0, 2777, 1470, 1453, - 3137, 3246, 1265, -66, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 631, 0, 978, 1477, - 1016, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1526, 209, + 0, 209, 0, 210, 0, 209, 0, 0, 0, 0, + 174, 134, 0, 0, 210, 0, 558, 394, 430, 863, + 0, 0, 863, 0, 0, 0, 0, 2499, 0, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1290, 0, 91, 13886, 3003, 0, 0, - 13955, 3576, 0, 0, 0, 0, 0, 0, 0, 0, - 27431, 27431, 0, 11806, 264, 18118, 0, 27431, 27431, 0, - 0, 20528, 0, 0, 14006, 8753, 0, 0, 0, 0, - 20280, 0, 10777, 21635, 0, 0, 0, 1349, 0, 0, - 0, 0, 0, 0, 1198, 0, 9261, 0, 1284, 0, - 0, 0, 710, 22480, 22592, 0, 1453, 0, 0, 1290, - 0, 1477, 0, 0, 0, 0, 0, 0, 2285, 985, - 1453, 2318, 2869, 229, 0, 0, 0, 0, 0, 0, - 1290, 0, 0, 27431, 27431, 6101, 27431, 27431, 0, 0, - 704, 1477, 1477, 0, 0, 0, 115, 1148, 0, 0, + 0, 0, 0, 10251, 2838, 12965, 13209, 13309, 13405, 13707, + 13526, 13612, 14072, 14119, 12171, 12266, 0, 1530, 12662, 12748, + 12362, 11772, 11868, 10347, 10663, 10758, 12843, 0, 0, 0, + 0, 0, 16141, 5800, 17593, 0, 0, 26881, 0, 6167, + 418, 1504, 16508, 0, 16625, 0, 15056, 0, 13092, 0, + 0, 0, 0, 0, 18077, 0, 0, 0, 1526, 0, + 1127, 0, 0, 0, 0, 107, 24328, 0, 0, 0, + 0, 1318, 0, 389, 0, 0, 24214, 0, 0, 0, + 0, 206, 0, 863, 546, 1526, 0, 0, 0, 0, + 0, 0, 4832, 15173, 1504, 5199, 5316, 21404, 0, 0, + 7007, 0, 0, 0, 0, 1002, 0, 226, 0, 0, + 0, 0, 0, 14205, 0, 10854, 8217, 0, 8315, 0, + 0, 1722, 0, 0, 1478, 0, 1823, 2026, 1504, 2373, + 2413, 1195, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1270, 0, 1031, 1052, 1526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1477, 0, 0, 0, 0, 0, 0, 252, 252, - 252, 0, 252, 0, 0, 262, 294, 252, 0, 0, - 0, 0, 0, 0, 0, 0, 229, 92, 200, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23622, 23734, - 0, 0, 0, 27431, 0, 0, 0, 0, 0, 0, - 0, 0, 243, 0, 27431, 0, 0, 10317, 0, 0, - 1327, 710, 0, 0, 0, 0, 0, 0, 0, 0, - 229, 0, 0, 0, 1055, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 27431, 0, 0, 899, - 0, 0, 125, 0, 0, 0, 0, 1102, 1112, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 460, - 0, 0, 0, 0, 13527, 7739, 13572, 8246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1453, 755, 20591, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 21674, 0, 2227, - 0, 0, 0, 0, 2578, 0, 0, 0, 10822, 0, - 20892, 0, 20934, 0, 0, 0, 20651, 20987, 0, 13641, - 88, 710, 0, 0, 429, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13706, 0, 16213, 17167, 1453, 16325, - 16690, 0, 0, 12260, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 639, 0, 0, 0, - 406, 710, 429, 0, 45, 0, 0, 252, 252, 252, - 252, 1290, 462, 1029, 1539, 1700, 1791, 2027, 2098, 1241, - 2110, 2114, 2070, 2215, 0, 0, 2302, 0, 710, 0, - 0, 0, 0, 0, 20709, 1453, 1453, 21043, 0, 0, + 28817, 11170, 22973, 14255, 0, 0, 0, 11265, 23041, 0, + 0, 0, 0, 0, 0, 0, 3180, 276, 1504, 3409, + 4050, 202, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8025, 552, 18921, 0, 0, + 0, 0, 0, 8534, 0, 0, 4184, 23083, 0, 0, + 0, 0, 21091, 0, 2108, 22431, 0, 0, 1559, 9501, + 0, 0, 0, 0, 0, 0, 22851, 0, 23161, 0, + 1236, 0, 0, 657, 399, 0, 1526, 0, 0, 0, + 0, 0, 0, 0, 399, 0, 0, 863, 23775, 23889, + 0, 1504, 0, 0, 0, 0, 0, 28817, 0, 0, + 4004, 0, 0, 0, 190, 1526, 1526, 0, 0, 0, + 1481, 0, 0, 0, 0, 0, 0, 1545, 544, 1558, + 636, 1526, 0, 0, 0, 0, 0, 0, 209, 209, + 209, 0, 209, 0, 0, 210, 430, 209, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 21721, 0, 20378, 20468, 0, 22260, 23100, - 0, 0, 21081, 0, 20770, 0, 0, 0, 612, 0, - 612, 88, 632, 0, 0, 612, 0, 1095, 1352, 632, - 0, 0, 0, 0, 18208, 21905, 0, 956, 0, 280, - 0, 0, 1290, 0, 0, 0, 0, 0, 1154, 0, - 0, 0, 0, 0, 0, 2457, 0, 243, 0, 989, - 1477, 0, 0, 21121, 20832, 21211, 0, 0, 0, 1433, - 0, 0, 0, 0, 21784, 0, 0, 0, 0, 0, - 0, 1477, 1477, 1477, 1453, 1453, 1453, 0, 0, 21346, - 0, 0, 0, 641, 0, 0, 0, 0, 0, 0, - 0, 0, 1829, 1866, 0, 1178, 0, 0, 1290, 0, - 0, 0, 0, 0, 0, 0, 0, 427, 0, 0, - 0, 0, 0, 252, 2740, 1406, 1453, 2895, 2930, 0, - 0, 21391, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 612, 612, 612, - 612, 0, 0, 632, 612, 0, 0, 1389, 0, 515, - 0, 0, 0, 0, 0, 782, 0, 21428, 21837, 0, + 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, + 0, 0, 1694, 0, 0, 1368, 0, 289, 0, 68, + 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 863, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 723, + 0, 0, -87, 0, 0, 0, 1069, 1071, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 11361, 23181, + 0, 0, 0, 0, 0, 14389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1883, 772, 1290, 0, 21476, 0, 612, 612, 612, - 612, 0, 0, 0, 0, 0, 0, 0, 0, 612, - 0, - }, yyGindex = { -//yyGindex 270 - 0, 0, 912, 0, 1486, 1247, 1518, -54, 0, 0, - -272, 1606, 1862, 0, 2066, 2189, 0, 0, 0, 1007, - 2348, 0, 42, 0, 0, 20, 1448, 715, 1646, 1997, - 1316, 0, 55, 1057, -331, -41, 0, 1054, 43, 80, - 3102, -28, -8, -57, 0, -122, -83, 610, 19, 824, - 0, 303, -828, -770, 0, 0, 356, 0, 0, 458, - 50, 752, -379, -7, 916, -278, -539, 510, 2420, -6, - 0, -221, -401, 1474, 2459, -375, 245, -535, -543, 0, - 0, 0, 0, 342, -1121, 7, 124, 886, -294, 222, - -719, 833, -787, -773, 847, 705, 0, 83, -472, 0, - 1488, 0, 0, 0, 670, 0, -701, 0, 848, 0, - 359, 0, -879, 299, 2500, 0, 0, 970, 1238, -75, - 224, 804, 2132, -2, -9, 1515, 0, 54, -98, -14, - -424, -169, 295, 0, 0, -851, 2512, 0, 0, 475, - -551, -306, 0, -374, -566, 268, 0, -834, 480, 0, - 0, 0, -255, 0, 479, 0, 0, -359, 0, -416, - 10, -56, -733, -487, -561, -455, -1134, -716, 2294, -256, - -77, 0, 0, 1554, 0, -1048, 0, 0, 481, 0, - 0, 2487, -212, 0, 0, 855, 0, 0, -717, -80, - -245, 0, 1181, 0, 0, 871, 0, 0, 0, 0, - 0, 0, 0, 0, 428, 0, 414, 0, 0, 0, - 0, 0, 0, 0, 0, -30, -19, 0, 0, 0, - 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -213, 0, 0, 0, 0, 0, -444, 0, - 0, 0, -63, 0, 0, 476, 0, 0, 0, 0, + 16992, 17960, 1504, 17109, 17476, 0, 1559, 3660, 0, 0, + 399, 101, 178, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 785, 0, 0, 0, 0, 0, 985, 0, + 0, 84, 0, 0, 209, 209, 209, 209, 14525, 22901, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1504, 1173, 21890, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22523, + 0, 21851, 0, 0, 0, 0, 21443, 0, 0, 0, + 21552, 0, 9043, 0, 9551, 0, 0, 0, 21928, 9962, + 0, 24938, 25052, 0, 0, 14572, 0, 19013, 11525, 0, + 128, 0, 0, 0, 202, 0, 0, 0, 107, 0, + 0, 0, 399, 0, 688, 0, 0, 1146, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 21975, 1504, + 1504, 10469, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22608, 0, 21591, 21732, 0, 29081, + 29451, 0, 0, 10976, 0, 22038, 0, 373, 863, 0, + 0, 546, 0, 0, 318, 441, 1163, 1228, 1971, 2068, + 2218, 1646, 2709, 2777, 1757, 2945, 0, 0, 3007, 0, + 863, 399, 0, 238, 0, 0, 0, 0, 0, 535, + 0, 546, 0, 0, 0, 0, 209, 1526, 0, 0, + 22085, 11483, 22124, 0, 0, 0, 0, 1526, 0, 0, + 22672, 0, 0, 0, 0, 0, 0, 0, 0, 1526, + 1526, 1526, 1504, 1504, 1504, 0, 0, 0, 22218, 0, + 0, 651, 0, 651, 373, 777, 0, 0, 651, 0, + 764, 1507, 777, 0, 0, 399, 3093, 0, 206, 0, + 657, 0, 0, 0, 0, 0, 0, 863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 942, 0, 0, 0, + 0, 0, 0, 0, 0, 1878, 2495, 0, 825, 0, + 0, 0, 2037, 756, 1504, 2704, 2739, 0, 832, 0, + 0, 0, 545, 0, 0, 0, 0, 22281, 1477, 22724, + 0, 0, 0, 0, 651, 651, 651, 651, 0, 0, + 777, 651, 0, 0, 998, 1281, 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2875, 836, 0, 0, 0, 0, 651, 651, + 651, 651, 0, 0, 0, 0, 0, 651, 0, + }, yyGindex = { +//yyGindex 277 + 0, 0, 1167, 0, 1535, 1605, 2549, -58, 0, 0, + -212, 3229, 22802, 0, 23240, 23252, 0, 0, 0, 1050, + 23638, 0, 59, 0, 0, 16, 1485, 750, 2213, 2337, + 0, 0, 0, 0, 4, 1367, 0, 1260, 1116, -531, + -534, -577, -42, 0, 1118, -1, -62, 3499, -50, -7, + -35, 0, -117, -61, 1759, 13, 0, 746, 425, -838, + -715, 0, 0, 361, 0, 0, 369, 48, -429, 89, + -370, 69, 988, -295, -497, 470, 3550, 30, 0, -226, + -448, 1548, 2614, -15, 469, -555, -558, 0, 0, 0, + 0, 350, -942, 129, 113, 824, -326, 78, -697, 901, + -798, -766, 761, 912, 0, 40, -436, 0, 1998, 0, + 0, 0, 547, 0, -594, 0, 905, 0, 363, 0, + -1033, 328, 24685, 0, -506, 1288, 0, -95, 126, 853, + 2635, -2, 12, 1621, 0, -4, -91, -16, -455, -123, + 358, 0, 0, -825, 1900, 0, 0, 541, -945, -22, + 0, -820, -786, -300, 0, -240, 548, 0, 0, 0, + -1015, 0, 543, 0, 652, -348, 0, -435, 20, -49, + -724, 1, -570, -438, -1089, -745, 1457, -305, -86, 0, + 0, 1634, 0, -962, 0, 952, 561, 0, 0, 1362, + -213, 0, -655, 77, 0, 0, -565, 354, 266, 0, + 1149, 774, 0, 0, 0, 0, 0, 0, 402, 0, + -141, 0, 0, 1241, 0, 0, 0, 0, 0, 685, + -508, 0, 0, 50, -668, -201, 263, 281, 0, 2, + 24, 0, 0, 0, 0, 0, 164, 0, 0, 0, + 0, 0, 0, 1531, 0, -198, 0, 0, 0, -437, + 0, 0, 0, -84, 0, 0, 0, 0, 476, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, }; - protected static final short[] yyTable = YyTables.yyTable(); - protected static final short[] yyCheck = YyTables.yyCheck(); + protected static final int[] yyTable = YyTables.yyTable(); + protected static final int[] yyCheck = YyTables.yyCheck(); /** maps symbol value to printable name. @see #yyExpecting @@ -925,22 +943,22 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "`__FILE__'","`__ENCODING__'","local variable or method","method","global variable", "instance variable","constant","class variable","label","integer literal","float literal","rational literal", "imaginary literal","char literal","numbered reference","back reference","literal content", - "tREGEXP_END","tUMINUS_NUM","escaped space","unary+","unary-","**","<=>", -"==","===","!=",">=","<=","&&","||","=~","!~", -"..","...","(..","(...","[]","[]=","<<",">>", -"&.","::",":: at EXPR_BEG","operator assignment","=>","'('", -"( arg","'['","'{'","{ arg","'*'","**arg", -"'&'","->","symbol literal","string literal","backtick literal", -"regexp literal","word list","verbatim work list","terminator","symbol list", -"verbatim symbol list","'}'","tSTRING_DBEG","tSTRING_DVAR", - "tLAMBEG","tLABEL_END","tIGNORED_NL","tCOMMENT","tEMBDOC_BEG", - "tEMBDOC","tEMBDOC_END","tHEREDOC_BEG","tHEREDOC_END","k__END__", - "tLOWEST", + "tREGEXP_END","dummy end","tUMINUS_NUM","end-of-input","escaped space", +"unary+","unary-","**","<=>","==","===","!=",">=","<=", +"&&","||","=~","!~","..","...","(..","(...", +"[]","[]=","<<",">>","&.","::",":: at EXPR_BEG", +"operator assignment","=>","'('","( arg","'['","'{'", +"{ arg","'*'","**arg","'&'","->","symbol literal", +"string literal","backtick literal","regexp literal","word list","verbatim work list", +"terminator","symbol list","verbatim symbol list","'}'", + "tSTRING_DBEG","tSTRING_DVAR","tLAMBEG","tLABEL_END","tIGNORED_NL", + "tCOMMENT","tEMBDOC_BEG","tEMBDOC","tEMBDOC_END","tHEREDOC_BEG", + "tHEREDOC_END","k__END__","tLOWEST", }; /** printable rules for debugging. */ - protected static final String [] yyRule = { + protected static final String[] yyRule = { "$accept : program", "$$1 :", "program : $$1 top_compstmt", @@ -948,23 +966,26 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "top_stmts : none", "top_stmts : top_stmt", "top_stmts : top_stmts terms top_stmt", - "top_stmts : error top_stmt", "top_stmt : stmt", "top_stmt : keyword_BEGIN begin_block", - "begin_block : '{' top_compstmt '}'", + "block_open : '{'", + "begin_block : block_open top_compstmt '}'", "$$2 :", - "bodystmt : compstmt opt_rescue k_else $$2 compstmt opt_ensure", - "bodystmt : compstmt opt_rescue opt_ensure", + "$$3 :", + "bodystmt : compstmt lex_ctxt opt_rescue k_else $$2 compstmt $$3 opt_ensure", + "$$4 :", + "bodystmt : compstmt lex_ctxt opt_rescue $$4 opt_ensure", "compstmt : stmts opt_terms", "stmts : none", "stmts : stmt_or_begin", "stmts : stmts terms stmt_or_begin", - "stmts : error stmt", "stmt_or_begin : stmt", - "$$3 :", - "stmt_or_begin : keyword_BEGIN $$3 begin_block", - "$$4 :", - "stmt : keyword_alias fitem $$4 fitem", + "$$5 :", + "stmt_or_begin : keyword_BEGIN $$5 begin_block", + "allow_exits :", + "k_END : keyword_END lex_ctxt", + "$$6 :", + "stmt : keyword_alias fitem $$6 fitem", "stmt : keyword_alias tGVAR tGVAR", "stmt : keyword_alias tGVAR tBACK_REF", "stmt : keyword_alias tGVAR tNTH_REF", @@ -973,14 +994,15 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "stmt : stmt modifier_unless expr_value", "stmt : stmt modifier_while expr_value", "stmt : stmt modifier_until expr_value", - "stmt : stmt modifier_rescue stmt", - "stmt : keyword_END '{' compstmt '}'", + "stmt : stmt modifier_rescue after_rescue stmt", + "stmt : k_END allow_exits '{' compstmt '}'", "stmt : command_asgn", "stmt : mlhs '=' lex_ctxt command_call", "stmt : lhs '=' lex_ctxt mrhs", - "stmt : mlhs '=' lex_ctxt mrhs_arg modifier_rescue stmt", + "stmt : mlhs '=' lex_ctxt mrhs_arg modifier_rescue after_rescue stmt", "stmt : mlhs '=' lex_ctxt mrhs_arg", "stmt : expr", + "stmt : error", "command_asgn : lhs '=' lex_ctxt command_rhs", "command_asgn : var_lhs tOP_ASGN lex_ctxt command_rhs", "command_asgn : primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt command_rhs", @@ -988,35 +1010,34 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "command_asgn : primary_value call_op tCONSTANT tOP_ASGN lex_ctxt command_rhs", "command_asgn : primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt command_rhs", "command_asgn : primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt command_rhs", - "command_asgn : defn_head f_opt_paren_args '=' command", - "command_asgn : defn_head f_opt_paren_args '=' command modifier_rescue arg", - "command_asgn : defs_head f_opt_paren_args '=' command", - "command_asgn : defs_head f_opt_paren_args '=' command modifier_rescue arg", + "command_asgn : defn_head f_opt_paren_args '=' endless_command", + "command_asgn : defs_head f_opt_paren_args '=' endless_command", "command_asgn : backref tOP_ASGN lex_ctxt command_rhs", + "endless_command : command", + "endless_command : endless_command modifier_rescue after_rescue arg", + "endless_command : keyword_not opt_nl endless_command", "command_rhs : command_call", - "command_rhs : command_call modifier_rescue stmt", + "command_rhs : command_call modifier_rescue after_rescue stmt", "command_rhs : command_asgn", "expr : command_call", "expr : expr keyword_and expr", "expr : expr keyword_or expr", "expr : keyword_not opt_nl expr", "expr : '!' command_call", - "$$5 :", - "$$6 :", "$$7 :", - "expr : arg tASSOC $$5 $$6 $$7 p_top_expr_body", + "expr : arg tASSOC $$7 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body", "$$8 :", - "$$9 :", - "$$10 :", - "expr : arg keyword_in $$8 $$9 $$10 p_top_expr_body", + "expr : arg keyword_in $$8 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body", "expr : arg", "def_name : fname", "defn_head : k_def def_name", - "$$11 :", - "defs_head : k_def singleton dot_or_colon $$11 def_name", + "$$9 :", + "defs_head : k_def singleton dot_or_colon $$9 def_name", "expr_value : expr", - "$$12 :", - "expr_value_do : $$12 expr_value do", + "expr_value : error", + "$$10 :", + "$$11 :", + "expr_value_do : $$10 expr_value do $$11", "command_call : command", "command_call : block_command", "block_command : block_call", @@ -1029,8 +1050,9 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "command : primary_value call_op operation2 command_args cmd_brace_block", "command : primary_value tCOLON2 operation2 command_args", "command : primary_value tCOLON2 operation2 command_args cmd_brace_block", + "command : primary_value tCOLON2 tCONSTANT '{' brace_body '}'", "command : keyword_super command_args", - "command : keyword_yield command_args", + "command : k_yield command_args", "command : k_return call_args", "command : keyword_break call_args", "command : keyword_next call_args", @@ -1105,8 +1127,8 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "fitem : fname", "fitem : symbol", "undef_list : fitem", - "$$13 :", - "undef_list : undef_list ',' $$13 fitem", + "$$12 :", + "undef_list : undef_list ',' $$12 fitem", "op : '|'", "op : '^'", "op : '&'", @@ -1218,29 +1240,30 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "arg : arg tRSHFT arg", "arg : arg tANDOP arg", "arg : arg tOROP arg", - "$$14 :", - "arg : keyword_defined opt_nl $$14 arg", + "arg : keyword_defined opt_nl begin_defined arg", "arg : arg '?' arg opt_nl ':' arg", - "arg : defn_head f_opt_paren_args '=' arg", - "arg : defn_head f_opt_paren_args '=' arg modifier_rescue arg", - "arg : defs_head f_opt_paren_args '=' arg", - "arg : defs_head f_opt_paren_args '=' arg modifier_rescue arg", + "arg : defn_head f_opt_paren_args '=' endless_arg", + "arg : defs_head f_opt_paren_args '=' endless_arg", "arg : primary", + "endless_arg : arg", + "endless_arg : endless_arg modifier_rescue after_rescue arg", + "endless_arg : keyword_not opt_nl endless_arg", "relop : '>'", "relop : '<'", "relop : tGEQ", "relop : tLEQ", "rel_expr : arg relop arg", "rel_expr : rel_expr relop arg", - "lex_ctxt : tSP", "lex_ctxt : none", + "begin_defined : lex_ctxt", + "after_rescue : lex_ctxt", "arg_value : arg", "aref_args : none", "aref_args : args trailer", "aref_args : args ',' assocs trailer", "aref_args : assocs trailer", "arg_rhs : arg", - "arg_rhs : arg modifier_rescue arg", + "arg_rhs : arg modifier_rescue after_rescue arg", "paren_args : '(' opt_call_args rparen", "paren_args : '(' args ',' args_forward rparen", "paren_args : '(' args_forward rparen", @@ -1256,16 +1279,18 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "call_args : assocs opt_block_arg", "call_args : args ',' assocs opt_block_arg", "call_args : block_arg", - "$$15 :", - "command_args : $$15 call_args", + "$$13 :", + "command_args : $$13 call_args", "block_arg : tAMPER arg_value", "block_arg : tAMPER", "opt_block_arg : ',' block_arg", "opt_block_arg : none_block_pass", "args : arg_value", - "args : tSTAR arg_value", + "args : arg_splat", "args : args ',' arg_value", - "args : args ',' tSTAR arg_value", + "args : args ',' arg_splat", + "arg_splat : tSTAR arg_value", + "arg_splat : tSTAR", "mrhs_arg : mrhs", "mrhs_arg : arg_value", "mrhs : args ',' arg_value", @@ -1282,23 +1307,20 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "primary : var_ref", "primary : backref", "primary : tFID", - "$$16 :", - "primary : k_begin $$16 bodystmt k_end", - "$$17 :", - "primary : tLPAREN_ARG $$17 rparen", - "$$18 :", - "primary : tLPAREN_ARG stmt $$18 rparen", + "$$14 :", + "primary : k_begin $$14 bodystmt k_end", + "$$15 :", + "primary : tLPAREN_ARG compstmt $$15 ')'", "primary : tLPAREN compstmt ')'", "primary : primary_value tCOLON2 tCONSTANT", "primary : tCOLON3 tCONSTANT", "primary : tLBRACK aref_args ']'", "primary : tLBRACE assoc_list '}'", "primary : k_return", - "primary : keyword_yield '(' call_args rparen", - "primary : keyword_yield '(' rparen", - "primary : keyword_yield", - "$$19 :", - "primary : keyword_defined opt_nl '(' $$19 expr rparen", + "primary : k_yield '(' call_args rparen", + "primary : k_yield '(' rparen", + "primary : k_yield", + "primary : keyword_defined opt_nl '(' begin_defined expr rparen", "primary : keyword_not '(' expr rparen", "primary : keyword_not '(' rparen", "primary : fcall brace_block", @@ -1309,20 +1331,22 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "primary : k_unless expr_value then compstmt opt_else k_end", "primary : k_while expr_value_do compstmt k_end", "primary : k_until expr_value_do compstmt k_end", - "$$20 :", - "primary : k_case expr_value opt_terms $$20 case_body k_end", - "$$21 :", - "primary : k_case opt_terms $$21 case_body k_end", + "$$16 :", + "primary : k_case expr_value opt_terms $$16 case_body k_end", + "$$17 :", + "primary : k_case opt_terms $$17 case_body k_end", "primary : k_case expr_value opt_terms p_case_body k_end", "primary : k_for for_var keyword_in expr_value_do compstmt k_end", + "$$18 :", + "primary : k_class cpath superclass $$18 bodystmt k_end", + "$$19 :", + "primary : k_class tLSHFT expr_value $$19 term bodystmt k_end", + "$$20 :", + "primary : k_module cpath $$20 bodystmt k_end", + "$$21 :", + "primary : defn_head f_arglist $$21 bodystmt k_end", "$$22 :", - "primary : k_class cpath superclass $$22 bodystmt k_end", - "$$23 :", - "primary : k_class tLSHFT expr $$23 term bodystmt k_end", - "$$24 :", - "primary : k_module cpath $$24 bodystmt k_end", - "primary : defn_head f_arglist bodystmt k_end", - "primary : defs_head f_arglist bodystmt k_end", + "primary : defs_head f_arglist $$22 bodystmt k_end", "primary : keyword_break", "primary : keyword_next", "primary : keyword_redo", @@ -1331,10 +1355,10 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "k_begin : keyword_begin", "k_if : keyword_if", "k_unless : keyword_unless", - "k_while : keyword_while", - "k_until : keyword_until", + "k_while : keyword_while allow_exits", + "k_until : keyword_until allow_exits", "k_case : keyword_case", - "k_for : keyword_for", + "k_for : keyword_for allow_exits", "k_class : keyword_class", "k_module : keyword_module", "k_def : keyword_def", @@ -1346,7 +1370,9 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "k_else : keyword_else", "k_elsif : keyword_elsif", "k_end : keyword_end", + "k_end : tDUMNY_END", "k_return : keyword_return", + "k_yield : keyword_yield", "then : term", "then : keyword_then", "then : term keyword_then", @@ -1371,8 +1397,8 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "f_rest_marg : tSTAR", "f_any_kwrest : f_kwrest", "f_any_kwrest : f_no_kwarg", - "$$25 :", - "f_eq : $$25 '='", + "$$23 :", + "f_eq : $$23 '='", "block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg", "block_args_tail : f_block_kwarg opt_f_block_arg", "block_args_tail : f_any_kwrest opt_f_block_arg", @@ -1405,15 +1431,17 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "bv_decls : bv_decls ',' bvar", "bvar : tIDENTIFIER", "bvar : f_bad_arg", - "$$26 :", - "$$27 :", - "$$28 :", - "$$29 :", - "lambda : tLAMBDA $$26 $$27 $$28 f_larglist $$29 lambda_body", + "max_numparam :", + "numparam :", + "it_id :", + "$$24 :", + "$$25 :", + "lambda : tLAMBDA $$24 max_numparam numparam it_id allow_exits f_larglist $$25 lambda_body", "f_larglist : '(' f_args opt_bv_decl ')'", "f_larglist : f_args", "lambda_body : tLAMBEG compstmt '}'", - "lambda_body : keyword_do_LAMBDA bodystmt k_end", + "$$26 :", + "lambda_body : keyword_do_LAMBDA $$26 bodystmt k_end", "do_block : k_do_block do_body k_end", "block_call : command do_block", "block_call : block_call call_op2 operation2 opt_paren_args", @@ -1430,14 +1458,10 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "method_call : primary_value '[' opt_call_args rbracket", "brace_block : '{' brace_body '}'", "brace_block : k_do do_body k_end", - "$$30 :", - "$$31 :", - "$$32 :", - "brace_body : $$30 $$31 $$32 opt_block_param compstmt", - "$$33 :", - "$$34 :", - "$$35 :", - "do_body : $$33 $$34 $$35 opt_block_param bodystmt", + "$$27 :", + "brace_body : $$27 max_numparam numparam it_id allow_exits opt_block_param compstmt", + "$$28 :", + "do_body : $$28 max_numparam numparam it_id allow_exits opt_block_param bodystmt", "case_args : arg_value", "case_args : tSTAR arg_value", "case_args : case_args ',' arg_value", @@ -1445,10 +1469,11 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "case_body : k_when case_args then compstmt cases", "cases : opt_else", "cases : case_body", - "$$36 :", - "$$37 :", - "$$38 :", - "p_case_body : keyword_in $$36 $$37 p_top_expr then $$38 compstmt p_cases", + "p_pvtbl :", + "p_pktbl :", + "p_in_kwarg :", + "$$29 :", + "p_case_body : keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $$29 compstmt p_cases", "p_cases : opt_else", "p_cases : p_case_body", "p_top_expr : p_top_expr_body", @@ -1465,8 +1490,8 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "p_as : p_alt", "p_alt : p_alt '|' p_expr_basic", "p_alt : p_expr_basic", - "p_lparen : '('", - "p_lbracket : '['", + "p_lparen : '(' p_pktbl", + "p_lbracket : '[' p_pktbl", "p_expr_basic : p_value", "p_expr_basic : p_variable", "p_expr_basic : p_const p_lparen p_args rparen", @@ -1480,18 +1505,15 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "p_expr_basic : tLBRACK p_args rbracket", "p_expr_basic : tLBRACK p_find rbracket", "p_expr_basic : tLBRACK rbracket", - "$$39 :", - "p_expr_basic : tLBRACE $$39 p_kwargs rbrace", + "$$30 :", + "p_expr_basic : tLBRACE p_pktbl lex_ctxt $$30 p_kwargs rbrace", "p_expr_basic : tLBRACE rbrace", - "$$40 :", - "p_expr_basic : tLPAREN $$40 p_expr rparen", + "p_expr_basic : tLPAREN p_pktbl p_expr rparen", "p_args : p_expr", "p_args : p_args_head", "p_args : p_args_head p_arg", - "p_args : p_args_head tSTAR tIDENTIFIER", - "p_args : p_args_head tSTAR tIDENTIFIER ',' p_args_post", - "p_args : p_args_head tSTAR", - "p_args : p_args_head tSTAR ',' p_args_post", + "p_args : p_args_head p_rest", + "p_args : p_args_head p_rest ',' p_args_post", "p_args : p_args_tail", "p_args_head : p_arg ','", "p_args_head : p_args_head p_arg ','", @@ -1547,7 +1569,7 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "p_variable : tIDENTIFIER", "p_var_ref : '^' tIDENTIFIER", "p_var_ref : '^' nonlocal_var", - "p_expr_ref : '^' tLPAREN expr_value ')'", + "p_expr_ref : '^' tLPAREN expr_value rparen", "p_const : tCOLON3 cname", "p_const : p_const tCOLON2 cname", "p_const : tCONSTANT", @@ -1569,20 +1591,22 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "string1 : tSTRING_BEG string_contents tSTRING_END", "xstring : tXSTRING_BEG xstring_contents tSTRING_END", "regexp : tREGEXP_BEG regexp_contents tREGEXP_END", - "words : tWORDS_BEG ' ' word_list tSTRING_END", + "words_sep : ' '", + "words_sep : words_sep ' '", + "words : tWORDS_BEG words_sep word_list tSTRING_END", "word_list :", - "word_list : word_list word ' '", + "word_list : word_list word words_sep", "word : string_content", "word : word string_content", - "symbols : tSYMBOLS_BEG ' ' symbol_list tSTRING_END", + "symbols : tSYMBOLS_BEG words_sep symbol_list tSTRING_END", "symbol_list :", - "symbol_list : symbol_list word ' '", - "qwords : tQWORDS_BEG ' ' qword_list tSTRING_END", - "qsymbols : tQSYMBOLS_BEG ' ' qsym_list tSTRING_END", + "symbol_list : symbol_list word words_sep", + "qwords : tQWORDS_BEG words_sep qword_list tSTRING_END", + "qsymbols : tQSYMBOLS_BEG words_sep qsym_list tSTRING_END", "qword_list :", - "qword_list : qword_list tSTRING_CONTENT ' '", + "qword_list : qword_list tSTRING_CONTENT words_sep", "qsym_list :", - "qsym_list : qsym_list tSTRING_CONTENT ' '", + "qsym_list : qsym_list tSTRING_CONTENT words_sep", "string_contents :", "string_contents : string_contents string_content", "xstring_contents :", @@ -1590,34 +1614,32 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "regexp_contents :", "regexp_contents : regexp_contents string_content", "string_content : tSTRING_CONTENT", - "$$41 :", - "string_content : tSTRING_DVAR $$41 string_dvar", - "$$42 :", - "$$43 :", - "$$44 :", - "$$45 :", - "string_content : tSTRING_DBEG $$42 $$43 $$44 $$45 compstmt tSTRING_DEND", - "string_dvar : tGVAR", - "string_dvar : tIVAR", - "string_dvar : tCVAR", + "$$31 :", + "string_content : tSTRING_DVAR $$31 string_dvar", + "$$32 :", + "$$33 :", + "$$34 :", + "$$35 :", + "string_content : tSTRING_DBEG $$32 $$33 $$34 $$35 compstmt string_dend", + "string_dend : tSTRING_DEND", + "string_dend : END_OF_INPUT", + "string_dvar : nonlocal_var", "string_dvar : backref", "symbol : ssym", "symbol : dsym", "ssym : tSYMBEG sym", "sym : fname", - "sym : tIVAR", - "sym : tGVAR", - "sym : tCVAR", + "sym : nonlocal_var", "dsym : tSYMBEG string_contents tSTRING_END", "numeric : simple_numeric", "numeric : tUMINUS_NUM simple_numeric", - "nonlocal_var : tIVAR", - "nonlocal_var : tGVAR", - "nonlocal_var : tCVAR", "simple_numeric : tINTEGER", "simple_numeric : tFLOAT", "simple_numeric : tRATIONAL", "simple_numeric : tIMAGINARY", + "nonlocal_var : tIVAR", + "nonlocal_var : tGVAR", + "nonlocal_var : tCVAR", "var_ref : tIDENTIFIER", "var_ref : tIVAR", "var_ref : tGVAR", @@ -1644,15 +1666,15 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "var_lhs : keyword__ENCODING__", "backref : tNTH_REF", "backref : tBACK_REF", - "$$46 :", - "superclass : '<' $$46 expr_value term", + "$$36 :", + "superclass : '<' $$36 expr_value term", "superclass :", "f_opt_paren_args : f_paren_args", "f_opt_paren_args : none", "f_paren_args : '(' f_args rparen", "f_arglist : f_paren_args", - "$$47 :", - "f_arglist : $$47 f_args term", + "$$37 :", + "f_arglist : $$37 f_args term", "args_tail : f_kwarg ',' f_kwrest opt_f_block_arg", "args_tail : f_kwarg opt_f_block_arg", "args_tail : f_any_kwrest opt_f_block_arg", @@ -1698,7 +1720,7 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "f_kwarg : f_kwarg ',' f_kw", "kwrest_mark : tPOW", "kwrest_mark : tDSTAR", - "f_no_kwarg : kwrest_mark keyword_nil", + "f_no_kwarg : p_kwnorest", "f_kwrest : kwrest_mark tIDENTIFIER", "f_kwrest : kwrest_mark", "f_opt : f_arg_asgn f_eq arg_value", @@ -1718,8 +1740,8 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "opt_f_block_arg : ',' f_block_arg", "opt_f_block_arg :", "singleton : var_ref", - "$$48 :", - "singleton : '(' $$48 expr rparen", + "$$38 :", + "singleton : '(' $$38 expr rparen", "assoc_list : none", "assoc_list : assocs trailer", "assocs : assoc", @@ -1729,12 +1751,11 @@ public RubyParser(Ruby runtime, LexerSource source, DynamicScope scope, org.jrub "assoc : tLABEL", "assoc : tSTRING_BEG string_contents tLABEL_END arg_value", "assoc : tDSTAR arg_value", + "assoc : tDSTAR", "operation : tIDENTIFIER", "operation : tCONSTANT", "operation : tFID", - "operation2 : tIDENTIFIER", - "operation2 : tCONSTANT", - "operation2 : tFID", + "operation2 : operation", "operation2 : op", "operation3 : tIDENTIFIER", "operation3 : tFID", @@ -1939,7 +1960,8 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { if (yydebug != null) yydebug.reduce(yystate, yystates[yytop-yyLen[yyn]].state, yyn, yyRule[yyn], yyLen[yyn]); - ParserState parserState = states[yyn]; + ParserState parserState = yyn >= states.length ? null : states[yyn]; +// ParserState parserState = states[yyn]; if (parserState == null) { yyVal = yyLen[yyn] > 0 ? yystates[yytop - yyLen[yyn] + 1].value : null; } else { @@ -1981,7 +2003,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { } } -static ParserState[] states = new ParserState[820]; +static ParserState[] states = new ParserState[823]; static { states[1] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_BEG); @@ -2033,14 +2055,20 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; states[7] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.remove_begin(((Node)yyVals[0+yyTop].value)); + p.clear_block_exit(true); + yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[9] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[8] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; +states[9] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.init_block_exit(); + return yyVal; +}; states[10] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.restore_block_exit(((NodeExits)yyVals[-2+yyTop].value)); /*%%%*/ p.getResult().addBeginNode(new PreExe19Node(yyVals[yyTop - count + 1].start(), p.getCurrentScope(), ((Node)yyVals[-1+yyTop].value), p.src_line())); /* $$ = new BeginNode(yyVals[yyTop - count + 1].start(), p.makeNullNil($2));*/ @@ -2051,91 +2079,106 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { }; states[11] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - if (((RescueBodyNode)yyVals[-1+yyTop].value) == null) p.yyerror("else without rescue is useless"); + if (((RescueBodyNode)yyVals[-1+yyTop].value) == null) p.yyerror("else without rescue is useless"); + p.next_rescue_context(((LexContext)yyVals[-2+yyTop].value), LexContext.InRescue.AFTER_ELSE); /*% %*/ return yyVal; }; states[12] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - /*%%%*/ - yyVal = p.new_bodystmt(((Node)yyVals[-5+yyTop].value), ((RescueBodyNode)yyVals[-4+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); - /*% %*/ - /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/ + p.next_rescue_context(((LexContext)yyVals[-4+yyTop].value), LexContext.InRescue.AFTER_ENSURE); return yyVal; }; states[13] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = p.new_bodystmt(((Node)yyVals[-2+yyTop].value), ((RescueBodyNode)yyVals[-1+yyTop].value), null, ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_bodystmt(((Node)yyVals[-7+yyTop].value), ((RescueBodyNode)yyVals[-5+yyTop].value), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ - /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/ + /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($3), escape_Qundef($6), escape_Qundef($8)) %*/ return yyVal; }; states[14] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.void_stmts(((Node)yyVals[-1+yyTop].value)); + p.next_rescue_context(((LexContext)yyVals[-1+yyTop].value), LexContext.InRescue.AFTER_ENSURE); return yyVal; }; states[15] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + /*%%%*/ + yyVal = p.new_bodystmt(((Node)yyVals[-4+yyTop].value), ((RescueBodyNode)yyVals[-2+yyTop].value), null, ((Node)yyVals[0+yyTop].value)); + /*% %*/ + /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($3), Qnil, escape_Qundef($5)) %*/ + return yyVal; +}; +states[16] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.void_stmts(((Node)yyVals[-1+yyTop].value)); + return yyVal; +}; +states[17] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = null; /*% %*/ /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/ return yyVal; }; -states[16] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[18] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newline_node(((Node)yyVals[0+yyTop].value), yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: stmts_add!(stmts_new!, $1) %*/ return yyVal; }; -states[17] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[19] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.appendToBlock(((Node)yyVals[-2+yyTop].value), p.newline_node(((Node)yyVals[0+yyTop].value), yyVals[yyTop - count + 3].start())); /*% %*/ /*% ripper: stmts_add!($1, $3) %*/ return yyVal; }; -states[18] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((Node)yyVals[0+yyTop].value); - return yyVal; -}; -states[19] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[20] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[20] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[21] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.yyerror("BEGIN is permitted only at toplevel"); return yyVal; }; -states[21] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[22] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[22] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[23] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.allow_block_exit(); + return yyVal; +}; +states[24] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((LexContext)yyVals[0+yyTop].value); + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; + /*% ripper: get_value($:2); %*/ + return yyVal; +}; +states[25] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_FNAME|EXPR_FITEM); return yyVal; }; -states[23] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[26] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = newAlias(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: alias!($2, $4) %*/ return yyVal; }; -states[24] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[27] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new VAliasNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[-1+yyTop].value)), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ /*% ripper: var_alias!($2, $3) %*/ return yyVal; }; -states[25] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[28] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new VAliasNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[-1+yyTop].value)), p.symbolID(((BackRefNode)yyVals[0+yyTop].value).getByteName())); /*% %*/ /*% ripper: var_alias!($2, $3) %*/ return yyVal; }; -states[26] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[29] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "can't make alias for the number variables"; /*%%%*/ p.yyerror(message); @@ -2143,14 +2186,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/ return yyVal; }; -states[27] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[30] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[0+yyTop].value); /*% %*/ /*% ripper: undef!($2) %*/ return yyVal; }; -states[28] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[31] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), p.remove_begin(((Node)yyVals[-2+yyTop].value)), null); p.fixpos(((Node)yyVal), ((Node)yyVals[0+yyTop].value)); @@ -2158,7 +2201,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: if_mod!($3, $1) %*/ return yyVal; }; -states[29] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[32] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), null, p.remove_begin(((Node)yyVals[-2+yyTop].value))); p.fixpos(((Node)yyVal), ((Node)yyVals[0+yyTop].value)); @@ -2166,7 +2209,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: unless_mod!($3, $1) %*/ return yyVal; }; -states[30] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[33] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-2+yyTop].value) != null && ((Node)yyVals[-2+yyTop].value) instanceof BeginNode) { yyVal = new WhileNode(yyVals[yyTop - count + 1].start(), p.cond(((Node)yyVals[0+yyTop].value)), ((BeginNode)yyVals[-2+yyTop].value).getBodyNode(), false); @@ -2177,7 +2220,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: while_mod!($3, $1) %*/ return yyVal; }; -states[31] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[34] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-2+yyTop].value) != null && ((Node)yyVals[-2+yyTop].value) instanceof BeginNode) { yyVal = new UntilNode(yyVals[yyTop - count + 1].start(), p.cond(((Node)yyVals[0+yyTop].value)), ((BeginNode)yyVals[-2+yyTop].value).getBodyNode(), false); @@ -2188,110 +2231,117 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: until_mod!($3, $1) %*/ return yyVal; }; -states[32] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[35] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; /*%%%*/ - yyVal = p.newRescueModNode(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.newRescueModNode(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ + /*% ripper: rescue_mod!($1, $4) %*/ return yyVal; }; -states[33] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[36] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (p.getLexContext().in_def) { p.warn("END in method; use at_exit"); } + p.restore_block_exit(((NodeExits)yyVals[-3+yyTop].value)); + p.setLexContext(((LexContext)yyVals[-4+yyTop].value)); /*%%%*/ yyVal = new PostExeNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value), p.src_line()); /*% %*/ - /*% ripper: END!($3) %*/ + /*% ripper: END!($4) %*/ return yyVal; }; -states[35] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[38] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = node_assign(((MultipleAsgnNode)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + p.value_expr(((Node)yyVals[0+yyTop].value)); + yyVal = node_assign(((MultipleAsgnNode)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: massign!($1, $4) %*/ return yyVal; }; -states[36] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[39] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: assign!($1, $4) %*/ return yyVal; }; -states[37] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[40] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = node_assign(((MultipleAsgnNode)yyVals[-5+yyTop].value), p.newRescueModNode(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value))); + p.getLexContext().in_rescue = ((LexContext)yyVals[-4+yyTop].value).in_rescue; + yyVal = node_assign(((MultipleAsgnNode)yyVals[-6+yyTop].value), p.newRescueModNode(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)), ((LexContext)yyVals[-4+yyTop].value)); /*% %*/ - /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/ + /*% ripper: massign!($1, rescue_mod!($4, $7)) %*/ return yyVal; }; -states[38] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[41] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = node_assign(((MultipleAsgnNode)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = node_assign(((MultipleAsgnNode)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: massign!($1, $4) %*/ return yyVal; }; -states[40] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[42] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + return yyVal; +}; +states[43] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.NEW_ERROR(yyVals[yyTop - count + 1]); + return yyVal; +}; +states[44] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: assign!($1, $4) %*/ return yyVal; }; -states[41] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[45] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_op_assign(((AssignableNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_op_assign(((AssignableNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: opassign!($1, $2, $4) %*/ return yyVal; }; -states[42] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[46] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_ary_op_assign(((Node)yyVals[-6+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_ary_op_assign(((Node)yyVals[-6+yyTop].value), ((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/ return yyVal; }; -states[43] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[47] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ return yyVal; }; -states[44] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[48] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ return yyVal; }; -states[45] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[49] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ int line = yyVals[yyTop - count + 1].start(); - yyVal = p.new_const_op_assign(line, p.new_colon2(line, ((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-3+yyTop].value)), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_const_op_assign(line, p.new_colon2(line, ((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-3+yyTop].value)), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/ return yyVal; }; -states[46] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[50] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ return yyVal; }; -states[47] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value)); +states[51] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value), yyVals[yyTop - count + 1]); p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); /*%%%*/ yyVal = new DefnNode(((DefHolder)yyVals[-3+yyTop].value).line, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), p.reduce_nodes(p.remove_begin(((Node)yyVals[0+yyTop].value))), yyVals[yyTop - count + 4].end()); @@ -2301,21 +2351,8 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.popCurrentScope(); return yyVal; }; -states[48] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-5+yyTop].value)); - p.restore_defun(((DefHolder)yyVals[-5+yyTop].value)); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)))); - yyVal = new DefnNode(((DefHolder)yyVals[-5+yyTop].value).line, ((DefHolder)yyVals[-5+yyTop].value).name, ((ArgsNode)yyVals[-4+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 6].end()); - /* Changed from MRI (cmobined two stmts)*/ - /*% %*/ - /*% ripper: def!(get_value($1), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - - p.popCurrentScope(); - return yyVal; -}; -states[49] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value)); +states[52] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value), yyVals[yyTop - count + 1]); p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); /*%%%*/ yyVal = new DefsNode(((DefHolder)yyVals[-3+yyTop].value).line, (Node) ((DefHolder)yyVals[-3+yyTop].value).singleton, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), p.reduce_nodes(p.remove_begin(((Node)yyVals[0+yyTop].value))), yyVals[yyTop - count + 4].end()); @@ -2324,111 +2361,85 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.popCurrentScope(); return yyVal; }; -states[50] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-5+yyTop].value)); - p.restore_defun(((DefHolder)yyVals[-5+yyTop].value)); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)))); - yyVal = new DefsNode(((DefHolder)yyVals[-5+yyTop].value).line, (Node) ((DefHolder)yyVals[-5+yyTop].value).singleton, ((DefHolder)yyVals[-5+yyTop].value).name, ((ArgsNode)yyVals[-4+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 6].end()); - /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); - return yyVal; -}; -states[51] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[53] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.backrefAssignError(((Node)yyVals[-3+yyTop].value)); + p.backref_error(((Node)yyVals[-3+yyTop].value)); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/ return yyVal; }; -states[52] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[55] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; + yyVal = p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + /*% ripper: rescue_mod!($:1, $:4) %*/ + return yyVal; +}; +states[56] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[0+yyTop].value)), NOT); + /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/ + return yyVal; +}; +states[57] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[53] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[58] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[-2+yyTop].value)); - yyVal = p.newRescueModNode(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; + p.value_expr(((Node)yyVals[-3+yyTop].value)); + yyVal = p.newRescueModNode(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ + /*% ripper: rescue_mod!($1, $4) %*/ return yyVal; }; -states[56] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[61] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.logop(((Node)yyVals[-2+yyTop].value), AND_KEYWORD, ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[57] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[62] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.logop(((Node)yyVals[-2+yyTop].value), OR_KEYWORD, ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[58] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[63] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[0+yyTop].value)), NOT); return yyVal; }; -states[59] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[64] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[0+yyTop].value)), BANG); return yyVal; }; -states[60] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[65] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[-1+yyTop].value)); - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - /* MRI 3.1 uses $2 but we want tASSOC typed?*/ - LexContext ctxt = p.getLexContext(); - yyVal = ctxt.in_kwarg; - ctxt.in_kwarg = true; - return yyVal; -}; -states[61] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pvtbl(); - return yyVal; -}; -states[62] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); return yyVal; }; -states[63] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.pop_pvtbl(((Set)yyVals[-1+yyTop].value)); +states[66] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pvtbl(((Set)yyVals[-2+yyTop].value)); + p.pop_pktbl(((Set)yyVals[-1+yyTop].value)); LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = ((Boolean)yyVals[-3+yyTop].value); + ctxt.in_kwarg = ((LexContext)yyVals[-3+yyTop].value).in_kwarg; /*%%%*/ - yyVal = p.newPatternCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-5+yyTop].value), p.newIn(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), null, null)); + yyVal = p.newPatternCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-6+yyTop].value), p.newIn(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), null, null)); /*% %*/ - /*% ripper: case!($1, in!($6, Qnil, Qnil)) %*/ + /*% ripper: case!($1, in!($7, Qnil, Qnil)) %*/ return yyVal; }; -states[64] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[67] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[-1+yyTop].value)); - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - LexContext ctxt = p.getLexContext(); - yyVal = ctxt.in_kwarg; - ctxt.in_kwarg = true; - return yyVal; -}; -states[65] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pvtbl(); - return yyVal; -}; -states[66] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); return yyVal; }; -states[67] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.pop_pvtbl(((Set)yyVals[-1+yyTop].value)); +states[68] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pvtbl(((Set)yyVals[-2+yyTop].value)); + p.pop_pktbl(((Set)yyVals[-1+yyTop].value)); LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = ((Boolean)yyVals[-3+yyTop].value); + ctxt.in_kwarg = ((LexContext)yyVals[-3+yyTop].value).in_kwarg; /*%%%*/ - yyVal = p.newPatternCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-5+yyTop].value), p.newIn(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), new TrueNode(yyVals[yyTop - count + 1].start()), new FalseNode(yyVals[yyTop - count + 1].start()))); + yyVal = p.newPatternCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-6+yyTop].value), p.newIn(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), new TrueNode(yyVals[yyTop - count + 1].start()), new FalseNode(yyVals[yyTop - count + 1].start()))); /*% %*/ - /*% ripper: case!($1, in!($6, Qnil, Qnil)) %*/ + /*% ripper: case!($1, in!($7, Qnil, Qnil)) %*/ return yyVal; }; -states[69] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[70] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pushLocalScope(); ByteList currentArg = p.getCurrentArg(); p.setCurrentArg(null); @@ -2443,21 +2454,22 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { $$ = new DefHolder(p.get_id(yyVals[yyTop - count + 1].id), currentArg, p.get_value($1), (LexContext) ctxt.clone()); %*/ ctxt.in_def = true; + ctxt.in_rescue = LexContext.InRescue.BEFORE_RESCUE; p.setCurrentArg(null); return yyVal; }; -states[70] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[71] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { ((DefHolder)yyVals[0+yyTop].value).line = yyVals[yyTop - count + 1].start(); yyVal = ((DefHolder)yyVals[0+yyTop].value); return yyVal; }; -states[71] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[72] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_FNAME); LexContext ctxt = p.getLexContext(); ctxt.in_argdef = true; return yyVal; }; -states[72] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[73] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_ENDFN|EXPR_LABEL); ((DefHolder)yyVals[0+yyTop].value).line = yyVals[yyTop - count + 1].start(); yyVal = ((DefHolder)yyVals[0+yyTop].value); @@ -2470,41 +2482,49 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[73] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[74] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[74] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[75] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.NEW_ERROR(yyVals[yyTop - count + 1]); + return yyVal; +}; +states[76] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getConditionState().push1(); return yyVal; }; -states[75] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[77] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getConditionState().pop(); - yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[79] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[78] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((Node)yyVals[-2+yyTop].value); + /*% ripper: get_value($:2); %*/ + return yyVal; +}; +states[82] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null, yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/ return yyVal; }; -states[80] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[83] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((IterNode)yyVals[-1+yyTop].value); /*%%%*/ /* FIXME: Missing loc stuff here.*/ /*% %*/ return yyVal; }; -states[81] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[84] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_fcall(((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: $1 %*/ return yyVal; }; -states[82] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[85] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.frobnicate_fcall_args(((FCallNode)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null); yyVal = ((FCallNode)yyVals[-1+yyTop].value); @@ -2512,7 +2532,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: command!($1, $2) %*/ return yyVal; }; -states[83] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[86] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.frobnicate_fcall_args(((FCallNode)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((IterNode)yyVals[0+yyTop].value)); yyVal = ((FCallNode)yyVals[-2+yyTop].value); @@ -2520,193 +2540,199 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: method_add_block!(command!($1, $2), $3) %*/ return yyVal; }; -states[84] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[87] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null, yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: command_call!($1, $2, $3, $4) %*/ return yyVal; }; -states[85] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[88] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((IterNode)yyVals[0+yyTop].value), yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/ return yyVal; }; -states[86] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[89] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/ return yyVal; }; -states[87] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[90] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((IterNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/ return yyVal; }; -states[88] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[91] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + /*set_embraced_location($5, &yyVals[yyTop - count + 4], &yyVals[yyTop - count + 6]);*/ + yyVal = p.new_call(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), null, ((IterNode)yyVals[-1+yyTop].value)); + /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, Qundef), $:5) %*/ + return yyVal; +}; +states[92] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_super(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: super!($2) %*/ return yyVal; }; -states[89] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[93] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_yield(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: yield!($2) %*/ return yyVal; }; -states[90] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[94] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ReturnNode(yyVals[yyTop - count + 1].start(), p.ret_args(((Node)yyVals[0+yyTop].value), yyVals[yyTop - count + 1].start())); /*% %*/ /*% ripper: return!($2) %*/ return yyVal; }; -states[91] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[95] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new BreakNode(yyVals[yyTop - count + 1].start(), p.ret_args(((Node)yyVals[0+yyTop].value), yyVals[yyTop - count + 1].start())); /*% %*/ /*% ripper: break!($2) %*/ return yyVal; }; -states[92] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[96] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new NextNode(yyVals[yyTop - count + 1].start(), p.ret_args(((Node)yyVals[0+yyTop].value), yyVals[yyTop - count + 1].start())); /*% %*/ /*% ripper: next!($2) %*/ return yyVal; }; -states[94] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[98] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ return yyVal; }; -states[95] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[99] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((MultipleAsgnNode)yyVals[0+yyTop].value); return yyVal; }; -states[96] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[100] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(((Integer)yyVals[-2+yyTop].value), p.newArrayNode(((Integer)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value)), null, null); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ return yyVal; }; -states[97] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[101] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[0+yyTop].value), null, null); /*% %*/ /*% ripper: $1 %*/ return yyVal; }; -states[98] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[102] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value).add(((Node)yyVals[0+yyTop].value)), null, null); /*% %*/ /*% ripper: mlhs_add!($1, $2) %*/ return yyVal; }; -states[99] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[103] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), (ListNode) null); /*% %*/ /*% ripper: mlhs_add_star!($1, $3) %*/ return yyVal; }; -states[100] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[104] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-4+yyTop].value), ((Node)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/ return yyVal; }; -states[101] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[105] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), new StarNode(p.src_line()), null); /*% %*/ /*% ripper: mlhs_add_star!($1, Qnil) %*/ return yyVal; }; -states[102] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[106] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), new StarNode(p.src_line()), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/ return yyVal; }; -states[103] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[107] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 2].start(), null, ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/ return yyVal; }; -states[104] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[108] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 2].start(), null, ((Node)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/ return yyVal; }; -states[105] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[109] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(p.src_line(), null, new StarNode(p.src_line()), null); /*% %*/ /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/ return yyVal; }; -states[106] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[110] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(p.src_line(), null, new StarNode(p.src_line()), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/ return yyVal; }; -states[108] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[112] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ return yyVal; }; -states[109] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[113] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!(mlhs_new!, $1) %*/ return yyVal; }; -states[110] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[114] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!($1, $2) %*/ return yyVal; }; -states[111] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[115] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!(mlhs_new!, $1) %*/ return yyVal; }; -states[112] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[116] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!($1, $3) %*/ return yyVal; }; -states[113] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[117] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.assignableLabelOrIdentifier(((ByteList)yyVals[0+yyTop].value), null); /*% @@ -2714,7 +2740,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[114] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[118] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new InstAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2722,7 +2748,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[115] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[119] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new GlobalAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2730,7 +2756,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[116] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[120] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (p.getLexContext().in_def) p.compile_error("dynamic constant assignment"); yyVal = new ConstDeclNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), null, NilImplicitNode.NIL); @@ -2739,7 +2765,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[117] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[121] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ClassVarAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2747,7 +2773,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[118] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[122] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to nil"); yyVal = null; @@ -2756,7 +2782,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[119] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[123] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't change the value of self"); yyVal = null; @@ -2765,7 +2791,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[120] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[124] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to true"); yyVal = null; @@ -2774,7 +2800,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[121] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[125] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to false"); yyVal = null; @@ -2783,7 +2809,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[122] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[126] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __FILE__"); yyVal = null; @@ -2792,7 +2818,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[123] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[127] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __LINE__"); yyVal = null; @@ -2801,7 +2827,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[124] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[128] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __ENCODING__"); yyVal = null; @@ -2810,14 +2836,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[125] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[129] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.aryset(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: aref_field!($1, escape_Qundef($3)) %*/ return yyVal; }; -states[126] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[130] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (((ByteList)yyVals[-1+yyTop].value) == AMPERSAND_DOT) { p.compile_error("&. inside multiple assignment destination"); } @@ -2827,14 +2853,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: field!($1, $2, $3) %*/ return yyVal; }; -states[127] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[131] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.attrset(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: const_path_field!($1, $3) %*/ return yyVal; }; -states[128] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[132] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (((ByteList)yyVals[-1+yyTop].value) == AMPERSAND_DOT) { p.compile_error("&. inside multiple assignment destination"); } @@ -2844,7 +2870,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: field!($1, $2, $3) %*/ return yyVal; }; -states[129] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[133] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (p.getLexContext().in_def) p.yyerror("dynamic constant assignment"); @@ -2855,7 +2881,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/ return yyVal; }; -states[130] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[134] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (p.getLexContext().in_def) { p.yyerror("dynamic constant assignment"); @@ -2868,14 +2894,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: const_decl(p, top_const_field!($2)) %*/ return yyVal; }; -states[131] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[135] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.backrefAssignError(((Node)yyVals[0+yyTop].value)); + p.backref_error(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/ return yyVal; }; -states[132] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[136] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.assignableLabelOrIdentifier(((ByteList)yyVals[0+yyTop].value), null); /*% @@ -2884,7 +2910,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; -states[133] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[137] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new InstAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2892,7 +2918,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[134] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[138] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new GlobalAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2900,7 +2926,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[135] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[139] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (p.getLexContext().in_def) p.compile_error("dynamic constant assignment"); @@ -2910,7 +2936,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[136] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[140] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ClassVarAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -2918,7 +2944,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[137] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[141] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to nil"); yyVal = null; @@ -2927,7 +2953,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[138] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[142] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't change the value of self"); yyVal = null; @@ -2936,7 +2962,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[139] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[143] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to true"); yyVal = null; @@ -2945,7 +2971,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[140] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[144] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to false"); yyVal = null; @@ -2954,7 +2980,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[141] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[145] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __FILE__"); yyVal = null; @@ -2963,7 +2989,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[142] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[146] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __LINE__"); yyVal = null; @@ -2972,7 +2998,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[143] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[147] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __ENCODING__"); yyVal = null; @@ -2981,68 +3007,56 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[144] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[148] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.aryset(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: aref_field!($1, escape_Qundef($3)) %*/ return yyVal; }; -states[145] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[149] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.attrset(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: field!($1, $2, $3) %*/ return yyVal; }; -states[146] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[150] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.attrset(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/ return yyVal; }; -states[147] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[151] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.attrset(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: field!($1, $2, $3) %*/ return yyVal; }; -states[148] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[152] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - if (p.getLexContext().in_def) { - p.yyerror("dynamic constant assignment"); - } - - Integer position = yyVals[yyTop - count + 1].start(); - - yyVal = new ConstDeclNode(position, (RubySymbol) null, p.new_colon2(position, ((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); + yyVal = new ConstDeclNode(yyVals[yyTop - count + 1].start(), (RubySymbol) null, p.new_colon2(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% %*/ /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/ return yyVal; }; -states[149] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[153] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - if (p.getLexContext().in_def) { - p.yyerror("dynamic constant assignment"); - } - - Integer position = yyVals[yyTop - count + 1].start(); - - yyVal = new ConstDeclNode(position, (RubySymbol) null, p.new_colon3(position, ((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); + yyVal = new ConstDeclNode(yyVals[yyTop - count + 1].start(), (RubySymbol) null, p.new_colon3(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% %*/ /*% ripper: const_decl(p, top_const_field!($2)) %*/ return yyVal; }; -states[150] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[154] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.backrefAssignError(((Node)yyVals[0+yyTop].value)); + p.backref_error(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/ return yyVal; }; -states[151] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[155] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "class/module name must be CONSTANT"; /*%%%*/ p.yyerror(message, yyVals[yyTop - count + 1]); @@ -3050,53 +3064,53 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/ return yyVal; }; -states[152] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[156] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[153] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[157] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon3(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: top_const_ref!($2) %*/ return yyVal; }; -states[154] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[158] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon2(yyVals[yyTop - count + 1].start(), null, ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: const_ref!($1) %*/ return yyVal; }; -states[155] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[159] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon2(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: const_path_ref!($1, $3) %*/ return yyVal; }; -states[156] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[160] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[157] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[161] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[158] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[162] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[159] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[163] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_ENDFN); yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[160] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[164] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[161] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[165] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new LiteralNode(p.src_line(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ @@ -3104,44 +3118,28 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; -states[162] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[166] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[163] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[167] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = newUndef(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[164] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[168] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_FNAME|EXPR_FITEM); return yyVal; }; -states[165] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[169] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.appendToBlock(((Node)yyVals[-3+yyTop].value), newUndef(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value))); /*% %*/ /*% ripper: rb_ary_push($1, get_value($4)) %*/ return yyVal; }; -states[166] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[167] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[168] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[169] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; states[170] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; @@ -3247,19 +3245,19 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; states[196] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; states[197] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; states[198] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; states[199] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; states[200] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { @@ -3327,7 +3325,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; states[216] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = yyVals[0+yyTop].value; + yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; states[217] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { @@ -3343,7 +3341,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; states[220] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + yyVal = yyVals[0+yyTop].value; return yyVal; }; states[221] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { @@ -3411,75 +3409,89 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; states[237] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[238] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[239] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[240] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[241] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = node_assign(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: assign!($1, $4) %*/ return yyVal; }; -states[238] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[242] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = p.new_op_assign(((AssignableNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_op_assign(((AssignableNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: opassign!($1, $2, $4) %*/ return yyVal; }; -states[239] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[243] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_ary_op_assign(((Node)yyVals[-6+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_ary_op_assign(((Node)yyVals[-6+yyTop].value), ((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/ return yyVal; }; -states[240] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[244] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ return yyVal; }; -states[241] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[245] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ return yyVal; }; -states[242] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[246] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((Node)yyVals[0+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value)); + yyVal = p.new_attr_op_assign(((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ return yyVal; }; -states[243] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[247] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Integer pos = yyVals[yyTop - count + 1].start(); - yyVal = p.new_const_op_assign(pos, p.new_colon2(pos, ((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-3+yyTop].value)), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_const_op_assign(pos, p.new_colon2(pos, ((Node)yyVals[-5+yyTop].value), ((ByteList)yyVals[-3+yyTop].value)), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/ return yyVal; }; -states[244] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[248] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Integer pos = p.src_line(); - yyVal = p.new_const_op_assign(pos, new Colon3Node(pos, p.symbolID(((ByteList)yyVals[-3+yyTop].value))), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = p.new_const_op_assign(pos, new Colon3Node(pos, p.symbolID(((ByteList)yyVals[-3+yyTop].value))), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), ((LexContext)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/ return yyVal; }; -states[245] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[249] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - p.backrefAssignError(((Node)yyVals[-3+yyTop].value)); + p.backref_error(((Node)yyVals[-3+yyTop].value)); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/ return yyVal; }; -states[246] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[250] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-2+yyTop].value)); p.value_expr(((Node)yyVals[0+yyTop].value)); @@ -3490,7 +3502,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!($1, $3) %*/ return yyVal; }; -states[247] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[251] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-2+yyTop].value)); p.value_expr(((Node)yyVals[0+yyTop].value)); @@ -3501,7 +3513,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!($1, $3) %*/ return yyVal; }; -states[248] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[252] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-1+yyTop].value)); @@ -3511,7 +3523,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!($1, Qnil) %*/ return yyVal; }; -states[249] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[253] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-1+yyTop].value)); @@ -3521,7 +3533,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!($1, Qnil) %*/ return yyVal; }; -states[250] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[254] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); boolean isLiteral = ((Node)yyVals[0+yyTop].value) instanceof FixnumNode; @@ -3530,7 +3542,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!(Qnil, $2) %*/ return yyVal; }; -states[251] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[255] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); boolean isLiteral = ((Node)yyVals[0+yyTop].value) instanceof FixnumNode; @@ -3539,116 +3551,112 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!(Qnil, $2) %*/ return yyVal; }; -states[252] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[256] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), PLUS, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[253] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[257] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), MINUS, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[254] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[258] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), STAR, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[255] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[259] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), SLASH, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[256] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[260] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), PERCENT, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[257] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[261] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), STAR_STAR, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[258] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[262] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.call_bin_op(((NumericNode)yyVals[-2+yyTop].value), STAR_STAR, ((Node)yyVals[0+yyTop].value), p.src_line()), MINUS_AT); return yyVal; }; -states[259] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[263] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(((Node)yyVals[0+yyTop].value), PLUS_AT); return yyVal; }; -states[260] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[264] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(((Node)yyVals[0+yyTop].value), MINUS_AT); return yyVal; }; -states[261] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[265] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), OR, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[262] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[266] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), CARET, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[263] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[267] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), AMPERSAND, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[264] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[268] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), LT_EQ_RT, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[265] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[269] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[266] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[270] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), EQ_EQ, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[267] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[271] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), EQ_EQ_EQ, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[268] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[272] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), BANG_EQ, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[269] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[273] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.match_op(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[270] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[274] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), BANG_TILDE, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[271] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[275] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[0+yyTop].value)), BANG); return yyVal; }; -states[272] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[276] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(((Node)yyVals[0+yyTop].value), TILDE); return yyVal; }; -states[273] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[277] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), LT_LT, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[274] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[278] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), GT_GT, ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[275] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[279] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.logop(((Node)yyVals[-2+yyTop].value), AMPERSAND_AMPERSAND, ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[276] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[280] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.logop(((Node)yyVals[-2+yyTop].value), OR_OR, ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[277] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.getLexContext().in_defined = true; - return yyVal; -}; -states[278] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[281] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_defined = false; yyVal = p.new_defined(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[279] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[282] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-5+yyTop].value)); yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-5+yyTop].value), ((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); @@ -3656,8 +3664,8 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: ifop!($1, $3, $6) %*/ return yyVal; }; -states[280] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value)); +states[283] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value), yyVals[yyTop - count + 1]); p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); /*%%%*/ yyVal = new DefnNode(((DefHolder)yyVals[-3+yyTop].value).line, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), p.reduce_nodes(p.remove_begin(((Node)yyVals[0+yyTop].value))), yyVals[yyTop - count + 4].end()); @@ -3668,21 +3676,8 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.popCurrentScope(); return yyVal; }; -states[281] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-5+yyTop].value)); - p.restore_defun(((DefHolder)yyVals[-5+yyTop].value)); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)))); - yyVal = new DefnNode(((DefHolder)yyVals[-5+yyTop].value).line, ((DefHolder)yyVals[-5+yyTop].value).name, ((ArgsNode)yyVals[-4+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 6].end()); - if (p.isNextBreak) ((DefnNode)yyVal).setContainsNextBreak(); - /* Changed from MRI (combined two stmts)*/ - /*% %*/ - /*% ripper: def!(get_value($1), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); - return yyVal; -}; -states[282] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value)); +states[284] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.endless_method_name(((DefHolder)yyVals[-3+yyTop].value), yyVals[yyTop - count + 1]); p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); /*%%%*/ yyVal = new DefsNode(((DefHolder)yyVals[-3+yyTop].value).line, (Node) ((DefHolder)yyVals[-3+yyTop].value).singleton, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), p.reduce_nodes(p.remove_begin(((Node)yyVals[0+yyTop].value))), yyVals[yyTop - count + 4].end()); @@ -3692,99 +3687,105 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.popCurrentScope(); return yyVal; }; -states[283] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.endless_method_name(((DefHolder)yyVals[-5+yyTop].value)); - p.restore_defun(((DefHolder)yyVals[-5+yyTop].value)); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)))); - yyVal = new DefsNode(((DefHolder)yyVals[-5+yyTop].value).line, (Node) ((DefHolder)yyVals[-5+yyTop].value).singleton, ((DefHolder)yyVals[-5+yyTop].value).name, ((ArgsNode)yyVals[-4+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 6].end()); - if (p.isNextBreak) ((DefsNode)yyVal).setContainsNextBreak(); - /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); +states[285] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[284] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((Node)yyVals[0+yyTop].value); +states[287] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; + yyVal = p.rescued_expr(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + /*% ripper: rescue_mod!($:1, $:4) %*/ return yyVal; }; -states[285] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[288] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[0+yyTop].value)), NOT); + /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/ + return yyVal; +}; +states[289] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = GT; return yyVal; }; -states[286] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[290] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = LT; return yyVal; }; -states[287] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[291] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = GT_EQ; return yyVal; }; -states[288] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[292] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = LT_EQ; return yyVal; }; -states[289] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[293] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[290] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[294] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.warning(p.src_line(), "comparison '" + ((ByteList)yyVals[-1+yyTop].value) + "' after comparison"); yyVal = p.call_bin_op(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), p.src_line()); return yyVal; }; -states[291] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[295] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = (LexContext) p.getLexContext().clone(); return yyVal; }; -states[292] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = (LexContext) p.getLexContext().clone(); +states[296] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_defined = true; + yyVal = ((LexContext)yyVals[0+yyTop].value); return yyVal; }; -states[293] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[297] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_rescue = LexContext.InRescue.AFTER_RESCUE; + yyVal = ((LexContext)yyVals[0+yyTop].value); + return yyVal; +}; +states[298] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); yyVal = p.makeNullNil(((Node)yyVals[0+yyTop].value)); return yyVal; }; -states[295] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[300] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[296] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[301] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.arg_append(((Node)yyVals[-3+yyTop].value), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/ return yyVal; }; -states[297] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[302] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/ return yyVal; }; -states[298] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[303] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[299] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[304] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; /*%%%*/ - p.value_expr(((Node)yyVals[-2+yyTop].value)); - yyVal = p.newRescueModNode(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); + p.value_expr(((Node)yyVals[-3+yyTop].value)); + yyVal = p.newRescueModNode(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ + /*% ripper: rescue_mod!($1, $4) %*/ return yyVal; }; -states[300] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[305] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: arg_paren!(escape_Qundef($2)) %*/ return yyVal; }; -states[301] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[306] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (!p.check_forwarding_args()) { yyVal = null; } else { @@ -3795,7 +3796,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { } return yyVal; }; -states[302] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[307] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (!p.check_forwarding_args()) { yyVal = null; } else { @@ -3806,25 +3807,25 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { } return yyVal; }; -states[307] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[312] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[308] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[313] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.arg_append(((Node)yyVals[-3+yyTop].value), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/ return yyVal; }; -states[309] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[314] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/ return yyVal; }; -states[310] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[315] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); @@ -3832,14 +3833,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add!(args_new!, $1) %*/ return yyVal; }; -states[311] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[316] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = arg_blk_pass(((Node)yyVals[-1+yyTop].value), ((BlockPassNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: args_add_block!($1, $2) %*/ return yyVal; }; -states[312] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[317] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); yyVal = arg_blk_pass(((Node)yyVal), ((BlockPassNode)yyVals[0+yyTop].value)); @@ -3847,7 +3848,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/ return yyVal; }; -states[313] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[318] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.arg_append(((Node)yyVals[-3+yyTop].value), p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value))); yyVal = arg_blk_pass(((Node)yyVal), ((BlockPassNode)yyVals[0+yyTop].value)); @@ -3855,11 +3856,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/ return yyVal; }; -states[314] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[319] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*% ripper[brace]: args_add_block!(args_new!, $1) %*/ return yyVal; }; -states[315] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[320] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { boolean lookahead = false; switch (yychar) { case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK: @@ -3871,7 +3872,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { if (lookahead) cmdarg.push0(); return yyVal; }; -states[316] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[321] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { StackState cmdarg = p.getCmdArgumentState(); boolean lookahead = false; switch (yychar) { @@ -3885,14 +3886,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[317] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[322] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new BlockPassNode(yyVals[yyTop - count + 2].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: $2 %*/ return yyVal; }; -states[318] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[323] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (!p.local_id(ANON_BLOCK)) p.compile_error("no anonymous block parameter"); yyVal = new BlockPassNode(yyVals[yyTop - count + 1].start(), p.arg_var(ANON_BLOCK)); @@ -3902,11 +3903,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[319] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[324] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((BlockPassNode)yyVals[0+yyTop].value); return yyVal; }; -states[320] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[325] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = null; /* Changed from MRI*/ @@ -3915,7 +3916,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[321] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[326] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ int line = ((Node)yyVals[0+yyTop].value) instanceof NilImplicitNode ? p.src_line() : yyVals[yyTop - count + 1].start(); yyVal = p.newArrayNode(line, ((Node)yyVals[0+yyTop].value)); @@ -3923,14 +3924,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add!(args_new!, $1) %*/ return yyVal; }; -states[322] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[327] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newSplatNode(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: args_add_star!(args_new!, $2) %*/ return yyVal; }; -states[323] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[328] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node node = p.splat_array(((Node)yyVals[-2+yyTop].value)); @@ -3943,30 +3944,41 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add!($1, $3) %*/ return yyVal; }; -states[324] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[329] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node node = null; /* FIXME: lose syntactical elements here (and others like this)*/ if (((Node)yyVals[0+yyTop].value) instanceof ArrayNode && - (node = p.splat_array(((Node)yyVals[-3+yyTop].value))) != null) { + (node = p.splat_array(((Node)yyVals[-2+yyTop].value))) != null) { yyVal = p.list_concat(node, ((Node)yyVals[0+yyTop].value)); } else { - yyVal = arg_concat(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); + yyVal = arg_concat(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); } /*% %*/ - /*% ripper: args_add_star!($1, $4) %*/ + /*% ripper: args_add_star!($1, $3) %*/ return yyVal; }; -states[325] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[330] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); + /*% ripper: get_value($2); %*/ return yyVal; }; -states[326] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[331] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.forwarding_arg_check(FWD_REST, FWD_ALL, "rest"); + yyVal = p.declareIdentifier(FWD_REST); + /*% ripper: Qnil %*/ + return yyVal; +}; +states[332] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[327] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[333] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((Node)yyVals[0+yyTop].value); + return yyVal; +}; +states[334] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node node = p.splat_array(((Node)yyVals[-2+yyTop].value)); @@ -3980,7 +3992,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/ return yyVal; }; -states[328] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[335] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node node = null; @@ -3994,41 +4006,41 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/ return yyVal; }; -states[329] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[336] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newSplatNode(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/ return yyVal; }; -states[334] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[341] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); /* FIXME: Why complaining without $$ = $1;*/ return yyVal; }; -states[335] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[342] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); /* FIXME: Why complaining without $$ = $1;*/ return yyVal; }; -states[336] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[343] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); /* FIXME: Why complaining without $$ = $1;*/ return yyVal; }; -states[337] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[344] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); /* FIXME: Why complaining without $$ = $1;*/ return yyVal; }; -states[340] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[347] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_fcall(((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/ return yyVal; }; -states[341] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[348] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getCmdArgumentState().push0(); return yyVal; }; -states[342] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[349] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getCmdArgumentState().pop(); /*%%%*/ yyVal = new BeginNode(yyVals[yyTop - count + 1].start(), p.makeNullNil(((Node)yyVals[-1+yyTop].value))); @@ -4036,29 +4048,18 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: begin!($3) %*/ return yyVal; }; -states[343] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.setState(EXPR_ENDARG); - return yyVal; -}; -states[344] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - /*%%%*/ - yyVal = null; /*FIXME: Should be implicit nil?*/ - /*% %*/ - /*% ripper: paren!(0) %*/ - return yyVal; -}; -states[345] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[350] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_ENDARG); return yyVal; }; -states[346] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[351] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-2+yyTop].value); /*% %*/ /*% ripper: paren!($2) %*/ return yyVal; }; -states[347] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[352] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-1+yyTop].value) != null) { /* compstmt position includes both parens around it*/ @@ -4071,21 +4072,21 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: paren!($2) %*/ return yyVal; }; -states[348] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[353] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon2(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: const_path_ref!($1, $3) %*/ return yyVal; }; -states[349] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[354] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon3(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: top_const_ref!($2) %*/ return yyVal; }; -states[350] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[355] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Integer position = yyVals[yyTop - count + 2].start(); if (((Node)yyVals[-1+yyTop].value) == null) { @@ -4097,7 +4098,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: array!(escape_Qundef($2)) %*/ return yyVal; }; -states[351] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[356] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((HashNode)yyVals[-1+yyTop].value); ((HashNode)yyVal).setIsLiteral(); @@ -4105,52 +4106,48 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: hash!(escape_Qundef($2)) %*/ return yyVal; }; -states[352] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[357] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ReturnNode(yyVals[yyTop - count + 1].start(), NilImplicitNode.NIL); /*% %*/ /*% ripper: return0! %*/ return yyVal; }; -states[353] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[358] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_yield(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: yield!(paren!($3)) %*/ return yyVal; }; -states[354] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[359] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new YieldNode(yyVals[yyTop - count + 1].start(), null); /*% %*/ /*% ripper: yield!(paren!(args_new!)) %*/ return yyVal; }; -states[355] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[360] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new YieldNode(yyVals[yyTop - count + 1].start(), null); /*% %*/ /*% ripper: yield0! %*/ return yyVal; }; -states[356] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.getLexContext().in_defined = true; - return yyVal; -}; -states[357] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[361] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_defined = false; yyVal = p.new_defined(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value)); return yyVal; }; -states[358] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[362] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.method_cond(((Node)yyVals[-1+yyTop].value)), NOT); return yyVal; }; -states[359] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[363] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.call_uni_op(p.method_cond(p.nil()), NOT); return yyVal; }; -states[360] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[364] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.frobnicate_fcall_args(((FCallNode)yyVals[-1+yyTop].value), null, ((IterNode)yyVals[0+yyTop].value)); yyVal = ((FCallNode)yyVals[-1+yyTop].value); @@ -4158,7 +4155,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/ return yyVal; }; -states[362] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[366] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-1+yyTop].value) != null && ((BlockAcceptingNode)yyVals[-1+yyTop].value).getIterNode() instanceof BlockPassNode) { @@ -4170,44 +4167,44 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: method_add_block!($1, $2) %*/ return yyVal; }; -states[363] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[367] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((LambdaNode)yyVals[0+yyTop].value); return yyVal; }; -states[364] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[368] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: if!($2, $4, escape_Qundef($5)) %*/ return yyVal; }; -states[365] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[369] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[-2+yyTop].value)); /*% %*/ /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/ return yyVal; }; -states[366] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[370] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new WhileNode(yyVals[yyTop - count + 1].start(), p.cond(((Node)yyVals[-2+yyTop].value)), p.makeNullNil(((Node)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: while!($2, $3) %*/ return yyVal; }; -states[367] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[371] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new UntilNode(yyVals[yyTop - count + 1].start(), p.cond(((Node)yyVals[-2+yyTop].value)), p.makeNullNil(((Node)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: until!($2, $3) %*/ return yyVal; }; -states[368] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[372] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.case_labels; p.case_labels = p.getRuntime().getNil(); return yyVal; }; -states[369] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[373] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[-1+yyTop].value)); p.fixpos(((Node)yyVal), ((Node)yyVals[-4+yyTop].value)); @@ -4215,42 +4212,37 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: case!($2, $5) %*/ return yyVal; }; -states[370] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[374] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.case_labels; p.case_labels = null; return yyVal; }; -states[371] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[375] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newCaseNode(yyVals[yyTop - count + 1].start(), null, ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: case!(Qnil, $4) %*/ return yyVal; }; -states[372] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[376] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newPatternCaseNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), ((InNode)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: case!($2, $4) %*/ return yyVal; }; -states[373] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[377] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ForNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[-2+yyTop].value), p.getCurrentScope(), 111); /*% %*/ /*% ripper: for!($2, $4, $5) %*/ return yyVal; }; -states[374] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - LexContext ctxt = p.getLexContext(); - if (ctxt.in_def) { - p.yyerror("class definition in method body"); - } - ctxt.in_class = true; - p.pushLocalScope(); +states[378] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.begin_definition("class"); return yyVal; }; -states[375] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[379] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node body = p.makeNullNil(((Node)yyVals[-1+yyTop].value)); @@ -4263,14 +4255,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { ctxt.shareable_constant_value = ((LexContext)yyVals[-5+yyTop].value).shareable_constant_value; return yyVal; }; -states[376] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - LexContext ctxt = p.getLexContext(); - ctxt.in_def = false; - ctxt.in_class = false; - p.pushLocalScope(); +states[380] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.begin_definition(null); return yyVal; }; -states[377] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[381] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node body = p.makeNullNil(((Node)yyVals[-1+yyTop].value)); @@ -4284,16 +4273,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.popCurrentScope(); return yyVal; }; -states[378] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - LexContext ctxt = p.getLexContext(); - if (ctxt.in_def) { - p.yyerror("module definition in method body"); - } - ctxt.in_class = true; - p.pushLocalScope(); +states[382] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.begin_definition("module"); return yyVal; }; -states[379] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[383] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node body = p.makeNullNil(((Node)yyVals[-1+yyTop].value)); @@ -4306,30 +4290,38 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { ctxt.shareable_constant_value = ((LexContext)yyVals[-4+yyTop].value).shareable_constant_value; return yyVal; }; -states[380] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); +states[384] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.push_end_expect_token_locations(yyVals[yyTop - count + 1].start()); + return yyVal; +}; +states[385] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.restore_defun(((DefHolder)yyVals[-4+yyTop].value)); /*%%%*/ Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil(((Node)yyVals[-1+yyTop].value)))); - yyVal = new DefnNode(((DefHolder)yyVals[-3+yyTop].value).line, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 4].end()); + yyVal = new DefnNode(((DefHolder)yyVals[-4+yyTop].value).line, ((DefHolder)yyVals[-4+yyTop].value).name, ((ArgsNode)yyVals[-3+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 4].end()); if (p.isNextBreak) ((DefnNode)yyVal).setContainsNextBreak(); /*% %*/ - /*% ripper: def!(get_value($1), $2, $3) %*/ + /*% ripper: def!(get_value($1), $2, $4) %*/ p.popCurrentScope(); return yyVal; }; -states[381] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.restore_defun(((DefHolder)yyVals[-3+yyTop].value)); +states[386] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.push_end_expect_token_locations(yyVals[yyTop - count + 1].start()); + return yyVal; +}; +states[387] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.restore_defun(((DefHolder)yyVals[-4+yyTop].value)); /*%%%*/ Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil(((Node)yyVals[-1+yyTop].value)))); - yyVal = new DefsNode(((DefHolder)yyVals[-3+yyTop].value).line, (Node) ((DefHolder)yyVals[-3+yyTop].value).singleton, ((DefHolder)yyVals[-3+yyTop].value).name, ((ArgsNode)yyVals[-2+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 4].end()); + yyVal = new DefsNode(((DefHolder)yyVals[-4+yyTop].value).line, (Node) ((DefHolder)yyVals[-4+yyTop].value).singleton, ((DefHolder)yyVals[-4+yyTop].value).name, ((ArgsNode)yyVals[-3+yyTop].value), p.getCurrentScope(), body, yyVals[yyTop - count + 4].end()); if (p.isNextBreak) ((DefsNode)yyVal).setContainsNextBreak(); /* Changed from MRI (no more get_value)*/ /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $3) %*/ + /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/ p.popCurrentScope(); return yyVal; }; -states[382] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[388] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.isNextBreak = true; yyVal = new BreakNode(yyVals[yyTop - count + 1].start(), NilImplicitNode.NIL); @@ -4337,7 +4329,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: break!(args_new!) %*/ return yyVal; }; -states[383] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[389] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.isNextBreak = true; yyVal = new NextNode(yyVals[yyTop - count + 1].start(), NilImplicitNode.NIL); @@ -4345,125 +4337,159 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: next!(args_new!) %*/ return yyVal; }; -states[384] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[390] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new RedoNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: redo! %*/ return yyVal; }; -states[385] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[391] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ + if (!p.getLexContext().in_defined) { + LexContext.InRescue rescue = p.getLexContext().in_rescue; + if (rescue != LexContext.InRescue.NONE) { + switch (rescue) { + case BEFORE_RESCUE: p.yyerror("Invalid retry without rescue"); break; + case AFTER_RESCUE: /* ok */ break; + case AFTER_ELSE: p.yyerror("Invalid retry after else"); break; + case AFTER_ENSURE: p.yyerror("Invalid retry after ensure"); break; + } + } + } yyVal = new RetryNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: retry! %*/ return yyVal; }; -states[386] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[392] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); - yyVal = ((Node)yyVals[0+yyTop].value); - if (yyVal == null) yyVal = p.nil(); + yyVal = ((Node)yyVals[0+yyTop].value) == null ? p.nil() : ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[387] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[393] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.token_info_push("begin", yyVals[yyTop - count + 1]); + p.push_end_expect_token_locations(yyVals[yyTop - count + 1].start()); yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[388] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[394] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); + p.WARN_EOL("if"); + p.token_info_push("if", yyVals[yyTop - count + 1]); + /* + TokenInfo tokenInfo = p.getTokenInfo(); + if (tokenInfo.nonspc && + tokenInfo.next != null && tokenInfo.next.name.equals("else")) { + throw new RuntimeException("IMPL ME"); + }*/ return yyVal; }; -states[389] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[395] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[390] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); +states[396] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((NodeExits)yyVals[0+yyTop].value); return yyVal; }; -states[391] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); +states[397] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[-1+yyTop].value); return yyVal; }; -states[392] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[398] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[393] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); +states[399] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((NodeExits)yyVals[0+yyTop].value); return yyVal; }; -states[394] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[400] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = (LexContext) p.getLexContext().clone(); + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; + p.push_end_expect_token_locations(yyVals[yyTop - count + 1].start()); return yyVal; }; -states[395] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[401] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = (LexContext) p.getLexContext().clone(); + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; return yyVal; }; -states[396] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[402] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); p.getLexContext().in_argdef = true; return yyVal; }; -states[397] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[403] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[398] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[404] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[399] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); +states[405] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.getLexContext().clone(); + p.getLexContext().in_rescue = LexContext.InRescue.AFTER_RESCUE; return yyVal; }; -states[400] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); +states[406] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.getLexContext().clone(); return yyVal; }; -states[401] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[407] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[402] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[408] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[403] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[409] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[404] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[410] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[405] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[411] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.compile_error("syntax error, unexpected end-of-input"); + return yyVal; +}; +states[412] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { LexContext ctxt = p.getLexContext(); if (ctxt.in_class && !ctxt.in_def && !p.getCurrentScope().isBlockScope()) { p.compile_error("Invalid return in class/module body"); } - yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[412] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[413] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + LexContext ctxt = p.getLexContext(); + if (ctxt.in_defined && !ctxt.in_def && !p.isEval()) { + p.compile_error("Invalid yield"); + } + return yyVal; +}; +states[420] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/ return yyVal; }; -states[414] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[422] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[0+yyTop].value) == null ? NilImplicitNode.NIL : ((Node)yyVals[0+yyTop].value); /*% %*/ /*% ripper: else!($2) %*/ return yyVal; }; -states[416] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[424] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { return yyVal; }; -states[417] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[425] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.assignableInCurr(((ByteList)yyVals[0+yyTop].value), NilImplicitNode.NIL); /*% @@ -4471,63 +4497,63 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[418] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[426] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ return yyVal; }; -states[419] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[427] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!(mlhs_new!, $1) %*/ return yyVal; }; -states[420] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[428] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add!($1, $3) %*/ return yyVal; }; -states[421] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[429] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[0+yyTop].value), null, null); /*% %*/ /*% ripper: $1 %*/ return yyVal; }; -states[422] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[430] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: mlhs_add_star!($1, $3) %*/ return yyVal; }; -states[423] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[431] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-4+yyTop].value), ((Node)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/ return yyVal; }; -states[424] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[432] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(p.src_line(), null, ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/ return yyVal; }; -states[425] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[433] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new MultipleAsgnNode(p.src_line(), null, ((Node)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/ return yyVal; }; -states[426] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[434] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { ByteList id = yyVals[yyTop - count + 2].id; /*%%%*/ yyVal = p.assignableInCurr(id, null); @@ -4536,14 +4562,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[427] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[435] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new StarNode(p.src_line()); /*% %*/ /*% ripper: Qnil %*/ return yyVal; }; -states[429] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[437] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ByteList)yyVals[0+yyTop].value); /*% @@ -4551,102 +4577,102 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[430] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[438] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = false; return yyVal; }; -states[432] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[440] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[433] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[441] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), (ByteList) null, ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[434] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[442] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(p.src_line(), null, ((ByteList)yyVals[-1+yyTop].value), ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[435] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[443] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), null, (ByteList) null, ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[436] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[444] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ArgsTailHolder)yyVals[0+yyTop].value); return yyVal; }; -states[437] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[445] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null); return yyVal; }; -states[438] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[446] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new UnnamedRestArgNode(yyVals[yyTop - count + 1].start(), null, p.getCurrentScope().addVariable("*")); /*% %*/ /*% ripper: excessed_comma! %*/ return yyVal; }; -states[439] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[447] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), ((ListNode)yyVals[-3+yyTop].value), ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[440] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[448] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-7+yyTop].value), ((ListNode)yyVals[-5+yyTop].value), ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[441] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[449] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[442] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[450] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), ((ListNode)yyVals[-3+yyTop].value), null, ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[443] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[451] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), null, ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[444] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[452] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), null, ((RestArgNode)yyVals[0+yyTop].value), null, (ArgsTailHolder) null); return yyVal; }; -states[445] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[453] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), null, ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[446] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[454] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), null, null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[447] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[455] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-3+yyTop].value), ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[448] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[456] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-5+yyTop].value), ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[449] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[457] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-1+yyTop].value), null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[450] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[458] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-3+yyTop].value), null, ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[451] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[459] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[452] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[460] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[453] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[461] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[454] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[462] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_args(p.src_line(), null, null, null, null, (ArgsTailHolder) null); /*% @@ -4654,12 +4680,12 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[455] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[463] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCommandStart(true); yyVal = ((ArgsNode)yyVals[0+yyTop].value); return yyVal; }; -states[456] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[464] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCurrentArg(null); p.ordinalMaxNumParam(); p.getLexContext().in_argdef = false; @@ -4669,7 +4695,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/ return yyVal; }; -states[457] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[465] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCurrentArg(null); p.ordinalMaxNumParam(); p.getLexContext().in_argdef = false; @@ -4679,69 +4705,76 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/ return yyVal; }; -states[458] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[466] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; -states[459] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[467] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = null; /*% %*/ /*% ripper: $3 %*/ return yyVal; }; -states[460] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[468] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; /*% ripper[brace]: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[461] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[469] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; /*% ripper[brace]: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[462] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[470] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.new_bv(yyVals[yyTop - count + 1].id); /*% ripper: get_value($1) %*/ return yyVal; }; -states[463] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[471] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; -states[464] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.pushBlockScope(); - yyVal = p.getLeftParenBegin(); - p.setLeftParenBegin(p.getParenNest()); - return yyVal; -}; -states[465] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[472] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.resetMaxNumParam(); return yyVal; }; -states[466] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[473] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.numparam_push(); return yyVal; }; -states[467] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[474] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.it_id(); + p.set_it_id(null); + return yyVal; +}; +states[475] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.pushBlockScope(); + yyVal = p.getLeftParenBegin(); + p.setLeftParenBegin(p.getParenNest()); + return yyVal; +}; +states[476] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getCmdArgumentState().push0(); return yyVal; }; -states[468] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-4+yyTop].value)); +states[477] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + Node it_id = p.it_id(); + int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-6+yyTop].value)); + p.set_it_id(((Node)yyVals[-4+yyTop].value)); p.getCmdArgumentState().pop(); /* Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match).*/ /*%%%*/ - ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-2+yyTop].value), max_numparam); + ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-2+yyTop].value), max_numparam, it_id); yyVal = new LambdaNode(yyVals[yyTop - count + 1].start(), args, ((Node)yyVals[0+yyTop].value), p.getCurrentScope(), p.src_line()); /*% %*/ /*% ripper: lambda!($5, $7) %*/ - p.setLeftParenBegin(((Integer)yyVals[-5+yyTop].value)); - p.numparam_pop(((Node)yyVals[-3+yyTop].value)); + p.setLeftParenBegin(((Integer)yyVals[-7+yyTop].value)); + p.numparam_pop(((Node)yyVals[-5+yyTop].value)); p.popCurrentScope(); return yyVal; }; -states[469] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[478] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = false; /*%%%*/ yyVal = ((ArgsNode)yyVals[-2+yyTop].value); @@ -4750,7 +4783,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: paren!($2) %*/ return yyVal; }; -states[470] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[479] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = false; /*%%%*/ if (!p.isArgsInfoEmpty(((ArgsNode)yyVals[0+yyTop].value))) { @@ -4760,21 +4793,26 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { yyVal = ((ArgsNode)yyVals[0+yyTop].value); return yyVal; }; -states[471] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[480] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.token_info_pop("}", yyVals[yyTop - count + 1]); yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[472] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[481] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.push_end_expect_token_locations(yyVals[yyTop - count + 1].start()); + return yyVal; +}; +states[482] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[473] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[483] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((IterNode)yyVals[-1+yyTop].value); /*%%%*/ /*% %*/ return yyVal; }; -states[474] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[484] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /* Workaround for JRUBY-2326 (MRI does not enter this production for some reason)*/ /*%%%*/ if (((Node)yyVals[-1+yyTop].value) instanceof YieldNode) { @@ -4794,28 +4832,28 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: method_add_block!($1, $2) %*/ return yyVal; }; -states[475] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[485] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null, yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/ return yyVal; }; -states[476] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[486] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((IterNode)yyVals[0+yyTop].value), yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/ return yyVal; }; -states[477] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[487] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-4+yyTop].value), ((ByteList)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((IterNode)yyVals[0+yyTop].value), yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/ return yyVal; }; -states[478] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[488] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.frobnicate_fcall_args(((FCallNode)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null); yyVal = ((FCallNode)yyVals[-1+yyTop].value); @@ -4823,56 +4861,56 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: method_add_arg!(fcall!($1), $2) %*/ return yyVal; }; -states[479] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[489] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null, yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/ return yyVal; }; -states[480] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[490] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-3+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/ return yyVal; }; -states[481] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[491] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value), null, null); /*% %*/ /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/ return yyVal; }; -states[482] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[492] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), LexingCommon.CALL, ((Node)yyVals[0+yyTop].value), null, yyVals[yyTop - count + 3].start()); /*% %*/ /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/ return yyVal; }; -states[483] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[493] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_call(((Node)yyVals[-2+yyTop].value), LexingCommon.CALL, ((Node)yyVals[0+yyTop].value), null); /*% %*/ /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/ return yyVal; }; -states[484] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[494] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_super(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: super!($2) %*/ return yyVal; }; -states[485] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[495] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ZSuperNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: zsuper! %*/ return yyVal; }; -states[486] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[496] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-3+yyTop].value) instanceof SelfNode) { yyVal = p.new_fcall(LBRACKET_RBRACKET); @@ -4884,71 +4922,59 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: aref!($1, escape_Qundef($3)) %*/ return yyVal; }; -states[487] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[497] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((IterNode)yyVals[-1+yyTop].value); /*%%%*/ ((IterNode)yyVals[-1+yyTop].value).setLine(yyVals[yyTop - count + 1].end()); /*% %*/ return yyVal; }; -states[488] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[498] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((IterNode)yyVals[-1+yyTop].value); /*%%%*/ ((IterNode)yyVals[-1+yyTop].value).setLine(yyVals[yyTop - count + 1].end()); /*% %*/ return yyVal; }; -states[489] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[499] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pushBlockScope(); return yyVal; }; -states[490] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.resetMaxNumParam(); - return yyVal; -}; -states[491] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.numparam_push(); - return yyVal; -}; -states[492] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-3+yyTop].value)); +states[500] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + Node it_id = p.it_id(); + int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-5+yyTop].value)); + p.set_it_id(((Node)yyVals[-3+yyTop].value)); /* Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match).*/ /*%%%*/ - ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-1+yyTop].value), max_numparam); + ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-1+yyTop].value), max_numparam, it_id); yyVal = new IterNode(yyVals[yyTop - count + 1].start(), args, ((Node)yyVals[0+yyTop].value), p.getCurrentScope(), p.src_line()); /*% %*/ - /*% ripper: brace_block!(escape_Qundef($4), $5) %*/ - p.numparam_pop(((Node)yyVals[-2+yyTop].value)); + /*% ripper: brace_block!(escape_Qundef($6), $7) %*/ + p.numparam_pop(((Node)yyVals[-4+yyTop].value)); p.popCurrentScope(); return yyVal; }; -states[493] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[501] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pushBlockScope(); - return yyVal; -}; -states[494] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.resetMaxNumParam(); - return yyVal; -}; -states[495] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.numparam_push(); p.getCmdArgumentState().push0(); return yyVal; }; -states[496] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-3+yyTop].value)); +states[502] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + Node it_id = p.it_id(); + int max_numparam = p.restoreMaxNumParam(((Integer)yyVals[-5+yyTop].value)); + p.set_it_id(((Node)yyVals[-3+yyTop].value)); /* Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match).*/ /*%%%*/ - ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-1+yyTop].value), max_numparam); + ArgsNode args = p.args_with_numbered(((ArgsNode)yyVals[-1+yyTop].value), max_numparam, it_id); yyVal = new IterNode(yyVals[yyTop - count + 1].start(), args, ((Node)yyVals[0+yyTop].value), p.getCurrentScope(), p.src_line()); /*% %*/ - /*% ripper: do_block!(escape_Qundef($4), $5) %*/ + /*% ripper: do_block!(escape_Qundef($6), $7) %*/ p.getCmdArgumentState().pop(); - p.numparam_pop(((Node)yyVals[-2+yyTop].value)); + p.numparam_pop(((Node)yyVals[-4+yyTop].value)); p.popCurrentScope(); return yyVal; }; -states[497] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[503] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.check_literal_when(((Node)yyVals[0+yyTop].value)); yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); @@ -4956,14 +4982,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add!(args_new!, $1) %*/ return yyVal; }; -states[498] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[504] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newSplatNode(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: args_add_star!(args_new!, $2) %*/ return yyVal; }; -states[499] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[505] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.check_literal_when(((Node)yyVals[0+yyTop].value)); yyVal = p.last_arg_append(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); @@ -4971,51 +4997,53 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: args_add!($1, $3) %*/ return yyVal; }; -states[500] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[506] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.rest_arg_append(((Node)yyVals[-3+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: args_add_star!($1, $4) %*/ return yyVal; }; -states[501] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[507] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newWhenNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: when!($2, $4, escape_Qundef($5)) %*/ return yyVal; }; -states[504] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - LexContext ctxt = (LexContext) p.getLexContext(); - yyVals[0+yyTop].value = ctxt.in_kwarg; - ctxt.in_kwarg = true; +states[510] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.push_pvtbl(); return yyVal; }; -states[505] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[511] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.push_pktbl(); return yyVal; }; -states[506] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); +states[512] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.getLexContext().clone(); + p.setState(EXPR_BEG|EXPR_LABEL); + p.setCommandStart(false); + p.getLexContext().in_kwarg = true; + return yyVal; +}; +states[513] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pvtbl(((Set)yyVals[-3+yyTop].value)); - p.getLexContext().in_kwarg = ((Boolean)yyVals[-4+yyTop].value); + p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); + p.getLexContext().in_kwarg = ((LexContext)yyVals[-4+yyTop].value).in_kwarg; return yyVal; }; -states[507] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[514] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newIn(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-4+yyTop].value), ((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ - /*% ripper: in!($4, $7, escape_Qundef($8)) %*/ + /*% ripper: in!($5, $8, escape_Qundef($9)) %*/ return yyVal; }; -states[509] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[516] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((InNode)yyVals[0+yyTop].value); return yyVal; }; -states[511] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[518] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), ((Node)yyVals[-2+yyTop].value), null); p.fixpos(((Node)yyVal), ((Node)yyVals[0+yyTop].value)); @@ -5023,7 +5051,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: if_mod!($3, $1) %*/ return yyVal; }; -states[512] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[519] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_if(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value), null, ((Node)yyVals[-2+yyTop].value)); p.fixpos(((Node)yyVal), ((Node)yyVals[0+yyTop].value)); @@ -5031,53 +5059,55 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: unless_mod!($3, $1) %*/ return yyVal; }; -states[514] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[521] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), null, ((Node)yyVals[-1+yyTop].value), p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, true, null, null)); return yyVal; }; -states[515] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[522] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), null, ((Node)yyVals[-2+yyTop].value), ((ArrayPatternNode)yyVals[0+yyTop].value)); /*%%%*/ p.nd_set_first_loc(((Node)yyVal), yyVals[yyTop - count + 1].start()); /*% %*/ return yyVal; }; -states[516] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[523] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_find_pattern(null, ((FindPatternNode)yyVals[0+yyTop].value)); return yyVal; }; -states[517] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[524] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), null, null, ((ArrayPatternNode)yyVals[0+yyTop].value)); return yyVal; }; -states[518] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[525] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern(null, ((HashPatternNode)yyVals[0+yyTop].value)); return yyVal; }; -states[520] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[527] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new HashNode(yyVals[yyTop - count + 1].start(), new KeyValuePair(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value))); /*% %*/ /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/ return yyVal; }; -states[522] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[529] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.logop(((Node)yyVals[-2+yyTop].value), OR, ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/ return yyVal; }; -states[524] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); +states[531] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((Set)yyVals[0+yyTop].value); + /*% ripper: get_value($:2); %*/ return yyVal; }; -states[525] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); +states[532] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((Set)yyVals[0+yyTop].value); + /*% ripper: get_value($:2); %*/ return yyVal; }; -states[528] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[535] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), null, ((ArrayPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5085,7 +5115,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[529] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[536] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_find_pattern(((Node)yyVals[-3+yyTop].value), ((FindPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5093,7 +5123,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[530] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[537] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_hash_pattern(((Node)yyVals[-3+yyTop].value), ((HashPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5101,12 +5131,12 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[531] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[538] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), null, p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, false, null, null)); return yyVal; }; -states[532] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[539] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-3+yyTop].value), null, ((ArrayPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5114,7 +5144,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[533] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[540] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_find_pattern(((Node)yyVals[-3+yyTop].value), ((FindPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5122,7 +5152,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[534] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[541] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = p.new_hash_pattern(((Node)yyVals[-3+yyTop].value), ((HashPatternNode)yyVals[-1+yyTop].value)); /*%%%*/ @@ -5130,51 +5160,44 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% %*/ return yyVal; }; -states[535] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[542] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), null, p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, false, null, null)); return yyVal; }; -states[536] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[543] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), null, null, ((ArrayPatternNode)yyVals[-1+yyTop].value)); return yyVal; }; -states[537] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[544] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_find_pattern(null, ((FindPatternNode)yyVals[-1+yyTop].value)); return yyVal; }; -states[538] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[545] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern(yyVals[yyTop - count + 1].start(), null, null, p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, false, null, null)); return yyVal; }; -states[539] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); - LexContext ctxt = p.getLexContext(); - yyVals[0+yyTop].value = ctxt.in_kwarg; - ctxt.in_kwarg = false; +states[546] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.getLexContext().in_kwarg = false; return yyVal; }; -states[540] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); - p.getLexContext().in_kwarg = ((Boolean)yyVals[-3+yyTop].value); +states[547] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.pop_pktbl(((Set)yyVals[-4+yyTop].value)); + p.getLexContext().in_kwarg = ((LexContext)yyVals[-3+yyTop].value).in_kwarg; yyVal = p.new_hash_pattern(null, ((HashPatternNode)yyVals[-1+yyTop].value)); return yyVal; }; -states[541] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[548] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern(null, p.new_hash_pattern_tail(yyVals[yyTop - count + 1].start(), p.none(), null)); return yyVal; }; -states[542] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.push_pktbl(); - return yyVal; -}; -states[543] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[549] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.pop_pktbl(((Set)yyVals[-2+yyTop].value)); yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[544] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[550] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ ListNode preArgs = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), preArgs, false, null, null); @@ -5184,11 +5207,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[545] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[551] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[0+yyTop].value), true, null, null); return yyVal; }; -states[546] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[552] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), p.list_concat(((ListNode)yyVals[-1+yyTop].value), ((ListNode)yyVals[0+yyTop].value)), false, null, null); /* JRuby Changed*/ @@ -5198,96 +5221,91 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[547] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-2+yyTop].value), true, ((ByteList)yyVals[0+yyTop].value), null); - return yyVal; -}; -states[548] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-4+yyTop].value), true, ((ByteList)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); - return yyVal; -}; -states[549] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), true, null, null); +states[553] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), true, ((ByteList)yyVals[0+yyTop].value), null); return yyVal; }; -states[550] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), true, null, ((ListNode)yyVals[0+yyTop].value)); +states[554] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), true, ((ByteList)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); return yyVal; }; -states[551] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[555] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ArrayPatternNode)yyVals[0+yyTop].value); return yyVal; }; -states[552] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[556] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[-1+yyTop].value); return yyVal; }; -states[553] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[557] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.list_concat(((ListNode)yyVals[-2+yyTop].value), ((ListNode)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: rb_ary_concat($1, get_value($2)) %*/ return yyVal; }; -states[554] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, true, ((ByteList)yyVals[0+yyTop].value), null); +states[558] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, true, ((ByteList)yyVals[0+yyTop].value), null); return yyVal; }; -states[555] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, true, ((ByteList)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); +states[559] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.new_array_pattern_tail(yyVals[yyTop - count + 1].start(), null, true, ((ByteList)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); return yyVal; }; -states[556] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - p.warn_experimental(yyVals[yyTop - count + 1].start(), "Find pattern is experimental, and the behavior may change in future versions of Ruby!"); - yyVal = p.new_find_pattern_tail(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[-4+yyTop].value), ((ListNode)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); +states[560] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.warn_experimental(yyVals[yyTop - count + 1].start(), "Find pattern is experimental, and the behavior may change in future versions of Ruby!"); + yyVal = p.new_find_pattern_tail(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[-4+yyTop].value), ((ListNode)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); return yyVal; }; -states[557] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[561] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + p.error_duplicate_pattern_variable(((ByteList)yyVals[0+yyTop].value)); yyVal = ((ByteList)yyVals[0+yyTop].value); + /*% ripper: ripper_assignable(p, $2, var_field(p, get_value($:2))) %*/ return yyVal; }; -states[558] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[562] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; + /*% ripper: var_field(p, Qnil) %*/ return yyVal; }; -states[560] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[564] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.list_concat(((ListNode)yyVals[-2+yyTop].value), ((ListNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_concat($1, get_value($3)) %*/ return yyVal; }; -states[561] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[565] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/ return yyVal; }; -states[562] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[566] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern_tail(yyVals[yyTop - count + 1].start(), ((HashNode)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); return yyVal; }; -states[563] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[567] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern_tail(yyVals[yyTop - count + 1].start(), ((HashNode)yyVals[0+yyTop].value), null); return yyVal; }; -states[564] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[568] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern_tail(yyVals[yyTop - count + 1].start(), ((HashNode)yyVals[-1+yyTop].value), null); return yyVal; }; -states[565] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[569] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_hash_pattern_tail(yyVals[yyTop - count + 1].start(), null, ((ByteList)yyVals[0+yyTop].value)); return yyVal; }; -states[566] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[570] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new HashNode(yyVals[yyTop - count + 1].start(), ((KeyValuePair)yyVals[0+yyTop].value)); /*% %*/ /*% ripper[brace]: rb_ary_new_from_args(1, $1) %*/ return yyVal; }; -states[567] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[571] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ ((HashNode)yyVals[-2+yyTop].value).add(((KeyValuePair)yyVals[0+yyTop].value)); yyVal = ((HashNode)yyVals[-2+yyTop].value); @@ -5295,7 +5313,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rb_ary_push($1, $3) %*/ return yyVal; }; -states[568] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[572] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.error_duplicate_pattern_key(yyVals[yyTop - count + 1].id); /*%%%*/ Node label = p.asSymbol(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[-1+yyTop].value)); @@ -5305,7 +5323,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/ return yyVal; }; -states[569] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[573] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.error_duplicate_pattern_key(yyVals[yyTop - count + 1].id); if (yyVals[yyTop - count + 1].id != null && !p.is_local_id(yyVals[yyTop - count + 1].id)) { p.yyerror("key must be valid as local variables"); @@ -5319,7 +5337,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/ return yyVal; }; -states[571] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[575] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-1+yyTop].value) == null || ((Node)yyVals[-1+yyTop].value) instanceof StrNode) { yyVal = ((StrNode)yyVals[-1+yyTop].value).getValue(); @@ -5335,11 +5353,11 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { } return yyVal; }; -states[572] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[576] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[573] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[577] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = STAR_STAR; /*% @@ -5347,7 +5365,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[574] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[578] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = KWNOREST; /*% @@ -5355,15 +5373,15 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[575] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[579] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[576] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[580] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[578] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[582] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-2+yyTop].value)); p.value_expr(((Node)yyVals[0+yyTop].value)); @@ -5373,7 +5391,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!($1, $3) %*/ return yyVal; }; -states[579] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[583] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-2+yyTop].value)); p.value_expr(((Node)yyVals[0+yyTop].value)); @@ -5383,7 +5401,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!($1, $3) %*/ return yyVal; }; -states[580] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[584] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-1+yyTop].value)); boolean isLiteral = ((Node)yyVals[-1+yyTop].value) instanceof FixnumNode; @@ -5392,7 +5410,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!($1, Qnil) %*/ return yyVal; }; -states[581] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[585] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[-1+yyTop].value)); boolean isLiteral = ((Node)yyVals[-1+yyTop].value) instanceof FixnumNode; @@ -5401,7 +5419,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!($1, Qnil) %*/ return yyVal; }; -states[585] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[589] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); boolean isLiteral = ((Node)yyVals[0+yyTop].value) instanceof FixnumNode; @@ -5410,7 +5428,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot2!(Qnil, $2) %*/ return yyVal; }; -states[586] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[590] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.value_expr(((Node)yyVals[0+yyTop].value)); boolean isLiteral = ((Node)yyVals[0+yyTop].value) instanceof FixnumNode; @@ -5419,51 +5437,51 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dot3!(Qnil, $2) %*/ return yyVal; }; -states[591] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[595] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); return yyVal; }; -states[592] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[596] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); return yyVal; }; -states[593] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[597] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); return yyVal; }; -states[594] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[598] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ListNode)yyVals[0+yyTop].value); return yyVal; }; -states[595] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[599] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new NilNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[596] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[600] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new SelfNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[597] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[601] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new TrueNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[598] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[602] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FalseNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[599] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[603] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FileNode(yyVals[yyTop - count + 1].start(), new ByteList(p.getFile().getBytes(), p.getRuntime().getEncodingService().getLocaleEncoding())); @@ -5471,25 +5489,25 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[600] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[604] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FixnumNode(yyVals[yyTop - count + 1].start(), yyVals[yyTop - count + 1].start()+1); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[601] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[605] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new EncodingNode(yyVals[yyTop - count + 1].start(), p.getEncoding()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[602] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[606] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((LambdaNode)yyVals[0+yyTop].value); return yyVal; }; -states[603] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[607] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.error_duplicate_pattern_variable(((ByteList)yyVals[0+yyTop].value)); yyVal = p.assignableLabelOrIdentifier(((ByteList)yyVals[0+yyTop].value), null); @@ -5498,7 +5516,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[604] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[608] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node n = p.gettable(((ByteList)yyVals[0+yyTop].value)); if (!(n instanceof LocalVarNode || n instanceof DVarNode)) { @@ -5509,7 +5527,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: var_ref!($2) %*/ return yyVal; }; -states[605] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[609] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.gettable(((ByteList)yyVals[0+yyTop].value)); if (yyVal == null) yyVal = new BeginNode(yyVals[yyTop - count + 1].start(), NilImplicitNode.NIL); @@ -5517,39 +5535,39 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: var_ref!($2) %*/ return yyVal; }; -states[606] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[610] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new BeginNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: begin!($3) %*/ return yyVal; }; -states[607] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[611] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon3(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: top_const_ref!($2) %*/ return yyVal; }; -states[608] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[612] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.new_colon2(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-2+yyTop].value), ((ByteList)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: const_path_ref!($1, $3) %*/ return yyVal; }; -states[609] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[613] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ConstNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[610] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[614] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node node; if (((Node)yyVals[-3+yyTop].value) != null) { - node = p.appendToBlock(node_assign(((Node)yyVals[-3+yyTop].value), new GlobalVarNode(yyVals[yyTop - count + 1].start(), p.symbolID(DOLLAR_BANG))), p.makeNullNil(((Node)yyVals[-1+yyTop].value))); + node = p.appendToBlock(node_assign(((Node)yyVals[-3+yyTop].value), new GlobalVarNode(yyVals[yyTop - count + 1].start(), p.symbolID(DOLLAR_BANG)), null), p.makeNullNil(((Node)yyVals[-1+yyTop].value))); if (((Node)yyVals[-1+yyTop].value) != null) { node.setLine(yyVals[yyTop - count + 1].start()); } @@ -5562,18 +5580,18 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/ return yyVal; }; -states[611] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[615] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; -states[612] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[616] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.newArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[613] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[617] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.splat_array(((Node)yyVals[0+yyTop].value)); if (yyVal == null) yyVal = ((Node)yyVals[0+yyTop].value); /* ArgsCat or ArgsPush*/ @@ -5581,48 +5599,49 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: $1 %*/ return yyVal; }; -states[615] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[619] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[617] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[621] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ + p.getLexContext().in_rescue = ((LexContext)yyVals[-1+yyTop].value).in_rescue; yyVal = ((Node)yyVals[0+yyTop].value); /*% %*/ /*% ripper: ensure!($2) %*/ return yyVal; }; -states[619] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[623] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((NumericNode)yyVals[0+yyTop].value); return yyVal; }; -states[620] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[624] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[621] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[625] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[0+yyTop].value) instanceof EvStrNode ? new DStrNode(yyVals[yyTop - count + 1].start(), p.getEncoding()).add(((Node)yyVals[0+yyTop].value)) : ((Node)yyVals[0+yyTop].value); /*% %*/ /*% ripper: $1 %*/ return yyVal; }; -states[622] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[626] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((StrNode)yyVals[0+yyTop].value); return yyVal; }; -states[623] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[627] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[624] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[628] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.literal_concat(((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: string_concat!($1, $2) %*/ return yyVal; }; -states[625] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[629] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.heredoc_dedent(((Node)yyVals[-1+yyTop].value)); yyVal = ((Node)yyVals[-1+yyTop].value); @@ -5630,7 +5649,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/ return yyVal; }; -states[626] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[630] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ int line = yyVals[yyTop - count + 2].start(); @@ -5651,114 +5670,117 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/ return yyVal; }; -states[627] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[631] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_regexp(yyVals[yyTop - count + 2].start(), ((Node)yyVals[-1+yyTop].value), ((RegexpNode)yyVals[0+yyTop].value)); return yyVal; }; -states[628] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[632] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + return yyVal; +}; +states[634] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: array!($3) %*/ return yyVal; }; -states[629] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[635] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(p.src_line()); /*% %*/ /*% ripper: words_new! %*/ return yyVal; }; -states[630] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[636] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[-1+yyTop].value) instanceof EvStrNode ? new DStrNode(yyVals[yyTop - count + 1].start(), p.getEncoding()).add(((Node)yyVals[-1+yyTop].value)) : ((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: words_add!($1, $2) %*/ return yyVal; }; -states[631] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[637] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); /*% ripper[brace]: word_add!(word_new!, $1) %*/ return yyVal; }; -states[632] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[638] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.literal_concat(((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: word_add!($1, $2) %*/ return yyVal; }; -states[633] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[639] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: array!($3) %*/ return yyVal; }; -states[634] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[640] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(p.src_line()); /*% %*/ /*% ripper: symbols_new! %*/ return yyVal; }; -states[635] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[641] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[-1+yyTop].value) instanceof EvStrNode ? new DSymbolNode(yyVals[yyTop - count + 1].start()).add(((Node)yyVals[-1+yyTop].value)) : p.asSymbol(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: symbols_add!($1, $2) %*/ return yyVal; }; -states[636] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[642] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: array!($3) %*/ return yyVal; }; -states[637] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[643] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: array!($3) %*/ return yyVal; }; -states[638] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[644] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(p.src_line()); /*% %*/ /*% ripper: qwords_new! %*/ return yyVal; }; -states[639] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[645] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: qwords_add!($1, $2) %*/ return yyVal; }; -states[640] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[646] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(p.src_line()); /*% %*/ /*% ripper: qsymbols_new! %*/ return yyVal; }; -states[641] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[647] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(p.asSymbol(yyVals[yyTop - count + 1].start(), ((Node)yyVals[-1+yyTop].value))); /*% %*/ /*% ripper: qsymbols_add!($1, $2) %*/ return yyVal; }; -states[642] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[648] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { ByteList aChar = ByteList.create(""); aChar.setEncoding(p.getEncoding()); yyVal = p.createStr(aChar, 0); /*% ripper: string_content! %*/ return yyVal; }; -states[643] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[649] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.literal_concat(((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ @@ -5766,7 +5788,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /* JRuby changed (removed)*/ return yyVal; }; -states[644] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[650] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ ByteList aChar = ByteList.create(""); aChar.setEncoding(p.getEncoding()); @@ -5775,21 +5797,21 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: xstring_new! %*/ return yyVal; }; -states[645] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[651] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.literal_concat(((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: xstring_add!($1, $2) %*/ return yyVal; }; -states[646] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[652] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = null; /*% %*/ /*% ripper: regexp_new! %*/ return yyVal; }; -states[647] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[653] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /* FIXME: mri is different here.*/ /*%%%*/ yyVal = p.literal_concat(((Node)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value)); @@ -5799,18 +5821,18 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[648] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[654] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); /*% ripper[brace]: ripper_new_yylval(p, 0, get_value($1), $1) %*/ return yyVal; }; -states[649] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[655] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.getStrTerm(); p.setStrTerm(null); p.setState(EXPR_BEG); return yyVal; }; -states[650] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[656] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setStrTerm(((StrTerm)yyVals[-1+yyTop].value)); /*%%%*/ yyVal = new EvStrNode(yyVals[yyTop - count + 3].start(), ((Node)yyVals[0+yyTop].value)); @@ -5818,29 +5840,29 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: string_dvar!($3) %*/ return yyVal; }; -states[651] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[657] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.getStrTerm(); p.setStrTerm(null); p.getConditionState().push0(); p.getCmdArgumentState().push0(); return yyVal; }; -states[652] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[658] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.getState(); p.setState(EXPR_BEG); return yyVal; }; -states[653] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[659] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.getBraceNest(); p.setBraceNest(0); return yyVal; }; -states[654] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[660] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.getHeredocIndent(); p.setHeredocIndent(0); return yyVal; }; -states[655] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[661] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getConditionState().pop(); p.getCmdArgumentState().pop(); p.setStrTerm(((StrTerm)yyVals[-5+yyTop].value)); @@ -5856,28 +5878,15 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: string_embexpr!($6) %*/ return yyVal; }; -states[656] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - /*%%%*/ - yyVal = new GlobalVarNode(p.src_line(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); - /*% %*/ - /*% ripper: var_ref!($1) %*/ - return yyVal; -}; -states[657] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - /*%%%*/ - yyVal = new InstVarNode(p.src_line(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); - /*% %*/ - /*% ripper: var_ref!($1) %*/ - return yyVal; -}; -states[658] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[664] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = new ClassVarNode(p.src_line(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); + yyVal = p.gettable(((ByteList)yyVals[0+yyTop].value)); + if (yyVal == null) yyVal = p.NEW_ERROR(yyVals[yyTop - count + 1]); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[662] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[668] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_END); /*%%%*/ yyVal = p.asSymbol(p.src_line(), ((ByteList)yyVals[0+yyTop].value)); @@ -5885,19 +5894,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: symbol_literal!(symbol!($2)) %*/ return yyVal; }; -states[664] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[665] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[666] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[667] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[671] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_END); /*%%%*/ @@ -5919,34 +5916,34 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: dyna_symbol!($2) %*/ return yyVal; }; -states[668] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[672] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((NumericNode)yyVals[0+yyTop].value); return yyVal; }; -states[669] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[673] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.negateNumeric(((NumericNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/ return yyVal; }; -states[673] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[674] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[674] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[675] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((FloatNode)yyVals[0+yyTop].value); return yyVal; }; -states[675] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[676] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((RationalNode)yyVals[0+yyTop].value); return yyVal; }; -states[676] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[677] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ComplexNode)yyVals[0+yyTop].value); return yyVal; }; -states[677] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[681] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.declareIdentifier(((ByteList)yyVals[0+yyTop].value)); /*% %*/ @@ -5959,7 +5956,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[678] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[682] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new InstVarNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ @@ -5972,7 +5969,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[679] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[683] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new GlobalVarNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ @@ -5985,7 +5982,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[680] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[684] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ConstNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ @@ -5998,7 +5995,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[681] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[685] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ClassVarNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value))); /*% %*/ @@ -6011,35 +6008,35 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[682] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[686] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new NilNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[683] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[687] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new SelfNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[684] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[688] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new TrueNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[685] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[689] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FalseNode(yyVals[yyTop - count + 1].start()); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[686] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[690] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FileNode(yyVals[yyTop - count + 1].start(), new ByteList(p.getFile().getBytes(), p.getRuntime().getEncodingService().getLocaleEncoding())); @@ -6047,21 +6044,22 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[687] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[691] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new FixnumNode(yyVals[yyTop - count + 1].start(), yyVals[yyTop - count + 1].start()+1); /*% %*/ /*% ripper: var_ref!($1) %*/ return yyVal; }; -states[688] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[692] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new EncodingNode(yyVals[yyTop - count + 1].start(), p.getEncoding()); /*% %*/ /*% ripper: var_ref!($1) %*/ + /* mri:keyword_variable*/ return yyVal; }; -states[689] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[693] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.assignableLabelOrIdentifier(((ByteList)yyVals[0+yyTop].value), null); /*% @@ -6070,7 +6068,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; -states[690] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[694] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new InstAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -6078,7 +6076,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[691] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[695] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new GlobalAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -6086,7 +6084,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[692] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[696] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (p.getLexContext().in_def) p.compile_error("dynamic constant assignment"); @@ -6096,7 +6094,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[693] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[697] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ClassVarAsgnNode(yyVals[yyTop - count + 1].start(), p.symbolID(((ByteList)yyVals[0+yyTop].value)), NilImplicitNode.NIL); /*% @@ -6104,7 +6102,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[694] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[698] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to nil"); yyVal = null; @@ -6113,7 +6111,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[695] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[699] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't change the value of self"); yyVal = null; @@ -6122,7 +6120,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[696] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[700] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to true"); yyVal = null; @@ -6131,7 +6129,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[697] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[701] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to false"); yyVal = null; @@ -6140,7 +6138,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[698] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[702] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __FILE__"); yyVal = null; @@ -6149,7 +6147,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[699] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[703] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __LINE__"); yyVal = null; @@ -6158,46 +6156,47 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[700] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[704] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.compile_error("Can't assign to __ENCODING__"); yyVal = null; /*% $$ = p.assignable(yyVals[yyTop - count + 1].id, p.var_field($1)); %*/ + /* mri:keyword_variable*/ return yyVal; }; -states[701] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[705] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[702] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[706] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[703] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[707] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_BEG); p.setCommandStart(true); return yyVal; }; -states[704] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[708] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((Node)yyVals[-1+yyTop].value); return yyVal; }; -states[705] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[709] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = null; /*% %*/ /*% ripper: Qnil %*/ return yyVal; }; -states[707] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[711] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = false; yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, null, null, p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null)); return yyVal; }; -states[708] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[712] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ArgsNode)yyVals[-1+yyTop].value); /*% %*/ @@ -6207,124 +6206,123 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { p.setCommandStart(true); return yyVal; }; -states[709] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[713] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ArgsNode)yyVals[0+yyTop].value); return yyVal; }; -states[710] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - LexContext ctxt = p.getLexContext(); - yyVal = ctxt.in_kwarg; - ctxt.in_kwarg = true; - ctxt.in_argdef = true; +states[714] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = p.getLexContext().clone(); + p.getLexContext().in_kwarg = true; + p.getLexContext().in_argdef = true; p.setState(p.getState() | EXPR_LABEL); return yyVal; }; -states[711] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[715] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = ((Boolean)yyVals[-2+yyTop].value); + ctxt.in_kwarg = ((LexContext)yyVals[-2+yyTop].value).in_kwarg; ctxt.in_argdef = false; yyVal = ((ArgsNode)yyVals[-1+yyTop].value); p.setState(EXPR_BEG); p.setCommandStart(true); return yyVal; }; -states[712] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[716] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), ((ByteList)yyVals[-1+yyTop].value), ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[713] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[717] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), (ByteList) null, ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[714] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[718] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(p.src_line(), null, ((ByteList)yyVals[-1+yyTop].value), ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[715] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[719] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), null, (ByteList) null, ((BlockArgNode)yyVals[0+yyTop].value)); return yyVal; }; -states[716] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[720] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.add_forwarding_args(); yyVal = p.new_args_tail(yyVals[yyTop - count + 1].start(), null, ((ByteList)yyVals[0+yyTop].value), FWD_BLOCK); return yyVal; }; -states[717] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[721] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ArgsTailHolder)yyVals[0+yyTop].value); return yyVal; }; -states[718] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[722] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null); return yyVal; }; -states[719] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[723] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), ((ListNode)yyVals[-3+yyTop].value), ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[720] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[724] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-7+yyTop].value), ((ListNode)yyVals[-5+yyTop].value), ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[721] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[725] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[722] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[726] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), ((ListNode)yyVals[-3+yyTop].value), null, ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[723] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[727] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-3+yyTop].value), null, ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[724] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[728] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-5+yyTop].value), null, ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[725] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[729] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), ((ListNode)yyVals[-1+yyTop].value), null, null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[726] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[730] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-3+yyTop].value), ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[727] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[731] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-5+yyTop].value), ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[728] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[732] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-1+yyTop].value), null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[729] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[733] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, ((ListNode)yyVals[-3+yyTop].value), null, ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[730] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[734] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, ((RestArgNode)yyVals[-1+yyTop].value), null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[731] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[735] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, ((RestArgNode)yyVals[-3+yyTop].value), ((ListNode)yyVals[-1+yyTop].value), ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[732] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[736] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(yyVals[yyTop - count + 1].start(), null, null, null, null, ((ArgsTailHolder)yyVals[0+yyTop].value)); return yyVal; }; -states[733] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[737] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.new_args(p.src_line(), null, null, null, null, (ArgsTailHolder) null); return yyVal; }; -states[734] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[738] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = FWD_KWREST; /*% %*/ /*% ripper: args_forward! %*/ return yyVal; }; -states[735] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[739] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "formal argument cannot be a constant"; /*%%%*/ p.yyerror(message); @@ -6332,7 +6330,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/ return yyVal; }; -states[736] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[740] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "formal argument cannot be an instance variable"; /*%%%*/ p.yyerror(message); @@ -6340,7 +6338,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/ return yyVal; }; -states[737] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[741] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "formal argument cannot be a global variable"; /*%%%*/ p.yyerror(message); @@ -6348,7 +6346,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/ return yyVal; }; -states[738] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[742] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { String message = "formal argument cannot be a class variable"; /*%%%*/ p.yyerror(message); @@ -6356,16 +6354,16 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/ return yyVal; }; -states[739] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[743] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); /* Not really reached*/ return yyVal; }; -states[740] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[744] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.formal_argument(yyVals[yyTop - count + 1].id, ((ByteList)yyVals[0+yyTop].value)); p.ordinalMaxNumParam(); return yyVal; }; -states[741] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[745] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { RubySymbol name = p.get_id(((ByteList)yyVals[0+yyTop].value)); p.setCurrentArg(name); /*%%%*/ @@ -6377,7 +6375,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { return yyVal; }; -states[742] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[746] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCurrentArg(null); /*%%%*/ yyVal = ((ArgumentNode)yyVals[0+yyTop].value); @@ -6385,21 +6383,21 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: get_value($1) %*/ return yyVal; }; -states[743] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[747] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((Node)yyVals[-1+yyTop].value); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ return yyVal; }; -states[744] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[748] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(p.src_line(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper[brace]: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[745] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[749] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[0+yyTop].value)); yyVal = ((ListNode)yyVals[-2+yyTop].value); @@ -6407,7 +6405,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[746] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[750] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.formal_argument(yyVals[yyTop - count + 1].id, ((ByteList)yyVals[0+yyTop].value)); p.arg_var(yyVals[yyTop - count + 1].id); p.setCurrentArg(p.get_id(((ByteList)yyVals[0+yyTop].value))); @@ -6416,7 +6414,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[747] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[751] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCurrentArg(null); p.getLexContext().in_argdef = true; /*%%%*/ @@ -6426,7 +6424,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[748] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[752] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setCurrentArg(null); p.getLexContext().in_argdef = true; /*%%%*/ @@ -6436,7 +6434,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[749] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[753] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = true; /*%%%*/ yyVal = new KeywordArgNode(yyVals[yyTop - count + 2].start(), p.assignableKeyword(((ByteList)yyVals[-1+yyTop].value), ((Node)yyVals[0+yyTop].value))); @@ -6445,7 +6443,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[750] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[754] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = true; /*%%%*/ yyVal = new KeywordArgNode(p.src_line(), p.assignableKeyword(((ByteList)yyVals[0+yyTop].value), new RequiredKeywordArgumentValueNode())); @@ -6454,50 +6452,47 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[751] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[755] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(yyVals[yyTop - count + 1].start(), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[752] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[756] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[753] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[757] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new ArrayNode(yyVals[yyTop - count + 1].start(), ((KeywordArgNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[754] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[758] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((ListNode)yyVals[-2+yyTop].value).add(((KeywordArgNode)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[755] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[759] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[756] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[760] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[757] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - /*%%%*/ - yyVal = KWNOREST; - /*% %*/ +states[761] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*% ripper: nokw_param!(Qnil) %*/ return yyVal; }; -states[758] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[762] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.shadowing_lvar(yyVals[yyTop - count + 2].id); /*%%%*/ yyVal = ((ByteList)yyVals[0+yyTop].value); @@ -6505,14 +6500,14 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: kwrest_param!($2) %*/ return yyVal; }; -states[759] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[763] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ - yyVal = p.INTERNAL_ID; + yyVal = FWD_KWREST; /*% %*/ /*% ripper: kwrest_param!(Qnil) %*/ return yyVal; }; -states[760] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[764] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ p.setCurrentArg(null); p.getLexContext().in_argdef = true; @@ -6520,10 +6515,9 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% $$ = p.new_assoc(p.assignable(yyVals[yyTop - count + 1].id, $1), $3); %*/ - return yyVal; }; -states[761] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[765] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.getLexContext().in_argdef = true; p.setCurrentArg(null); /*%%%*/ @@ -6533,43 +6527,43 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[762] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[766] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new BlockNode(yyVals[yyTop - count + 1].start()).add(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[763] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[767] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.appendToBlock(((ListNode)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[764] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[768] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new BlockNode(yyVals[yyTop - count + 1].start()).add(((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[765] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[769] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.appendToBlock(((ListNode)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[766] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[770] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = STAR; return yyVal; }; -states[767] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[771] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[768] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[772] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (!p.is_local_id(yyVals[yyTop - count + 2].id)) { p.yyerror("rest argument must be local variable"); } @@ -6580,22 +6574,22 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: rest_param!($2) %*/ return yyVal; }; -states[769] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[773] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new UnnamedRestArgNode(p.src_line(), p.symbolID(CommonByteLists.EMPTY), p.getCurrentScope().addVariable("*")); /*% %*/ /*% ripper: rest_param!(Qnil) %*/ return yyVal; }; -states[770] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[774] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = AMPERSAND; return yyVal; }; -states[771] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[775] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[772] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[776] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { if (!p.is_local_id(yyVals[yyTop - count + 2].id)) { p.yyerror("block argument must be local variable"); } @@ -6606,7 +6600,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: blockarg!($2) %*/ return yyVal; }; -states[773] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[777] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = p.arg_var(p.shadowing_lvar(ANON_BLOCK)); /*%%%*/ yyVal = new BlockArgNode(((ArgumentNode)yyVal)); @@ -6616,24 +6610,24 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { %*/ return yyVal; }; -states[774] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[778] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((BlockArgNode)yyVals[0+yyTop].value); return yyVal; }; -states[775] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[779] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; -states[776] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[780] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.value_expr(((Node)yyVals[0+yyTop].value)); yyVal = ((Node)yyVals[0+yyTop].value); return yyVal; }; -states[777] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[781] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { p.setState(EXPR_BEG); return yyVal; }; -states[778] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[782] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-1+yyTop].value) == null) { p.yyerror("can't define single method for ()."); @@ -6646,41 +6640,41 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: paren!($3) %*/ return yyVal; }; -states[779] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[783] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new HashNode(p.src_line()); /*% %*/ return yyVal; }; -states[780] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[784] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.remove_duplicate_keys(((HashNode)yyVals[-1+yyTop].value)); /*% %*/ /*% ripper: assoclist_from_args!($1) %*/ return yyVal; }; -states[781] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[785] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = new HashNode(p.src_line(), ((KeyValuePair)yyVals[0+yyTop].value)); /*% %*/ /*% ripper[brace]: rb_ary_new3(1, get_value($1)) %*/ return yyVal; }; -states[782] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[786] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = ((HashNode)yyVals[-2+yyTop].value).add(((KeyValuePair)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ return yyVal; }; -states[783] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[787] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.createKeyValue(((Node)yyVals[-2+yyTop].value), ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: assoc_new!($1, $3) %*/ return yyVal; }; -states[784] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[788] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node label = p.asSymbol(yyVals[yyTop - count + 2].start(), ((ByteList)yyVals[-1+yyTop].value)); yyVal = p.createKeyValue(label, ((Node)yyVals[0+yyTop].value)); @@ -6688,7 +6682,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: assoc_new!($1, $2) %*/ return yyVal; }; -states[785] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[789] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ Node label = p.asSymbol(yyVals[yyTop - count + 1].start(), ((ByteList)yyVals[0+yyTop].value)); Node var = p.gettable(((ByteList)yyVals[0+yyTop].value)); @@ -6698,11 +6692,12 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: assoc_new!($1, Qnil) %*/ return yyVal; }; -states[786] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[790] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ if (((Node)yyVals[-2+yyTop].value) instanceof StrNode) { - Node label = p.asSymbol(yyVals[yyTop - count + 2].start(), ((Node)yyVals[-2+yyTop].value)); - yyVal = p.createKeyValue(label, ((Node)yyVals[0+yyTop].value)); + DStrNode dnode = new DStrNode(yyVals[yyTop - count + 2].start(), p.getEncoding()); + dnode.add(((Node)yyVals[-2+yyTop].value)); + yyVal = p.createKeyValue(new DSymbolNode(yyVals[yyTop - count + 2].start(), dnode), ((Node)yyVals[0+yyTop].value)); } else if (((Node)yyVals[-2+yyTop].value) instanceof DStrNode) { yyVal = p.createKeyValue(new DSymbolNode(yyVals[yyTop - count + 2].start(), ((DStrNode)yyVals[-2+yyTop].value)), ((Node)yyVals[0+yyTop].value)); } else { @@ -6712,31 +6707,17 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/ return yyVal; }; -states[787] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[791] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { /*%%%*/ yyVal = p.createKeyValue(null, ((Node)yyVals[0+yyTop].value)); /*% %*/ /*% ripper: assoc_splat!($2) %*/ return yyVal; }; -states[788] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[789] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[790] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; -states[791] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); - return yyVal; -}; states[792] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { - yyVal = ((ByteList)yyVals[0+yyTop].value); + p.forwarding_arg_check(FWD_KWREST, FWD_ALL, "keyword rest"); + yyVal = p.createKeyValue(null, p.declareIdentifier(FWD_KWREST)); + /*% ripper: assoc_splat!(Qnil) %*/ return yyVal; }; states[793] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { @@ -6775,32 +6756,44 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; +states[802] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; states[803] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = ((ByteList)yyVals[0+yyTop].value); return yyVal; }; -states[808] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[804] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[806] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { + yyVal = ((ByteList)yyVals[0+yyTop].value); + return yyVal; +}; +states[811] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = RPAREN; return yyVal; }; -states[809] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[812] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = RBRACKET; return yyVal; }; -states[810] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[813] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = RCURLY; return yyVal; }; -states[818] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[821] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; -states[819] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { +states[822] = (RubyParser p, Object yyVal, ProductionState[] yyVals, int yyTop, int count, int yychar) -> { yyVal = null; return yyVal; }; } - // line 4770 "parse.y" + // line 4812 "parse.y" } - // line 14586 "-" + // line 14925 "-" diff --git a/core/src/main/java/org/jruby/parser/RubyParser.y b/core/src/main/java/org/jruby/parser/RubyParser.y index 161394b7d89..650cc31b530 100644 --- a/core/src/main/java/org/jruby/parser/RubyParser.y +++ b/core/src/main/java/org/jruby/parser/RubyParser.y @@ -36,6 +36,7 @@ 'token_backref_type' => ['Node', 'IRubyObject'], 'token_string_type' => ['Node', 'IRubyObject'], 'token_regexp_type' => ['RegexpNode', 'IRubyObject'], + 'token_dumny_end_type' => ['Node', 'IRubyObject'], 'prod_undef_list_type' => ['Node', 'RubyArray'], 'prod_bv_decls_type' => ['Node', 'RubyArray'], 'prod_type' => ['Node', 'IRubyObject'], @@ -125,6 +126,7 @@ import org.jruby.util.CommonByteLists; import org.jruby.util.KeyValuePair; import org.jruby.util.StringSupport; import org.jruby.lexer.yacc.LexContext; +import org.jruby.lexer.yacc.LexContext.InRescue.*; import @@lex_package@@.RubyLexer; import org.jruby.lexer.yacc.StackState; import org.jruby.parser.ProductionState; @@ -171,7 +173,9 @@ import static org.jruby.lexer.LexingCommon.EXPR_ENDARG; import static org.jruby.lexer.LexingCommon.EXPR_END; import static org.jruby.lexer.LexingCommon.EXPR_LABEL; import static org.jruby.util.CommonByteLists.ANON_BLOCK; +import static org.jruby.util.CommonByteLists.FWD_ALL; import static org.jruby.util.CommonByteLists.FWD_BLOCK; +import static org.jruby.util.CommonByteLists.FWD_REST; import static org.jruby.util.CommonByteLists.FWD_KWREST; public class @@Parser@@Parser extends @@Parser@@ParserBase { @@ -247,6 +251,7 @@ import static org.jruby.util.CommonByteLists.FWD_KWREST; %token <@@token_backref_type@@> tBACK_REF /* {{back reference}} */ %token <@@token_string_type@@> tSTRING_CONTENT /* {{literal content}} */ %token <@@token_regexp_type@@> tREGEXP_END +%token <@@token_dumny_end_type@@> tDUMNY_END /* {{dummy end}} */ %type <@@prod_type@@> singleton strings string string1 xstring regexp %type <@@prod_type@@> string_contents xstring_contents @@ -259,15 +264,16 @@ import static org.jruby.util.CommonByteLists.FWD_KWREST; %type <@@prod_numeric_type@@> numeric simple_numeric %type <@@prod_type@@> ssym dsym symbol cpath %type def_name defn_head defs_head -%type <@@prod_type@@> top_compstmt top_stmts top_stmt begin_block +%type block_open k_while k_until k_for allow_exits +%type <@@prod_type@@> top_compstmt top_stmts top_stmt begin_block endless_arg endless_command %type <@@prod_type@@> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary command command_call method_call -%type <@@prod_type@@> expr_value expr_value_do arg_value primary_value -%type <@@prod_fcall_type@@> fcall +%type <@@prod_type@@> expr_value expr_value_do arg_value primary_value %type <@@prod_type@@> rel_expr +%type <@@prod_fcall_type@@> fcall %type <@@prod_type@@> if_tail opt_else case_body case_args cases %type <@@prod_rescue_type@@> opt_rescue %type <@@prod_type@@> exc_list exc_var opt_ensure -%type <@@prod_type@@> args call_args opt_call_args +%type <@@prod_type@@> args arg_splat call_args opt_call_args %type <@@prod_type@@> paren_args opt_paren_args %type args_tail opt_args_tail block_args_tail opt_block_args_tail %type <@@prod_type@@> command_args aref_args @@ -284,7 +290,7 @@ import static org.jruby.util.CommonByteLists.FWD_KWREST; %type <@@prod_farg_type@@> f_optarg %type <@@prod_type@@> f_marg %type <@@prod_marg_type@@> f_marg_list -%type <@@prod_type@@> f_margs f_rest_marg +%type <@@prod_type@@> f_rest_marg f_margs %type <@@prod_assoc_list_type@@> assoc_list %type <@@prod_assocs_type@@> assocs %type <@@prod_assoc_type@@> assoc @@ -299,9 +305,9 @@ import static org.jruby.util.CommonByteLists.FWD_KWREST; %type <@@prod_bv_decls_type@@> bv_decls opt_bv_decl %type <@@prod_bvar_type@@> bvar %type <@@prod_lambda_type@@> lambda -%type <@@prod_f_larglist_type@@> f_larglist %type <@@prod_type@@> lambda_body %type <@@prod_brace_block_type@@> brace_body do_body +%type <@@prod_f_larglist_type@@> f_larglist %type <@@prod_brace_block_type@@> brace_block cmd_brace_block do_block %type <@@prod_type@@> lhs none fitem %type <@@prod_mlhs_type@@> mlhs @@ -343,13 +349,18 @@ import static org.jruby.util.CommonByteLists.FWD_KWREST; %type <@@token_type@@> blkarg_mark restarg_mark kwrest_mark rparen rbracket %type <@@prod_blockarg_type@@> none_block_pass %type <@@keyword_type@@> k_return -%type k_class k_module %type <@@keyword_type@@> k_else k_when k_begin k_if k_do -%type <@@keyword_type@@> k_do_block k_rescue k_ensure k_elsif +%type <@@keyword_type@@> k_do_block k_elsif %token <@@token_type@@> tUMINUS_NUM %type <@@keyword_type@@> rbrace -%type <@@keyword_type@@> k_def k_end k_while k_until k_for k_case k_unless -%type <@@prod_type@@> p_lparen p_lbracket +%type <@@keyword_type@@> k_def k_end k_case k_unless +%type begin_defined k_class k_module k_END k_rescue k_ensure after_rescue +%type p_in_kwarg +%type p_lparen p_lbracket p_pktbl p_pvtbl +%type max_numparam +%type <@@token_type@@> numparam +%type <@@prod_type@@> it_id +%token <@@token_type@@> END_OF_INPUT /* {{end-of-input}} */ // Things not declared in MRI - end @@ -464,11 +475,11 @@ program : { p.getResult().setAST(p.addRootNode($2)); /*% %*/ /*% ripper[final]: program!($2) %*/ - } + }; top_compstmt : top_stmts opt_terms { $$ = p.void_stmts($1); - } + }; top_stmts : none { /*%%%*/ @@ -487,47 +498,58 @@ top_stmts : none { $$ = p.appendToBlock($1, p.newline_node($3, @3.start())); /*% %*/ /*% ripper: stmts_add!($1, $3) %*/ - } - | error top_stmt { - $$ = p.remove_begin($2); - } + }; + -top_stmt : stmt +top_stmt : stmt { + p.clear_block_exit(true); + $$ = $1; + } | keyword_BEGIN begin_block { $$ = $2; - } + }; + +block_open : '{' { + $$ = p.init_block_exit(); + }; -begin_block : '{' top_compstmt '}' { +begin_block : block_open top_compstmt '}' { + p.restore_block_exit($1); /*%%%*/ p.getResult().addBeginNode(new PreExe19Node(@1.start(), p.getCurrentScope(), $2, p.src_line())); // $$ = new BeginNode(@1.start(), p.makeNullNil($2)); $$ = null; /*% %*/ /*% ripper: BEGIN!($2) %*/ - } + }; -bodystmt : compstmt opt_rescue k_else { +bodystmt : compstmt lex_ctxt opt_rescue k_else { /*%%%*/ - if ($2 == null) p.yyerror("else without rescue is useless"); + if ($3 == null) p.yyerror("else without rescue is useless"); + p.next_rescue_context($2, LexContext.InRescue.AFTER_ELSE); /*% %*/ - } compstmt opt_ensure { + } compstmt { + p.next_rescue_context($2, LexContext.InRescue.AFTER_ENSURE); + } opt_ensure { /*%%%*/ - $$ = p.new_bodystmt($1, $2, $5, $6); + $$ = p.new_bodystmt($1, $3, $6, $8); /*% %*/ - /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/ + /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($3), escape_Qundef($6), escape_Qundef($8)) %*/ } - | compstmt opt_rescue opt_ensure { + | compstmt lex_ctxt opt_rescue { + p.next_rescue_context($2, LexContext.InRescue.AFTER_ENSURE); + } opt_ensure { /*%%%*/ - $$ = p.new_bodystmt($1, $2, null, $3); + $$ = p.new_bodystmt($1, $3, null, $5); /*% %*/ - /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/ - } + /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($3), Qnil, escape_Qundef($5)) %*/ + }; -compstmt : stmts opt_terms { - $$ = p.void_stmts($1); - } +compstmt : stmts opt_terms { + $$ = p.void_stmts($1); + }; -stmts : none { +stmts : none { /*%%%*/ $$ = null; /*% %*/ @@ -544,10 +566,7 @@ stmts : none { $$ = p.appendToBlock($1, p.newline_node($3, @3.start())); /*% %*/ /*% ripper: stmts_add!($1, $3) %*/ - } - | error stmt { - $$ = $2; - } + }; stmt_or_begin : stmt { $$ = $1; @@ -556,7 +575,17 @@ stmt_or_begin : stmt { p.yyerror("BEGIN is permitted only at toplevel"); } begin_block { $$ = $3; - } + }; + +allow_exits : { + $$ = p.allow_block_exit(); + }; + +k_END : keyword_END lex_ctxt { + $$ = $2; + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; + /*% ripper: get_value($:2); %*/ + }; stmt : keyword_alias fitem { p.setState(EXPR_FNAME|EXPR_FITEM); @@ -625,101 +654,105 @@ stmt : keyword_alias fitem { /*% %*/ /*% ripper: until_mod!($3, $1) %*/ } - | stmt modifier_rescue stmt { + | stmt modifier_rescue after_rescue stmt { + p.getLexContext().in_rescue = $3.in_rescue; /*%%%*/ - $$ = p.newRescueModNode($1, $3); + $$ = p.newRescueModNode($1, $4); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ + /*% ripper: rescue_mod!($1, $4) %*/ } - | keyword_END '{' compstmt '}' { + | k_END allow_exits '{' compstmt '}' { if (p.getLexContext().in_def) { p.warn("END in method; use at_exit"); } + p.restore_block_exit($2); + p.setLexContext($1); /*%%%*/ - $$ = new PostExeNode(@1.start(), $3, p.src_line()); + $$ = new PostExeNode(@1.start(), $4, p.src_line()); /*% %*/ - /*% ripper: END!($3) %*/ + /*% ripper: END!($4) %*/ } | command_asgn | mlhs '=' lex_ctxt command_call { /*%%%*/ - $$ = node_assign($1, $4); + p.value_expr($4); + $$ = node_assign($1, $4, $3); /*% %*/ /*% ripper: massign!($1, $4) %*/ } | lhs '=' lex_ctxt mrhs { /*%%%*/ - p.value_expr($4); - $$ = node_assign($1, $4); + $$ = node_assign($1, $4, $3); /*% %*/ /*% ripper: assign!($1, $4) %*/ } - | mlhs '=' lex_ctxt mrhs_arg modifier_rescue stmt { + | mlhs '=' lex_ctxt mrhs_arg modifier_rescue after_rescue stmt { /*%%%*/ - $$ = node_assign($1, p.newRescueModNode($4, $6)); + p.getLexContext().in_rescue = $3.in_rescue; + $$ = node_assign($1, p.newRescueModNode($4, $7), $3); /*% %*/ - /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/ + /*% ripper: massign!($1, rescue_mod!($4, $7)) %*/ } | mlhs '=' lex_ctxt mrhs_arg { /*%%%*/ - $$ = node_assign($1, $4); + $$ = node_assign($1, $4, $3); /*% %*/ /*% ripper: massign!($1, $4) %*/ } - | expr + | expr { + } + | error { + $$ = p.NEW_ERROR(@1); + }; + command_asgn : lhs '=' lex_ctxt command_rhs { /*%%%*/ - p.value_expr($4); - $$ = node_assign($1, $4); + $$ = node_assign($1, $4, $3); /*% %*/ /*% ripper: assign!($1, $4) %*/ } | var_lhs tOP_ASGN lex_ctxt command_rhs { /*%%%*/ - p.value_expr($4); - $$ = p.new_op_assign($1, $2, $4); + $$ = p.new_op_assign($1, $2, $4, $3); /*% %*/ /*% ripper: opassign!($1, $2, $4) %*/ } | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt command_rhs { /*%%%*/ p.value_expr($7); - $$ = p.new_ary_op_assign($1, $5, $3, $7); + $$ = p.new_ary_op_assign($1, $3, $5, $7); /*% %*/ /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/ } | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt command_rhs { /*%%%*/ - p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt command_rhs { /*%%%*/ - p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt command_rhs { /*%%%*/ int line = @1.start(); - $$ = p.new_const_op_assign(line, p.new_colon2(line, $1, $3), $4, $6); + $$ = p.new_const_op_assign(line, p.new_colon2(line, $1, $3), $4, $6, $5); /*% %*/ /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/ } - | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt command_rhs { /*%%%*/ p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ } - | defn_head f_opt_paren_args '=' command { - p.endless_method_name($1); + | defn_head f_opt_paren_args '=' endless_command { + p.endless_method_name($1, @1); p.restore_defun($1); /*%%%*/ $$ = new DefnNode($1.line, $1.name, $2, p.getCurrentScope(), p.reduce_nodes(p.remove_begin($4)), @4.end()); @@ -728,20 +761,8 @@ command_asgn : lhs '=' lex_ctxt command_rhs { /*% ripper: def!(get_value($1), $2, bodystmt!($4, Qnil, Qnil, Qnil)) %*/ p.popCurrentScope(); } - | defn_head f_opt_paren_args '=' command modifier_rescue arg { - p.endless_method_name($1); - p.restore_defun($1); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(@1.start(), $4, $6))); - $$ = new DefnNode($1.line, $1.name, $2, p.getCurrentScope(), body, @6.end()); - // Changed from MRI (cmobined two stmts) - /*% %*/ - /*% ripper: def!(get_value($1), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - - p.popCurrentScope(); - } - | defs_head f_opt_paren_args '=' command { - p.endless_method_name($1); + | defs_head f_opt_paren_args '=' endless_command { + p.endless_method_name($1, @1); p.restore_defun($1); /*%%%*/ $$ = new DefsNode($1.line, (Node) $1.singleton, $1.name, $2, p.getCurrentScope(), p.reduce_nodes(p.remove_begin($4)), @4.end()); @@ -749,36 +770,38 @@ command_asgn : lhs '=' lex_ctxt command_rhs { /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!($4, Qnil, Qnil, Qnil)) %*/ p.popCurrentScope(); } - | defs_head f_opt_paren_args '=' command modifier_rescue arg { - p.endless_method_name($1); - p.restore_defun($1); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(@1.start(), $4, $6))); - $$ = new DefsNode($1.line, (Node) $1.singleton, $1.name, $2, p.getCurrentScope(), body, @6.end()); - /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); - } | backref tOP_ASGN lex_ctxt command_rhs { /*%%%*/ - p.backrefAssignError($1); + p.backref_error($1); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/ + }; + +endless_command : command + | endless_command modifier_rescue after_rescue arg { + p.getLexContext().in_rescue = $3.in_rescue; + $$ = p.rescued_expr(@1.start(), $1, $4); + /*% ripper: rescue_mod!($:1, $:4) %*/ } + | keyword_not opt_nl endless_command { + $$ = p.call_uni_op(p.method_cond($3), NOT); + /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/ + }; command_rhs : command_call %prec tOP_ASGN { p.value_expr($1); $$ = $1; } - | command_call modifier_rescue stmt { + | command_call modifier_rescue after_rescue stmt { /*%%%*/ + p.getLexContext().in_rescue = $3.in_rescue; p.value_expr($1); - $$ = p.newRescueModNode($1, $3); + $$ = p.newRescueModNode($1, $4); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ + /*% ripper: rescue_mod!($1, $4) %*/ } | command_asgn - + ; // Node:expr *CURRENT* all but arg so far expr : command_call @@ -796,49 +819,31 @@ expr : command_call } | arg tASSOC { p.value_expr($1); - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - // MRI 3.1 uses $2 but we want tASSOC typed? - LexContext ctxt = p.getLexContext(); - $$ = ctxt.in_kwarg; - ctxt.in_kwarg = true; - } { - $$ = p.push_pvtbl(); - } { - $$ = p.push_pktbl(); - } p_top_expr_body { + } p_in_kwarg p_pvtbl p_pktbl p_top_expr_body { p.pop_pvtbl($5); - p.pop_pvtbl($4); + p.pop_pktbl($6); LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = $3; + ctxt.in_kwarg = $4.in_kwarg; /*%%%*/ - $$ = p.newPatternCaseNode(@1.start(), $1, p.newIn(@1.start(), $6, null, null)); + $$ = p.newPatternCaseNode(@1.start(), $1, p.newIn(@1.start(), $7, null, null)); /*% %*/ - /*% ripper: case!($1, in!($6, Qnil, Qnil)) %*/ + /*% ripper: case!($1, in!($7, Qnil, Qnil)) %*/ } | arg keyword_in { p.value_expr($1); - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - LexContext ctxt = p.getLexContext(); - $$ = ctxt.in_kwarg; - ctxt.in_kwarg = true; - } { - $$ = p.push_pvtbl(); - } { - $$ = p.push_pktbl(); - } p_top_expr_body { + } p_in_kwarg p_pvtbl p_pktbl p_top_expr_body { p.pop_pvtbl($5); - p.pop_pvtbl($4); + p.pop_pktbl($6); LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = $3; + ctxt.in_kwarg = $4.in_kwarg; /*%%%*/ - $$ = p.newPatternCaseNode(@1.start(), $1, p.newIn(@1.start(), $6, new TrueNode(@1.start()), new FalseNode(@1.start()))); + $$ = p.newPatternCaseNode(@1.start(), $1, p.newIn(@1.start(), $7, new TrueNode(@1.start()), new FalseNode(@1.start()))); /*% %*/ - /*% ripper: case!($1, in!($6, Qnil, Qnil)) %*/ + /*% ripper: case!($1, in!($7, Qnil, Qnil)) %*/ } | arg %prec tLBRACE_ARG - + ; + /* note[ripper]: We use DefHolder and we ignore MRI ripper code */ // [!null] - DefHolder def_name : fname { @@ -856,14 +861,16 @@ def_name : fname { $$ = new DefHolder(p.get_id(@1.id), currentArg, p.get_value($1), (LexContext) ctxt.clone()); %*/ ctxt.in_def = true; + ctxt.in_rescue = LexContext.InRescue.BEFORE_RESCUE; p.setCurrentArg(null); - } + }; + // [!null] - DefHolder defn_head : k_def def_name { $2.line = @1.start(); $$ = $2; - } + }; // [!null] - DefHolder defs_head : k_def singleton dot_or_colon { @@ -881,18 +888,23 @@ defs_head : k_def singleton dot_or_colon { /*% $$.value = p.new_array($2, $3, $$.value); %*/ - } + }; expr_value : expr { p.value_expr($1); } + | error { + p.NEW_ERROR(@1); + }; expr_value_do : { p.getConditionState().push1(); } expr_value do { p.getConditionState().pop(); + } { $$ = $2; - } + /*% ripper: get_value($:2); %*/ + }; // Node:command - call with or with block on end [!null] command_call : command @@ -905,22 +917,22 @@ block_command : block_call $$ = p.new_call($1, $2, $3, $4, null, @3.start()); /*% %*/ /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/ - } + }; -// :brace_block - [!null] +// Node:brace_block - [!null] cmd_brace_block : tLBRACE_ARG brace_body '}' { $$ = $2; /*%%%*/ // FIXME: Missing loc stuff here. /*% %*/ - } + }; fcall : operation { /*%%%*/ $$ = p.new_fcall($1); /*% %*/ /*% ripper: $1 %*/ - } + }; // Node:command - fcall/call/yield/super [!null] command : fcall command_args %prec tLOWEST { @@ -961,13 +973,18 @@ command : fcall command_args %prec tLOWEST { /*% %*/ /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/ } + | primary_value tCOLON2 tCONSTANT '{' brace_body '}' { + //set_embraced_location($5, &@4, &@6); + $$ = p.new_call($1, $3, null, $5); + /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, Qundef), $:5) %*/ + } | keyword_super command_args { /*%%%*/ $$ = p.new_super(@1.start(), $2); /*% %*/ /*% ripper: super!($2) %*/ } - | keyword_yield command_args { + | k_yield command_args { /*%%%*/ $$ = p.new_yield(@1.start(), $2); /*% %*/ @@ -990,7 +1007,7 @@ command : fcall command_args %prec tLOWEST { $$ = new NextNode(@1.start(), p.ret_args($2, @1.start())); /*% %*/ /*% ripper: next!($2) %*/ - } + }; // MultipleAssigNode:mlhs - [!null] mlhs : mlhs_basic @@ -999,7 +1016,7 @@ mlhs : mlhs_basic $$ = $2; /*% %*/ /*% ripper: mlhs_paren!($2) %*/ - } + }; // MultipleAssignNode:mlhs_entry - mlhs w or w/o parens [!null] mlhs_inner : mlhs_basic { @@ -1010,7 +1027,7 @@ mlhs_inner : mlhs_basic { $$ = new MultipleAsgnNode($1, p.newArrayNode($1, $2), null, null); /*% %*/ /*% ripper: mlhs_paren!($2) %*/ - } + }; // MultipleAssignNode:mlhs_basic - multiple left hand side (basic because used in multiple context) [!null] mlhs_basic : mlhs_head { @@ -1072,7 +1089,7 @@ mlhs_basic : mlhs_head { $$ = new MultipleAsgnNode(p.src_line(), null, new StarNode(p.src_line()), $3); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/ - } + }; mlhs_item : mlhs_node | tLPAREN mlhs_inner rparen { @@ -1080,7 +1097,7 @@ mlhs_item : mlhs_node $$ = $2; /*% %*/ /*% ripper: mlhs_paren!($2) %*/ - } + }; // Set of mlhs terms at front of mlhs (a, *b, d, e = arr # a is head) mlhs_head : mlhs_item ',' { @@ -1094,7 +1111,7 @@ mlhs_head : mlhs_item ',' { $$ = $1.add($2); /*% %*/ /*% ripper: mlhs_add!($1, $2) %*/ - } + }; // Set of mlhs terms at end of mlhs (a, *b, d, e = arr # d,e is post) mlhs_post : mlhs_item { @@ -1108,7 +1125,7 @@ mlhs_post : mlhs_item { $$ = $1.add($3); /*% %*/ /*% ripper: mlhs_add!($1, $3) %*/ - } + }; mlhs_node : /*mri:user_variable*/ tIDENTIFIER { /*%%%*/ @@ -1256,10 +1273,10 @@ mlhs_node : /*mri:user_variable*/ tIDENTIFIER { } | backref { /*%%%*/ - p.backrefAssignError($1); + p.backref_error($1); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/ - } + }; // [!null or throws] lhs : /*mri:user_variable*/ tIDENTIFIER { @@ -1382,31 +1399,19 @@ lhs : /*mri:user_variable*/ tIDENTIFIER { } | primary_value tCOLON2 tCONSTANT { /*%%%*/ - if (p.getLexContext().in_def) { - p.yyerror("dynamic constant assignment"); - } - - Integer position = @1.start(); - - $$ = new ConstDeclNode(position, (RubySymbol) null, p.new_colon2(position, $1, $3), NilImplicitNode.NIL); + $$ = new ConstDeclNode(@1.start(), (RubySymbol) null, p.new_colon2(@1.start(), $1, $3), NilImplicitNode.NIL); /*% %*/ /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/ } | tCOLON3 tCONSTANT { /*%%%*/ - if (p.getLexContext().in_def) { - p.yyerror("dynamic constant assignment"); - } - - Integer position = @1.start(); - - $$ = new ConstDeclNode(position, (RubySymbol) null, p.new_colon3(position, $2), NilImplicitNode.NIL); + $$ = new ConstDeclNode(@1.start(), (RubySymbol) null, p.new_colon3(@1.start(), $2), NilImplicitNode.NIL); /*% %*/ /*% ripper: const_decl(p, top_const_field!($2)) %*/ } | backref { /*%%%*/ - p.backrefAssignError($1); + p.backref_error($1); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/ } @@ -1439,7 +1444,7 @@ cpath : tCOLON3 cname { $$ = p.new_colon2(@1.start(), $1, $3); /*% %*/ /*% ripper: const_path_ref!($1, $3) %*/ - } + }; // ByteList:fname - A function name [!null] fname : tIDENTIFIER { @@ -1457,7 +1462,7 @@ fname : tIDENTIFIER { } | reswords { $$ = $1; - } + }; // Node:fitem fitem : fname { // LiteralNode @@ -1469,7 +1474,7 @@ fitem : fname { // LiteralNode } | symbol { // SymbolNode/DSymbolNode $$ = $1; - } + }; undef_list : fitem { /*%%%*/ @@ -1484,7 +1489,7 @@ undef_list : fitem { $$ = p.appendToBlock($1, newUndef(@1.start(), $4)); /*% %*/ /*% ripper: rb_ary_push($1, get_value($4)) %*/ - } + }; // ByteList:op op : '|' { @@ -1576,9 +1581,8 @@ op : '|' { } | '`' { $$ = $<@@token_type@@>1; - } - -// ByteList: reswords + }; + reswords : keyword__LINE__ { $$ = $1; } @@ -1701,65 +1705,63 @@ reswords : keyword__LINE__ { } | keyword_until { $$ = $1; - } + }; arg : lhs '=' lex_ctxt arg_rhs { /*%%%*/ - $$ = node_assign($1, $4); + $$ = node_assign($1, $4, $3); /*% %*/ /*% ripper: assign!($1, $4) %*/ } | var_lhs tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ - $$ = p.new_op_assign($1, $2, $4); + $$ = p.new_op_assign($1, $2, $4, $3); /*% %*/ /*% ripper: opassign!($1, $2, $4) %*/ } | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ - p.value_expr($7); - $$ = p.new_ary_op_assign($1, $5, $3, $7); + $$ = p.new_ary_op_assign($1, $3, $5, $7); /*% %*/ /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/ } | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ - p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ - p.value_expr($6); - $$ = p.new_attr_op_assign($1, $2, $6, $3, $4); + $$ = p.new_attr_op_assign($1, $2, $3, $4, $6); /*% %*/ /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ } | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ Integer pos = @1.start(); - $$ = p.new_const_op_assign(pos, p.new_colon2(pos, $1, $3), $4, $6); + $$ = p.new_const_op_assign(pos, p.new_colon2(pos, $1, $3), $4, $6, $5); /*% %*/ /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/ } | tCOLON3 tCONSTANT tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ Integer pos = p.src_line(); - $$ = p.new_const_op_assign(pos, new Colon3Node(pos, p.symbolID($2)), $3, $5); + $$ = p.new_const_op_assign(pos, new Colon3Node(pos, p.symbolID($2)), $3, $5, $4); /*% %*/ /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/ } | backref tOP_ASGN lex_ctxt arg_rhs { /*%%%*/ - p.backrefAssignError($1); + p.backref_error($1); /*% %*/ /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/ } @@ -1892,9 +1894,7 @@ arg : lhs '=' lex_ctxt arg_rhs { | arg tOROP arg { $$ = p.logop($1, OR_OR, $3); } - | keyword_defined opt_nl { - p.getLexContext().in_defined = true; - } arg { + | keyword_defined opt_nl begin_defined arg { p.getLexContext().in_defined = false; $$ = p.new_defined(@1.start(), $4); } @@ -1905,8 +1905,8 @@ arg : lhs '=' lex_ctxt arg_rhs { /*% %*/ /*% ripper: ifop!($1, $3, $6) %*/ } - | defn_head f_opt_paren_args '=' arg { - p.endless_method_name($1); + | defn_head f_opt_paren_args '=' endless_arg { + p.endless_method_name($1, @1); p.restore_defun($1); /*%%%*/ $$ = new DefnNode($1.line, $1.name, $2, p.getCurrentScope(), p.reduce_nodes(p.remove_begin($4)), @4.end()); @@ -1916,20 +1916,8 @@ arg : lhs '=' lex_ctxt arg_rhs { /*% ripper: def!(get_value($1), $2, bodystmt!($4, Qnil, Qnil, Qnil)) %*/ p.popCurrentScope(); } - | defn_head f_opt_paren_args '=' arg modifier_rescue arg { - p.endless_method_name($1); - p.restore_defun($1); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(@1.start(), $4, $6))); - $$ = new DefnNode($1.line, $1.name, $2, p.getCurrentScope(), body, @6.end()); - if (p.isNextBreak) $$.setContainsNextBreak(); - // Changed from MRI (combined two stmts) - /*% %*/ - /*% ripper: def!(get_value($1), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); - } - | defs_head f_opt_paren_args '=' arg { - p.endless_method_name($1); + | defs_head f_opt_paren_args '=' endless_arg { + p.endless_method_name($1, @1); p.restore_defun($1); /*%%%*/ $$ = new DefsNode($1.line, (Node) $1.singleton, $1.name, $2, p.getCurrentScope(), p.reduce_nodes(p.remove_begin($4)), @4.end()); @@ -1938,20 +1926,20 @@ arg : lhs '=' lex_ctxt arg_rhs { /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!($4, Qnil, Qnil, Qnil)) %*/ p.popCurrentScope(); } - | defs_head f_opt_paren_args '=' arg modifier_rescue arg { - p.endless_method_name($1); - p.restore_defun($1); - /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.rescued_expr(@1.start(), $4, $6))); - $$ = new DefsNode($1.line, (Node) $1.singleton, $1.name, $2, p.getCurrentScope(), body, @6.end()); - if (p.isNextBreak) $$.setContainsNextBreak(); - /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil)) %*/ - p.popCurrentScope(); - } | primary { $$ = $1; + }; + +endless_arg : arg %prec modifier_rescue + | endless_arg modifier_rescue after_rescue arg { + p.getLexContext().in_rescue = $3.in_rescue; + $$ = p.rescued_expr(@1.start(), $1, $4); + /*% ripper: rescue_mod!($:1, $:4) %*/ } + | keyword_not opt_nl endless_arg { + $$ = p.call_uni_op(p.method_cond($3), NOT); + /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/ + }; relop : '>' { $$ = GT; @@ -1964,7 +1952,7 @@ relop : '>' { } | tLEQ { $$ = LT_EQ; - } + }; rel_expr : arg relop arg %prec '>' { $$ = p.call_bin_op($1, $2, $3, p.src_line()); @@ -1972,19 +1960,26 @@ rel_expr : arg relop arg %prec '>' { | rel_expr relop arg %prec '>' { p.warning(p.src_line(), "comparison '" + $2 + "' after comparison"); $$ = p.call_bin_op($1, $2, $3, p.src_line()); - } + }; -lex_ctxt : tSP { +lex_ctxt : none { $$ = (LexContext) p.getLexContext().clone(); - } - | none { - $$ = (LexContext) p.getLexContext().clone(); - } + }; + +begin_defined : lex_ctxt { + p.getLexContext().in_defined = true; + $$ = $1; + }; + +after_rescue : lex_ctxt { + p.getLexContext().in_rescue = LexContext.InRescue.AFTER_RESCUE; + $$ = $1; + }; arg_value : arg { p.value_expr($1); $$ = p.makeNullNil($1); - } + }; aref_args : none | args trailer { @@ -2001,19 +1996,20 @@ aref_args : none $$ = p.newArrayNode(@1.start(), p.remove_duplicate_keys($1)); /*% %*/ /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/ - } + }; arg_rhs : arg %prec tOP_ASGN { p.value_expr($1); $$ = $1; } - | arg modifier_rescue arg { + | arg modifier_rescue after_rescue arg { + p.getLexContext().in_rescue = $3.in_rescue; /*%%%*/ p.value_expr($1); - $$ = p.newRescueModNode($1, $3); + $$ = p.newRescueModNode($1, $4); /*% %*/ - /*% ripper: rescue_mod!($1, $3) %*/ - } + /*% ripper: rescue_mod!($1, $4) %*/ + }; paren_args : '(' opt_call_args rparen { /*%%%*/ @@ -2040,9 +2036,9 @@ paren_args : '(' opt_call_args rparen { /*% %*/ /*% ripper: arg_paren!($2) %*/ } - } + }; -opt_paren_args : none | paren_args +opt_paren_args : none | paren_args; opt_call_args : none | call_args @@ -2060,7 +2056,7 @@ opt_call_args : none $$ = p.newArrayNode(@1.start(), p.remove_duplicate_keys($1)); /*% %*/ /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/ - } + }; // [!null] - ArgsCatNode, SplatNode, ArrayNode, HashNode, BlockPassNode @@ -2093,7 +2089,7 @@ call_args : command { } | block_arg { /*% ripper[brace]: args_add_block!(args_new!, $1) %*/ - } + }; // [!null] - ArgsCatNode, SplatNode, ArrayNode, HashNode, BlockPassNode command_args : { @@ -2118,7 +2114,7 @@ command_args : { cmdarg.pop(); if (lookahead) cmdarg.push0(); $$ = $2; - } + }; block_arg : tAMPER arg_value { /*%%%*/ @@ -2134,7 +2130,7 @@ block_arg : tAMPER arg_value { /*% $$ = p.nil(); %*/ - } + }; opt_block_arg : ',' block_arg { @@ -2147,7 +2143,7 @@ opt_block_arg : ',' block_arg { /*% $$ = p.fals(); %*/ - } + }; // [!null] args : arg_value { // ArrayNode @@ -2157,9 +2153,9 @@ args : arg_value { // ArrayNode /*% %*/ /*% ripper: args_add!(args_new!, $1) %*/ } - | tSTAR arg_value { // SplatNode + | arg_splat { // SplatNode /*%%%*/ - $$ = p.newSplatNode($2); + $$ = p.newSplatNode($1); /*% %*/ /*% ripper: args_add_star!(args_new!, $2) %*/ } @@ -2175,27 +2171,37 @@ args : arg_value { // ArrayNode /*% %*/ /*% ripper: args_add!($1, $3) %*/ } - | args ',' tSTAR arg_value { // ArgsCatNode, SplatNode, ArrayNode + | args ',' arg_splat { // ArgsCatNode, SplatNode, ArrayNode /*%%%*/ Node node = null; // FIXME: lose syntactical elements here (and others like this) - if ($4 instanceof ArrayNode && + if ($3 instanceof ArrayNode && (node = p.splat_array($1)) != null) { - $$ = p.list_concat(node, $4); + $$ = p.list_concat(node, $3); } else { - $$ = arg_concat($1, $4); + $$ = arg_concat($1, $3); } /*% %*/ - /*% ripper: args_add_star!($1, $4) %*/ + /*% ripper: args_add_star!($1, $3) %*/ + }; + +arg_splat : tSTAR arg_value { + $$ = $2; + /*% ripper: get_value($2); %*/ } + | tSTAR /* none */ { + p.forwarding_arg_check(FWD_REST, FWD_ALL, "rest"); + $$ = p.declareIdentifier(FWD_REST); + /*% ripper: Qnil %*/ + }; mrhs_arg : mrhs { $$ = $1; } | arg_value { $$ = $1; - } + }; mrhs : args ',' arg_value { @@ -2229,7 +2235,7 @@ mrhs : args ',' arg_value { $$ = p.newSplatNode($2); /*% %*/ /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/ - } + }; primary : literal | strings @@ -2264,17 +2270,9 @@ primary : literal /*% %*/ /*% ripper: begin!($3) %*/ } - | tLPAREN_ARG { - p.setState(EXPR_ENDARG); - } rparen { - /*%%%*/ - $$ = null; //FIXME: Should be implicit nil? - /*% %*/ - /*% ripper: paren!(0) %*/ - } - | tLPAREN_ARG stmt { + | tLPAREN_ARG compstmt { p.setState(EXPR_ENDARG); - } rparen { + } ')' { /*%%%*/ $$ = $2; /*% %*/ @@ -2328,27 +2326,25 @@ primary : literal /*% %*/ /*% ripper: return0! %*/ } - | keyword_yield '(' call_args rparen { + | k_yield '(' call_args rparen { /*%%%*/ $$ = p.new_yield(@1.start(), $3); /*% %*/ /*% ripper: yield!(paren!($3)) %*/ } - | keyword_yield '(' rparen { + | k_yield '(' rparen { /*%%%*/ $$ = new YieldNode(@1.start(), null); /*% %*/ /*% ripper: yield!(paren!(args_new!)) %*/ } - | keyword_yield { + | k_yield { /*%%%*/ $$ = new YieldNode(@1.start(), null); /*% %*/ /*% ripper: yield0! %*/ } - | keyword_defined opt_nl '(' { - p.getLexContext().in_defined = true; - } expr rparen { + | keyword_defined opt_nl '(' begin_defined expr rparen { p.getLexContext().in_defined = false; $$ = p.new_defined(@1.start(), $5); } @@ -2436,12 +2432,7 @@ primary : literal /*% ripper: for!($2, $4, $5) %*/ } | k_class cpath superclass { - LexContext ctxt = p.getLexContext(); - if (ctxt.in_def) { - p.yyerror("class definition in method body"); - } - ctxt.in_class = true; - p.pushLocalScope(); + p.begin_definition("class"); } bodystmt k_end { /*%%%*/ Node body = p.makeNullNil($5); @@ -2454,11 +2445,8 @@ primary : literal ctxt.in_class = $1.in_class; ctxt.shareable_constant_value = $1.shareable_constant_value; } - | k_class tLSHFT expr { - LexContext ctxt = p.getLexContext(); - ctxt.in_def = false; - ctxt.in_class = false; - p.pushLocalScope(); + | k_class tLSHFT expr_value { + p.begin_definition(null); } term bodystmt k_end { /*%%%*/ Node body = p.makeNullNil($6); @@ -2473,12 +2461,7 @@ primary : literal p.popCurrentScope(); } | k_module cpath { - LexContext ctxt = p.getLexContext(); - if (ctxt.in_def) { - p.yyerror("module definition in method body"); - } - ctxt.in_class = true; - p.pushLocalScope(); + p.begin_definition("module"); } bodystmt k_end { /*%%%*/ Node body = p.makeNullNil($4); @@ -2491,25 +2474,29 @@ primary : literal ctxt.in_class = $1.in_class; ctxt.shareable_constant_value = $1.shareable_constant_value; } - | defn_head f_arglist bodystmt k_end { + | defn_head f_arglist { + p.push_end_expect_token_locations(@1.start()); + } bodystmt k_end { p.restore_defun($1); /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil($3))); + Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil($4))); $$ = new DefnNode($1.line, $1.name, $2, p.getCurrentScope(), body, @4.end()); if (p.isNextBreak) $$.setContainsNextBreak(); /*% %*/ - /*% ripper: def!(get_value($1), $2, $3) %*/ + /*% ripper: def!(get_value($1), $2, $4) %*/ p.popCurrentScope(); } - | defs_head f_arglist bodystmt k_end { + | defs_head f_arglist { + p.push_end_expect_token_locations(@1.start()); + } bodystmt k_end { p.restore_defun($1); /*%%%*/ - Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil($3))); + Node body = p.reduce_nodes(p.remove_begin(p.makeNullNil($4))); $$ = new DefsNode($1.line, (Node) $1.singleton, $1.name, $2, p.getCurrentScope(), body, @4.end()); if (p.isNextBreak) $$.setContainsNextBreak(); // Changed from MRI (no more get_value) /*% %*/ - /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $3) %*/ + /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/ p.popCurrentScope(); } | keyword_break { @@ -2534,105 +2521,138 @@ primary : literal } | keyword_retry { /*%%%*/ + if (!p.getLexContext().in_defined) { + LexContext.InRescue rescue = p.getLexContext().in_rescue; + if (rescue != LexContext.InRescue.NONE) { + switch (rescue) { + case BEFORE_RESCUE: p.yyerror("Invalid retry without rescue"); break; + case AFTER_RESCUE: /* ok */ break; + case AFTER_ELSE: p.yyerror("Invalid retry after else"); break; + case AFTER_ENSURE: p.yyerror("Invalid retry after ensure"); break; + } + } + } $$ = new RetryNode(@1.start()); /*% %*/ /*% ripper: retry! %*/ - } + }; primary_value : primary { p.value_expr($1); - $$ = $1; - if ($$ == null) $$ = p.nil(); - } + $$ = $1 == null ? p.nil() : $1; + }; // FIXME: token_info_push k_begin : keyword_begin { + p.token_info_push("begin", @1); + p.push_end_expect_token_locations(@1.start()); $$ = $1; - } + }; k_if : keyword_if { $$ = $1; - } + p.WARN_EOL("if"); + p.token_info_push("if", @1); + /* + TokenInfo tokenInfo = p.getTokenInfo(); + if (tokenInfo.nonspc && + tokenInfo.next != null && tokenInfo.next.name.equals("else")) { + throw new RuntimeException("IMPL ME"); + }*/ + }; k_unless : keyword_unless { $$ = $1; - } + }; -k_while : keyword_while { - $$ = $1; - } +k_while : keyword_while allow_exits { + $$ = $2; + }; -k_until : keyword_until { +k_until : keyword_until allow_exits { $$ = $1; - } + }; k_case : keyword_case { $$ = $1; - } + }; -k_for : keyword_for { - $$ = $1; - } +k_for : keyword_for allow_exits { + $$ = $2; + }; k_class : keyword_class { $$ = (LexContext) p.getLexContext().clone(); - } + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; + p.push_end_expect_token_locations(@1.start()); + }; k_module : keyword_module { $$ = (LexContext) p.getLexContext().clone(); - } + p.getLexContext().in_rescue = LexContext.InRescue.BEFORE_RESCUE; + }; k_def : keyword_def { $$ = $1; p.getLexContext().in_argdef = true; - } + }; k_do : keyword_do { $$ = $1; - } + }; k_do_block : keyword_do_block { $$ = $1; - } + }; k_rescue : keyword_rescue { - $$ = $1; - } + $$ = p.getLexContext().clone(); + p.getLexContext().in_rescue = LexContext.InRescue.AFTER_RESCUE; + }; k_ensure : keyword_ensure { - $$ = $1; - } + $$ = p.getLexContext().clone(); + }; k_when : keyword_when { $$ = $1; - } + }; k_else : keyword_else { $$ = $1; - } + }; k_elsif : keyword_elsif { $$ = $1; - } + }; k_end : keyword_end { $$ = $1; } + | tDUMNY_END { + p.compile_error("syntax error, unexpected end-of-input"); + }; k_return : keyword_return { LexContext ctxt = p.getLexContext(); if (ctxt.in_class && !ctxt.in_def && !p.getCurrentScope().isBlockScope()) { p.compile_error("Invalid return in class/module body"); } - $$ = $1; - } + }; + +k_yield : keyword_yield { + LexContext ctxt = p.getLexContext(); + if (ctxt.in_defined && !ctxt.in_def && !p.isEval()) { + p.compile_error("Invalid yield"); + } + }; then : term | keyword_then - | term keyword_then + | term keyword_then; do : term - | keyword_do_cond + | keyword_do_cond; if_tail : opt_else | k_elsif expr_value then compstmt if_tail { @@ -2640,7 +2660,7 @@ if_tail : opt_else $$ = p.new_if(@1.start(), $2, $4, $5); /*% %*/ /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/ - } + }; opt_else : none | k_else compstmt { @@ -2648,12 +2668,12 @@ opt_else : none $$ = $2 == null ? NilImplicitNode.NIL : $2; /*% %*/ /*% ripper: else!($2) %*/ - } + }; // [!null] for_var : lhs | mlhs { - } + }; f_marg : f_norm_arg { /*%%%*/ @@ -2667,7 +2687,7 @@ f_marg : f_norm_arg { $$ = $2; /*% %*/ /*% ripper: mlhs_paren!($2) %*/ - } + }; // [!null] f_marg_list : f_marg { @@ -2681,7 +2701,7 @@ f_marg_list : f_marg { $$ = $1.add($3); /*% %*/ /*% ripper: mlhs_add!($1, $3) %*/ - } + }; f_margs : f_marg_list { /*%%%*/ @@ -2712,7 +2732,7 @@ f_margs : f_marg_list { $$ = new MultipleAsgnNode(p.src_line(), null, $1, $3); /*% %*/ /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/ - } + }; f_rest_marg : tSTAR f_norm_arg { ByteList id = @2.id; @@ -2727,7 +2747,7 @@ f_rest_marg : tSTAR f_norm_arg { $$ = new StarNode(p.src_line()); /*% %*/ /*% ripper: Qnil %*/ - } + }; f_any_kwrest : f_kwrest | f_no_kwarg { @@ -2736,12 +2756,12 @@ f_any_kwrest : f_kwrest /*% $$ = p.symbolID(LexingCommon.NIL); %*/ - } + }; f_eq : { p.getLexContext().in_argdef = false; } '=' - + ; block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg { $$ = p.new_args_tail(@1.start(), $1, $3, $4); @@ -2754,21 +2774,21 @@ block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg { } | f_block_arg { $$ = p.new_args_tail(@1.start(), null, (ByteList) null, $1); - } + }; opt_block_args_tail : ',' block_args_tail { $$ = $2; } | { $$ = p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null); - } + }; excessed_comma : ',' { // no need for this other than to look similar to MRI. /*%%%*/ $$ = new UnnamedRestArgNode(@1.start(), null, p.getCurrentScope().addVariable("*")); /*% %*/ /*% ripper: excessed_comma! %*/ - } + }; // [!null] block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail { @@ -2815,7 +2835,7 @@ block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail { } | block_args_tail { $$ = p.new_args(@1.start(), null, null, null, null, $1); - } + }; opt_block_param : none { /*%%%*/ @@ -2827,7 +2847,7 @@ opt_block_param : none { | block_param_def { p.setCommandStart(true); $$ = $1; - } + }; block_param_def : '|' opt_bv_decl '|' { p.setCurrentArg(null); @@ -2846,7 +2866,7 @@ block_param_def : '|' opt_bv_decl '|' { $$ = $2; /*% %*/ /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/ - } + }; // shadowed block variables.... opt_bv_decl : opt_nl { @@ -2857,7 +2877,7 @@ opt_bv_decl : opt_nl { $$ = null; /*% %*/ /*% ripper: $3 %*/ - } + }; // ENEBO: This is confusing... bv_decls : bvar { @@ -2867,7 +2887,7 @@ bv_decls : bvar { | bv_decls ',' bvar { $$ = null; /*% ripper[brace]: rb_ary_push($1, get_value($3)) %*/ - } + }; bvar : tIDENTIFIER { p.new_bv(@1.id); @@ -2875,31 +2895,42 @@ bvar : tIDENTIFIER { } | f_bad_arg { $$ = null; - } + }; + +max_numparam : { + $$ = p.resetMaxNumParam(); + }; + +numparam : { + $$ = p.numparam_push(); + }; +it_id : { + $$ = p.it_id(); + p.set_it_id(null); + }; + lambda : tLAMBDA { p.pushBlockScope(); $$ = p.getLeftParenBegin(); p.setLeftParenBegin(p.getParenNest()); - } { - $$ = p.resetMaxNumParam(); - } { - $$ = p.numparam_push(); - } f_larglist { + } max_numparam numparam it_id allow_exits f_larglist { p.getCmdArgumentState().push0(); } lambda_body { + Node it_id = p.it_id(); int max_numparam = p.restoreMaxNumParam($3); + p.set_it_id($5); p.getCmdArgumentState().pop(); // Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match). /*%%%*/ - ArgsNode args = p.args_with_numbered($5, max_numparam); - $$ = new LambdaNode(@1.start(), args, $7, p.getCurrentScope(), p.src_line()); + ArgsNode args = p.args_with_numbered($7, max_numparam, it_id); + $$ = new LambdaNode(@1.start(), args, $9, p.getCurrentScope(), p.src_line()); /*% %*/ /*% ripper: lambda!($5, $7) %*/ p.setLeftParenBegin($2); p.numparam_pop($4); p.popCurrentScope(); - } + }; f_larglist : '(' f_args opt_bv_decl ')' { p.getLexContext().in_argdef = false; @@ -2917,20 +2948,23 @@ f_larglist : '(' f_args opt_bv_decl ')' { } /*% %*/ $$ = $1; - } + }; lambda_body : tLAMBEG compstmt '}' { + p.token_info_pop("}", @1); $$ = $2; } - | keyword_do_LAMBDA bodystmt k_end { - $$ = $2; - } + | keyword_do_LAMBDA { + p.push_end_expect_token_locations(@1.start()); + } bodystmt k_end { + $$ = $3; + }; do_block : k_do_block do_body k_end { $$ = $2; /*%%%*/ /*% %*/ - } + }; // JRUBY-2326 and GH #305 both end up hitting this production whereas in // MRI these do not. I have never isolated the cause but I can work around @@ -2972,7 +3006,7 @@ block_call : command do_block { $$ = p.new_call($1, $2, $3, $4, $5, @3.start()); /*% %*/ /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/ - } + }; // [!null] method_call : fcall paren_args { @@ -3034,7 +3068,7 @@ method_call : fcall paren_args { } /*% %*/ /*% ripper: aref!($1, escape_Qundef($3)) %*/ - } + }; brace_block : '{' brace_body '}' { $$ = $2; @@ -3047,45 +3081,41 @@ brace_block : '{' brace_body '}' { /*%%%*/ $2.setLine(@1.end()); /*% %*/ - } + }; brace_body : { p.pushBlockScope(); - } { - $$ = p.resetMaxNumParam(); - } { - $$ = p.numparam_push(); - } opt_block_param compstmt { + } max_numparam numparam it_id allow_exits opt_block_param compstmt { + Node it_id = p.it_id(); int max_numparam = p.restoreMaxNumParam($2); + p.set_it_id($4); // Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match). /*%%%*/ - ArgsNode args = p.args_with_numbered($4, max_numparam); - $$ = new IterNode(@1.start(), args, $5, p.getCurrentScope(), p.src_line()); + ArgsNode args = p.args_with_numbered($6, max_numparam, it_id); + $$ = new IterNode(@1.start(), args, $7, p.getCurrentScope(), p.src_line()); /*% %*/ - /*% ripper: brace_block!(escape_Qundef($4), $5) %*/ + /*% ripper: brace_block!(escape_Qundef($6), $7) %*/ p.numparam_pop($3); p.popCurrentScope(); - } + }; do_body : { p.pushBlockScope(); - } { - $$ = p.resetMaxNumParam(); - } { - $$ = p.numparam_push(); p.getCmdArgumentState().push0(); - } opt_block_param bodystmt { + } max_numparam numparam it_id allow_exits opt_block_param bodystmt { + Node it_id = p.it_id(); int max_numparam = p.restoreMaxNumParam($2); + p.set_it_id($4); // Changed from MRI args_with_numbered put into parser codepath and not used by ripper (since it is just a passthrough method and types do not match). /*%%%*/ - ArgsNode args = p.args_with_numbered($4, max_numparam); - $$ = new IterNode(@1.start(), args, $5, p.getCurrentScope(), p.src_line()); + ArgsNode args = p.args_with_numbered($6, max_numparam, it_id); + $$ = new IterNode(@1.start(), args, $7, p.getCurrentScope(), p.src_line()); /*% %*/ - /*% ripper: do_block!(escape_Qundef($4), $5) %*/ + /*% ripper: do_block!(escape_Qundef($6), $7) %*/ p.getCmdArgumentState().pop(); p.numparam_pop($3); p.popCurrentScope(); - } + }; case_args : arg_value { /*%%%*/ @@ -3112,43 +3142,50 @@ case_args : arg_value { $$ = p.rest_arg_append($1, $4); /*% %*/ /*% ripper: args_add_star!($1, $4) %*/ - } + }; case_body : k_when case_args then compstmt cases { /*%%%*/ $$ = p.newWhenNode(@1.start(), $2, $4, $5); /*% %*/ /*% ripper: when!($2, $4, escape_Qundef($5)) %*/ - } + }; cases : opt_else | case_body + ; -// InNode - [!null] -p_case_body : keyword_in { - p.setState(EXPR_BEG|EXPR_LABEL); - p.setCommandStart(false); - LexContext ctxt = (LexContext) p.getLexContext(); - $1 = ctxt.in_kwarg; - ctxt.in_kwarg = true; +p_pvtbl : { $$ = p.push_pvtbl(); - } { + }; + +p_pktbl : { $$ = p.push_pktbl(); - } p_top_expr then { - p.pop_pktbl($3); - p.pop_pvtbl($2); - p.getLexContext().in_kwarg = $1; + }; + +p_in_kwarg : { + $$ = p.getLexContext().clone(); + p.setState(EXPR_BEG|EXPR_LABEL); + p.setCommandStart(false); + p.getLexContext().in_kwarg = true; + }; + +// InNode - [!null] +p_case_body : keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then { + p.pop_pvtbl($3); + p.pop_pktbl($4); + p.getLexContext().in_kwarg = $2.in_kwarg; } compstmt p_cases { /*%%%*/ - $$ = p.newIn(@1.start(), $4, $7, $8); + $$ = p.newIn(@1.start(), $5, $8, $9); /*% %*/ - /*% ripper: in!($4, $7, escape_Qundef($8)) %*/ - } + /*% ripper: in!($5, $8, escape_Qundef($9)) %*/ + }; p_cases : opt_else | p_case_body { $$ = $1; - } + }; p_top_expr : p_top_expr_body | p_top_expr_body modifier_if expr_value { @@ -3164,7 +3201,7 @@ p_top_expr : p_top_expr_body p.fixpos($$, $3); /*% %*/ /*% ripper: unless_mod!($3, $1) %*/ - } + }; // FindPatternNode, HashPatternNode, ArrayPatternNode + p_expr(a lot) p_top_expr_body : p_expr @@ -3186,9 +3223,10 @@ p_top_expr_body : p_expr } | p_kwargs { $$ = p.new_hash_pattern(null, $1); - } + }; p_expr : p_as + ; p_as : p_expr tASSOC p_variable { /*%%%*/ @@ -3197,6 +3235,7 @@ p_as : p_expr tASSOC p_variable { /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/ } | p_alt + ; p_alt : p_alt '|' p_expr_basic { /*%%%*/ @@ -3205,13 +3244,17 @@ p_alt : p_alt '|' p_expr_basic { /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/ } | p_expr_basic + ; -p_lparen : '(' { - $$ = p.push_pktbl(); - } -p_lbracket : '[' { - $$ = p.push_pktbl(); - } +p_lparen : '(' p_pktbl { + $$ = $2; + /*% ripper: get_value($:2); %*/ + }; + +p_lbracket : '[' p_pktbl { + $$ = $2; + /*% ripper: get_value($:2); %*/ + }; p_expr_basic : p_value | p_variable @@ -3275,25 +3318,20 @@ p_expr_basic : p_value $$ = p.new_array_pattern(@1.start(), null, null, p.new_array_pattern_tail(@1.start(), null, false, null, null)); } - | tLBRACE { - $$ = p.push_pktbl(); - LexContext ctxt = p.getLexContext(); - $1 = ctxt.in_kwarg; - ctxt.in_kwarg = false; + | tLBRACE p_pktbl lex_ctxt { + p.getLexContext().in_kwarg = false; } p_kwargs rbrace { p.pop_pktbl($2); - p.getLexContext().in_kwarg = $1; - $$ = p.new_hash_pattern(null, $3); + p.getLexContext().in_kwarg = $3.in_kwarg; + $$ = p.new_hash_pattern(null, $5); } | tLBRACE rbrace { $$ = p.new_hash_pattern(null, p.new_hash_pattern_tail(@1.start(), p.none(), null)); } - | tLPAREN { - $$ = p.push_pktbl(); - } p_expr rparen { + | tLPAREN p_pktbl p_expr rparen { p.pop_pktbl($2); $$ = $3; - } + }; p_args : p_expr { /*%%%*/ @@ -3316,21 +3354,15 @@ p_args : p_expr { $$ = p.new_array_pattern_tail(@1.start(), pre_args, false, null, null); %*/ } - | p_args_head tSTAR tIDENTIFIER { - $$ = p.new_array_pattern_tail(@1.start(), $1, true, $3, null); - } - | p_args_head tSTAR tIDENTIFIER ',' p_args_post { - $$ = p.new_array_pattern_tail(@1.start(), $1, true, $3, $5); + | p_args_head p_rest { + $$ = p.new_array_pattern_tail(@1.start(), $1, true, $2, null); } - | p_args_head tSTAR { - $$ = p.new_array_pattern_tail(@1.start(), $1, true, null, null); - } - | p_args_head tSTAR ',' p_args_post { - $$ = p.new_array_pattern_tail(@1.start(), $1, true, null, $4); + | p_args_head p_rest ',' p_args_post { + $$ = p.new_array_pattern_tail(@1.start(), $1, true, $2, $4); } | p_args_tail { $$ = $1; - } + }; // ListNode - [!null] p_args_head : p_arg ',' { @@ -3341,28 +3373,31 @@ p_args_head : p_arg ',' { $$ = p.list_concat($1, $2); /*% %*/ /*% ripper: rb_ary_concat($1, get_value($2)) %*/ - } + }; p_args_tail : p_rest { - $$ = p.new_array_pattern_tail(@1.start(), null, true, $1, null); + $$ = p.new_array_pattern_tail(@1.start(), null, true, $1, null); } | p_rest ',' p_args_post { - $$ = p.new_array_pattern_tail(@1.start(), null, true, $1, $3); - } + $$ = p.new_array_pattern_tail(@1.start(), null, true, $1, $3); + }; // FindPatternNode - [!null] p_find : p_rest ',' p_args_post ',' p_rest { - p.warn_experimental(@1.start(), "Find pattern is experimental, and the behavior may change in future versions of Ruby!"); - $$ = p.new_find_pattern_tail(@1.start(), $1, $3, $5); - } + p.warn_experimental(@1.start(), "Find pattern is experimental, and the behavior may change in future versions of Ruby!"); + $$ = p.new_find_pattern_tail(@1.start(), $1, $3, $5); + }; // ByteList p_rest : tSTAR tIDENTIFIER { + p.error_duplicate_pattern_variable($2); $$ = $2; + /*% ripper: ripper_assignable(p, $2, var_field(p, get_value($:2))) %*/ } | tSTAR { $$ = null; - } + /*% ripper: var_field(p, Qnil) %*/ + }; // ListNode - [!null] p_args_post : p_arg @@ -3371,7 +3406,7 @@ p_args_post : p_arg $$ = p.list_concat($1, $3); /*% %*/ /*% ripper: rb_ary_concat($1, get_value($3)) %*/ - } + }; // ListNode - [!null] p_arg : p_expr { @@ -3379,7 +3414,7 @@ p_arg : p_expr { $$ = p.newArrayNode(@1.start(), $1); /*% %*/ /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/ - } + }; // HashPatternNode - [!null] p_kwargs : p_kwarg ',' p_any_kwrest { @@ -3393,7 +3428,7 @@ p_kwargs : p_kwarg ',' p_any_kwrest { } | p_any_kwrest { $$ = p.new_hash_pattern_tail(@1.start(), null, $1); - } + }; // HashNode - [!null] p_kwarg : p_kw { @@ -3408,7 +3443,7 @@ p_kwarg : p_kw { $$ = $1; /*% %*/ /*% ripper: rb_ary_push($1, $3) %*/ - } + }; // KeyValuePair - [!null] p_kw : p_kw_label p_expr { @@ -3432,7 +3467,7 @@ p_kw : p_kw_label p_expr { $$ = new KeyValuePair(label, p.assignableLabelOrIdentifier($1, null)); /*% %*/ /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/ - } + }; // ByteList p_kw_label : tLABEL @@ -3450,7 +3485,7 @@ p_kw_label : tLABEL p.yyerror("symbol literal with interpolation is not allowed"); $$ = null; } - } + }; p_kwrest : kwrest_mark tIDENTIFIER { $$ = $2; @@ -3461,7 +3496,7 @@ p_kwrest : kwrest_mark tIDENTIFIER { /*% $$ = null; %*/ - } + }; p_kwnorest : kwrest_mark keyword_nil { /*%%%*/ @@ -3469,14 +3504,14 @@ p_kwnorest : kwrest_mark keyword_nil { /*% $$ = p.symbolID(KWNOREST); %*/ - } + }; p_any_kwrest : p_kwrest { $$ = $1; } | p_kwnorest { $$ = $1; - } + }; p_value : p_primitive | p_primitive tDOT2 p_primitive { @@ -3531,7 +3566,7 @@ p_value : p_primitive $$ = new DotNode(@1.start(), NilImplicitNode.NIL, p.makeNullNil($2), true, isLiteral); /*% %*/ /*% ripper: dot3!(Qnil, $2) %*/ - } + }; p_primitive : literal | strings @@ -3594,7 +3629,7 @@ p_primitive : literal } /*mri:keyword_variable*/ | lambda { $$ = $1; - } + }; p_variable : tIDENTIFIER { /*%%%*/ @@ -3603,7 +3638,7 @@ p_variable : tIDENTIFIER { /*% $$ = p.assignable(@1.id, p.var_field($1)); %*/ - } + }; p_var_ref : '^' tIDENTIFIER { /*%%%*/ @@ -3621,14 +3656,14 @@ p_var_ref : '^' tIDENTIFIER { if ($$ == null) $$ = new BeginNode(@1.start(), NilImplicitNode.NIL); /*% %*/ /*% ripper: var_ref!($2) %*/ - } + }; -p_expr_ref : '^' tLPAREN expr_value ')' { +p_expr_ref : '^' tLPAREN expr_value rparen { /*%%%*/ $$ = new BeginNode(@1.start(), $3); /*% %*/ /*% ripper: begin!($3) %*/ - } + }; p_const : tCOLON3 cname { /*%%%*/ @@ -3647,13 +3682,13 @@ p_const : tCOLON3 cname { $$ = new ConstNode(@1.start(), p.symbolID($1)); /*% %*/ /*% ripper: var_ref!($1) %*/ - } + }; opt_rescue : k_rescue exc_list exc_var then compstmt opt_rescue { /*%%%*/ Node node; if ($3 != null) { - node = p.appendToBlock(node_assign($3, new GlobalVarNode(@1.start(), p.symbolID(DOLLAR_BANG))), p.makeNullNil($5)); + node = p.appendToBlock(node_assign($3, new GlobalVarNode(@1.start(), p.symbolID(DOLLAR_BANG)), null), p.makeNullNil($5)); if ($5 != null) { node.setLine(@1.start()); } @@ -3667,7 +3702,7 @@ opt_rescue : k_rescue exc_list exc_var then compstmt opt_rescue { } | none { $$ = null; - } + }; exc_list : arg_value { /*%%%*/ @@ -3683,26 +3718,30 @@ exc_list : arg_value { /*% ripper: $1 %*/ } | none + ; exc_var : tASSOC lhs { $$ = $2; } | none + ; opt_ensure : k_ensure compstmt { /*%%%*/ + p.getLexContext().in_rescue = $1.in_rescue; $$ = $2; /*% %*/ /*% ripper: ensure!($2) %*/ } | none + ; literal : numeric { $$ = $1; } | symbol { $$ = $1; - } + }; strings : string { @@ -3710,7 +3749,7 @@ strings : string { $$ = $1 instanceof EvStrNode ? new DStrNode(@1.start(), p.getEncoding()).add($1) : $1; /*% %*/ /*% ripper: $1 %*/ - } + }; // [!null] string : tCHAR { @@ -3724,7 +3763,7 @@ string : tCHAR { $$ = p.literal_concat($1, $2); /*% %*/ /*% ripper: string_concat!($1, $2) %*/ - } + }; string1 : tSTRING_BEG string_contents tSTRING_END { /*%%%*/ @@ -3732,7 +3771,7 @@ string1 : tSTRING_BEG string_contents tSTRING_END { $$ = $2; /*% %*/ /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/ - } + }; xstring : tXSTRING_BEG xstring_contents tSTRING_END { /*%%%*/ @@ -3753,19 +3792,25 @@ xstring : tXSTRING_BEG xstring_contents tSTRING_END { } /*% %*/ /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/ - } + }; regexp : tREGEXP_BEG regexp_contents tREGEXP_END { $$ = p.new_regexp(@2.start(), $2, $3); + }; + +words_sep : ' ' { } + | words_sep ' ' + ; // [!null] - ListNode -words : tWORDS_BEG ' ' word_list tSTRING_END { +words : tWORDS_BEG words_sep word_list tSTRING_END { /*%%%*/ $$ = $3; /*% %*/ /*% ripper: array!($3) %*/ - } + }; + // [!null] - ListNode word_list : /* none */ { @@ -3774,12 +3819,12 @@ word_list : /* none */ { /*% %*/ /*% ripper: words_new! %*/ } - | word_list word ' ' { + | word_list word words_sep { /*%%%*/ $$ = $1.add($2 instanceof EvStrNode ? new DStrNode(@1.start(), p.getEncoding()).add($2) : $2); /*% %*/ /*% ripper: words_add!($1, $2) %*/ - } + }; // [!null] - StrNode, ListNode (usually D*) word : string_content { @@ -3791,14 +3836,14 @@ word : string_content { $$ = p.literal_concat($1, $2); /*% %*/ /*% ripper: word_add!($1, $2) %*/ - } + }; -symbols : tSYMBOLS_BEG ' ' symbol_list tSTRING_END { +symbols : tSYMBOLS_BEG words_sep symbol_list tSTRING_END { /*%%%*/ $$ = $3; /*% %*/ /*% ripper: array!($3) %*/ - } + }; symbol_list : /* none */ { /*%%%*/ @@ -3806,28 +3851,28 @@ symbol_list : /* none */ { /*% %*/ /*% ripper: symbols_new! %*/ } - | symbol_list word ' ' { + | symbol_list word words_sep { /*%%%*/ $$ = $1.add($2 instanceof EvStrNode ? new DSymbolNode(@1.start()).add($2) : p.asSymbol(@1.start(), $2)); /*% %*/ /*% ripper: symbols_add!($1, $2) %*/ - } + }; // [!null] - ListNode -qwords : tQWORDS_BEG ' ' qword_list tSTRING_END { +qwords : tQWORDS_BEG words_sep qword_list tSTRING_END { /*%%%*/ $$ = $3; /*% %*/ /*% ripper: array!($3) %*/ - } + }; // [!null] - ListNode -qsymbols : tQSYMBOLS_BEG ' ' qsym_list tSTRING_END { +qsymbols : tQSYMBOLS_BEG words_sep qsym_list tSTRING_END { /*%%%*/ $$ = $3; /*% %*/ /*% ripper: array!($3) %*/ - } + }; // [!null] - ListNode @@ -3837,12 +3882,12 @@ qword_list : /* none */ { /*% %*/ /*% ripper: qwords_new! %*/ } - | qword_list tSTRING_CONTENT ' ' { + | qword_list tSTRING_CONTENT words_sep { /*%%%*/ $$ = $1.add($2); /*% %*/ /*% ripper: qwords_add!($1, $2) %*/ - } + }; // [!null] - ListNode qsym_list : /* none */ { @@ -3851,12 +3896,12 @@ qsym_list : /* none */ { /*% %*/ /*% ripper: qsymbols_new! %*/ } - | qsym_list tSTRING_CONTENT ' ' { + | qsym_list tSTRING_CONTENT words_sep { /*%%%*/ $$ = $1.add(p.asSymbol(@1.start(), $2)); /*% %*/ /*% ripper: qsymbols_add!($1, $2) %*/ - } + }; /* note: we differ from MRI in that we just use same RubyString logic vs their ripper_new_yyval code. */ @@ -3872,7 +3917,7 @@ string_contents : /* none */ { /*% %*/ /*% ripper: string_add!($1, $2) %*/ // JRuby changed (removed) - } + }; xstring_contents: /* none */ { /*%%%*/ @@ -3887,7 +3932,7 @@ xstring_contents: /* none */ { $$ = p.literal_concat($1, $2); /*% %*/ /*% ripper: xstring_add!($1, $2) %*/ - } + }; regexp_contents: /* none */ { /*%%%*/ @@ -3903,7 +3948,7 @@ regexp_contents: /* none */ { /*% $$ = p.dispatch("on_regexp_add", $1, $2); %*/ - } + }; // [!null] - StrNode, EvStrNode string_content : tSTRING_CONTENT { @@ -3935,7 +3980,7 @@ string_content : tSTRING_CONTENT { } { $$ = p.getHeredocIndent(); p.setHeredocIndent(0); - } compstmt tSTRING_DEND { + } compstmt string_dend { p.getConditionState().pop(); p.getCmdArgumentState().pop(); p.setStrTerm($2); @@ -3949,31 +3994,27 @@ string_content : tSTRING_CONTENT { $$ = p.newEvStrNode(@6.start(), $6); /*% %*/ /*% ripper: string_embexpr!($6) %*/ - } + }; -string_dvar : tGVAR { - /*%%%*/ - $$ = new GlobalVarNode(p.src_line(), p.symbolID($1)); - /*% %*/ - /*% ripper: var_ref!($1) %*/ - } - | tIVAR { - /*%%%*/ - $$ = new InstVarNode(p.src_line(), p.symbolID($1)); - /*% %*/ - /*% ripper: var_ref!($1) %*/ - } - | tCVAR { +string_dend : tSTRING_DEND + | END_OF_INPUT + ; + + +string_dvar : nonlocal_var { /*%%%*/ - $$ = new ClassVarNode(p.src_line(), p.symbolID($1)); + $$ = p.gettable($1); + if ($$ == null) $$ = p.NEW_ERROR(@1); /*% %*/ /*% ripper: var_ref!($1) %*/ } | backref + ; // [!null] - SymbolNode, DSymbolNode symbol : ssym | dsym + ; // [!null] - SymbolNode:symbol ssym : tSYMBEG sym { @@ -3982,19 +4023,12 @@ ssym : tSYMBEG sym { $$ = p.asSymbol(p.src_line(), $2); /*% %*/ /*% ripper: symbol_literal!(symbol!($2)) %*/ - } + }; // [!null] - ByteList:symbol sym : fname - | tIVAR { - $$ = $1; - } - | tGVAR { - $$ = $1; - } - | tCVAR { - $$ = $1; - } + | nonlocal_var + ; // [!null] - SymbolNode, DSymbolNode dsym : tSYMBEG string_contents tSTRING_END { @@ -4017,7 +4051,7 @@ dsym : tSYMBEG string_contents tSTRING_END { } /*% %*/ /*% ripper: dyna_symbol!($2) %*/ - } + }; numeric : simple_numeric { $$ = $1; @@ -4027,11 +4061,7 @@ numeric : simple_numeric { $$ = p.negateNumeric($2); /*% %*/ /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/ - } - -nonlocal_var : tIVAR - | tGVAR - | tCVAR + }; simple_numeric : tINTEGER { $$ = $1; @@ -4044,7 +4074,12 @@ simple_numeric : tINTEGER { } | tIMAGINARY { $$ = $1; - } + }; + +nonlocal_var : tIVAR + | tGVAR + | tCVAR + ; /* note[ripper]: We call a helper for user_variables instead of their code */ // [!null] @@ -4150,7 +4185,8 @@ var_ref : tIDENTIFIER { // mri:user_variable $$ = new EncodingNode(@1.start(), p.getEncoding()); /*% %*/ /*% ripper: var_ref!($1) %*/ - } // mri:keyword_variable + // mri:keyword_variable + }; // [!null] var_lhs : tIDENTIFIER { // mri:user_variable @@ -4246,7 +4282,8 @@ var_lhs : tIDENTIFIER { // mri:user_variable /*% $$ = p.assignable(@1.id, p.var_field($1)); %*/ - } // mri:keyword_variable + // mri:keyword_variable + }; // [!null] backref : tNTH_REF { @@ -4254,7 +4291,7 @@ backref : tNTH_REF { } | tBACK_REF { $$ = $1; - } + }; superclass : '<' { p.setState(EXPR_BEG); @@ -4267,14 +4304,14 @@ superclass : '<' { $$ = null; /*% %*/ /*% ripper: Qnil %*/ - } + }; f_opt_paren_args: f_paren_args | none { p.getLexContext().in_argdef = false; $$ = p.new_args(@1.start(), null, null, null, null, p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null)); - } + }; f_paren_args : '(' f_args rparen { /*%%%*/ @@ -4284,26 +4321,25 @@ f_paren_args : '(' f_args rparen { p.setState(EXPR_BEG); p.getLexContext().in_argdef = false; p.setCommandStart(true); - } + }; // [!null] f_arglist : f_paren_args { $$ = $1; } | { - LexContext ctxt = p.getLexContext(); - $$ = ctxt.in_kwarg; - ctxt.in_kwarg = true; - ctxt.in_argdef = true; + $$ = p.getLexContext().clone(); + p.getLexContext().in_kwarg = true; + p.getLexContext().in_argdef = true; p.setState(p.getState() | EXPR_LABEL); } f_args term { LexContext ctxt = p.getLexContext(); - ctxt.in_kwarg = $1; + ctxt.in_kwarg = $1.in_kwarg; ctxt.in_argdef = false; $$ = $2; p.setState(EXPR_BEG); p.setCommandStart(true); - } + }; args_tail : f_kwarg ',' f_kwrest opt_f_block_arg { @@ -4321,14 +4357,14 @@ args_tail : f_kwarg ',' f_kwrest opt_f_block_arg { | args_forward { p.add_forwarding_args(); $$ = p.new_args_tail(@1.start(), null, $1, FWD_BLOCK); - } + }; opt_args_tail : ',' args_tail { $$ = $2; } | /* none */ { $$ = p.new_args_tail(p.src_line(), null, (ByteList) null, (ByteList) null); - } + }; // [!null] f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail { @@ -4375,7 +4411,7 @@ f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail { } | /* none */ { $$ = p.new_args(p.src_line(), null, null, null, null, (ArgsTailHolder) null); - } + }; // [!null] - ByteList args_forward : tBDOT3 { @@ -4383,7 +4419,7 @@ args_forward : tBDOT3 { $$ = FWD_KWREST; /*% %*/ /*% ripper: args_forward! %*/ - } + }; f_bad_arg : tCONSTANT { String message = "formal argument cannot be a constant"; @@ -4412,7 +4448,7 @@ f_bad_arg : tCONSTANT { p.yyerror(message); /*% %*/ /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/ - } + }; // ByteList:f_norm_arg [!null] f_norm_arg : f_bad_arg { @@ -4421,7 +4457,7 @@ f_norm_arg : f_bad_arg { | tIDENTIFIER { $$ = p.formal_argument(@1.id, $1); p.ordinalMaxNumParam(); - } + }; f_arg_asgn : f_norm_arg { RubySymbol name = p.get_id($1); @@ -4433,7 +4469,7 @@ f_arg_asgn : f_norm_arg { $$ = $1; %*/ - } + }; f_arg_item : f_arg_asgn { p.setCurrentArg(null); @@ -4447,7 +4483,7 @@ f_arg_item : f_arg_asgn { $$ = $2; /*% %*/ /*% ripper: mlhs_paren!($2) %*/ - } + }; // [!null] f_arg : f_arg_item { @@ -4462,7 +4498,7 @@ f_arg : f_arg_item { $$ = $1; /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; f_label : tLABEL { p.formal_argument(@1.id, $1); @@ -4471,7 +4507,7 @@ f_label : tLABEL { p.ordinalMaxNumParam(); p.getLexContext().in_argdef = false; $$ = $1; - } + }; // KeywordArgNode - [!null] f_kw : f_label arg_value { @@ -4491,7 +4527,7 @@ f_kw : f_label arg_value { /*% $$ = p.new_assoc(p.assignable(@1.id, $1), p.nil()); %*/ - } + }; f_block_kw : f_label primary_value { p.getLexContext().in_argdef = true; @@ -4508,7 +4544,7 @@ f_block_kw : f_label primary_value { /*% $$ = p.new_assoc(p.assignable(@1.id, $1), p.fals()); %*/ - } + }; f_block_kwarg : f_block_kw { @@ -4522,7 +4558,7 @@ f_block_kwarg : f_block_kw { $$ = $1.add($3); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; // ListNode - [!null] f_kwarg : f_kw { @@ -4536,21 +4572,18 @@ f_kwarg : f_kw { $$ = $1.add($3); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; kwrest_mark : tPOW { $$ = $1; } | tDSTAR { $$ = $1; - } + }; -f_no_kwarg : kwrest_mark keyword_nil { - /*%%%*/ - $$ = KWNOREST; - /*% %*/ +f_no_kwarg : p_kwnorest { /*% ripper: nokw_param!(Qnil) %*/ - } + }; f_kwrest : kwrest_mark tIDENTIFIER { p.shadowing_lvar(@2.id); @@ -4561,10 +4594,10 @@ f_kwrest : kwrest_mark tIDENTIFIER { } | kwrest_mark { /*%%%*/ - $$ = p.INTERNAL_ID; + $$ = FWD_KWREST; /*% %*/ /*% ripper: kwrest_param!(Qnil) %*/ - } + }; f_opt : f_arg_asgn f_eq arg_value { /*%%%*/ @@ -4574,8 +4607,7 @@ f_opt : f_arg_asgn f_eq arg_value { /*% $$ = p.new_assoc(p.assignable(@1.id, $1), $3); %*/ - - } + }; f_block_opt : f_arg_asgn f_eq primary_value { p.getLexContext().in_argdef = true; @@ -4585,7 +4617,7 @@ f_block_opt : f_arg_asgn f_eq primary_value { /*% $$ = p.new_assoc(p.assignable(@1.id, $1), $3); %*/ - } + }; f_block_optarg : f_block_opt { /*%%%*/ @@ -4598,7 +4630,7 @@ f_block_optarg : f_block_opt { $$ = p.appendToBlock($1, $3); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; f_optarg : f_opt { /*%%%*/ @@ -4611,14 +4643,14 @@ f_optarg : f_opt { $$ = p.appendToBlock($1, $3); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; restarg_mark : '*' { $$ = STAR; } | tSTAR { $$ = $1; - } + }; // [!null] f_rest_arg : restarg_mark tIDENTIFIER { @@ -4636,7 +4668,7 @@ f_rest_arg : restarg_mark tIDENTIFIER { $$ = new UnnamedRestArgNode(p.src_line(), p.symbolID(CommonByteLists.EMPTY), p.getCurrentScope().addVariable("*")); /*% %*/ /*% ripper: rest_param!(Qnil) %*/ - } + }; // [!null] blkarg_mark : '&' { @@ -4644,7 +4676,7 @@ blkarg_mark : '&' { } | tAMPER { $$ = $1; - } + }; // f_block_arg - Block argument def for function (foo(&block)) [!null] f_block_arg : blkarg_mark tIDENTIFIER { @@ -4665,7 +4697,7 @@ f_block_arg : blkarg_mark tIDENTIFIER { /*% $$ = p.dispatch("on_blockarg", p.nil()); %*/ - } + }; opt_f_block_arg : ',' f_block_arg { @@ -4673,7 +4705,7 @@ opt_f_block_arg : ',' f_block_arg { } | { $$ = null; - } + }; singleton : var_ref { p.value_expr($1); @@ -4692,7 +4724,7 @@ singleton : var_ref { $$ = $3; /*% %*/ /*% ripper: paren!($3) %*/ - } + }; // HashNode: [!null] assoc_list : none { @@ -4705,7 +4737,7 @@ assoc_list : none { $$ = p.remove_duplicate_keys($1); /*% %*/ /*% ripper: assoclist_from_args!($1) %*/ - } + }; // [!null] assocs : assoc { @@ -4719,7 +4751,7 @@ assocs : assoc { $$ = $1.add($3); /*% %*/ /*% ripper: rb_ary_push($1, get_value($3)) %*/ - } + }; // Cons: [!null] assoc : arg_value tASSOC arg_value { @@ -4744,12 +4776,12 @@ assoc : arg_value tASSOC arg_value { /*% %*/ /*% ripper: assoc_new!($1, Qnil) %*/ } - | tSTRING_BEG string_contents tLABEL_END arg_value { /*%%%*/ if ($2 instanceof StrNode) { - Node label = p.asSymbol(@2.start(), $2); - $$ = p.createKeyValue(label, $4); + DStrNode dnode = new DStrNode(@2.start(), p.getEncoding()); + dnode.add($2); + $$ = p.createKeyValue(new DSymbolNode(@2.start(), dnode), $4); } else if ($2 instanceof DStrNode) { $$ = p.createKeyValue(new DSymbolNode(@2.start(), $2), $4); } else { @@ -4764,6 +4796,12 @@ assoc : arg_value tASSOC arg_value { /*% %*/ /*% ripper: assoc_splat!($2) %*/ } + | tDSTAR { + p.forwarding_arg_check(FWD_KWREST, FWD_ALL, "keyword rest"); + $$ = p.createKeyValue(null, p.declareIdentifier(FWD_KWREST)); + /*% ripper: assoc_splat!(Qnil) %*/ + }; + operation : tIDENTIFIER { $$ = $1; @@ -4773,19 +4811,14 @@ operation : tIDENTIFIER { } | tFID { $$ = $1; - } -operation2 : tIDENTIFIER { - $$ = $1; - } - | tCONSTANT { - $$ = $1; - } - | tFID { + }; + +operation2 : operation { $$ = $1; } | op { $$ = $1; - } + }; operation3 : tIDENTIFIER { $$ = $1; @@ -4795,53 +4828,63 @@ operation3 : tIDENTIFIER { } | op { $$ = $1; - } + }; dot_or_colon : '.' { $$ = $<@@token_type@@>1; } | tCOLON2 { $$ = $<@@token_type@@>1; - } + }; call_op : '.' { $$ = $<@@token_type@@>1; } | tANDDOT { $$ = $1; - } + }; call_op2 : call_op | tCOLON2 { $$ = $1; - } + }; opt_terms : | terms + ; + opt_nl : | '\n' + ; + rparen : opt_nl ')' { $$ = RPAREN; - } + }; + rbracket : opt_nl ']' { $$ = RBRACKET; - } + }; + rbrace : opt_nl '}' { $$ = RCURLY; - } + }; + trailer : | '\n' | ',' + ; term : ';' | '\n' + ; terms : term | terms ';' + ; none : { $$ = null; - } + }; none_block_pass : { $$ = null; - } + }; %% diff --git a/core/src/main/java/org/jruby/parser/RubyParserBase.java b/core/src/main/java/org/jruby/parser/RubyParserBase.java index 8c44ff12f51..1f4effcc5b6 100644 --- a/core/src/main/java/org/jruby/parser/RubyParserBase.java +++ b/core/src/main/java/org/jruby/parser/RubyParserBase.java @@ -44,6 +44,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import org.jcodings.Encoding; @@ -124,6 +125,10 @@ public abstract class RubyParserBase { private boolean frozenStringLiterals; + private Node itId; + + private TokenInfo tokenInfo; + public RubyParserBase(Ruby runtime, LexerSource source, DynamicScope scope, ParserType type) { this.runtime = runtime; this.lexer = new RubyLexer(this, source, getWarnings()); @@ -196,18 +201,29 @@ public void numparam_pop(Node previousInner) { } - public ArgsNode args_with_numbered(ArgsNode args, int paramCount) { - if (paramCount > 0) { - if (args == null) { // FIXME: I think this is not possible. + public ArgsNode args_with_numbered(ArgsNode args, int paramCount, Node itNode) { + if (args.isEmpty()) { + if (paramCount > 0) { ListNode pre = makePreNumArgs(paramCount); args = new_args(lexer.getRubySourceline(), pre, null, null, null, null); - } else if (args.getArgs().length == 0) { - ListNode pre = makePreNumArgs(paramCount); - args = new_args(lexer.getRubySourceline(), pre, null, null, null, null); - } else { - // FIXME: not sure where errors are printed in all this but could be here. + } else if (itNode != null) { + DVarNode dvar = (DVarNode) itNode; + Node arg = new ArgumentNode(dvar.getLine(), dvar.getName(), dvar.getDepth()); + args = new_args(lexer.getRubySourceline(), newArrayNode(arg.getLine(), arg), null, null, null, null); + } + } else { + if (itNode != null) { + boolean hasNormalIt = false; + for (Node arg : args.getArgs()) { + if (arg instanceof INameNode && "it".equals(((INameNode) arg).getName().idString())) { + hasNormalIt = true; + break; + } + } + + if (!hasNormalIt) yyerror("ordinary parameter is defined"); } - // FIXME: it just sets pre-value here but what existing args node would work here? + // FIXME: multiple mismatch errors need to be defined. } return args; } @@ -320,6 +336,10 @@ public Node gettable2(Node node) { return null; } + public boolean hasNumParam() { + return maxNumParam > 0; + } + private boolean numberedParam(String id) { int n = Integer.parseInt(id.substring(1)); if (scopedParserState.getEnclosingScope() == null) return false; @@ -389,6 +409,13 @@ public Node declareIdentifier(ByteList byteName) { new DVarNode(lexer.tokline, slot, name) : new LocalVarNode(lexer.tokline, slot, name); if (numParamCurrent == null) numParamCurrent = node; + } else if ("**".equals(id)) { + slot = currentScope.addVariable(id); + node = new LocalVarNode(lexer.tokline, slot, name); + } else if (id.equals("it") && !this.scopedParserState.hasDefinedVariables()) { + slot = currentScope.addVariable(id); + node = new DVarNode(lexer.tokline, slot, name); + set_it_id(node); } else { node = currentScope.declare(lexer.tokline, name); slot = currentScope.isDefined(id); // FIXME: we should not do this extra call. @@ -586,14 +613,10 @@ public Node attrset(Node receiver, ByteList callType, ByteList name) { return new_attrassign(receiver.getLine(), receiver, name.append('='), null, isLazy(callType)); } - public void backrefAssignError(Node node) { - if (node instanceof NthRefNode) { - String varName = "$" + ((NthRefNode) node).getMatchNumber(); - lexer.compile_error("Can't set variable " + varName + '.'); - } else if (node instanceof BackRefNode) { - String varName = "$" + ((BackRefNode) node).getType(); - lexer.compile_error("Can't set variable " + varName + '.'); - } + public void backref_error(Node node) { + String varName = "$" + (node instanceof NthRefNode ? + ((NthRefNode) node).getMatchNumber() : ((BackRefNode) node).getType()); + lexer.compile_error("Can't set variable " + varName + '.'); } private static Node arg_add(int line, Node node1, Node node2) { @@ -608,10 +631,11 @@ private static Node arg_add(int line, Node node1, Node node2) { return new ArgsPushNode(line, node1, node2); } - + + // FIXME: lexcontext for shareable constants support but not impld /** **/ - public static Node node_assign(Node lhs, Node rhs) { + public static Node node_assign(Node lhs, Node rhs, LexContext _lexContext) { if (lhs == null) return null; // MRI sets position to one passed in its version of node_assign but it is always pos of lhs???? @@ -853,6 +877,16 @@ public Node gettable(ByteList id) { if (numParamCurrent == null) numParamCurrent = newNode; return newNode; } + if (type == StaticScope.Type.BLOCK && id.equals("it") && !this.scopedParserState.hasDefinedVariables()) { + if (hasNumParam()) return null; + if (maxNumParam == -1) { + compile_error("ordinary parameter is defined"); + return null; + } + if (it_id() == null) { + throw new RuntimeException("Need to register in lvtbl+make anon lvar(or maybe it although perhaps they do not capture)"); + } + } if (currentScope.getType() != StaticScope.Type.BLOCK) numparam_name(id); return new VCallNode(loc, name); @@ -1157,7 +1191,7 @@ public WhenNode newWhenNode(int line, Node expressionNodes, Node bodyNode, Node return new WhenNode(line, expressionNodes, bodyNode, nextCase); } - public Node new_op_assign(AssignableNode receiverNode, ByteList operatorName, Node valueNode) { + public Node new_op_assign(AssignableNode receiverNode, ByteList operatorName, Node valueNode, LexContext _lexContext) { int line = receiverNode.getLine(); if (operatorName == OR_KEYWORD || operatorName == OR_OR) { @@ -1173,7 +1207,7 @@ public Node new_op_assign(AssignableNode receiverNode, ByteList operatorName, No } } - public Node new_ary_op_assign(Node receiverNode, ByteList operatorName, Node argsNode, Node valueNode) { + public Node new_ary_op_assign(Node receiverNode, Node argsNode, ByteList operatorName, Node valueNode) { int line = lexer.tokline; // We extract BlockPass from tree and insert it as a block node value (MRI wraps it around the args) @@ -1189,11 +1223,11 @@ public Node new_ary_op_assign(Node receiverNode, ByteList operatorName, Node arg return newNode; } - public Node new_attr_op_assign(Node receiverNode, ByteList callType, Node valueNode, ByteList variableName, ByteList operatorName) { + public Node new_attr_op_assign(Node receiverNode, ByteList callType, ByteList variableName, ByteList operatorName, Node valueNode) { return new OpAsgnNode(receiverNode.getLine(), receiverNode, valueNode, symbolID(variableName), symbolID(operatorName), isLazy(callType)); } - public Node new_const_op_assign(int line, Node lhs, ByteList operatorName, Node rhs) { + public Node new_const_op_assign(int line, Node lhs, ByteList operatorName, Node rhs, LexContext _lexContext) { // FIXME: Maybe need to fixup position? if (lhs != null) { return new OpAsgnConstDeclNode(line, lhs, symbolID(operatorName), rhs); @@ -1321,7 +1355,7 @@ public void initTopLocalVariables() { warnOnUnusedVariables = getWarnings().isVerbose() && !isEval() && !isInline(); } - boolean isEval() { + protected boolean isEval() { return type == ParserType.EVAL; } @@ -1893,6 +1927,16 @@ public String internalId() { return INTERNAL_ID.toString(); } + protected void begin_definition(String name) { + LexContext ctxt = getLexContext(); + ctxt.in_class = name != null; + if (!ctxt.in_class) { + ctxt.in_def = false; + } else if (ctxt.in_def) { + yyerror((name != null ? (name + " ") : "") + "definition in method body"); + } + pushLocalScope(); + } public Set push_pvtbl() { Set currentTable = variableTable; @@ -1921,8 +1965,15 @@ public Node newIn(int line, Node expression, Node body, Node nextCase) { return new InNode(line, expression, body, nextCase); } - public void endless_method_name(DefHolder name) { - // FIXME: IMPL + public void endless_method_name(DefHolder name, ProductionState loc) { + if (is_attrset_id(name.name)) { + yyerror("setter method cannot be defined in an endless method definition"); + } + token_info_drop(name.name.idString(), loc); + } + + private boolean is_attrset_id(RubySymbol name) { + return id_type(name.getBytes()) == AttrSet; } public Node reduce_nodes(Node body) { @@ -2106,6 +2157,10 @@ protected LexContext getLexContext() { return lexer.getLexContext(); } + protected void setLexContext(LexContext lexContext) { + lexer.setLexContext(lexContext); + } + protected int src_line() { return lexer.getRubySourceline(); } @@ -2202,6 +2257,12 @@ protected void setHeredocLineIndent(int indent) { lexer.setHeredocLineIndent(indent); } + protected ConstDeclNode cont_decl(int position, INameNode constNode) { + if (getLexContext().in_def) yyerror("dynamic constant assignment"); + + return new ConstDeclNode(position, null, constNode, NilImplicitNode.NIL); + } + public Ruby getRuntime() { return runtime; } @@ -2301,4 +2362,72 @@ public CoverageData finishCoverage(String file, int lines) { } public static final ByteList NOT = BANG; + + protected void token_info_setup(String value, ProductionState loc) { + + } + + protected void token_info_push(String value, ProductionState loc) { + + } + + protected void token_info_pop(String value, ProductionState loc) { + // FIXME: impl + } + protected void token_info_drop(String value, ProductionState loc) { + // FIXME: impl + } + + protected void token_info_warn(String name, int same, ProductionState loc) { + + } + + protected TokenInfo getTokenInfo() { + return tokenInfo; + } + + protected void push_end_expect_token_locations(int line) { + // FIXME: impl + } + + protected NodeExits allow_block_exit() { + // FIXME: Impl + return null; + } + + protected void clear_block_exit(boolean value) { + + } + + protected void next_rescue_context(LexContext context, LexContext.InRescue value) { + + } + + protected Node it_id() { + return itId; + } + + protected void set_it_id(Node node) { + this.itId = node; + } + + protected NodeExits init_block_exit() { + return new NodeExits(); + } + + protected void restore_block_exit(NodeExits nodeExits) { + // FIXME:Impl + } + + protected Node NEW_ERROR(ProductionState loc) { + return new ErrorNode(loc); + } + + protected void forwarding_arg_check(ByteList rest, ByteList all, String var) { + // FIXME: Impl + } + + protected void WARN_EOL(String name) { + // FIXME: IMpl + } } diff --git a/core/src/main/java/org/jruby/parser/ScopedParserState.java b/core/src/main/java/org/jruby/parser/ScopedParserState.java index 7dda229fa30..aed9e5579a0 100644 --- a/core/src/main/java/org/jruby/parser/ScopedParserState.java +++ b/core/src/main/java/org/jruby/parser/ScopedParserState.java @@ -70,6 +70,10 @@ public void growNamedCaptures(int index) { this.namedCaptures = newNamedCaptures; } + public boolean hasDefinedVariables() { + return definedVariables != null; + } + public boolean isNamedCapture(int index) { boolean[] namedCaptures = this.namedCaptures; return namedCaptures != null && index < namedCaptures.length && namedCaptures[index]; diff --git a/core/src/main/java/org/jruby/parser/TokenInfo.java b/core/src/main/java/org/jruby/parser/TokenInfo.java new file mode 100644 index 00000000000..ae52e766c0e --- /dev/null +++ b/core/src/main/java/org/jruby/parser/TokenInfo.java @@ -0,0 +1,14 @@ +package org.jruby.parser; + +public class TokenInfo { + public TokenInfo next; + String name; + int line; + public boolean nonspc; + + public TokenInfo(TokenInfo previous, String name, int line) { + this.next = previous; + this.name = name; + this.line = line; + } +} diff --git a/core/src/main/java/org/jruby/parser/YYDebug.java b/core/src/main/java/org/jruby/parser/YYDebug.java index 2dbb5fd4303..549bafe68cc 100644 --- a/core/src/main/java/org/jruby/parser/YYDebug.java +++ b/core/src/main/java/org/jruby/parser/YYDebug.java @@ -50,13 +50,13 @@ public void pop(int a) { public void push(int a, Object b) { } - public void reduce(int a, int b, int c, String d, short e) { + public void reduce(int a, int b, int c, String d, int e) { } public void reject() { } - public void shift(int a, short b, int c) { + public void shift(int a, int b, int c) { } public void shift(int a, int b) { diff --git a/core/src/main/java/org/jruby/parser/YyTables.java b/core/src/main/java/org/jruby/parser/YyTables.java index 064287e79ab..2b0f32c1dff 100644 --- a/core/src/main/java/org/jruby/parser/YyTables.java +++ b/core/src/main/java/org/jruby/parser/YyTables.java @@ -29,9 +29,9 @@ package org.jruby.parser; public class YyTables { - private static short[] combine(short[] t1, short[] t2, - short[] t3, short[] t4) { - short[] t = new short[t1.length + t2.length + t3.length + t4.length]; + private static int[] combine(int[] t1, int[] t2, + int[] t3, int[] t4) { + int[] t = new int[t1.length + t2.length + t3.length + t4.length]; int index = 0; System.arraycopy(t1, 0, t, index, t1.length); index += t1.length; @@ -43,4682 +43,4983 @@ private static short[] combine(short[] t1, short[] t2, return t; } - public static final short[] yyTable() { + public static final int[] yyTable() { return combine(yyTable1(), yyTable2(), yyTable3(), yyTable4()); } - public static final short[] yyCheck() { + public static final int[] yyCheck() { return combine(yyCheck1(), yyCheck2(), yyCheck3(), yyCheck4()); } - private static final short[] yyTable1() { - return new short[] { + private static final int[] yyTable1() { + return new int[] { - 107, 464, 467, 318, 671, 596, 319, 230, 230, 645, - 327, 404, 273, 712, 246, 247, 486, 203, 252, 390, - 384, 96, 96, 696, 342, 397, 775, 200, 641, 308, - 909, 650, 912, 499, 232, 232, 766, 203, 445, 660, - 770, 595, 983, 311, 907, 89, 89, 200, 550, 552, - 916, 915, 571, 285, 289, 818, 712, 571, 125, 249, - 342, 1292, 569, 442, 911, 233, 233, 1163, 341, 203, - 1279, 529, 96, 96, 585, 531, 309, 389, 249, 585, - 709, 308, 334, 334, 709, 1068, 232, 308, 308, 257, - 391, 392, 336, 465, 308, 678, 978, 280, 237, 237, - 704, 818, 612, 517, 818, 282, 230, 278, 339, 245, - 761, 383, 684, 778, 742, 1234, 996, 742, 748, 641, - 835, 650, 819, 804, 1169, 125, 819, 819, 309, 203, - 1306, 779, 998, 232, 422, 422, 321, 232, 284, 288, - 1111, 459, 232, 232, 749, 742, 805, 806, 742, 748, - 818, 612, 748, 108, 729, 480, 125, 338, 896, 125, - 739, 486, 105, 742, 233, 430, 806, 748, 501, 377, - 94, 474, 348, 349, 375, 1168, 125, 377, 372, 376, - 273, 729, 375, 373, 806, 374, 513, 376, 1279, 750, - 899, 1184, 383, 105, 1139, 1140, 769, 237, 427, 521, - 339, 523, 1027, 427, 427, 242, 486, 535, 245, 337, - 818, 342, 806, 105, 1306, 510, 563, 733, 1067, 1067, - 249, 600, 601, 602, 603, 334, 334, 769, 1112, 773, - 769, 273, 540, 664, 230, 336, 230, 230, 486, 818, - 96, 838, 929, 498, 519, 769, 567, 712, 804, 338, - 1228, 1199, 107, 818, 246, 520, 1330, 391, 845, 818, - 773, 232, 718, 232, 232, 819, 1118, 232, 382, 232, - 753, 805, 775, 96, 307, 96, 486, 308, 773, 249, - 914, 747, 817, 747, 907, 339, 824, 914, 818, 96, - 510, 96, 233, 718, 233, 494, 846, 89, 911, 389, - 761, 902, 1256, 775, 759, 733, 254, 339, 569, 248, - 769, 718, 860, 515, 336, 754, 709, 729, 709, 1105, - 256, 775, 687, 1291, 309, 237, 278, 237, 500, 996, - 502, 1236, 1237, 729, 338, 759, 818, 1185, 759, 510, - 348, 349, 1208, 773, 388, 533, 847, 389, 819, 382, - 96, 475, 476, 759, 1007, 96, 338, 307, 818, 612, - 96, 273, 232, 232, 232, 232, 96, 232, 232, 1000, - 1002, 1004, 1162, 1006, 1273, 308, 386, 396, 1008, 854, - 230, 568, 692, 649, 89, 1067, 498, 742, 94, 666, - 604, 748, 479, 656, 125, 486, 599, 656, 656, 656, - 651, 342, 686, 709, 688, 819, 819, 232, 651, 715, - 819, 819, 683, 818, 322, 960, 718, 1162, 759, 720, - 721, 96, 309, 427, 427, 427, 427, 804, 605, 606, - 1167, 105, 1274, 323, 694, 804, 1067, 732, 232, 818, - 818, 612, 734, 535, 269, 96, 543, 458, 761, 888, - 761, 733, 818, 1067, 1067, 1067, 278, 679, 351, 875, - 486, 486, 96, 232, 96, 571, 351, 818, 806, 769, - 818, 230, 138, 649, 60, 742, 897, 498, 543, 748, - 897, 1145, 656, 364, 365, 656, 656, 585, 818, 879, - 651, 389, 762, 818, 886, 545, 546, 722, 232, 668, - 733, 818, 773, 324, 8, 881, 649, 585, 683, 585, - 389, 963, 656, 308, 8, 1351, 203, 712, 1308, 818, - 1310, 138, 884, 651, 427, 818, 200, 545, 546, 325, - 458, 230, 788, 649, 907, 718, 479, 498, 1106, 96, - 916, 1313, 679, 813, 819, 775, 922, 510, 867, 330, - 651, 806, 389, 683, 818, 539, 819, 769, 232, 922, - 309, 1052, 1052, 8, 710, 1075, 1077, 535, 1138, 864, - 1080, 1082, 669, 1088, 818, 813, 670, 759, 1209, 1211, - 1212, 1213, 562, 1186, 837, 250, 787, 253, 709, 791, - 773, 784, 641, 992, 650, 389, 563, 675, 386, 387, - 815, 964, 1349, 376, 815, 815, 833, 735, 379, 571, - 863, 525, 907, 232, 1142, 974, 232, 400, 1175, 1241, - 1244, 1258, 437, 718, 856, 389, 567, 568, 1267, 8, - 1095, 585, 389, 775, 802, 803, 1176, 308, 885, 849, - 691, 427, 775, 809, 811, 524, 386, 478, 812, 818, - 395, 438, 376, 809, 823, 870, 1197, 921, 812, 879, - 761, 761, 369, 922, 368, 759, 286, 230, 399, 649, - 952, 437, 427, 498, 97, 427, 816, 1217, 343, 904, - 816, 816, 232, 230, 309, 649, 651, 377, 871, 498, - 804, 775, 375, 373, 232, 374, 96, 376, 818, 96, - 438, 232, 651, 525, 1192, 97, 818, 203, 308, 343, - 232, 818, 829, 829, 819, 96, 249, 200, 818, 962, - 818, 802, 809, 818, 818, 97, 1327, 812, 1052, 138, - 805, 1328, 401, 966, 922, 569, 437, 528, 805, 953, - 1190, 535, 232, 585, 1324, 819, 405, 955, 470, 818, - 1322, 1238, 1339, 377, 1269, 309, 775, 345, 375, 373, - 1345, 374, 851, 376, 1186, 438, 1186, 234, 241, 818, - 914, 972, 669, 1186, 804, 543, 1141, 961, 468, 818, - 1205, 924, 348, 930, 818, 389, 103, 1150, 345, 248, - 386, 512, 144, 477, 818, 481, 442, 819, 656, 656, - 880, 990, 991, 882, 484, 656, 656, 683, 683, 386, - 538, 308, 792, 485, 1188, 487, 348, 103, 348, 488, - 544, 995, 975, 733, 545, 546, 97, 97, 486, 469, - 675, 348, 471, 472, 473, 829, 309, 103, 1286, 97, - 97, 144, 507, 1194, 1186, 511, 1186, 969, 1186, 1100, - 1186, 386, 674, 532, 733, 19, 351, 1233, 309, 729, - 232, 96, 203, 348, 1242, 1245, 406, 309, 969, 1186, - 514, 656, 656, 486, 656, 656, 101, 97, 97, 518, - 806, 527, 96, 815, 815, 1010, 19, 880, 815, 815, - 530, 97, 1165, 1166, 386, 690, 348, 534, 1229, 1096, - 1221, 1222, 818, 818, 19, 486, 825, 101, 818, 308, - 818, 804, 804, 804, 805, 1243, 1246, 804, 804, 309, - 804, 427, 541, 1239, 386, 951, 1013, 101, 804, 1099, - 734, 386, 1216, 356, 357, 594, 1073, 1073, 97, 652, - 308, 656, 97, 97, 230, 96, 649, 97, 97, 597, - 498, 819, 656, 655, 307, 818, 818, 818, 825, 816, - 816, 734, 543, 651, 816, 816, 818, 818, 1121, 96, - 19, 232, 818, 818, 818, 883, 351, 667, 96, 818, - 96, 1155, 819, 308, 656, 307, 818, 910, 421, 96, - 232, 917, 308, 1085, 489, 1188, 492, 1188, 805, 1301, - 1302, 1303, 1094, 557, 818, 558, 559, 560, 561, 562, - 789, 545, 546, 95, 1230, 818, 818, 804, 672, 421, - 249, 689, 815, 563, 693, 792, 424, 942, 96, 129, - 1135, 348, 98, 1191, 815, 947, 598, 564, 1231, 137, - 699, 1325, 351, 700, 95, 97, 795, 565, 569, 144, - 799, 427, 570, 567, 568, 103, 716, 424, 1218, 364, - 365, 717, 486, 98, 93, 1202, 97, 539, 97, 97, - 719, 1206, 97, 1207, 97, 682, 348, 725, 97, 1188, - 97, 539, 736, 98, 386, 1316, 726, 701, 137, 1240, - 96, 708, 848, 96, 97, 286, 97, 1219, 816, 125, - 853, 486, 857, 1270, 1271, 750, 763, 19, 19, 19, - 816, 539, 422, 19, 19, 539, 19, 348, 348, 924, - 682, 765, 425, 767, 19, 96, 769, 486, 486, 774, - 96, 96, 780, 96, 708, 805, 805, 805, 286, 750, - 1290, 805, 805, 422, 805, 101, 486, 776, 1320, 1321, - 777, 106, 805, 425, 750, 97, 1268, 96, 733, 308, - 97, 1298, 1299, 1300, 423, 97, 503, 97, 97, 97, - 97, 97, 97, 97, 1294, 782, 504, 505, 486, 232, - 800, 794, 106, 114, 114, 1076, 1078, 801, 749, 733, - 1081, 1083, 537, 537, 771, 423, 114, 114, 326, 804, - 969, 797, 106, 839, 806, 807, 1265, 733, 326, 230, - 808, 649, 97, 19, 99, 498, 96, 784, 850, 750, - 818, 1117, 749, 1119, 818, 818, 97, 1120, 651, 1076, - 1078, 867, 1081, 1083, 114, 114, 232, 749, 308, 326, - 427, 805, 321, 97, 864, 99, 96, 898, 114, 873, - 97, 132, 818, 818, 661, 662, 663, 326, 818, 874, - 900, 965, 543, 806, 148, 99, 969, 97, 97, 97, - 876, 877, 828, 834, 903, 104, 905, 96, 1343, 977, - 108, 788, 979, 920, 932, 1317, 934, 677, 943, 232, - 232, 937, 1180, 944, 102, 114, 137, 94, 806, 114, - 132, 98, 749, 97, 114, 114, 104, 548, 872, 948, - 950, 545, 546, 954, 698, 958, 557, 878, 558, 559, - 560, 561, 562, 326, 1193, 102, 104, 708, 959, 286, - 348, 348, 677, 922, 144, 486, 563, 100, 96, 711, - 986, 969, 713, 714, 97, 102, 989, 999, 1001, 298, - 427, 427, 1003, 1193, 543, 551, 1005, 779, 1011, 298, - 565, 1070, 742, 97, 788, 566, 567, 568, 100, 730, - 119, 1154, 683, 1115, 682, 682, 1116, 1097, 710, 1164, - 1172, 1098, 919, 40, 41, 42, 43, 1173, 100, 1101, - 298, 1210, 1103, 293, 543, 927, 742, 1107, 1203, 761, - 486, 486, 114, 545, 546, 806, 710, 1204, 298, 543, - 710, 742, 921, 430, 708, 1225, 148, 683, 97, 806, - 106, 97, 1162, 114, 1215, 114, 114, 710, 1226, 114, - 1227, 114, 1283, 761, 1025, 114, 957, 114, 1251, 548, - 1253, 1250, 1257, 545, 546, 1259, 792, 1260, 761, 1281, - 1296, 114, 348, 114, 549, 118, 1282, 682, 545, 546, - 326, 326, 326, 1293, 1297, 148, 326, 326, 1304, 326, - 1311, 1315, 1326, 1307, 298, 1331, 742, 326, 1333, 981, - 129, 97, 1314, 99, 1335, 97, 97, 97, 543, 1337, - 104, 104, 326, 326, 326, 326, 326, 348, 1346, 97, - 1356, 97, 682, 543, 97, 818, 97, 818, 132, 1196, - 792, 129, 114, 761, 129, 97, 348, 114, 806, 804, - 97, 788, 114, 811, 114, 114, 114, 114, 114, 114, - 114, 129, 543, 548, 806, 811, 813, 545, 546, 642, - 1230, 104, 104, 806, 104, 310, 806, 97, 746, 139, - 368, 1110, 545, 546, 818, 1347, 329, 1348, 806, 1350, - 1250, 348, 752, 102, 425, 1250, 326, 973, 1093, 114, - 509, 1318, 1329, 731, 733, 1289, 822, 751, 1359, 1214, - 1177, 545, 546, 114, 642, 684, 677, 677, 642, 642, - 1104, 806, 1152, 441, 1250, 1309, 908, 310, 139, 286, - 114, 18, 901, 423, 423, 138, 100, 114, 997, 1074, - 460, 298, 298, 298, 1329, 913, 1312, 298, 298, 1280, - 298, 1344, 813, 636, 114, 114, 114, 956, 298, 1110, - 684, 557, 18, 558, 559, 560, 561, 463, 1352, 1235, - 298, 298, 1232, 298, 298, 298, 298, 806, 84, 84, - 18, 1247, 394, 1248, 925, 940, 941, 1295, 891, 892, - 114, 893, 945, 946, 1266, 97, 97, 0, 45, 46, - 0, 683, 683, 148, 710, 755, 710, 710, 710, 710, - 710, 343, 344, 345, 346, 347, 1156, 97, 1157, 1158, - 137, 1159, 0, 0, 710, 0, 0, 0, 298, 84, - 84, 114, 1195, 306, 806, 806, 0, 0, 710, 104, - 140, 0, 0, 0, 0, 1201, 18, 298, 710, 0, - 114, 0, 0, 710, 710, 710, 0, 806, 984, 985, - 1160, 987, 988, 557, 0, 558, 559, 560, 561, 0, - 1110, 0, 104, 0, 104, 0, 685, 0, 0, 129, - 97, 348, 348, 0, 0, 306, 682, 682, 104, 140, - 104, 306, 306, 0, 97, 97, 0, 0, 306, 97, - 97, 68, 0, 0, 97, 114, 97, 755, 114, 0, - 0, 68, 756, 97, 0, 97, 0, 0, 1152, 0, - 0, 685, 0, 310, 97, 97, 0, 0, 1079, 0, - 0, 142, 0, 806, 806, 806, 139, 0, 0, 1091, - 1272, 0, 68, 0, 0, 348, 348, 0, 557, 104, - 558, 559, 560, 561, 104, 0, 0, 0, 0, 104, - 68, 0, 0, 97, 0, 104, 1323, 687, 114, 677, - 0, 1108, 114, 114, 114, 806, 0, 1037, 1037, 0, - 142, 0, 0, 18, 18, 18, 114, 0, 114, 18, - 18, 114, 18, 114, 0, 0, 0, 84, 0, 788, - 18, 0, 114, 677, 0, 677, 680, 114, 0, 120, - 0, 684, 687, 0, 684, 684, 0, 0, 677, 0, - 104, 310, 0, 795, 0, 97, 68, 0, 97, 0, - 84, 0, 84, 97, 114, 0, 789, 0, 0, 0, - 680, 0, 680, 0, 104, 97, 84, 0, 84, 0, - 677, 0, 0, 791, 0, 680, 684, 795, 0, 795, - 97, 104, 0, 104, 0, 97, 97, 0, 97, 0, - 1037, 1037, 795, 710, 1037, 1276, 0, 558, 559, 560, - 561, 306, 788, 677, 0, 0, 0, 680, 0, 18, - 788, 0, 97, 0, 113, 0, 677, 140, 0, 0, - 0, 710, 0, 0, 795, 710, 0, 84, 1037, 113, - 0, 0, 84, 0, 97, 0, 0, 84, 0, 789, - 680, 0, 710, 84, 818, 0, 0, 0, 0, 85, - 85, 0, 0, 0, 0, 0, 795, 795, 104, 788, - 113, 677, 0, 113, 1037, 677, 0, 0, 0, 0, - 0, 97, 114, 114, 0, 0, 0, 0, 0, 310, - 113, 0, 0, 68, 68, 68, 0, 141, 68, 68, - 68, 97, 68, 788, 114, 685, 685, 0, 84, 306, - 85, 85, 68, 0, 307, 1037, 0, 0, 142, 1037, - 677, 0, 68, 68, 0, 68, 68, 68, 68, 68, - 0, 0, 84, 686, 0, 1037, 1037, 1037, 1037, 0, - 135, 0, 1037, 1037, 0, 1037, 141, 0, 0, 84, - 0, 84, 788, 0, 97, 97, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 307, 114, 143, 788, - 789, 0, 307, 307, 139, 0, 680, 0, 686, 307, - 134, 114, 114, 0, 133, 0, 114, 114, 0, 135, - 0, 114, 0, 114, 106, 106, 687, 687, 0, 68, - 114, 0, 114, 97, 688, 820, 789, 0, 0, 820, - 820, 114, 114, 310, 0, 0, 679, 143, 0, 0, - 678, 680, 0, 795, 0, 104, 84, 0, 104, 134, - 0, 0, 0, 133, 677, 677, 0, 0, 0, 0, - 684, 684, 1038, 1038, 104, 106, 106, 306, 0, 688, - 114, 0, 0, 789, 0, 0, 0, 0, 0, 132, - 788, 679, 0, 0, 1037, 678, 0, 0, 0, 1037, - 0, 680, 680, 0, 0, 0, 1037, 0, 85, 0, - 0, 0, 0, 0, 310, 136, 789, 521, 795, 795, - 116, 0, 680, 894, 121, 0, 685, 521, 1037, 710, - 0, 710, 710, 710, 710, 710, 0, 0, 113, 788, - 0, 85, 114, 85, 462, 114, 0, 0, 1037, 710, - 114, 681, 0, 0, 0, 677, 677, 85, 521, 85, - 0, 521, 114, 710, 136, 1038, 1038, 680, 0, 1038, - 0, 685, 0, 710, 0, 0, 521, 114, 710, 710, - 710, 0, 114, 114, 141, 114, 0, 0, 0, 0, - 0, 0, 307, 84, 0, 0, 681, 84, 84, 789, - 0, 306, 150, 1038, 677, 677, 0, 0, 0, 114, - 521, 0, 123, 84, 687, 791, 84, 310, 85, 127, - 104, 795, 0, 85, 0, 0, 0, 135, 85, 0, - 0, 114, 84, 0, 85, 0, 73, 0, 339, 1038, - 789, 104, 521, 106, 0, 0, 73, 0, 791, 0, - 0, 150, 126, 0, 791, 143, 0, 0, 0, 687, - 0, 0, 686, 686, 0, 0, 795, 134, 114, 0, - 0, 133, 306, 0, 0, 0, 106, 73, 106, 0, - 1038, 0, 0, 339, 1038, 0, 0, 0, 114, 85, - 307, 0, 106, 0, 106, 73, 0, 0, 795, 791, - 1038, 1038, 1038, 1038, 104, 680, 680, 1038, 1038, 0, - 1038, 0, 0, 85, 0, 122, 0, 686, 820, 820, - 0, 0, 0, 820, 820, 0, 0, 0, 104, 0, - 85, 791, 85, 688, 688, 0, 0, 104, 0, 104, - 0, 114, 114, 1039, 1039, 679, 679, 0, 104, 678, - 678, 100, 100, 106, 0, 135, 789, 149, 106, 140, - 0, 73, 686, 106, 0, 0, 0, 0, 0, 106, - 0, 124, 136, 688, 0, 306, 0, 0, 84, 521, - 521, 521, 0, 0, 521, 521, 521, 104, 521, 1136, - 114, 0, 0, 349, 0, 0, 521, 0, 521, 84, - 0, 0, 100, 100, 0, 0, 149, 85, 521, 521, - 0, 521, 521, 521, 521, 521, 0, 0, 688, 0, - 0, 680, 680, 0, 106, 685, 685, 0, 307, 1038, - 0, 1040, 1040, 0, 1038, 0, 1039, 1039, 349, 0, - 1039, 1038, 0, 0, 0, 0, 0, 142, 106, 104, - 681, 681, 104, 0, 146, 795, 0, 820, 0, 150, - 0, 0, 84, 1038, 0, 106, 521, 106, 577, 820, - 0, 115, 0, 679, 1039, 0, 84, 84, 577, 0, - 0, 84, 84, 1038, 104, 521, 84, 145, 791, 104, - 104, 0, 104, 0, 0, 84, 0, 84, 73, 73, - 73, 0, 0, 73, 73, 73, 84, 73, 0, 577, - 1039, 0, 577, 687, 687, 73, 104, 73, 679, 0, - 795, 795, 0, 0, 1040, 1040, 0, 577, 1040, 0, - 73, 73, 73, 73, 73, 0, 0, 339, 339, 0, - 0, 0, 106, 0, 85, 84, 0, 306, 85, 85, - 141, 1039, 307, 791, 791, 1039, 0, 0, 0, 0, - 0, 577, 1040, 0, 85, 423, 114, 85, 678, 0, - 100, 1039, 1039, 1039, 1039, 104, 0, 0, 1039, 1039, - 0, 1039, 0, 85, 0, 0, 0, 0, 0, 0, - 0, 0, 577, 577, 119, 0, 0, 0, 1040, 0, - 0, 116, 0, 100, 73, 100, 143, 84, 0, 0, - 84, 0, 0, 678, 149, 84, 686, 686, 0, 100, - 118, 100, 0, 307, 0, 119, 0, 84, 119, 0, - 683, 789, 116, 0, 0, 116, 0, 680, 0, 1040, - 146, 0, 84, 1040, 423, 119, 0, 84, 84, 0, - 84, 118, 116, 0, 118, 0, 682, 0, 0, 1040, - 1040, 1040, 1040, 0, 0, 0, 1040, 1040, 0, 1040, - 791, 118, 688, 688, 84, 683, 795, 127, 0, 821, - 100, 0, 680, 821, 821, 100, 0, 1041, 1041, 146, - 100, 0, 349, 349, 0, 0, 100, 104, 0, 106, - 1039, 682, 106, 0, 0, 1039, 134, 791, 127, 0, - 0, 127, 1039, 795, 789, 0, 0, 0, 106, 0, - 0, 795, 117, 306, 681, 0, 307, 0, 127, 85, - 577, 577, 577, 84, 1039, 577, 577, 577, 0, 577, - 120, 0, 0, 0, 0, 0, 0, 577, 0, 577, - 85, 100, 0, 795, 1039, 0, 0, 0, 795, 577, - 577, 0, 577, 577, 577, 577, 577, 0, 131, 681, - 339, 120, 679, 679, 120, 100, 684, 0, 0, 0, - 1041, 1041, 0, 0, 1041, 0, 0, 0, 1040, 0, - 795, 120, 100, 1040, 100, 145, 0, 0, 0, 792, - 1040, 133, 306, 128, 0, 792, 0, 0, 0, 0, - 0, 0, 0, 85, 0, 339, 0, 577, 1041, 0, - 0, 684, 1040, 0, 0, 791, 0, 85, 85, 0, - 147, 791, 85, 85, 0, 0, 577, 85, 0, 0, - 0, 0, 1040, 0, 145, 0, 85, 130, 85, 349, - 792, 0, 0, 0, 1041, 84, 0, 85, 0, 0, - 792, 0, 0, 119, 106, 0, 792, 678, 678, 100, - 116, 789, 0, 121, 0, 0, 791, 0, 0, 147, - 0, 0, 792, 0, 0, 106, 0, 0, 0, 118, - 0, 1042, 1042, 47, 349, 1041, 85, 146, 307, 1041, - 0, 0, 0, 47, 121, 0, 0, 121, 791, 685, - 795, 792, 0, 0, 0, 1041, 1041, 1041, 1041, 0, - 0, 0, 1041, 1041, 121, 1041, 0, 0, 0, 683, - 683, 0, 0, 0, 47, 0, 680, 680, 0, 0, - 0, 0, 0, 792, 0, 0, 127, 795, 106, 0, - 0, 0, 47, 0, 685, 682, 682, 136, 85, 0, - 0, 85, 821, 821, 0, 0, 85, 821, 821, 0, - 0, 0, 106, 0, 0, 795, 795, 0, 85, 0, - 0, 106, 0, 106, 1042, 1042, 0, 0, 1042, 0, - 0, 0, 106, 85, 0, 0, 0, 0, 85, 85, - 0, 85, 0, 150, 0, 0, 100, 229, 229, 120, - 100, 100, 795, 795, 1043, 1043, 0, 0, 47, 0, - 0, 0, 1042, 681, 681, 85, 100, 0, 0, 100, - 0, 106, 0, 1137, 0, 0, 0, 126, 147, 792, - 262, 266, 267, 268, 1041, 100, 0, 229, 229, 1041, - 0, 0, 145, 0, 0, 0, 1041, 0, 1042, 326, - 328, 0, 0, 0, 0, 791, 0, 791, 126, 339, - 339, 126, 0, 791, 307, 684, 684, 0, 1041, 0, - 0, 0, 149, 0, 85, 0, 0, 147, 126, 0, - 0, 0, 0, 106, 0, 0, 106, 0, 1041, 1042, - 792, 821, 0, 1042, 792, 792, 229, 1043, 1043, 0, - 0, 1043, 0, 821, 0, 0, 0, 0, 791, 1042, - 1042, 1042, 1042, 0, 569, 0, 1042, 1042, 106, 1042, - 791, 791, 0, 106, 106, 0, 106, 0, 0, 0, - 0, 0, 121, 0, 0, 1043, 128, 0, 349, 349, - 791, 0, 0, 307, 0, 47, 47, 47, 0, 0, - 106, 47, 47, 0, 47, 792, 792, 0, 0, 0, - 0, 0, 47, 1044, 1044, 0, 792, 128, 0, 0, - 128, 1043, 792, 0, 0, 0, 0, 47, 47, 47, - 47, 100, 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 85, 0, 685, 685, - 0, 229, 100, 0, 229, 229, 229, 0, 326, 106, - 0, 0, 1043, 0, 0, 0, 1043, 792, 0, 0, - 0, 0, 0, 0, 229, 0, 229, 229, 0, 0, - 0, 0, 1043, 1043, 1043, 1043, 0, 0, 1042, 1043, - 1043, 0, 1043, 1042, 1187, 0, 0, 0, 0, 792, - 1042, 47, 0, 0, 0, 0, 1044, 1044, 0, 0, - 1044, 0, 0, 0, 0, 100, 0, 0, 0, 0, - 123, 0, 1042, 0, 0, 0, 0, 0, 0, 100, - 100, 0, 0, 0, 100, 100, 0, 0, 0, 100, - 0, 0, 1042, 0, 1044, 0, 126, 791, 100, 0, - 100, 123, 0, 0, 123, 0, 687, 0, 0, 100, - 0, 0, 0, 0, 0, 1045, 1045, 0, 0, 0, - 0, 123, 0, 0, 0, 0, 0, 1047, 1047, 0, - 1044, 106, 0, 608, 609, 610, 611, 612, 0, 0, - 613, 614, 615, 616, 617, 618, 619, 620, 100, 622, - 0, 687, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 1043, 791, 791, 0, 0, 1043, 0, 0, 0, - 229, 1044, 0, 1043, 0, 1044, 654, 0, 0, 0, - 0, 0, 557, 0, 558, 559, 560, 561, 562, 0, - 0, 1044, 1044, 1044, 1044, 1043, 0, 0, 1044, 1044, - 0, 1044, 563, 0, 0, 128, 792, 0, 1045, 1045, - 100, 0, 1045, 100, 0, 1043, 0, 0, 100, 0, - 0, 0, 0, 0, 1144, 1187, 565, 1187, 0, 0, - 100, 1187, 567, 568, 1187, 0, 0, 1189, 0, 0, - 0, 0, 0, 0, 0, 100, 1045, 0, 0, 0, - 100, 100, 0, 100, 0, 0, 49, 0, 1174, 229, - 0, 229, 0, 229, 0, 0, 49, 229, 0, 0, - 0, 792, 792, 0, 0, 268, 0, 100, 785, 0, - 1254, 0, 1045, 0, 0, 1261, 0, 0, 785, 0, - 724, 0, 0, 727, 1047, 0, 0, 49, 0, 0, - 0, 0, 0, 0, 0, 1187, 229, 1187, 0, 1187, - 229, 1187, 0, 0, 0, 49, 0, 0, 0, 785, - 1044, 229, 785, 1045, 0, 1044, 0, 1045, 0, 0, - 1187, 273, 1044, 0, 0, 1220, 100, 785, 0, 123, - 0, 273, 0, 1045, 1045, 1045, 1045, 0, 0, 0, - 1045, 1045, 0, 1045, 1044, 1144, 0, 0, 0, 0, - 0, 122, 1144, 1144, 0, 124, 229, 0, 0, 273, - 0, 785, 273, 0, 1044, 273, 786, 0, 0, 790, - 0, 49, 0, 0, 0, 0, 0, 0, 0, 273, - 273, 273, 122, 273, 273, 122, 124, 686, 0, 124, - 0, 688, 115, 785, 0, 687, 687, 1332, 1334, 1336, - 1338, 0, 122, 0, 1340, 0, 124, 0, 1189, 0, - 1189, 0, 0, 0, 273, 273, 0, 1189, 0, 0, - 0, 0, 0, 115, 0, 0, 115, 0, 679, 814, - 0, 0, 686, 814, 827, 229, 688, 1354, 1355, 1357, - 1358, 0, 0, 115, 0, 273, 273, 229, 100, 1360, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1045, 229, 0, 0, 0, 1045, 0, 0, - 229, 786, 790, 679, 1045, 0, 0, 0, 0, 229, - 0, 0, 0, 814, 0, 814, 814, 0, 1189, 229, - 1189, 229, 1189, 0, 1189, 0, 1045, 0, 0, 0, - 0, 0, 814, 0, 0, 0, 0, 0, 49, 49, - 49, 0, 0, 1189, 49, 49, 1045, 49, 0, 0, - 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, - 785, 785, 785, 0, 0, 785, 785, 785, 0, 785, - 49, 49, 49, 49, 229, 0, 318, 785, 0, 785, - 785, 0, 0, 0, 0, 0, 318, 229, 0, 785, - 785, 0, 785, 785, 785, 785, 785, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 229, 0, 0, 0, - 0, 0, 0, 273, 273, 273, 0, 318, 273, 273, - 273, 0, 273, 0, 0, 0, 114, 0, 229, 0, - 273, 0, 273, 273, 273, 318, 0, 0, 0, 0, - 0, 0, 273, 273, 49, 273, 273, 273, 273, 273, - 122, 0, 785, 0, 124, 0, 0, 114, 0, 0, - 114, 0, 678, 0, 0, 0, 785, 0, 0, 318, - 0, 229, 0, 0, 0, 0, 0, 114, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, - 0, 115, 0, 0, 273, 273, 0, 0, 0, 0, - 273, 318, 0, 0, 0, 273, 0, 678, 0, 0, - 0, 0, 0, 0, 0, 0, 686, 686, 0, 273, - 688, 688, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1014, 1015, 1016, 1017, 0, 0, 1069, - 0, 0, 814, 814, 117, 0, 0, 814, 814, 0, - 0, 1084, 0, 0, 229, 0, 0, 679, 679, 677, - 229, 0, 0, 0, 0, 0, 0, 0, 0, 677, - 0, 0, 0, 0, 0, 117, 0, 0, 117, 0, - 681, 0, 229, 0, 0, 0, 814, 814, 0, 814, - 814, 229, 788, 0, 0, 117, 677, 677, 0, 788, - 677, 677, 677, 677, 677, 677, 677, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 677, 677, 677, - 132, 677, 677, 0, 0, 681, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 318, 318, - 318, 0, 0, 318, 318, 318, 0, 318, 0, 0, - 677, 0, 677, 677, 0, 318, 0, 318, 318, 0, - 0, 0, 0, 0, 0, 131, 0, 318, 318, 0, - 318, 318, 318, 318, 318, 0, 0, 0, 0, 0, - 680, 814, 788, 677, 677, 788, 0, 0, 0, 0, - 680, 0, 0, 814, 229, 114, 131, 0, 0, 131, - 0, 339, 0, 0, 0, 0, 0, 229, 0, 0, - 814, 0, 0, 789, 0, 0, 131, 680, 680, 0, - 789, 680, 680, 680, 680, 680, 680, 680, 0, 0, - 318, 0, 0, 0, 130, 0, 0, 0, 680, 680, - 680, 135, 680, 680, 318, 0, 339, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 678, 678, 0, 0, 130, 0, 0, 130, 0, - 349, 680, 0, 680, 680, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 130, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 229, 789, 680, 680, 789, 0, 0, 0, - 0, 0, 0, 117, 0, 349, 788, 788, 788, 229, - 788, 677, 677, 677, 788, 788, 677, 677, 677, 788, - 677, 788, 788, 788, 788, 788, 788, 788, 677, 788, - 677, 677, 677, 788, 788, 788, 788, 788, 788, 788, - 677, 677, 788, 677, 677, 677, 677, 677, 0, 788, - 0, 0, 788, 788, 788, 788, 788, 788, 788, 788, - 788, 788, 788, 788, 788, 788, 788, 788, 788, 681, - 681, 788, 0, 788, 788, 677, 677, 677, 677, 677, - 677, 677, 677, 677, 677, 677, 677, 677, 788, 788, - 0, 0, 677, 677, 677, 677, 788, 689, 677, 788, - 788, 788, 788, 677, 788, 788, 788, 788, 788, 788, - 788, 788, 788, 788, 0, 788, 788, 677, 0, 0, - 677, 0, 0, 0, 131, 0, 0, 789, 789, 789, - 0, 789, 680, 680, 680, 789, 789, 680, 680, 680, - 789, 680, 789, 789, 789, 789, 789, 789, 789, 680, - 789, 680, 680, 680, 789, 789, 789, 789, 789, 789, - 789, 680, 680, 789, 680, 680, 680, 680, 680, 0, - 789, 0, 0, 789, 789, 789, 789, 789, 789, 789, - 789, 789, 789, 789, 789, 789, 789, 789, 789, 789, - 339, 339, 789, 130, 789, 789, 680, 680, 680, 680, - 680, 680, 680, 680, 680, 680, 680, 680, 680, 789, - 789, 0, 0, 680, 680, 680, 680, 789, 692, 680, - 789, 789, 789, 789, 680, 789, 789, 789, 789, 789, - 789, 789, 789, 789, 789, 795, 789, 789, 680, 0, - 0, 680, 0, 0, 0, 795, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, - 349, 0, 0, 0, 0, 0, 0, 0, 791, 0, - 0, 0, 795, 795, 0, 791, 795, 795, 795, 795, - 795, 795, 795, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 795, 795, 795, 146, 795, 795, 0, - 0, 0, 0, 0, 1018, 1019, 1020, 1021, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1022, 1023, 1024, 0, 0, 0, 795, 0, 795, 795, - 40, 41, 42, 43, 44, 0, 0, 0, 0, 303, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 791, 0, 0, 0, 0, 0, 795, 795, - 795, 791, 791, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, - 63, 64, 0, 65, 66, 791, 0, 0, 0, 791, - 791, 0, 791, 791, 791, 791, 791, 791, 791, 791, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 791, 791, 791, 145, 791, 791, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 791, 0, 791, 791, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 791, 791, 791, 791, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 791, 791, 791, 0, 791, 795, 795, 795, - 791, 791, 795, 795, 795, 791, 795, 791, 791, 791, - 791, 791, 791, 791, 795, 795, 795, 795, 795, 791, - 791, 791, 791, 791, 791, 791, 795, 795, 791, 795, - 795, 795, 795, 795, 0, 791, 0, 0, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 0, 0, 791, 0, 791, - 791, 795, 795, 795, 795, 795, 795, 795, 795, 795, - 795, 795, 795, 795, 791, 791, 0, 0, 795, 795, - 795, 795, 791, 0, 795, 791, 791, 791, 791, 795, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 0, 791, 791, 795, 0, 0, 795, 0, 0, 791, - 791, 791, 0, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 0, 791, 0, 0, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 0, 0, 791, 0, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 0, 0, 791, 791, 791, 791, 791, - 0, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 792, 791, 791, - 791, 0, 0, 791, 0, 0, 0, 792, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 792, 0, 0, 0, 792, 792, 0, 792, 792, 792, - 792, 792, 792, 792, 792, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 792, 792, 792, 147, 792, - 792, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 792, 0, - 792, 792, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, - 792, 792, 792, 792, 340, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 790, 0, 0, - 0, 340, 340, 0, 790, 340, 340, 340, 340, 340, - 340, 340, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 340, 340, 340, 0, 340, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 340, 0, 340, 340, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 790, 340, 340, - 790, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 792, 792, 792, 0, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 0, 792, 0, 0, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 0, 0, 792, - 0, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 0, 0, - 792, 792, 792, 792, 792, 0, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 0, 792, 792, 792, 0, 0, 792, 0, - 0, 790, 790, 790, 0, 790, 340, 340, 340, 790, - 790, 340, 340, 340, 790, 340, 790, 790, 790, 790, - 790, 790, 790, 340, 790, 340, 340, 340, 790, 790, - 790, 790, 790, 790, 790, 340, 340, 790, 340, 340, - 340, 340, 340, 0, 790, 0, 0, 790, 790, 790, - 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, - 790, 790, 790, 790, 0, 0, 790, 0, 790, 790, - 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 340, 790, 790, 0, 0, 340, 340, 340, - 340, 790, 0, 340, 790, 790, 790, 790, 340, 790, - 790, 790, 790, 790, 790, 790, 790, 790, 790, 796, - 790, 790, 340, 0, 0, 340, 0, 0, 0, 796, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 793, 0, 0, 0, 796, 796, 0, 793, - 796, 796, 796, 796, 796, 796, 796, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 796, 796, 796, - 0, 796, 796, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 796, 0, 796, 796, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 797, 0, 0, 0, - 0, 0, 796, 796, 796, 793, 797, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 110, 92, 323, 410, 454, 457, 368, 311, 234, 234, + 321, 277, 284, 416, 601, 99, 495, 208, 209, 423, + 693, 430, 789, 201, 784, 796, 345, 204, 236, 236, + 591, 925, 332, 697, 504, 591, 986, 368, 311, 255, + 577, 314, 719, 201, 661, 577, 719, 204, 919, 282, + 922, 281, 281, 288, 292, 242, 242, 435, 722, 435, + 435, 718, 311, 237, 237, 657, 99, 99, 666, 798, + 312, 453, 797, 311, 311, 917, 674, 252, 821, 204, + 236, 575, 339, 339, 775, 328, 329, 330, 779, 534, + 248, 751, 689, 536, 821, 287, 291, 722, 823, 905, + 718, 359, 365, 285, 239, 246, 262, 261, 1184, 823, + 234, 616, 555, 557, 367, 1005, 841, 821, 714, 857, + 841, 841, 247, 455, 365, 312, 882, 821, 814, 474, + 236, 419, 236, 770, 236, 236, 470, 470, 821, 657, + 204, 666, 403, 821, 746, 326, 940, 401, 1007, 1169, + 489, 364, 402, 523, 1230, 981, 476, 242, 1061, 365, + 616, 409, 1190, 835, 1277, 237, 821, 807, 112, 808, + 418, 483, 738, 364, 748, 746, 1261, 1264, 746, 797, + 921, 520, 415, 277, 752, 98, 365, 821, 821, 506, + 253, 509, 256, 746, 368, 438, 737, 738, 342, 1130, + 822, 247, 758, 1114, 1114, 409, 432, 1344, 364, 1242, + 787, 926, 821, 1189, 341, 752, 821, 540, 752, 722, + 779, 252, 1250, 281, 860, 415, 545, 605, 788, 339, + 339, 822, 326, 752, 277, 364, 314, 821, 99, 808, + 234, 1319, 415, 234, 1231, 503, 1259, 1262, 517, 759, + 722, 779, 614, 615, 616, 617, 110, 92, 311, 415, + 236, 821, 738, 236, 236, 880, 236, 314, 722, 779, + 414, 99, 282, 610, 281, 1005, 495, 719, 1344, 719, + 525, 257, 435, 822, 1075, 252, 737, 488, 1348, 99, + 242, 722, 807, 415, 808, 499, 718, 517, 237, 821, + 989, 604, 526, 606, 488, 678, 1157, 435, 435, 435, + 435, 1058, 620, 621, 1225, 917, 794, 946, 408, 314, + 133, 312, 353, 252, 1223, 822, 770, 912, 142, 1114, + 395, 881, 394, 515, 248, 821, 889, 418, 544, 505, + 530, 281, 971, 281, 484, 485, 123, 756, 687, 756, + 694, 1351, 868, 251, 738, 1016, 99, 236, 99, 695, + 979, 341, 408, 696, 687, 538, 92, 353, 616, 109, + 368, 821, 1353, 802, 529, 821, 821, 142, 719, 311, + 99, 684, 236, 236, 236, 236, 277, 236, 236, 841, + 841, 821, 821, 687, 688, 841, 841, 718, 1019, 821, + 109, 1018, 574, 98, 773, 435, 965, 234, 821, 687, + 1064, 1053, 503, 680, 921, 1183, 684, 746, 1183, 821, + 109, 1009, 1011, 1013, 282, 1015, 281, 236, 822, 821, + 1017, 281, 809, 377, 1353, 773, 667, 1226, 773, 341, + 763, 99, 312, 1182, 667, 821, 99, 817, 821, 819, + 821, 141, 616, 773, 821, 540, 691, 752, 1129, 1129, + 575, 537, 1018, 274, 821, 805, 821, 591, 234, 591, + 1188, 763, 821, 1278, 763, 770, 770, 821, 841, 326, + 236, 234, 821, 412, 422, 665, 503, 686, 236, 763, + 841, 415, 722, 779, 893, 821, 311, 809, 671, 60, + 141, 236, 675, 676, 677, 517, 816, 746, 821, 667, + 820, 822, 895, 821, 807, 242, 1347, 795, 773, 1349, + 548, 804, 807, 237, 821, 731, 412, 413, 1384, 201, + 720, 821, 686, 204, 718, 335, 609, 234, 405, 99, + 667, 862, 503, 412, 487, 906, 898, 752, 1062, 906, + 811, 719, 14, 14, 763, 152, 821, 236, 665, 312, + 412, 519, 312, 722, 705, 667, 374, 375, 777, 744, + 721, 550, 551, 723, 724, 1360, 466, 1158, 1160, 1161, + 1162, 142, 722, 779, 1129, 142, 809, 1042, 540, 665, + 1355, 515, 1357, 794, 412, 543, 794, 281, 739, 777, + 281, 415, 234, 382, 383, 821, 431, 503, 657, 799, + 666, 14, 99, 236, 665, 99, 236, 777, 812, 917, + 1148, 1283, 236, 353, 353, 866, 1129, 1129, 1129, 311, + 667, 737, 99, 421, 770, 770, 837, 527, 109, 762, + 837, 837, 855, 864, 530, 312, 701, 1233, 931, 687, + 687, 874, 1390, 821, 899, 935, 839, 1166, 821, 466, + 846, 445, 883, 821, 834, 687, 687, 800, 893, 809, + 896, 821, 834, 374, 375, 917, 1069, 773, 533, 665, + 737, 252, 777, 281, 838, 415, 763, 825, 838, 838, + 236, 281, 312, 1234, 234, 311, 833, 591, 99, 503, + 236, 281, 281, 591, 845, 1321, 99, 577, 141, 1220, + 445, 821, 1330, 763, 236, 1367, 99, 99, 425, 885, + 1345, 821, 667, 201, 851, 851, 824, 204, 980, 809, + 957, 982, 475, 313, 568, 831, 834, 426, 1129, 1299, + 816, 991, 1154, 831, 427, 236, 510, 809, 101, 960, + 569, 477, 958, 1254, 807, 926, 511, 512, 312, 988, + 863, 101, 101, 591, 313, 894, 152, 773, 548, 938, + 540, 665, 816, 577, 754, 445, 415, 924, 907, 908, + 573, 574, 909, 910, 924, 1292, 101, 779, 686, 686, + 1380, 987, 412, 608, 7, 821, 794, 1022, 415, 101, + 101, 815, 353, 763, 7, 251, 824, 831, 754, 281, + 644, 311, 787, 101, 435, 152, 313, 101, 453, 550, + 551, 1288, 1246, 754, 99, 828, 971, 479, 871, 706, + 1196, 1055, 122, 486, 686, 753, 779, 101, 807, 737, + 1059, 777, 821, 701, 821, 1063, 353, 353, 1066, 646, + 1163, 1164, 920, 7, 738, 726, 927, 644, 728, 1057, + 729, 968, 974, 101, 645, 101, 894, 101, 101, 753, + 737, 1241, 974, 821, 312, 281, 794, 741, 828, 686, + 353, 490, 353, 493, 753, 738, 107, 204, 754, 236, + 99, 821, 1281, 822, 1269, 353, 646, 105, 944, 945, + 808, 779, 412, 700, 1065, 1002, 950, 951, 808, 837, + 837, 645, 828, 494, 435, 837, 837, 107, 1334, 7, + 821, 821, 821, 1153, 822, 794, 821, 353, 105, 1028, + 1030, 777, 771, 1056, 403, 1034, 1036, 107, 496, 401, + 399, 738, 400, 99, 402, 236, 1252, 1253, 105, 753, + 234, 947, 446, 497, 932, 503, 647, 838, 838, 952, + 353, 970, 971, 838, 838, 994, 995, 1054, 997, 998, + 236, 101, 828, 281, 99, 807, 807, 807, 667, 821, + 890, 807, 807, 514, 807, 281, 412, 956, 99, 236, + 1024, 518, 807, 101, 97, 737, 101, 101, 837, 101, + 99, 446, 1269, 647, 101, 1269, 1186, 1187, 765, 1281, + 837, 1281, 312, 1350, 900, 695, 521, 851, 1133, 1165, + 1152, 524, 101, 152, 377, 1033, 737, 665, 532, 1156, + 1131, 1132, 859, 1293, 1294, 807, 1045, 807, 1136, 1179, + 535, 429, 765, 312, 737, 828, 838, 1139, 1143, 821, + 1147, 993, 99, 539, 821, 101, 821, 765, 838, 884, + 281, 99, 432, 102, 1247, 656, 446, 141, 656, 281, + 1350, 1281, 429, 1067, 937, 99, 656, 412, 1287, 430, + 942, 433, 943, 807, 99, 546, 1074, 558, 1076, 101, + 101, 101, 1077, 432, 102, 311, 821, 110, 1202, 412, + 1363, 821, 1203, 353, 353, 600, 1221, 821, 1149, 603, + 430, 821, 433, 101, 102, 101, 101, 101, 101, 435, + 101, 101, 765, 915, 607, 821, 821, 821, 110, 1200, + 1200, 1289, 821, 542, 542, 686, 686, 103, 281, 656, + 840, 656, 281, 1167, 847, 1176, 281, 990, 110, 611, + 974, 117, 669, 99, 821, 107, 431, 99, 1217, 1284, + 101, 99, 1249, 681, 117, 117, 105, 612, 103, 1260, + 1263, 656, 656, 143, 101, 698, 1339, 1340, 1290, 101, + 124, 704, 688, 353, 353, 821, 709, 431, 103, 1298, + 840, 710, 847, 730, 236, 656, 281, 656, 1279, 281, + 548, 725, 117, 117, 1369, 108, 828, 1312, 897, 688, + 129, 99, 496, 101, 99, 727, 117, 734, 281, 974, + 977, 101, 143, 1026, 1027, 377, 743, 688, 745, 281, + 311, 435, 435, 99, 101, 772, 108, 1236, 144, 1256, + 1258, 774, 390, 391, 99, 776, 106, 549, 778, 1000, + 1001, 550, 551, 1244, 688, 783, 108, 496, 828, 1177, + 656, 785, 656, 786, 818, 1004, 117, 821, 117, 117, + 117, 117, 101, 826, 689, 1273, 829, 106, 830, 311, + 435, 234, 861, 1143, 865, 868, 503, 144, 968, 496, + 101, 148, 871, 1328, 714, 281, 1366, 106, 809, 793, + 117, 236, 913, 117, 888, 681, 236, 236, 1137, 667, + 99, 435, 891, 892, 435, 1279, 548, 1279, 1229, 689, + 117, 924, 714, 889, 1279, 793, 714, 496, 930, 117, + 914, 681, 102, 828, 828, 933, 281, 934, 941, 948, + 148, 949, 1364, 714, 953, 101, 101, 955, 101, 101, + 681, 99, 656, 828, 656, 101, 959, 963, 665, 252, + 1174, 1229, 964, 553, 974, 101, 110, 550, 551, 966, + 708, 971, 496, 1279, 117, 1279, 681, 1279, 104, 1279, + 403, 398, 793, 996, 999, 401, 399, 575, 400, 992, + 402, 576, 1354, 1032, 1008, 1279, 117, 1010, 1012, 117, + 117, 1361, 117, 1014, 496, 788, 103, 117, 793, 104, + 125, 20, 689, 1029, 1031, 143, 1072, 101, 548, 1035, + 1037, 101, 101, 101, 1073, 117, 828, 828, 828, 104, + 143, 101, 1141, 101, 1145, 1238, 1239, 1159, 1229, 101, + 1178, 1185, 20, 1193, 1194, 148, 496, 101, 323, 101, + 101, 1197, 1388, 548, 1389, 1255, 1391, 689, 323, 1243, + 20, 1183, 1245, 1029, 1031, 553, 1035, 1037, 1087, 550, + 551, 403, 1397, 1295, 108, 1286, 401, 399, 101, 400, + 1296, 402, 1301, 688, 688, 511, 1302, 1305, 1313, 323, + 1314, 129, 117, 117, 117, 144, 1316, 1320, 828, 1322, + 554, 511, 1134, 1323, 550, 551, 1368, 323, 548, 1346, + 688, 688, 1177, 496, 496, 106, 117, 746, 117, 117, + 117, 117, 129, 117, 117, 129, 20, 496, 1309, 1310, + 1311, 511, 1358, 126, 1362, 511, 1134, 1370, 117, 793, + 1372, 323, 129, 1374, 1257, 821, 126, 126, 148, 1376, + 1378, 746, 127, 1394, 691, 553, 821, 101, 807, 550, + 551, 496, 1246, 117, 136, 793, 746, 809, 438, 548, + 556, 814, 496, 323, 814, 689, 689, 117, 40, 41, + 42, 43, 117, 548, 126, 126, 809, 816, 809, 372, + 714, 1300, 714, 714, 714, 714, 714, 809, 126, 691, + 1365, 1304, 809, 331, 496, 334, 681, 681, 656, 473, + 656, 761, 714, 1306, 1307, 1308, 117, 978, 1020, 1021, + 550, 551, 101, 101, 117, 517, 714, 613, 496, 496, + 755, 746, 681, 681, 550, 551, 714, 117, 740, 1038, + 1039, 714, 714, 714, 742, 144, 1291, 104, 126, 1048, + 126, 1337, 126, 126, 1331, 563, 136, 564, 565, 566, + 567, 568, 844, 20, 20, 20, 1356, 1270, 452, 20, + 20, 377, 20, 918, 1006, 117, 911, 569, 101, 1201, + 20, 923, 1180, 1359, 316, 317, 793, 318, 390, 391, + 101, 101, 681, 117, 336, 1387, 101, 101, 961, 651, + 126, 571, 690, 101, 336, 136, 572, 573, 574, 363, + 323, 323, 323, 689, 689, 323, 323, 323, 128, 323, + 692, 101, 101, 20, 1385, 20, 1251, 323, 1181, 323, + 323, 1248, 100, 101, 417, 336, 1266, 681, 330, 323, + 323, 1049, 323, 323, 323, 323, 323, 690, 117, 117, + 1371, 117, 117, 336, 1267, 732, 126, 1329, 117, 1089, + 129, 496, 377, 100, 0, 692, 112, 139, 117, 793, + 323, 20, 323, 0, 0, 569, 0, 0, 126, 101, + 548, 126, 126, 98, 126, 101, 0, 146, 119, 126, + 683, 101, 0, 0, 101, 0, 563, 794, 564, 565, + 566, 567, 0, 684, 323, 573, 0, 126, 101, 1265, + 120, 0, 0, 0, 0, 289, 139, 101, 323, 336, + 117, 648, 0, 0, 117, 117, 117, 760, 496, 496, + 0, 550, 551, 131, 117, 683, 117, 0, 0, 0, + 794, 120, 117, 0, 120, 635, 684, 0, 684, 0, + 117, 0, 117, 117, 0, 691, 691, 640, 0, 0, + 118, 120, 682, 793, 131, 636, 0, 131, 648, 798, + 0, 0, 648, 648, 126, 126, 126, 0, 641, 0, + 794, 117, 0, 0, 131, 0, 101, 0, 681, 0, + 101, 684, 635, 0, 101, 0, 635, 635, 126, 0, + 126, 126, 126, 126, 640, 126, 126, 682, 640, 640, + 0, 0, 636, 136, 798, 0, 636, 636, 793, 0, + 0, 0, 681, 794, 681, 641, 793, 101, 0, 641, + 641, 0, 0, 0, 0, 145, 0, 681, 0, 656, + 0, 656, 0, 0, 101, 126, 798, 101, 121, 0, + 685, 0, 0, 147, 0, 0, 336, 336, 336, 126, + 117, 336, 336, 336, 126, 336, 101, 0, 0, 681, + 0, 0, 0, 336, 0, 1126, 1126, 101, 0, 0, + 714, 146, 478, 0, 0, 480, 481, 482, 336, 336, + 336, 336, 336, 681, 681, 685, 0, 0, 126, 0, + 107, 793, 681, 690, 690, 0, 126, 794, 714, 0, + 0, 120, 714, 684, 0, 656, 336, 691, 336, 126, + 0, 692, 692, 138, 139, 117, 117, 0, 0, 714, + 146, 821, 0, 0, 101, 0, 133, 794, 0, 101, + 101, 0, 0, 101, 0, 336, 0, 150, 0, 0, + 0, 107, 107, 0, 0, 313, 0, 126, 684, 0, + 0, 0, 691, 0, 336, 0, 794, 133, 0, 0, + 133, 0, 353, 0, 0, 126, 0, 793, 145, 120, + 794, 117, 0, 798, 101, 0, 360, 133, 0, 0, + 794, 683, 683, 117, 117, 137, 150, 0, 0, 117, + 117, 1126, 131, 798, 684, 684, 117, 0, 485, 0, + 313, 0, 0, 0, 690, 0, 0, 353, 485, 0, + 0, 471, 471, 0, 117, 117, 0, 145, 798, 0, + 126, 126, 0, 126, 126, 0, 117, 0, 0, 0, + 126, 0, 0, 1126, 1126, 1126, 0, 684, 684, 485, + 126, 0, 0, 0, 485, 0, 0, 0, 793, 690, + 798, 0, 0, 682, 682, 316, 317, 485, 318, 0, + 798, 798, 0, 0, 0, 45, 46, 0, 123, 0, + 0, 0, 117, 140, 0, 0, 0, 0, 117, 0, + 1099, 1099, 0, 0, 117, 0, 563, 117, 564, 565, + 566, 567, 126, 0, 0, 0, 126, 126, 126, 123, + 0, 117, 123, 0, 687, 84, 126, 0, 126, 0, + 117, 0, 0, 107, 126, 681, 681, 0, 147, 123, + 0, 298, 126, 485, 126, 126, 0, 0, 146, 0, + 0, 298, 764, 0, 0, 711, 139, 794, 0, 717, + 0, 685, 685, 289, 0, 1126, 107, 1099, 1099, 687, + 0, 1099, 0, 126, 692, 0, 84, 84, 0, 0, + 309, 0, 298, 0, 107, 298, 714, 147, 714, 714, + 714, 714, 714, 369, 370, 371, 372, 373, 717, 117, + 298, 0, 289, 117, 0, 1099, 0, 117, 714, 0, + 0, 309, 0, 0, 150, 133, 313, 0, 0, 692, + 0, 0, 714, 0, 684, 684, 1099, 798, 691, 691, + 0, 0, 714, 0, 298, 309, 0, 714, 714, 714, + 117, 0, 0, 0, 1099, 145, 309, 309, 1099, 85, + 0, 107, 126, 107, 0, 0, 135, 117, 346, 780, + 117, 1099, 1099, 1099, 1099, 0, 298, 0, 1099, 1099, + 0, 1099, 0, 0, 0, 107, 0, 0, 0, 117, + 485, 485, 485, 353, 353, 485, 485, 485, 0, 485, + 117, 0, 0, 130, 798, 798, 0, 485, 0, 485, + 85, 85, 0, 346, 310, 0, 0, 0, 0, 485, + 485, 0, 485, 485, 485, 485, 485, 126, 126, 0, + 0, 0, 0, 793, 130, 690, 690, 130, 0, 793, + 0, 0, 0, 132, 0, 310, 107, 313, 0, 0, + 485, 107, 485, 0, 130, 850, 856, 117, 84, 0, + 0, 0, 117, 117, 0, 0, 117, 123, 0, 310, + 0, 0, 0, 794, 132, 485, 485, 132, 0, 794, + 310, 310, 0, 126, 793, 0, 0, 886, 0, 1099, + 0, 84, 1099, 0, 132, 126, 126, 0, 485, 0, + 1099, 126, 126, 0, 717, 147, 289, 117, 126, 84, + 0, 0, 0, 298, 298, 298, 793, 0, 298, 298, + 298, 0, 298, 0, 794, 684, 126, 126, 0, 0, + 298, 0, 298, 298, 298, 687, 687, 0, 126, 0, + 0, 309, 298, 298, 107, 298, 298, 298, 298, 298, + 0, 0, 0, 0, 0, 794, 794, 1099, 0, 684, + 929, 684, 0, 134, 313, 354, 1341, 0, 564, 565, + 566, 567, 0, 298, 684, 298, 84, 0, 84, 1282, + 0, 0, 85, 0, 126, 692, 692, 0, 0, 0, + 126, 0, 0, 0, 0, 122, 126, 0, 0, 126, + 84, 154, 298, 0, 0, 717, 684, 298, 0, 124, + 354, 0, 0, 126, 0, 85, 0, 107, 0, 0, + 107, 298, 126, 0, 298, 0, 122, 962, 0, 122, + 0, 686, 0, 85, 0, 0, 103, 107, 794, 684, + 124, 0, 0, 124, 0, 688, 122, 0, 1100, 1100, + 125, 0, 984, 0, 0, 0, 0, 109, 0, 0, + 124, 84, 309, 0, 0, 310, 84, 0, 0, 346, + 346, 0, 130, 793, 1280, 0, 686, 0, 0, 0, + 0, 125, 0, 0, 125, 0, 689, 103, 103, 842, + 688, 126, 0, 842, 842, 126, 1282, 313, 1282, 126, + 85, 125, 85, 107, 0, 1282, 0, 0, 109, 109, + 0, 107, 132, 794, 0, 1100, 1100, 0, 0, 1100, + 0, 107, 107, 0, 85, 0, 0, 0, 0, 0, + 0, 689, 126, 0, 149, 0, 0, 0, 0, 138, + 793, 793, 1047, 362, 0, 0, 0, 0, 1051, 126, + 0, 0, 126, 1100, 1282, 0, 1282, 0, 1282, 84, + 1282, 0, 1060, 313, 793, 0, 0, 0, 0, 151, + 793, 126, 903, 0, 1100, 683, 1282, 0, 289, 309, + 794, 794, 126, 149, 0, 85, 310, 0, 138, 0, + 85, 1280, 1100, 1280, 0, 794, 1100, 1280, 153, 794, + 1280, 0, 0, 0, 0, 794, 0, 137, 0, 1100, + 1100, 1100, 1100, 0, 0, 793, 1100, 1100, 151, 1100, + 683, 0, 0, 0, 0, 1138, 0, 0, 0, 107, + 0, 0, 84, 0, 0, 84, 0, 0, 0, 126, + 1151, 0, 0, 682, 126, 126, 0, 793, 126, 1280, + 794, 1280, 84, 1280, 0, 1280, 137, 0, 268, 103, + 0, 0, 684, 684, 122, 0, 354, 354, 268, 0, + 0, 1280, 0, 0, 0, 0, 0, 0, 124, 313, + 109, 0, 794, 85, 0, 0, 0, 0, 682, 126, + 0, 0, 103, 0, 0, 107, 0, 0, 0, 268, + 0, 0, 268, 310, 84, 798, 0, 0, 84, 84, + 103, 0, 309, 109, 0, 0, 268, 268, 84, 125, + 563, 268, 564, 565, 566, 567, 84, 1100, 0, 1224, + 1100, 109, 686, 686, 0, 793, 84, 84, 1100, 798, + 0, 798, 0, 1109, 1109, 0, 688, 688, 0, 0, + 0, 268, 0, 0, 798, 0, 85, 0, 0, 85, + 0, 0, 842, 842, 0, 0, 764, 0, 842, 842, + 0, 765, 0, 0, 0, 140, 85, 103, 309, 103, + 0, 0, 0, 268, 0, 0, 798, 689, 689, 0, + 0, 149, 0, 107, 0, 1100, 138, 0, 109, 0, + 109, 103, 0, 0, 793, 107, 0, 0, 0, 0, + 0, 685, 0, 0, 1168, 0, 0, 0, 798, 798, + 0, 0, 109, 0, 140, 0, 151, 0, 85, 0, + 0, 0, 85, 85, 0, 0, 310, 154, 0, 794, + 0, 0, 85, 0, 84, 0, 0, 0, 1195, 0, + 85, 842, 0, 0, 0, 0, 685, 107, 0, 0, + 85, 85, 103, 842, 137, 230, 107, 103, 0, 1109, + 0, 793, 793, 346, 0, 0, 683, 683, 0, 0, + 107, 0, 0, 109, 0, 0, 154, 1237, 109, 107, + 0, 0, 0, 230, 309, 230, 0, 230, 0, 0, + 0, 687, 310, 0, 1168, 0, 794, 794, 0, 0, + 84, 1168, 1168, 0, 230, 0, 230, 0, 346, 0, + 268, 268, 268, 153, 0, 268, 268, 268, 0, 268, + 0, 0, 0, 0, 0, 0, 0, 268, 0, 268, + 268, 268, 0, 0, 682, 682, 0, 0, 0, 268, + 268, 0, 268, 268, 268, 268, 268, 0, 107, 354, + 103, 0, 107, 1218, 0, 0, 107, 575, 85, 1068, + 0, 576, 153, 0, 0, 798, 0, 84, 84, 127, + 268, 109, 268, 84, 84, 0, 0, 0, 0, 0, + 0, 0, 0, 268, 268, 0, 0, 268, 268, 0, + 0, 0, 0, 0, 354, 0, 0, 0, 84, 268, + 127, 0, 0, 127, 268, 691, 107, 0, 310, 107, + 84, 0, 0, 0, 0, 0, 0, 789, 268, 0, + 127, 268, 140, 103, 85, 0, 103, 789, 107, 0, + 793, 0, 798, 798, 131, 0, 798, 0, 0, 107, + 0, 0, 0, 103, 109, 0, 0, 109, 0, 0, + 691, 0, 0, 0, 0, 0, 84, 0, 789, 0, + 0, 789, 84, 0, 109, 0, 0, 0, 84, 0, + 0, 84, 403, 398, 0, 0, 789, 401, 399, 0, + 400, 798, 402, 0, 154, 84, 0, 0, 471, 0, + 0, 85, 85, 0, 84, 103, 0, 85, 85, 103, + 103, 0, 685, 685, 0, 107, 0, 0, 0, 103, + 789, 0, 0, 798, 0, 0, 843, 103, 0, 0, + 843, 843, 85, 0, 0, 0, 0, 103, 103, 397, + 109, 0, 0, 0, 85, 0, 0, 471, 109, 0, + 0, 0, 789, 0, 0, 126, 107, 0, 109, 109, + 0, 230, 0, 230, 230, 230, 230, 230, 0, 396, + 0, 0, 0, 84, 346, 346, 0, 84, 309, 0, + 153, 84, 0, 230, 0, 0, 126, 0, 0, 126, + 85, 690, 0, 128, 0, 0, 85, 230, 0, 0, + 0, 0, 85, 687, 0, 85, 126, 230, 0, 0, + 0, 0, 230, 230, 230, 0, 0, 0, 0, 85, + 0, 0, 0, 808, 128, 0, 0, 128, 85, 692, + 0, 84, 0, 0, 84, 563, 690, 564, 565, 566, + 567, 568, 0, 0, 128, 103, 0, 0, 127, 0, + 0, 0, 0, 84, 0, 0, 0, 569, 0, 0, + 354, 354, 0, 0, 84, 0, 109, 0, 0, 793, + 0, 570, 0, 130, 692, 793, 0, 0, 0, 150, + 798, 571, 0, 0, 0, 0, 572, 573, 574, 789, + 789, 789, 0, 0, 789, 789, 789, 85, 789, 0, + 0, 85, 310, 0, 0, 85, 789, 808, 789, 789, + 223, 103, 0, 309, 0, 0, 691, 691, 789, 789, + 793, 789, 789, 789, 789, 789, 0, 0, 0, 0, + 84, 0, 109, 0, 233, 233, 0, 0, 223, 0, + 223, 0, 223, 0, 0, 0, 686, 798, 798, 789, + 0, 789, 793, 0, 0, 85, 0, 0, 85, 223, + 0, 223, 309, 0, 0, 0, 0, 266, 271, 272, + 273, 84, 0, 377, 233, 233, 0, 85, 103, 103, + 0, 0, 0, 789, 103, 103, 331, 333, 85, 0, + 390, 391, 1101, 1101, 0, 0, 0, 789, 0, 843, + 843, 0, 0, 0, 0, 843, 843, 0, 0, 103, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 103, 0, 0, 126, 0, 0, 0, 0, 0, + 109, 0, 0, 0, 0, 0, 233, 310, 0, 0, + 0, 0, 109, 0, 808, 808, 808, 0, 0, 0, + 808, 808, 0, 808, 85, 0, 0, 0, 0, 1101, + 1101, 808, 128, 1101, 0, 0, 0, 103, 0, 0, + 0, 0, 0, 103, 0, 0, 0, 0, 0, 103, + 334, 0, 103, 0, 0, 0, 310, 0, 843, 0, + 334, 0, 690, 690, 109, 85, 103, 1101, 0, 0, + 843, 0, 0, 109, 808, 103, 808, 0, 149, 793, + 0, 0, 0, 0, 0, 0, 0, 109, 1101, 0, + 0, 334, 0, 0, 328, 0, 109, 0, 0, 0, + 692, 692, 0, 0, 0, 0, 1101, 119, 0, 334, + 1101, 0, 233, 0, 0, 233, 233, 233, 0, 331, + 0, 0, 808, 1101, 1101, 1101, 1101, 0, 0, 0, + 1101, 1101, 0, 1101, 0, 0, 233, 0, 119, 233, + 0, 119, 0, 683, 103, 0, 793, 793, 103, 0, + 0, 0, 103, 575, 0, 0, 0, 576, 119, 0, + 0, 0, 0, 0, 233, 109, 0, 0, 0, 109, + 1219, 0, 0, 109, 0, 334, 223, 0, 223, 223, + 223, 223, 223, 0, 0, 0, 0, 0, 683, 0, + 0, 0, 233, 0, 233, 0, 233, 0, 223, 0, + 688, 0, 103, 0, 0, 103, 0, 0, 0, 0, + 0, 0, 223, 233, 0, 233, 0, 0, 686, 0, + 0, 0, 223, 109, 103, 0, 109, 223, 223, 223, + 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, + 0, 1101, 0, 0, 1101, 109, 0, 0, 0, 0, + 0, 0, 1101, 0, 0, 0, 109, 0, 0, 0, + 0, 331, 0, 0, 0, 0, 623, 624, 625, 626, + 627, 331, 0, 628, 629, 630, 631, 632, 633, 634, + 635, 0, 637, 0, 0, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 0, 0, 0, 0, 0, 0, + 118, 103, 331, 233, 0, 331, 668, 121, 0, 1101, + 0, 0, 334, 334, 334, 0, 0, 334, 334, 334, + 331, 334, 109, 0, 0, 74, 0, 0, 0, 334, + 0, 118, 0, 0, 118, 74, 682, 0, 121, 0, + 0, 121, 103, 685, 334, 334, 334, 334, 334, 0, + 0, 118, 0, 0, 331, 0, 0, 0, 121, 0, + 0, 0, 0, 109, 233, 0, 74, 0, 0, 0, + 0, 0, 334, 0, 334, 233, 119, 233, 0, 233, + 0, 682, 0, 233, 74, 0, 331, 273, 685, 0, + 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, + 0, 334, 0, 0, 496, 733, 0, 735, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, + 334, 563, 233, 564, 565, 566, 567, 568, 0, 0, + 0, 496, 496, 233, 0, 496, 496, 496, 496, 496, + 496, 496, 0, 569, 683, 683, 0, 0, 0, 0, + 74, 0, 496, 496, 496, 148, 496, 496, 0, 0, + 233, 0, 233, 233, 233, 233, 233, 571, 0, 0, + 0, 0, 572, 573, 574, 0, 0, 0, 0, 233, + 794, 0, 233, 0, 132, 496, 794, 496, 496, 793, + 0, 0, 793, 0, 0, 0, 233, 0, 233, 0, + 0, 0, 688, 0, 0, 0, 233, 0, 0, 0, + 0, 233, 233, 233, 0, 0, 0, 496, 496, 496, + 0, 0, 0, 331, 331, 331, 0, 0, 331, 331, + 331, 794, 331, 0, 0, 0, 0, 0, 0, 0, + 331, 0, 331, 331, 0, 0, 0, 0, 0, 0, + 0, 0, 331, 331, 0, 331, 331, 331, 331, 331, + 836, 0, 0, 794, 836, 849, 233, 0, 0, 118, + 0, 0, 0, 0, 303, 0, 121, 0, 0, 0, + 0, 0, 0, 331, 303, 331, 0, 74, 74, 74, + 233, 0, 74, 74, 74, 0, 74, 233, 793, 793, + 0, 0, 0, 0, 74, 0, 74, 0, 0, 0, + 836, 0, 836, 836, 233, 303, 233, 331, 303, 74, + 74, 74, 74, 74, 0, 0, 0, 0, 836, 0, + 0, 331, 303, 303, 0, 0, 0, 682, 682, 0, + 0, 0, 1102, 1102, 685, 685, 0, 74, 0, 74, + 0, 0, 0, 0, 0, 0, 496, 496, 496, 0, + 0, 496, 496, 496, 0, 496, 0, 303, 0, 0, + 233, 0, 0, 496, 496, 496, 496, 496, 0, 0, + 0, 0, 0, 0, 0, 496, 496, 0, 496, 496, + 496, 496, 496, 0, 0, 74, 0, 0, 0, 303, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1102, + 1102, 0, 0, 1102, 0, 233, 496, 0, 496, 151, + 794, 135, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 0, 0, 233, 681, 496, + 496, 496, 496, 0, 0, 496, 0, 1102, 681, 0, + 496, 0, 135, 0, 0, 135, 0, 346, 0, 0, + 0, 0, 233, 0, 496, 0, 0, 496, 1102, 0, + 0, 793, 135, 0, 0, 681, 681, 0, 793, 681, + 681, 681, 681, 681, 681, 681, 1102, 794, 794, 0, + 1102, 0, 0, 0, 0, 0, 681, 681, 681, 136, + 681, 681, 346, 1102, 1102, 1102, 1102, 0, 0, 0, + 1102, 1102, 0, 1102, 0, 0, 0, 0, 0, 0, + 0, 793, 0, 0, 0, 0, 0, 0, 0, 681, + 1025, 681, 681, 836, 836, 0, 303, 303, 303, 836, + 836, 303, 303, 303, 0, 303, 233, 0, 0, 0, + 0, 0, 233, 303, 0, 303, 303, 303, 233, 0, + 0, 793, 681, 681, 793, 303, 303, 0, 303, 303, + 303, 303, 233, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 793, 836, 836, 0, 836, 836, 233, 0, + 0, 0, 0, 0, 0, 0, 303, 0, 303, 0, + 0, 0, 134, 0, 0, 0, 403, 398, 0, 1078, + 1079, 401, 399, 0, 400, 0, 402, 0, 0, 0, + 0, 1102, 836, 0, 1102, 303, 0, 1135, 0, 395, + 303, 394, 1102, 134, 836, 233, 134, 575, 354, 0, + 0, 576, 0, 0, 303, 0, 0, 303, 0, 0, + 233, 0, 0, 134, 0, 0, 836, 0, 0, 0, + 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 354, 0, 0, 0, 0, 0, 1102, + 135, 0, 0, 396, 0, 793, 793, 793, 0, 793, + 681, 681, 681, 793, 793, 681, 681, 681, 793, 681, + 793, 793, 793, 793, 793, 793, 793, 681, 793, 681, + 681, 681, 793, 793, 793, 793, 793, 793, 793, 681, + 681, 793, 681, 681, 681, 681, 681, 575, 793, 233, + 0, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 346, 346, + 681, 793, 681, 0, 793, 793, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 793, + 793, 0, 0, 681, 681, 681, 681, 793, 693, 681, + 793, 793, 793, 793, 681, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 684, 793, 793, 681, 0, + 0, 681, 0, 0, 0, 684, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 794, 0, + 0, 0, 684, 684, 0, 794, 684, 684, 684, 684, + 684, 684, 684, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 684, 684, 684, 139, 684, 684, 0, + 0, 134, 0, 0, 0, 0, 0, 233, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 684, 377, 684, 684, + 0, 0, 382, 383, 0, 563, 0, 564, 565, 566, + 567, 568, 0, 1317, 390, 391, 0, 0, 1324, 0, + 0, 0, 798, 0, 0, 0, 0, 569, 794, 684, + 684, 794, 798, 0, 0, 0, 0, 0, 0, 354, + 354, 570, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 571, 0, 0, 0, 793, 572, 573, 574, 798, + 798, 0, 793, 798, 798, 798, 798, 798, 798, 798, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 798, 798, 798, 150, 798, 798, 0, 0, 0, 0, + 0, 0, 0, 0, 1373, 1375, 1377, 1379, 0, 0, + 0, 1381, 0, 0, 0, 563, 0, 564, 565, 566, + 567, 568, 0, 798, 0, 798, 798, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 569, 1392, 1393, + 1395, 1396, 0, 0, 0, 0, 0, 1398, 0, 0, + 0, 570, 0, 0, 0, 798, 798, 798, 793, 0, + 0, 571, 0, 0, 0, 0, 0, 573, 574, 0, + 0, 0, 794, 794, 794, 0, 794, 684, 684, 684, + 794, 794, 684, 684, 684, 794, 684, 794, 794, 794, + 794, 794, 794, 794, 684, 794, 684, 684, 684, 794, + 794, 794, 794, 794, 794, 794, 684, 684, 794, 684, + 684, 684, 684, 684, 575, 794, 0, 0, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 0, 0, 684, 794, 684, + 0, 794, 794, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 794, 794, 0, 0, + 684, 684, 684, 684, 794, 696, 684, 794, 794, 794, + 794, 684, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 0, 794, 794, 684, 0, 0, 684, 793, + 793, 793, 0, 793, 798, 798, 798, 793, 793, 798, + 798, 798, 793, 798, 793, 793, 793, 793, 793, 793, + 793, 798, 798, 798, 798, 798, 793, 793, 793, 793, + 793, 793, 793, 798, 798, 793, 798, 798, 798, 798, + 798, 0, 793, 0, 0, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 0, 0, 798, 793, 798, 0, 793, 793, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 793, 793, 0, 0, 798, 798, 798, + 798, 793, 0, 798, 793, 793, 793, 793, 798, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 798, 0, 0, 798, 0, 0, 0, 793, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 793, 0, 0, 0, 793, 793, 0, 793, + 793, 793, 793, 793, 793, 793, 793, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 793, 793, 793, + 149, 793, 793, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 563, 0, 564, 565, 566, 567, 568, 0, + 793, 0, 793, 793, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 569, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 794, 0, 0, 0, + 0, 0, 793, 793, 793, 793, 794, 0, 571, 0, + 0, 0, 0, 0, 573, 574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 794, - 0, 0, 0, 797, 797, 0, 794, 797, 797, 797, - 797, 797, 797, 797, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 797, 797, 797, 0, 797, 797, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 797, 0, 797, - 797, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 794, 794, 0, 794, 794, 794, 794, + 794, 794, 794, 794, 0, 0, 0, 0, 0, 0, + 1080, 1081, 1082, 1083, 794, 794, 794, 151, 794, 794, + 0, 0, 0, 0, 0, 0, 1084, 1085, 1086, 0, + 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, + 44, 0, 0, 0, 0, 0, 306, 794, 0, 794, + 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 797, - 797, 797, 794, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 793, 793, 793, 0, - 793, 796, 796, 796, 793, 793, 796, 796, 796, 793, - 796, 793, 793, 793, 793, 793, 793, 793, 796, 796, - 796, 796, 796, 793, 793, 793, 793, 793, 793, 793, - 796, 796, 793, 796, 796, 796, 796, 796, 0, 793, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 794, + 794, 794, 794, 58, 59, 60, 61, 62, 63, 64, + 0, 65, 66, 0, 0, 0, 793, 793, 793, 0, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 0, 793, 0, 0, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, 0, - 0, 793, 0, 793, 793, 796, 796, 796, 796, 796, - 796, 796, 796, 796, 796, 796, 796, 796, 793, 793, - 0, 0, 796, 796, 796, 796, 793, 0, 796, 793, - 793, 793, 793, 796, 793, 793, 793, 793, 793, 793, - 793, 793, 793, 793, 0, 793, 793, 796, 0, 0, - 796, 0, 0, 794, 794, 794, 0, 794, 797, 797, - 797, 794, 794, 797, 797, 797, 794, 797, 794, 794, - 794, 794, 794, 794, 794, 797, 797, 797, 797, 797, - 794, 794, 794, 794, 794, 794, 794, 797, 797, 794, - 797, 797, 797, 797, 797, 0, 794, 0, 0, 794, + 0, 793, 793, 793, 0, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 0, 0, 793, 793, 793, 793, 793, 0, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 0, 793, 793, 793, + 0, 0, 793, 794, 794, 794, 0, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, - 794, 794, 794, 794, 794, 794, 0, 0, 794, 0, - 794, 794, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 794, 794, 0, 0, 797, - 797, 797, 797, 794, 0, 797, 794, 794, 794, 794, - 797, 794, 794, 794, 794, 794, 794, 794, 794, 794, - 794, 348, 794, 794, 797, 0, 0, 797, 0, 0, - 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 792, 0, 0, 0, 348, 348, - 0, 792, 348, 348, 348, 348, 348, 348, 348, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, - 348, 348, 148, 348, 348, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 377, 372, 0, - 0, 0, 375, 373, 0, 374, 0, 376, 0, 0, - 0, 0, 348, 0, 348, 348, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 486, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 486, 0, 0, 0, 348, 348, 792, 0, 0, - 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 486, 486, - 0, 0, 486, 486, 486, 486, 486, 486, 486, 0, - 0, 0, 0, 0, 370, 0, 0, 0, 0, 486, - 486, 486, 144, 486, 486, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 226, 0, 0, 0, 0, 0, 0, - 0, 0, 486, 0, 486, 486, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 226, 0, 226, 0, 226, 0, 0, 0, 683, - 0, 0, 0, 0, 486, 486, 486, 0, 0, 0, - 0, 0, 226, 0, 226, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 792, 792, - 792, 0, 792, 348, 348, 348, 792, 792, 348, 348, - 348, 792, 348, 792, 792, 792, 792, 792, 792, 792, - 348, 0, 348, 348, 348, 792, 792, 792, 792, 792, - 792, 792, 348, 348, 792, 348, 348, 348, 348, 348, - 0, 792, 0, 0, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 0, 0, 792, 0, 792, 792, 348, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 792, 792, 0, 0, 348, 348, 348, 348, 792, 0, - 348, 792, 792, 792, 792, 348, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 351, 792, 792, 348, - 0, 0, 348, 486, 486, 486, 0, 0, 486, 486, - 486, 0, 486, 364, 365, 0, 0, 0, 0, 0, - 486, 486, 486, 486, 486, 0, 0, 0, 0, 0, - 0, 0, 486, 486, 0, 486, 486, 486, 486, 486, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 683, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 683, 0, 486, 486, 486, - 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 0, 0, 0, 0, 486, 486, 486, 486, 0, 0, - 486, 0, 683, 683, 0, 486, 683, 683, 683, 683, - 683, 683, 683, 0, 0, 0, 0, 0, 0, 486, - 0, 0, 486, 683, 683, 683, 138, 683, 683, 226, - 0, 226, 226, 226, 226, 226, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, - 0, 0, 0, 0, 0, 0, 683, 0, 683, 683, - 682, 0, 0, 226, 0, 0, 0, 0, 0, 683, - 682, 0, 0, 226, 0, 0, 0, 0, 226, 226, - 226, 0, 0, 0, 0, 0, 0, 0, 0, 683, - 683, 0, 0, 0, 0, 0, 0, 682, 682, 0, - 0, 682, 682, 682, 682, 682, 682, 682, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 682, 682, - 682, 137, 682, 682, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 569, 0, 887, 0, 570, - 0, 682, 0, 682, 682, 0, 0, 0, 684, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 684, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 682, 682, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 684, 684, 0, 0, 684, - 684, 684, 684, 684, 684, 684, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 684, 684, 684, 139, - 684, 684, 0, 0, 0, 0, 0, 683, 683, 683, - 0, 0, 683, 683, 683, 0, 683, 0, 0, 0, - 0, 0, 0, 0, 683, 0, 683, 683, 683, 684, - 0, 684, 684, 0, 0, 0, 683, 683, 0, 683, - 683, 683, 683, 683, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, - 0, 0, 684, 684, 0, 39, 0, 0, 0, 0, + 794, 794, 794, 794, 794, 0, 794, 0, 0, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 0, 0, 794, 794, + 794, 0, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 0, + 0, 794, 794, 794, 794, 794, 0, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 347, 794, 794, 794, 0, 0, 794, + 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 795, 0, 0, 0, + 347, 347, 0, 795, 347, 347, 347, 347, 347, 347, + 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 347, 347, 347, 0, 347, 347, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 347, 0, 347, 347, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 799, 0, 0, 0, 0, 0, 795, 347, 347, 795, + 799, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 795, 0, 0, 0, 799, 799, 0, + 795, 799, 799, 799, 799, 799, 799, 799, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 799, 799, + 799, 0, 799, 799, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 799, 0, 799, 799, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 799, 799, 799, 795, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 795, 795, 795, 0, 795, 347, 347, 347, 795, 795, + 347, 347, 347, 795, 347, 795, 795, 795, 795, 795, + 795, 795, 347, 795, 347, 347, 347, 795, 795, 795, + 795, 795, 795, 795, 347, 347, 795, 347, 347, 347, + 347, 347, 0, 795, 0, 0, 795, 795, 795, 795, + 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, + 795, 795, 795, 0, 0, 347, 795, 347, 0, 795, + 795, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 795, 795, 0, 0, 347, 347, + 347, 347, 795, 0, 347, 795, 795, 795, 795, 347, + 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, + 0, 795, 795, 347, 0, 0, 347, 795, 795, 795, + 0, 795, 799, 799, 799, 795, 795, 799, 799, 799, + 795, 799, 795, 795, 795, 795, 795, 795, 795, 799, + 799, 799, 799, 799, 795, 795, 795, 795, 795, 795, + 795, 799, 799, 795, 799, 799, 799, 799, 799, 0, + 795, 0, 0, 795, 795, 795, 795, 795, 795, 795, + 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, + 0, 0, 799, 795, 799, 0, 795, 795, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + 799, 795, 795, 0, 0, 799, 799, 799, 799, 795, + 0, 799, 795, 795, 795, 795, 799, 795, 795, 795, + 795, 795, 795, 795, 795, 795, 795, 800, 795, 795, + 799, 0, 0, 799, 0, 0, 0, 800, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 797, 0, 0, 0, 800, 800, 0, 797, 800, 800, + 800, 800, 800, 800, 800, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 800, 800, 800, 0, 800, + 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 800, 0, + 800, 800, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 687, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 687, + 800, 800, 800, 797, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 687, 687, 0, 0, + 687, 687, 687, 687, 687, 687, 687, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 687, 687, 687, + 142, 687, 687, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, + 687, 0, 687, 687, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 218, 0, 218, 0, 218, 0, 0, 0, 689, + 0, 0, 0, 687, 687, 0, 0, 0, 0, 0, + 0, 0, 218, 0, 218, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 797, 797, 797, 0, 797, 800, + 800, 800, 797, 797, 800, 800, 800, 797, 800, 797, + 797, 797, 797, 797, 797, 797, 800, 800, 800, 800, + 800, 797, 797, 797, 797, 797, 797, 797, 800, 800, + 797, 800, 800, 800, 800, 800, 0, 797, 0, 0, + 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, + 797, 797, 797, 797, 797, 797, 797, 0, 0, 800, + 797, 800, 0, 797, 797, 800, 800, 800, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, 797, 797, + 0, 0, 800, 800, 800, 800, 797, 0, 800, 797, + 797, 797, 797, 800, 797, 797, 797, 797, 797, 797, + 797, 797, 797, 797, 0, 797, 797, 800, 0, 0, + 800, 687, 687, 687, 0, 0, 687, 687, 687, 0, + 687, 0, 0, 0, 0, 0, 0, 0, 687, 0, + 687, 687, 687, 0, 0, 0, 0, 0, 0, 0, + 687, 687, 0, 687, 687, 687, 687, 687, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 686, 0, 0, 0, 0, + 0, 687, 0, 687, 0, 686, 0, 687, 687, 687, + 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, + 0, 0, 0, 0, 687, 687, 687, 687, 0, 699, + 687, 0, 686, 686, 0, 687, 686, 686, 686, 686, + 686, 686, 686, 0, 0, 0, 0, 0, 0, 687, + 0, 0, 687, 686, 686, 686, 141, 686, 686, 218, + 0, 218, 218, 218, 218, 218, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 218, 0, 0, 0, 0, 686, 0, 686, 686, + 688, 0, 0, 0, 0, 218, 0, 0, 0, 0, + 688, 689, 0, 0, 0, 218, 0, 0, 0, 0, + 218, 218, 218, 0, 0, 0, 0, 0, 0, 686, + 686, 0, 0, 0, 0, 0, 0, 688, 688, 0, + 0, 688, 688, 688, 688, 688, 688, 688, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 688, 688, + 688, 143, 688, 688, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 688, 0, 688, 688, 0, 0, 0, 689, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 688, 688, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 689, 689, 0, 0, 689, + 689, 689, 689, 689, 689, 689, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 689, 689, 689, 144, + 689, 689, 0, 0, 0, 0, 0, 686, 686, 686, + 0, 0, 686, 686, 686, 0, 686, 0, 0, 0, + 0, 0, 0, 0, 686, 0, 686, 686, 686, 689, + 0, 689, 689, 0, 0, 0, 686, 686, 0, 686, + 686, 686, 686, 686, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 689, 689, 0, 0, 0, 686, 0, 686, + 0, 0, 0, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 0, 0, 0, 0, + 686, 686, 686, 686, 0, 698, 686, 0, 0, 0, + 0, 686, 688, 688, 688, 0, 0, 688, 688, 688, + 0, 688, 0, 0, 0, 686, 0, 0, 686, 688, + 0, 688, 688, 688, 0, 0, 0, 0, 0, 0, + 0, 688, 688, 0, 688, 688, 688, 688, 688, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 822, 0, 0, + 0, 0, 688, 0, 688, 0, 0, 822, 688, 688, + 688, 688, 688, 688, 688, 688, 688, 688, 688, 688, + 688, 0, 0, 0, 0, 688, 688, 688, 688, 0, + 700, 688, 0, 0, 0, 0, 688, 0, 822, 0, + 689, 689, 689, 0, 0, 689, 689, 689, 0, 689, + 688, 0, 0, 688, 0, 0, 822, 689, 0, 689, + 689, 689, 0, 0, 0, 0, 0, 0, 0, 689, + 689, 0, 689, 689, 689, 689, 689, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 822, 0, 0, 0, 691, 0, 0, 0, 0, 0, + 689, 0, 689, 0, 691, 0, 689, 689, 689, 689, + 689, 689, 689, 689, 689, 689, 689, 689, 689, 0, + 0, 0, 822, 689, 689, 689, 689, 0, 701, 689, + 0, 691, 691, 0, 689, 691, 691, 691, 691, 691, + 691, 691, 0, 0, 0, 0, 0, 0, 689, 0, + 0, 689, 691, 691, 691, 146, 691, 691, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 691, 0, 691, 691, 690, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 690, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 691, 691, + 0, 0, 0, 0, 0, 0, 690, 690, 0, 0, + 690, 690, 690, 690, 690, 690, 690, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 690, 690, 690, + 145, 690, 690, 0, 0, 0, 0, 0, 0, 822, + 822, 822, 0, 0, 822, 822, 822, 0, 822, 0, + 0, 0, 0, 0, 0, 0, 822, 0, 822, 822, + 690, 0, 690, 690, 0, 0, 0, 692, 822, 822, + 0, 822, 822, 822, 822, 822, 0, 692, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 690, 690, 0, 0, 0, 0, 822, + 0, 822, 0, 0, 692, 692, 0, 0, 692, 692, + 692, 692, 692, 692, 692, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 692, 692, 692, 147, 692, + 692, 0, 0, 822, 0, 0, 691, 691, 691, 0, + 0, 691, 691, 691, 0, 691, 0, 822, 0, 0, + 0, 0, 0, 691, 0, 691, 691, 691, 692, 0, + 692, 692, 0, 0, 0, 691, 691, 0, 691, 691, + 691, 691, 691, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 692, 692, 0, 0, 0, 691, 0, 691, 0, + 0, 0, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 0, 0, 0, 0, 691, + 691, 691, 691, 0, 703, 691, 0, 0, 0, 0, + 691, 690, 690, 690, 0, 0, 690, 690, 690, 0, + 690, 0, 0, 0, 691, 0, 0, 691, 690, 0, + 690, 690, 690, 0, 0, 0, 0, 0, 0, 0, + 690, 690, 0, 690, 690, 690, 690, 690, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, + 0, 690, 0, 690, 0, 0, 85, 690, 690, 690, + 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, + 0, 0, 0, 0, 690, 690, 690, 690, 0, 702, + 690, 0, 0, 0, 0, 690, 0, 85, 0, 692, + 692, 692, 0, 0, 692, 692, 692, 0, 692, 690, + 0, 0, 690, 0, 0, 85, 692, 0, 692, 692, + 692, 0, 0, 0, 0, 0, 0, 0, 692, 692, + 0, 692, 692, 692, 692, 692, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, + 0, 0, 0, 683, 0, 0, 0, 0, 0, 692, + 0, 692, 0, 683, 0, 692, 692, 692, 692, 692, + 692, 692, 692, 692, 692, 692, 692, 692, 0, 0, + 0, 85, 692, 692, 692, 692, 0, 704, 692, 0, + 683, 683, 0, 692, 683, 683, 683, 683, 683, 683, + 683, 0, 0, 0, 0, 0, 0, 692, 0, 0, + 692, 683, 683, 683, 138, 683, 683, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 683, 0, 683, 683, 682, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 682, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 683, 683, 0, + 0, 0, 0, 0, 0, 682, 682, 0, 0, 682, + 682, 682, 682, 682, 682, 682, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 682, 682, 682, 137, + 682, 682, 0, 0, 0, 0, 0, 0, 85, 85, + 85, 0, 0, 85, 85, 85, 0, 85, 0, 0, + 0, 0, 0, 0, 0, 85, 0, 85, 85, 682, + 0, 682, 682, 0, 0, 0, 685, 85, 85, 0, + 85, 85, 85, 85, 85, 0, 685, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 682, 682, 0, 0, 0, 0, 85, 0, + 85, 0, 0, 685, 685, 0, 0, 685, 685, 685, + 685, 685, 685, 685, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 685, 685, 685, 140, 685, 685, + 0, 0, 0, 0, 0, 683, 683, 683, 0, 0, + 683, 683, 683, 0, 683, 0, 85, 0, 0, 0, + 0, 0, 683, 0, 683, 683, 683, 685, 0, 685, + 685, 0, 0, 0, 683, 683, 0, 683, 683, 683, + 683, 683, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 685, 685, 0, 0, 0, 683, 0, 683, 0, 0, 0, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 0, 0, 0, 0, 683, 683, - 683, 683, 0, 695, 683, 0, 39, 0, 0, 683, - 0, 0, 682, 682, 682, 0, 0, 682, 682, 682, - 0, 682, 0, 683, 39, 0, 683, 0, 0, 682, - 0, 682, 682, 682, 0, 0, 0, 0, 0, 0, - 0, 682, 682, 0, 682, 682, 682, 682, 682, 0, - 0, 0, 0, 0, 569, 0, 0, 0, 570, 0, - 0, 0, 0, 0, 0, 0, 569, 0, 0, 0, - 570, 0, 0, 0, 0, 0, 682, 682, 682, 682, + 683, 683, 0, 695, 683, 0, 0, 0, 0, 683, + 682, 682, 682, 0, 0, 682, 682, 682, 0, 682, + 0, 0, 0, 683, 0, 0, 683, 682, 0, 682, + 682, 682, 0, 0, 0, 0, 0, 0, 0, 682, + 682, 0, 682, 682, 682, 682, 682, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, + 682, 0, 682, 0, 0, 89, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 0, - 39, 0, 0, 682, 682, 682, 682, 0, 694, 682, - 0, 0, 0, 557, 682, 558, 559, 560, 561, 562, - 684, 684, 684, 0, 0, 684, 684, 684, 682, 684, - 0, 682, 0, 563, 0, 0, 0, 684, 0, 684, - 684, 684, 0, 0, 0, 0, 0, 564, 0, 684, - 684, 0, 684, 684, 684, 684, 684, 565, 0, 0, - 0, 0, 566, 567, 568, 0, 0, 0, 0, 0, - 0, 0, 685, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 685, 0, 684, 684, 684, 684, 684, 684, - 684, 684, 684, 684, 684, 684, 684, 0, 0, 0, - 0, 684, 684, 684, 684, 0, 696, 684, 0, 685, - 685, 0, 684, 685, 685, 685, 685, 685, 685, 685, - 0, 0, 0, 0, 0, 0, 684, 0, 0, 684, - 685, 685, 685, 140, 685, 685, 0, 39, 39, 39, - 0, 0, 0, 39, 39, 0, 39, 0, 0, 0, - 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, - 0, 0, 0, 685, 0, 685, 685, 687, 0, 39, - 39, 39, 39, 39, 0, 0, 0, 687, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 685, 685, 0, 0, - 0, 0, 0, 0, 687, 687, 0, 0, 687, 687, - 687, 687, 687, 687, 687, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 687, 687, 687, 142, 687, - 687, 0, 557, 0, 558, 559, 560, 561, 562, 0, - 0, 0, 0, 39, 557, 0, 558, 559, 560, 561, - 562, 0, 563, 0, 0, 0, 0, 0, 687, 0, - 687, 687, 0, 0, 563, 686, 564, 0, 0, 0, - 0, 0, 0, 0, 0, 686, 565, 0, 0, 0, - 0, 566, 567, 568, 0, 0, 0, 0, 565, 0, - 0, 687, 687, 566, 567, 568, 0, 0, 0, 0, - 0, 0, 686, 686, 0, 0, 686, 686, 686, 686, - 686, 686, 686, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 686, 686, 686, 141, 686, 686, 0, - 0, 0, 0, 0, 685, 685, 685, 0, 0, 685, - 685, 685, 0, 685, 0, 0, 0, 0, 0, 0, - 0, 685, 0, 685, 685, 685, 686, 0, 686, 686, - 0, 0, 0, 685, 685, 0, 685, 685, 685, 685, - 685, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 0, 0, 686, - 686, 0, 27, 0, 0, 0, 0, 0, 685, 685, - 685, 685, 685, 685, 685, 685, 685, 685, 685, 685, - 685, 0, 0, 0, 0, 685, 685, 685, 685, 0, - 697, 685, 0, 27, 0, 0, 685, 0, 0, 687, - 687, 687, 0, 0, 687, 687, 687, 0, 687, 0, - 685, 27, 0, 685, 0, 0, 687, 0, 687, 687, - 687, 0, 0, 0, 0, 0, 0, 0, 687, 687, - 0, 687, 687, 687, 687, 687, 0, 377, 372, 0, - 0, 0, 375, 373, 0, 374, 0, 376, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 369, 0, 368, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 0, 27, 0, 0, - 687, 687, 687, 687, 0, 699, 687, 0, 0, 0, - 0, 687, 0, 0, 371, 0, 0, 686, 686, 686, - 0, 0, 686, 686, 686, 687, 686, 0, 687, 0, - 0, 0, 0, 0, 686, 0, 686, 686, 686, 0, - 0, 0, 0, 0, 370, 0, 686, 686, 0, 686, - 686, 686, 686, 686, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 688, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 688, - 0, 686, 686, 686, 686, 686, 686, 686, 686, 686, - 686, 686, 686, 686, 0, 0, 0, 0, 686, 686, - 686, 686, 0, 698, 686, 0, 688, 688, 0, 686, - 688, 688, 688, 688, 688, 688, 688, 0, 0, 0, - 0, 0, 0, 686, 0, 0, 686, 688, 688, 688, - 143, 688, 688, 0, 27, 27, 27, 0, 0, 0, - 27, 27, 0, 27, 0, 0, 0, 0, 0, 0, - 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, - 688, 0, 688, 688, 679, 0, 27, 27, 27, 27, - 27, 0, 0, 0, 679, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 688, 688, 0, 0, 0, 0, 0, - 0, 679, 679, 0, 0, 679, 679, 679, 679, 679, - 679, 679, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 679, 679, 679, 134, 679, 679, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 27, 0, 0, 0, 0, 0, 351, 0, 0, 0, - 0, 356, 357, 0, 0, 679, 0, 679, 679, 0, - 0, 0, 678, 364, 365, 0, 0, 0, 0, 0, - 0, 0, 678, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 679, 679, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, - 678, 0, 0, 678, 678, 678, 678, 678, 678, 678, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 678, 678, 678, 133, 678, 678, 0, 0, 0, 0, - 0, 688, 688, 688, 0, 0, 688, 688, 688, 0, - 688, 0, 0, 0, 0, 0, 0, 0, 688, 0, - 688, 688, 688, 678, 0, 678, 678, 0, 0, 0, - 688, 688, 0, 688, 688, 688, 688, 688, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 0, 0, 0, 0, 0, 0, 678, 678, 0, 48, - 0, 0, 0, 0, 0, 688, 688, 688, 688, 688, - 688, 688, 688, 688, 688, 688, 688, 688, 0, 0, - 0, 0, 688, 688, 688, 688, 0, 700, 688, 0, - 48, 0, 0, 688, 0, 0, 679, 679, 679, 0, - 0, 679, 679, 679, 0, 679, 0, 688, 48, 0, - 688, 0, 0, 679, 0, 679, 679, 679, 0, 0, - 0, 0, 0, 0, 0, 679, 679, 0, 679, 679, - 679, 679, 679, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 679, 679, 679, 679, 679, 679, 679, + 0, 0, 0, 682, 682, 682, 682, 0, 694, 682, + 0, 0, 0, 0, 682, 0, 89, 0, 685, 685, + 685, 0, 0, 685, 685, 685, 0, 685, 682, 0, + 0, 682, 0, 0, 89, 685, 0, 685, 685, 685, + 0, 0, 0, 0, 0, 0, 0, 685, 685, 0, + 685, 685, 685, 685, 685, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, + 0, 0, 495, 0, 0, 0, 0, 0, 685, 0, + 685, 0, 495, 0, 685, 685, 685, 685, 685, 685, + 685, 685, 685, 685, 685, 685, 685, 0, 0, 0, + 89, 685, 685, 685, 685, 0, 697, 685, 0, 495, + 495, 0, 685, 495, 495, 495, 495, 495, 495, 495, + 0, 0, 0, 0, 0, 0, 685, 0, 0, 685, + 495, 495, 495, 0, 495, 495, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 495, 0, 495, 495, 353, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 495, 495, 495, 0, 0, + 0, 0, 0, 0, 353, 353, 0, 794, 353, 353, + 353, 353, 353, 353, 353, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 353, 353, 353, 152, 353, + 353, 0, 0, 0, 0, 0, 0, 89, 89, 89, + 0, 0, 89, 89, }; } - private static final short[] yyTable2() { - return new short[] { + private static final int[] yyTable2() { + return new int[] { - 679, 679, 679, 679, 679, 679, 0, 48, 0, 0, - 679, 679, 679, 679, 0, 691, 679, 0, 0, 0, - 0, 679, 0, 0, 0, 0, 0, 678, 678, 678, - 0, 0, 678, 678, 678, 679, 678, 0, 679, 0, - 0, 0, 0, 0, 678, 0, 678, 678, 678, 0, - 0, 0, 0, 0, 0, 0, 678, 678, 0, 678, - 678, 678, 678, 678, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 681, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 681, - 0, 678, 678, 678, 678, 678, 678, 678, 678, 678, - 678, 678, 678, 678, 0, 0, 0, 0, 678, 678, - 678, 678, 0, 690, 678, 0, 681, 681, 0, 678, - 681, 681, 681, 681, 681, 681, 681, 0, 0, 0, - 0, 0, 0, 678, 0, 0, 678, 681, 681, 681, - 136, 681, 681, 0, 48, 48, 48, 0, 0, 0, - 48, 48, 0, 48, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 681, 0, 681, 681, 485, 0, 48, 48, 48, 48, - 48, 0, 0, 0, 485, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 681, 681, 0, 0, 0, 0, 0, - 0, 485, 485, 0, 0, 485, 485, 485, 485, 485, - 485, 485, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 485, 485, 485, 0, 485, 485, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 485, 0, 485, 485, 0, - 0, 0, 818, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 818, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 485, 485, 485, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 818, - 818, 0, 0, 818, 818, 818, 818, 818, 818, 818, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 818, 818, 818, 0, 818, 818, 0, 0, 0, 0, - 0, 681, 681, 681, 0, 0, 681, 681, 681, 0, - 681, 0, 0, 0, 0, 0, 0, 0, 681, 0, - 681, 681, 681, 818, 0, 818, 818, 0, 0, 0, - 681, 681, 0, 681, 681, 681, 681, 681, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 0, 0, 0, 0, 0, 818, 818, 818, 0, 50, - 0, 0, 0, 0, 0, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 0, 0, - 0, 0, 681, 681, 681, 681, 0, 693, 681, 0, - 50, 0, 0, 681, 0, 0, 485, 485, 485, 0, - 0, 485, 485, 485, 0, 485, 0, 681, 50, 0, - 681, 0, 0, 485, 485, 485, 485, 485, 0, 0, - 0, 0, 0, 0, 0, 485, 485, 0, 485, 485, - 485, 485, 485, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, - 485, 485, 485, 0, 50, 0, 0, 485, 485, 485, - 485, 0, 0, 485, 0, 0, 0, 0, 485, 0, - 0, 0, 0, 0, 818, 818, 818, 0, 0, 818, - 818, 818, 485, 818, 0, 485, 0, 0, 0, 0, - 0, 818, 818, 818, 818, 818, 0, 0, 0, 0, - 0, 0, 0, 818, 818, 0, 818, 818, 818, 818, - 818, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 339, 0, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 0, 0, 0, 0, 818, 818, 818, 818, 0, - 0, 818, 0, 339, 339, 0, 818, 339, 339, 339, - 339, 339, 339, 339, 0, 0, 0, 0, 0, 0, - 818, 0, 0, 818, 339, 339, 339, 150, 339, 339, - 0, 50, 50, 50, 0, 0, 0, 50, 50, 0, - 50, 0, 0, 0, 0, 0, 0, 0, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 339, 0, 339, - 339, 349, 0, 50, 50, 50, 50, 50, 0, 0, - 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 339, 339, 0, 0, 0, 0, 0, 0, 349, 349, - 0, 0, 349, 349, 349, 349, 349, 349, 349, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, - 349, 349, 149, 349, 349, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 349, 0, 349, 349, 0, 0, 0, 621, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 349, 349, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 621, 621, 0, 0, - 621, 621, 621, 621, 621, 621, 621, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 621, 621, 621, - 0, 621, 621, 0, 0, 0, 0, 0, 339, 339, - 339, 0, 0, 339, 339, 339, 0, 339, 0, 0, - 0, 0, 0, 0, 0, 339, 0, 339, 339, 339, - 621, 0, 621, 621, 0, 0, 0, 339, 339, 0, - 339, 339, 339, 339, 339, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, - 0, 0, 0, 621, 621, 0, 52, 0, 0, 0, - 0, 0, 339, 339, 339, 339, 339, 339, 339, 339, - 339, 339, 339, 339, 339, 0, 0, 0, 0, 339, - 339, 339, 339, 0, 0, 339, 0, 52, 0, 0, - 339, 0, 0, 349, 349, 349, 0, 0, 349, 349, - 349, 0, 349, 0, 339, 52, 0, 339, 0, 0, - 349, 0, 349, 349, 349, 0, 0, 0, 0, 0, - 0, 0, 349, 349, 0, 349, 349, 349, 349, 349, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 0, 52, 0, 0, 349, 349, 349, 349, 0, 0, - 349, 0, 0, 0, 0, 349, 0, 0, 0, 0, - 0, 621, 621, 621, 0, 0, 621, 621, 621, 349, - 621, 0, 349, 0, 0, 0, 0, 0, 621, 0, - 621, 621, 621, 0, 0, 0, 0, 0, 0, 0, - 621, 621, 0, 621, 621, 621, 621, 621, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 284, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 284, 0, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 0, 0, - 0, 0, 621, 621, 621, 621, 0, 0, 621, 0, - 284, 284, 0, 621, 284, 284, 284, 284, 284, 386, - 284, 0, 0, 0, 0, 0, 0, 621, 0, 0, - 621, 284, 284, 284, 0, 284, 284, 0, 52, 52, - 52, 0, 0, 0, 52, 52, 0, 52, 0, 0, - 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, - 0, 0, 0, 0, 386, 0, 284, 284, 361, 0, - 52, 52, 52, 52, 0, 0, 0, 0, 361, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 284, 284, 0, - 0, 0, 0, 0, 0, 361, 361, 0, 0, 361, - 361, 361, 361, 361, 361, 361, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 361, 361, 361, 0, - 361, 361, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 361, - 0, 361, 361, 0, 0, 0, 355, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 361, 361, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 355, 355, 0, 0, 355, 355, 355, - 355, 355, 355, 355, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 355, 355, 355, 0, 355, 355, - 0, 0, 0, 0, 0, 284, 284, 284, 0, 0, - 284, 284, 284, 0, 284, 0, 0, 0, 0, 0, - 0, 0, 284, 0, 284, 284, 284, 355, 0, 355, - 355, 0, 0, 0, 284, 284, 0, 284, 284, 284, - 284, 284, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, - 355, 355, 0, 0, 38, 0, 0, 0, 0, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 0, 0, 0, 0, 284, 284, 386, 386, - 0, 0, 284, 0, 0, 38, 0, 284, 0, 0, - 361, 361, 361, 0, 0, 361, 361, 361, 0, 361, - 0, 284, 0, 38, 284, 0, 0, 361, 0, 361, - 361, 361, 0, 0, 0, 0, 0, 0, 0, 361, - 361, 0, 361, 361, 361, 361, 361, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 321, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 321, 0, 361, 361, 361, 361, 361, 361, - 361, 361, 361, 361, 361, 361, 361, 0, 0, 38, - 0, 361, 361, 361, 361, 0, 0, 361, 0, 0, - 0, 0, 361, 321, 0, 0, 321, 0, 355, 355, - 355, 0, 0, 355, 355, 355, 361, 355, 0, 361, - 0, 321, 0, 0, 0, 355, 0, 355, 355, 355, - 0, 0, 0, 0, 0, 0, 0, 355, 355, 0, - 355, 355, 355, 355, 355, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, - 669, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 669, 0, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 0, 0, 321, 0, 355, - 355, 355, 355, 0, 0, 355, 0, 669, 669, 0, - 355, 669, 669, 669, 669, 669, 669, 669, 0, 0, - 0, 0, 0, 0, 355, 0, 0, 355, 669, 669, - 669, 0, 669, 669, 0, 0, 38, 38, 38, 0, - 0, 0, 38, 38, 0, 38, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, - 0, 669, 0, 669, 669, 248, 0, 0, 38, 38, - 38, 38, 0, 0, 0, 248, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 669, 669, 0, 0, 0, 0, - 0, 0, 248, 248, 0, 0, 248, 248, 248, 248, - 248, 0, 248, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 248, 248, 248, 0, 248, 248, 0, - 0, 0, 0, 0, 321, 321, 321, 0, 0, 321, - 321, 321, 38, 321, 0, 0, 0, 0, 0, 0, - 0, 321, 0, 321, 321, 0, 0, 0, 248, 248, - 0, 249, 0, 321, 321, 0, 321, 321, 321, 321, - 321, 249, 377, 372, 0, 0, 0, 375, 373, 0, - 374, 0, 376, 0, 0, 0, 0, 0, 0, 248, - 248, 0, 0, 0, 0, 369, 0, 368, 249, 249, - 0, 0, 249, 249, 249, 249, 249, 0, 249, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 249, - 249, 249, 0, 249, 249, 0, 321, 0, 0, 371, - 0, 0, 669, 669, 669, 0, 0, 669, 669, 669, - 321, 669, 0, 0, 0, 0, 0, 0, 0, 669, - 0, 669, 669, 669, 249, 249, 0, 0, 0, 370, - 0, 669, 669, 0, 669, 669, 669, 669, 669, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 323, 0, 0, 0, 249, 249, 0, 0, 0, - 0, 323, 0, 0, 0, 0, 0, 669, 669, 669, - 669, 669, 669, 669, 669, 669, 669, 669, 669, 0, - 0, 0, 0, 669, 669, 669, 669, 0, 0, 669, - 0, 0, 323, 0, 669, 323, 0, 248, 248, 248, - 0, 0, 248, 248, 248, 0, 248, 0, 669, 0, - 323, 669, 0, 0, 248, 0, 248, 248, 248, 0, - 0, 0, 0, 0, 0, 0, 248, 248, 0, 248, - 248, 248, 248, 248, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 323, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 0, 0, 323, 0, 248, 248, - 0, 0, 0, 0, 248, 0, 0, 0, 0, 248, - 0, 0, 0, 249, 249, 249, 0, 0, 249, 249, - 249, 0, 249, 248, 0, 0, 248, 0, 0, 0, - 249, 0, 249, 249, 249, 0, 0, 0, 0, 0, - 0, 0, 249, 249, 0, 249, 249, 249, 249, 249, - 0, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 0, 0, 0, 260, 0, 0, 364, 365, - 0, 0, 0, 0, 0, 260, 0, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 0, 0, 0, 0, 249, 249, 0, 0, 0, 0, - 249, 0, 260, 260, 0, 249, 260, 260, 260, 260, - 260, 0, 260, 0, 0, 0, 0, 0, 0, 249, - 0, 0, 249, 260, 260, 260, 0, 260, 260, 0, - 0, 0, 0, 323, 323, 323, 0, 0, 323, 323, - 323, 0, 323, 0, 0, 0, 0, 0, 0, 0, - 323, 0, 323, 323, 0, 0, 0, 0, 260, 260, - 257, 0, 323, 323, 0, 323, 323, 323, 323, 323, - 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 260, - 260, 0, 0, 0, 0, 0, 0, 257, 257, 0, - 0, 257, 257, 257, 257, 257, 0, 257, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 257, 257, - 257, 0, 257, 257, 0, 323, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 257, 257, 0, 254, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 254, 377, 372, 0, - 0, 0, 375, 373, 0, 374, 0, 376, 0, 0, - 0, 0, 0, 0, 257, 257, 0, 0, 0, 0, - 369, 0, 368, 254, 254, 0, 0, 254, 254, 254, - 254, 254, 0, 254, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 254, 254, 254, 0, 254, 254, - 0, 0, 0, 0, 371, 0, 0, 260, 260, 260, - 0, 0, 260, 260, 260, 0, 260, 0, 0, 0, - 0, 0, 0, 0, 260, 0, 260, 260, 260, 254, - 254, 0, 0, 0, 370, 0, 260, 260, 0, 260, - 260, 260, 260, 260, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 819, 0, 0, 0, 0, - 254, 254, 0, 0, 0, 819, 0, 0, 0, 0, - 0, 0, 260, 260, 260, 260, 260, 260, 260, 260, - 260, 260, 260, 260, 0, 0, 0, 0, 260, 260, - 0, 0, 0, 0, 260, 0, 819, 0, 0, 260, - 329, 0, 257, 257, 257, 0, 0, 257, 257, 257, - 329, 257, 0, 260, 819, 0, 260, 0, 0, 257, - 0, 257, 257, 257, 0, 0, 0, 0, 0, 0, - 0, 257, 257, 0, 257, 257, 257, 257, 257, 0, - 0, 329, 0, 0, 322, 0, 0, 0, 819, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, - 0, 0, 0, 0, 0, 0, 0, 257, 257, 257, - 257, 257, 257, 257, 257, 257, 257, 257, 257, 0, - 819, 0, 0, 257, 257, 0, 0, 0, 0, 257, - 0, 0, 0, 0, 257, 0, 0, 0, 254, 254, - 254, 0, 0, 254, 254, 254, 0, 254, 257, 0, - 0, 257, 0, 0, 0, 254, 0, 254, 254, 254, - 0, 0, 0, 0, 0, 329, 0, 254, 254, 0, - 254, 254, 254, 254, 254, 0, 351, 352, 353, 354, - 355, 356, 357, 358, 0, 360, 361, 0, 0, 0, - 255, 0, 0, 364, 365, 0, 0, 0, 0, 0, - 255, 0, 0, 254, 254, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 0, 0, 0, 0, 254, - 254, 0, 0, 0, 0, 254, 0, 255, 255, 0, - 254, 255, 255, 255, 255, 255, 0, 255, 0, 0, - 0, 0, 0, 0, 254, 0, 0, 254, 255, 255, - 255, 0, 255, 255, 0, 0, 0, 819, 819, 819, - 0, 0, 819, 819, 819, 0, 819, 0, 0, 0, - 0, 0, 0, 0, 819, 0, 819, 819, 0, 0, - 0, 0, 0, 255, 255, 256, 819, 819, 0, 819, - 819, 819, 819, 819, 0, 256, 0, 0, 0, 0, - 0, 0, 329, 329, 329, 0, 0, 329, 329, 329, - 0, 329, 0, 0, 255, 255, 0, 0, 0, 329, - 0, 0, 256, 256, 0, 0, 256, 256, 256, 256, - 256, 0, 256, 0, 329, 329, 329, 329, 329, 0, - 0, 0, 0, 256, 256, 256, 0, 256, 256, 819, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 819, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 256, 256, - 0, 258, 0, 0, 0, 0, 0, 0, 0, 329, - 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 329, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 258, 258, - 0, 0, 258, 258, 258, 258, 258, 0, 258, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, - 258, 258, 0, 258, 258, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 0, 0, 255, 255, 255, - 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, - 0, 255, 255, 255, 258, 258, 0, 0, 0, 0, - 0, 255, 255, 0, 255, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 475, 0, 0, 0, 0, 258, 258, 0, 0, 0, - 475, 0, 0, 0, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, - 0, 0, 0, 255, 255, 0, 0, 0, 0, 255, - 0, 475, 0, 0, 255, 584, 475, 256, 256, 256, - 0, 0, 256, 256, 256, 584, 256, 0, 255, 475, - 0, 255, 0, 0, 256, 0, 256, 256, 256, 0, - 0, 0, 0, 0, 0, 0, 256, 256, 0, 256, - 256, 256, 256, 256, 0, 0, 584, 0, 0, 584, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 584, 0, 0, 0, 0, 0, - 0, 0, 256, 256, 256, 256, 256, 256, 256, 256, - 256, 256, 256, 256, 0, 475, 0, 0, 256, 256, - 0, 0, 0, 0, 256, 0, 0, 0, 584, 256, - 0, 82, 0, 258, 258, 258, 0, 0, 258, 258, - 258, 82, 258, 256, 0, 0, 256, 0, 0, 0, - 258, 0, 258, 258, 258, 0, 0, 0, 0, 584, - 584, 0, 258, 258, 0, 258, 258, 258, 258, 258, - 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 265, 0, 0, 0, 0, - 82, 0, 0, 0, 0, 265, 0, 0, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 0, 0, 0, 0, 258, 258, 0, 0, 0, 0, - 258, 0, 265, 265, 82, 258, 265, 265, 265, 265, - 265, 0, 265, 0, 0, 0, 0, 0, 0, 258, - 0, 0, 258, 265, 265, 0, 0, 0, 265, 0, - 0, 0, 475, 475, 475, 0, 82, 475, 475, 475, - 0, 475, 0, 0, 0, 0, 0, 0, 0, 475, - 0, 475, 0, 0, 0, 0, 0, 0, 265, 265, - 252, 475, 475, 0, 475, 475, 475, 475, 475, 0, - 252, 0, 0, 0, 0, 0, 0, 584, 584, 584, - 0, 0, 584, 584, 584, 0, 584, 0, 0, 265, - 265, 0, 0, 0, 584, 0, 584, 0, 252, 0, - 0, 252, 0, 252, 252, 252, 584, 584, 0, 584, - 584, 584, 584, 584, 0, 475, 475, 0, 252, 252, - 252, 0, 252, 252, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 475, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 252, 252, 0, 253, 0, 0, 0, - 0, 0, 0, 0, 584, 0, 253, 0, 0, 0, - 0, 0, 0, 82, 82, 82, 0, 0, 82, 82, - 82, 0, 82, 584, 252, 252, 0, 0, 0, 0, - 82, 0, 82, 82, 253, 0, 0, 253, 0, 253, - 253, 253, 82, 82, 0, 82, 82, 82, 82, 82, + 89, 0, 89, 0, 0, 0, 0, 0, 0, 0, + 89, 0, 89, 89, 353, 0, 353, 353, 0, 0, + 0, 821, 89, 89, 0, 89, 89, 89, 89, 89, + 0, 821, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 353, 353, 0, + 0, 0, 0, 89, 0, 89, 0, 0, 821, 821, + 0, 0, 821, 821, 821, 821, 821, 821, 821, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 821, + 821, 821, 0, 821, 821, 0, 0, 0, 0, 0, + 495, 495, 495, 0, 0, 495, 495, 495, 0, 495, + 0, 89, 0, 0, 0, 0, 0, 495, 495, 495, + 495, 495, 821, 0, 821, 821, 0, 0, 0, 495, + 495, 0, 495, 495, 495, 495, 495, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 821, 821, 821, 0, 0, 0, + 495, 0, 495, 0, 0, 0, 495, 495, 495, 495, + 495, 495, 495, 495, 495, 495, 495, 495, 495, 0, + 0, 0, 0, 495, 495, 495, 495, 0, 0, 495, + 0, 0, 0, 0, 495, 353, 353, 353, 0, 0, + 353, 353, 353, 0, 353, 0, 0, 0, 495, 0, + 0, 495, 353, 0, 353, 353, 353, 0, 0, 0, + 0, 0, 0, 0, 353, 353, 0, 353, 353, 353, + 353, 353, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 87, 0, 0, 0, 0, 353, 0, 353, 0, 0, + 87, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 0, 0, 0, 0, 353, 353, + 353, 353, 0, 0, 353, 0, 0, 0, 0, 353, + 0, 87, 0, 821, 821, 821, 0, 0, 821, 821, + 821, 0, 821, 353, 0, 0, 353, 0, 0, 87, + 821, 821, 821, 821, 821, 0, 0, 0, 0, 0, + 0, 0, 821, 821, 0, 821, 821, 821, 821, 821, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 87, 0, 0, 0, 346, 0, 0, + 0, 0, 0, 821, 0, 821, 0, 346, 0, 821, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 821, 0, 0, 0, 87, 821, 821, 821, 821, + 0, 0, 821, 0, 346, 346, 0, 821, 346, 346, + 346, 346, 346, 346, 346, 0, 0, 0, 0, 0, + 0, 821, 0, 0, 821, 346, 346, 346, 154, 346, + 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 346, 0, + 346, 346, 354, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 354, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 346, 346, 0, 0, 0, 0, 0, 0, 354, + 354, 0, 0, 354, 354, 354, 354, 354, 354, 354, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 354, 354, 354, 153, 354, 354, 0, 0, 0, 0, + 0, 0, 87, 87, 87, 0, 0, 87, 87, 87, + 0, 87, 0, 0, 0, 0, 0, 0, 0, 87, + 0, 87, 87, 354, 0, 354, 354, 0, 0, 0, + 625, 87, 87, 0, 87, 87, 87, 87, 87, 0, + 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 354, 354, 0, 0, + 0, 0, 87, 0, 87, 0, 0, 625, 625, 0, + 0, 625, 625, 625, 625, 625, 625, 625, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 625, 625, + 625, 0, 625, 625, 0, 0, 0, 0, 0, 346, + 346, 346, 0, 0, 346, 346, 346, 0, 346, 0, + 87, 0, 0, 0, 0, 0, 346, 0, 346, 346, + 346, 625, 0, 625, 625, 0, 0, 0, 346, 346, + 0, 346, 346, 346, 346, 346, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 625, 625, 0, 0, 0, 346, + 0, 346, 0, 0, 0, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 0, 0, + 0, 0, 346, 346, 346, 346, 0, 0, 346, 0, + 0, 0, 0, 346, 354, 354, 354, 0, 0, 354, + 354, 354, 0, 354, 0, 0, 0, 346, 0, 0, + 346, 354, 0, 354, 354, 354, 0, 0, 0, 0, + 0, 0, 0, 354, 354, 0, 354, 354, 354, 354, + 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 567, + 0, 0, 0, 0, 354, 0, 354, 0, 0, 567, + 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + 354, 354, 354, 0, 0, 0, 0, 354, 354, 354, + 354, 0, 0, 354, 0, 0, 0, 0, 354, 0, + 567, 0, 625, 625, 625, 0, 0, 625, 625, 625, + 0, 625, 354, 0, 0, 354, 0, 0, 567, 625, + 0, 625, 625, 625, 0, 0, 0, 0, 0, 0, + 0, 625, 625, 0, 625, 625, 625, 625, 625, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 567, 0, 0, 0, 285, 0, 0, 0, + 0, 0, 625, 0, 625, 0, 285, 0, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, + 625, 0, 0, 0, 567, 625, 625, 625, 625, 0, + 0, 625, 0, 285, 285, 0, 625, 285, 285, 285, + 285, 285, 392, 285, 0, 0, 0, 0, 0, 0, + 625, 0, 0, 625, 285, 285, 285, 0, 285, 285, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 392, 0, 285, + 285, 365, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 365, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 285, 285, 0, 0, 0, 0, 0, 0, 365, 365, + 0, 0, 365, 365, 365, 365, 365, 365, 365, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, + 365, 365, 0, 365, 365, 0, 0, 0, 0, 0, + 0, 567, 567, 567, 0, 0, 567, 567, 567, 0, + 567, 0, 0, 0, 0, 0, 0, 0, 567, 0, + 567, 0, 365, 0, 365, 365, 0, 0, 0, 360, + 567, 567, 0, 567, 567, 567, 567, 567, 0, 360, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 365, 365, 0, 0, 0, + 0, 567, 0, 567, 0, 0, 360, 360, 0, 0, + 360, 360, 360, 360, 360, 360, 360, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 360, 360, 360, + 0, 360, 360, 0, 0, 0, 0, 0, 285, 285, + 285, 0, 0, 285, 285, 285, 0, 285, 0, 567, + 0, 0, 0, 0, 0, 285, 0, 285, 285, 285, + 360, 0, 360, 360, 0, 0, 0, 285, 285, 0, + 285, 285, 285, 285, 285, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 360, 360, 0, 0, 0, 285, 0, + 285, 0, 0, 0, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 0, 0, 0, + 0, 285, 285, 392, 392, 0, 0, 285, 0, 0, + 0, 0, 285, 365, 365, 365, 0, 303, 365, 365, + 365, 0, 365, 0, 0, 0, 285, 303, 0, 285, + 365, 0, 365, 365, 365, 0, 0, 0, 0, 0, + 0, 0, 365, 365, 0, 365, 365, 365, 365, 365, + 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, + 0, 298, 0, 0, 0, 0, 0, 558, 0, 0, + 0, 0, 0, 365, 0, 365, 303, 558, 0, 365, + 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, + 365, 365, 0, 0, 0, 0, 365, 365, 365, 365, + 0, 0, 365, 0, 0, 0, 0, 365, 558, 0, + 0, 360, 360, 360, 0, 0, 360, 360, 360, 0, + 360, 365, 0, 0, 365, 0, 558, 0, 360, 0, + 360, 360, 360, 0, 0, 0, 0, 0, 0, 0, + 360, 360, 303, 360, 360, 360, 360, 360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 558, 0, 0, 0, 0, 673, 0, 0, 0, 0, + 0, 360, 0, 360, 0, 673, 0, 360, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + 0, 0, 558, 0, 360, 360, 360, 360, 0, 0, + 360, 0, 673, 673, 0, 360, 673, 673, 673, 673, + 673, 673, 673, 0, 0, 0, 0, 0, 0, 360, + 0, 0, 360, 673, 673, 673, 0, 673, 673, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 673, 0, 673, 673, + 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 0, 0, 0, 0, 0, 303, + 303, 303, 0, 0, 0, 303, 303, 0, 303, 673, + 673, 0, 0, 0, 0, 0, 303, 252, 252, 0, + 0, 252, 252, 252, 252, 252, 0, 252, 303, 303, + 0, 303, 303, 303, 303, 0, 0, 0, 252, 252, + 252, 0, 252, 252, 0, 0, 0, 0, 0, 558, + 558, 558, 0, 0, 558, 558, 558, 0, 558, 303, + 0, 303, 0, 0, 0, 0, 558, 0, 558, 0, + 0, 0, 0, 252, 252, 0, 253, 0, 558, 558, + 0, 558, 558, 558, 558, 558, 253, 0, 303, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 252, 252, 0, 303, 0, 558, + 0, 558, 0, 253, 253, 0, 0, 253, 253, 253, + 253, 253, 0, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 253, 253, 0, 253, 253, - 0, 0, 0, 0, 0, 0, 0, 265, 265, 265, - 0, 0, 265, 265, 265, 0, 265, 0, 0, 0, - 0, 0, 0, 0, 265, 0, 265, 265, 265, 253, - 253, 0, 0, 0, 0, 0, 265, 265, 0, 265, - 265, 265, 265, 265, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 278, 0, 0, 82, - 253, 253, 0, 0, 0, 0, 278, 0, 0, 0, - 0, 265, 265, 265, 265, 265, 0, 0, 265, 265, - 265, 265, 265, 265, 0, 0, 0, 0, 265, 265, - 0, 0, 0, 0, 265, 0, 0, 278, 0, 265, - 278, 0, 252, 252, 252, 0, 0, 252, 252, 252, - 0, 252, 0, 265, 278, 278, 265, 0, 0, 252, - 0, 252, 252, 252, 0, 0, 0, 0, 0, 0, - 0, 252, 252, 0, 252, 252, 252, 252, 252, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 0, - 0, 278, 0, 252, 252, 0, 0, 0, 0, 252, - 0, 0, 0, 0, 252, 0, 0, 0, 253, 253, - 253, 0, 0, 253, 253, 253, 0, 253, 252, 0, - 0, 252, 0, 0, 0, 253, 0, 253, 253, 253, + 0, 0, 0, 0, 0, 0, 0, 673, 673, 673, + 0, 0, 673, 673, 673, 0, 673, 558, 0, 0, + 0, 0, 0, 0, 673, 0, 673, 673, 673, 253, + 253, 0, 0, 0, 0, 0, 673, 673, 0, 673, + 673, 673, 673, 673, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 577, 0, + 253, 253, 0, 0, 0, 0, 0, 673, 577, 673, + 0, 0, 0, 0, 673, 673, 673, 673, 673, 673, + 673, 673, 673, 673, 673, 673, 0, 0, 0, 0, + 673, 673, 673, 673, 0, 0, 673, 200, 0, 577, + 0, 673, 252, 252, 252, 0, 0, 252, 252, 252, + 0, 252, 0, 0, 0, 673, 0, 577, 673, 252, + 0, 252, 252, 252, 0, 200, 0, 200, 0, 200, + 0, 252, 252, 691, 252, 252, 252, 252, 252, 0, + 0, 0, 0, 0, 0, 0, 200, 0, 200, 0, + 0, 577, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 252, 0, 252, 0, 0, 0, 252, 252, + 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, + 252, 0, 0, 577, 0, 252, 252, 0, 0, 0, + 0, 252, 0, 0, 0, 0, 252, 0, 253, 253, + 253, 0, 0, 253, 253, 253, 0, 253, 0, 0, + 252, 0, 0, 252, 0, 253, 0, 253, 253, 253, 0, 0, 0, 0, 0, 0, 0, 253, 253, 0, - 253, 253, 253, 253, 253, 0, 0, 274, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 274, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 274, 0, 0, 274, 253, - 253, 274, 0, 0, 0, 253, 0, 0, 0, 0, - 253, 0, 0, 0, 0, 274, 274, 274, 0, 274, - 274, 0, 0, 0, 253, 0, 0, 253, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, - 278, 0, 0, 278, 278, 278, 0, 278, 0, 0, - 274, 274, 263, 0, 0, 278, 0, 278, 278, 278, - 0, 0, 263, 0, 0, 0, 0, 278, 278, 0, - 278, 278, 278, 278, 278, 0, 0, 0, 0, 0, - 0, 274, 274, 0, 0, 0, 0, 0, 0, 0, - 263, 0, 0, 263, 0, 0, 263, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 263, 263, 263, 0, 263, 263, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, - 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 278, 263, 263, 278, 261, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 261, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 263, 263, 0, 0, + 253, 253, 253, 253, 253, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 264, 0, 0, 0, 0, 0, 253, 0, + 253, 0, 264, 0, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 0, 0, 0, + 0, 253, 253, 0, 0, 0, 0, 253, 0, 264, + 264, 0, 253, 264, 264, 264, 264, 264, 0, 264, + 0, 0, 0, 0, 0, 0, 253, 0, 0, 253, + 264, 264, 264, 0, 264, 264, 0, 0, 0, 0, + 577, 577, 577, 0, 0, 577, 577, 577, 0, 577, + 0, 0, 0, 0, 0, 0, 0, 577, 0, 577, + 0, 0, 0, 0, 0, 264, 264, 261, 0, 577, + 577, 0, 577, 577, 577, 577, 577, 261, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 264, 264, 0, 0, + 577, 0, 577, 0, 261, 261, 0, 0, 261, 261, + 261, 261, 261, 200, 261, 200, 200, 200, 200, 200, + 0, 0, 0, 0, 0, 261, 261, 261, 0, 261, + 261, 0, 0, 0, 0, 200, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 577, 200, + 0, 0, 0, 0, 0, 691, 0, 0, 0, 200, + 261, 261, 0, 258, 200, 200, 200, 0, 0, 0, + 0, 0, 0, 258, 403, 398, 0, 0, 0, 401, + 399, 0, 400, 0, 402, 0, 0, 0, 0, 0, + 0, 261, 261, 0, 0, 0, 0, 395, 0, 394, + 258, 258, 0, 0, 258, 258, 258, 258, 258, 0, + 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 258, 258, 258, 0, 258, 258, 0, 0, 0, + 0, 397, 0, 0, 264, 264, 264, 0, 0, 264, + 264, 264, 0, 264, 0, 0, 0, 0, 0, 0, + 0, 264, 0, 264, 264, 264, 258, 258, 0, 0, + 0, 396, 0, 264, 264, 0, 264, 264, 264, 264, + 264, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 551, 0, 258, 258, 0, + 0, 0, 0, 0, 264, 551, 264, 0, 0, 0, + 0, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 0, 0, 0, 0, 264, 264, 0, + 0, 0, 0, 264, 201, 0, 551, 0, 264, 261, + 261, 261, 0, 0, 261, 261, 261, 0, 261, 0, + 0, 0, 264, 0, 551, 264, 261, 0, 261, 261, + 261, 0, 201, 0, 201, 0, 201, 0, 261, 261, + 690, 261, 261, 261, 261, 261, 0, 0, 0, 0, + 0, 0, 0, 201, 0, 201, 0, 0, 551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261, - 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 261, 261, 261, 0, - 261, 261, 0, 0, 0, 0, 0, 0, 0, 274, - 274, 274, 0, 0, 274, 274, 274, 0, 274, 219, - 0, 0, 0, 0, 0, 0, 274, 0, 274, 274, - 274, 261, 261, 0, 0, 0, 0, 0, 274, 274, - 0, 274, 274, 274, 274, 274, 0, 219, 0, 219, - 0, 219, 0, 0, 0, 682, 0, 0, 0, 0, - 0, 0, 261, 261, 0, 0, 0, 0, 219, 0, - 219, 0, 0, 0, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 0, 0, 0, 86, - 274, 274, 0, 0, 0, 0, 274, 0, 0, 86, - 0, 274, 0, 0, 263, 263, 263, 0, 0, 263, - 263, 263, 0, 263, 0, 274, 0, 0, 274, 0, - 0, 263, 0, 263, 263, 263, 0, 0, 0, 0, - 86, 0, 0, 263, 263, 0, 263, 263, 263, 263, - 263, 0, 0, 0, 0, 0, 0, 0, 86, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, - 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, - 263, 0, 86, 0, 0, 0, 0, 262, 0, 0, - 0, 263, 0, 0, 0, 0, 263, 262, 0, 0, - 261, 261, 261, 0, 0, 261, 261, 261, 0, 261, - 263, 0, 0, 263, 86, 0, 0, 261, 0, 261, - 261, 261, 0, 0, 0, 0, 0, 0, 262, 261, - 261, 262, 261, 261, 261, 261, 261, 0, 0, 0, - 0, 0, 0, 0, 0, 262, 262, 262, 0, 262, - 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 261, 261, 261, 0, 0, 0, - 262, 262, 0, 289, 0, 0, 0, 261, 0, 0, - 0, 0, 261, 289, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 261, 0, 0, 261, - 0, 262, 262, 0, 0, 219, 0, 219, 219, 219, - 219, 219, 0, 0, 289, 0, 0, 289, 0, 0, - 0, 0, 0, 0, 0, 219, 0, 0, 0, 0, - 0, 289, 289, 289, 0, 289, 289, 0, 0, 219, - 0, 86, 86, 86, 0, 682, 86, 86, 86, 219, - 86, 0, 0, 0, 219, 219, 219, 0, 86, 0, - 86, 86, 0, 0, 0, 0, 289, 0, 290, 0, - 86, 86, 0, 86, 86, 86, 86, 86, 290, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, - 0, 0, 290, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 290, 290, 290, 0, - 290, 290, 0, 0, 0, 0, 0, 0, 0, 262, - 262, 262, 0, 0, 262, 262, 262, 86, 262, 0, - 0, 0, 0, 0, 0, 0, 262, 0, 262, 262, - 262, 290, 0, 0, 0, 0, 0, 0, 262, 262, - 0, 262, 262, 262, 262, 262, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 264, 0, - 0, 0, 0, 290, 0, 0, 0, 0, 264, 0, - 0, 0, 0, 0, 262, 262, 262, 262, 262, 262, - 262, 262, 262, 262, 262, 262, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 262, 0, 0, 264, - 0, 262, 264, 327, 0, 289, 289, 289, 0, 0, - 289, 289, 289, 327, 289, 262, 264, 264, 262, 0, - 0, 264, 289, 0, 289, 289, 289, 0, 0, 0, - 0, 0, 0, 0, 289, 289, 0, 289, 289, 289, - 289, 289, 0, 0, 327, 0, 0, 323, 0, 0, - 0, 264, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 0, 264, 0, 0, 0, 0, 0, 0, - 0, 0, 289, 0, 0, 0, 0, 289, 266, 0, - 290, 290, 290, 0, 0, 290, 290, 290, 266, 290, - 0, 289, 0, 0, 289, 0, 0, 290, 0, 290, - 290, 290, 0, 0, 0, 0, 0, 0, 327, 290, - 290, 0, 290, 290, 290, 290, 290, 0, 0, 266, - 0, 0, 266, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 266, 266, 0, 0, - 0, 266, 0, 0, 0, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 290, 0, 0, - 0, 266, 290, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 290, 0, 0, 290, + 0, 261, 0, 0, 0, 0, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 0, 0, + 551, 0, 261, 261, 0, 0, 0, 0, 261, 0, + 0, 0, 0, 261, 0, 258, 258, 258, 0, 0, + 258, 258, 258, 0, 258, 0, 0, 261, 0, 0, + 261, 0, 258, 0, 258, 258, 258, 0, 0, 0, + 0, 0, 0, 0, 258, 258, 0, 258, 258, 258, + 258, 258, 0, 0, 0, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 0, 0, 259, + 0, 0, 390, 391, 0, 258, 0, 258, 0, 259, + 0, 0, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 0, 0, 0, 0, 258, 258, + 0, 0, 0, 0, 258, 0, 259, 259, 0, 258, + 259, 259, 259, 259, 259, 0, 259, 0, 0, 0, + 0, 0, 0, 258, 0, 0, 258, 259, 259, 259, + 0, 259, 259, 0, 0, 0, 0, 551, 551, 551, + 0, 0, 551, 551, 551, 0, 551, 0, 0, 0, + 0, 0, 0, 0, 551, 0, 551, 0, 0, 0, + 0, 0, 259, 259, 260, 0, 551, 551, 0, 551, + 551, 551, 551, 551, 260, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 259, 259, 0, 0, 551, 0, 551, + 0, 260, 260, 0, 0, 260, 260, 260, 260, 260, + 201, 260, 201, 201, 201, 201, 201, 0, 0, 0, + 0, 0, 260, 260, 260, 0, 260, 260, 0, 0, + 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 551, 201, 0, 0, 0, + 0, 0, 690, 0, 0, 0, 201, 260, 260, 0, + 262, 201, 201, 201, 0, 0, 0, 0, 0, 0, + 262, 403, 398, 0, 0, 0, 401, 399, 0, 400, + 0, 402, 0, 0, 0, 0, 0, 0, 260, 260, + 0, 0, 0, 0, 395, 0, 394, 262, 262, 0, + 0, 262, 262, 262, 262, 262, 0, 262, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 262, 262, + 262, 0, 262, 262, 0, 0, 0, 0, 397, 0, + 0, 259, 259, 259, 0, 0, 259, 259, 259, 0, + 259, 0, 0, 0, 0, 0, 0, 0, 259, 0, + 259, 259, 259, 262, 262, 0, 0, 0, 396, 0, + 259, 259, 0, 259, 259, 259, 259, 259, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 568, 0, 262, 262, 0, 0, 0, 0, + 0, 259, 568, 259, 0, 0, 0, 0, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 0, 0, 0, 0, 259, 259, 0, 0, 0, 0, + 259, 202, 0, 568, 0, 259, 260, 260, 260, 0, + 0, 260, 260, 260, 0, 260, 0, 0, 0, 259, + 0, 568, 259, 260, 0, 260, 260, 260, 0, 202, + 0, 202, 0, 202, 0, 260, 260, 692, 260, 260, + 260, 260, 260, 0, 0, 0, 0, 0, 0, 0, + 202, 0, 202, 0, 0, 568, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 260, 0, 260, 0, + 0, 0, 0, 260, 260, 260, 260, 260, 260, 260, + 260, 260, 260, 260, 260, 0, 0, 568, 0, 260, + 260, 0, 0, 0, 0, 260, 0, 0, 0, 0, + 260, 0, 262, 262, 262, 0, 0, 262, 262, 262, + 0, 262, 0, 0, 260, 0, 0, 260, 0, 262, + 0, 262, 262, 262, 0, 0, 0, 0, 0, 0, + 0, 262, 262, 0, 262, 262, 262, 262, 262, 0, + 0, 0, 377, 378, 379, 380, 381, 382, 383, 384, + 0, 386, 387, 0, 0, 0, 283, 0, 0, 390, + 391, 0, 262, 0, 262, 0, 283, 0, 0, 262, + 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, + 262, 0, 0, 0, 0, 262, 262, 0, 0, 0, + 0, 262, 0, 283, 283, 0, 262, 283, 283, 283, + 283, 283, 0, 283, 0, 0, 0, 0, 0, 0, + 262, 0, 0, 262, 283, 283, 283, 0, 283, 283, + 0, 0, 0, 0, 568, 568, 568, 0, 0, 568, + 568, 568, 0, 568, 0, 0, 0, 0, 0, 0, + 0, 568, 0, 568, 0, 0, 0, 0, 0, 283, + 283, 284, 0, 568, 568, 0, 568, 568, 568, 568, + 568, 284, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 283, 283, 0, 0, 568, 0, 568, 0, 284, 284, + 0, 0, 284, 284, 284, 284, 284, 202, 284, 202, + 202, 202, 202, 202, 0, 0, 0, 0, 0, 284, + 284, 284, 0, 284, 284, 0, 0, 0, 0, 202, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 568, 202, 0, 0, 0, 0, 0, 692, + 0, 0, 0, 202, 284, 284, 0, 288, 202, 202, + 202, 0, 0, 0, 0, 0, 0, 288, 403, 398, + 0, 0, 0, 401, 399, 0, 400, 0, 402, 0, + 0, 0, 0, 0, 0, 284, 284, 0, 0, 0, + 0, 395, 0, 394, 288, 288, 0, 0, 288, 288, + 288, 288, 288, 0, 288, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 288, 288, 288, 0, 288, + 288, 0, 0, 0, 0, 397, 0, 0, 283, 283, + 283, 0, 0, 283, 283, 283, 0, 283, 0, 0, + 0, 0, 0, 0, 0, 283, 0, 283, 283, 283, + 288, 288, 0, 0, 0, 396, 0, 283, 283, 0, + 283, 283, 283, 283, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 552, + 0, 288, 288, 0, 0, 0, 0, 0, 283, 552, + 283, 0, 0, 0, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 0, 0, 0, + 0, 283, 283, 0, 0, 0, 0, 283, 0, 0, + 552, 335, 283, 284, 284, 284, 0, 0, 284, 284, + 284, 335, 284, 0, 0, 0, 283, 0, 552, 283, + 284, 0, 284, 284, 284, 0, 0, 0, 0, 0, + 0, 0, 284, 284, 0, 284, 284, 284, 284, 0, + 0, 0, 335, 0, 0, 330, 0, 0, 0, 0, + 0, 0, 552, 0, 0, 0, 0, 0, 0, 0, + 335, 0, 0, 284, 0, 284, 0, 0, 0, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 0, 0, 552, 0, 284, 284, 0, 0, + 0, 0, 284, 0, 0, 0, 0, 284, 0, 288, + 288, 288, 0, 0, 288, 288, 288, 0, 288, 0, + 0, 284, 0, 0, 284, 0, 288, 0, 288, 288, + 288, 0, 0, 0, 0, 0, 335, 0, 288, 288, + 0, 288, 288, 288, 288, 0, 0, 0, 0, 377, + 378, 379, 380, 381, 382, 383, 0, 0, 386, 387, + 0, 0, 0, 269, 0, 0, 390, 391, 0, 288, + 0, 288, 0, 269, 0, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 0, 0, + 0, 0, 288, 288, 0, 0, 0, 0, 288, 0, + 269, 269, 0, 288, 269, 269, 269, 269, 269, 0, + 269, 0, 0, 0, 0, 0, 0, 288, 0, 0, + 288, 269, 269, 0, 0, 0, 269, 0, 0, 0, + 0, 552, 552, 552, 0, 0, 552, 552, 552, 0, + 552, 0, 0, 0, 0, 0, 0, 0, 552, 0, + 552, 0, 0, 0, 0, 0, 269, 269, 256, 0, + 552, 552, 0, 552, 552, 552, 552, 552, 256, 0, + 0, 0, 0, 335, 335, 335, 0, 0, 335, 335, + 335, 0, 335, 0, 0, 0, 0, 269, 269, 0, + 335, 552, 0, 552, 0, 0, 256, 0, 0, 256, + 0, 256, 256, 256, 0, 335, 335, 335, 335, 335, + 0, 0, 0, 0, 0, 0, 256, 256, 256, 0, + 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 335, 0, 335, 0, 0, 0, 552, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 256, 256, 0, 257, 0, 0, 0, 0, 0, + 0, 0, 335, 0, 257, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 335, 256, 256, 0, 0, 0, 0, 0, 0, + 0, 0, 257, 0, 0, 257, 0, 257, 257, 257, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 257, 257, 257, 0, 257, 257, 0, 0, + 0, 0, 0, 0, 0, 269, 269, 269, 0, 0, + 269, 269, 269, 0, 269, 0, 0, 0, 0, 0, + 0, 0, 269, 0, 269, 269, 269, 257, 257, 0, + 0, 0, 0, 0, 269, 269, 0, 269, 269, 269, + 269, 269, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 257, 257, + 0, 0, 0, 0, 0, 269, 0, 269, 0, 0, + 0, 269, 269, 269, 269, 269, 0, 0, 269, 269, + 269, 269, 269, 269, 0, 42, 0, 0, 269, 269, + 0, 0, 0, 0, 269, 42, 0, 0, 0, 269, + 256, 256, 256, 0, 0, 256, 256, 256, 0, 256, + 0, 0, 0, 269, 0, 0, 269, 256, 0, 256, + 256, 256, 0, 0, 0, 0, 42, 0, 0, 256, + 256, 0, 256, 256, 256, 256, 256, 0, 0, 0, + 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 256, 0, 256, 0, 0, 0, 0, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256, 256, 0, + 0, 0, 0, 256, 256, 0, 0, 0, 0, 256, + 0, 0, 0, 0, 256, 0, 257, 257, 257, 0, + 0, 257, 257, 257, 0, 257, 0, 0, 256, 0, + 42, 256, 0, 257, 0, 257, 257, 257, 0, 0, + 0, 0, 0, 0, 0, 257, 257, 0, 257, 257, + 257, 257, 257, 0, 0, 0, 0, 277, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, + 0, 0, 0, 0, 0, 0, 257, 0, 257, 0, + 0, 0, 0, 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 277, 0, 0, 277, 257, + 257, 277, 0, 0, 0, 257, 0, 0, 0, 0, + 257, 0, 0, 0, 0, 277, 277, 277, 0, 277, + 277, 0, 0, 0, 257, 0, 0, 257, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 277, 277, 278, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 278, 0, 0, 0, 0, 42, 42, 42, + 0, 0, 0, 42, 42, 0, 42, 0, 0, 0, + 0, 277, 277, 0, 42, 0, 0, 0, 0, 0, + 278, 0, 0, 278, 0, 0, 278, 0, 0, 42, + 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, + 278, 278, 278, 0, 278, 278, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 42, 0, 42, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 278, 278, 0, 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 267, 0, - 264, 264, 264, 266, 0, 264, 264, 264, 267, 264, - 0, 0, 0, 0, 0, 0, 0, 264, 0, 264, - 264, 264, 0, 0, 0, 0, 0, 0, 0, 264, - 264, 0, 264, 264, 264, 264, 264, 0, 0, 267, - 0, 0, 267, 0, 0, 327, 327, 327, 0, 0, - 327, 327, 327, 0, 327, 0, 267, 267, 0, 268, - 0, 267, 327, 0, 0, 0, 0, 0, 0, 268, - 0, 264, 264, 0, 0, 264, 264, 327, 327, 327, - 327, 327, 0, 0, 0, 0, 0, 264, 0, 0, - 0, 267, 264, 0, 0, 0, 0, 0, 0, 0, - 268, 0, 0, 268, 0, 0, 264, 0, 0, 264, - 0, 0, 0, 0, 0, 0, 0, 268, 268, 0, - 0, 0, 268, 267, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, - 266, 266, 266, 0, 0, 266, 266, 266, 0, 266, - 0, 327, 268, 0, 0, 0, 0, 266, 0, 266, - 266, 266, 0, 0, 0, 0, 0, 0, 0, 266, - 266, 0, 266, 266, 266, 266, 266, 275, 0, 0, - 0, 0, 0, 0, 268, 0, 0, 275, 0, 0, - 0, 0, 229, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 266, 266, 0, 0, 266, 266, 0, 275, 0, - 229, 275, 229, 0, 229, 0, 0, 266, 684, 0, - 0, 0, 266, 0, 0, 275, 275, 0, 0, 0, - 275, 229, 0, 229, 0, 0, 266, 0, 0, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 42, 278, 278, 0, 0, + 0, 0, 0, 0, 0, 0, 267, 0, 0, 267, + 0, 0, 267, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 267, 267, 267, 0, + 267, 267, 0, 0, 0, 0, 0, 0, 0, 277, + 277, 277, 0, 0, 277, 277, 277, 0, 277, 0, + 0, 0, 0, 0, 0, 0, 277, 0, 277, 277, + 277, 267, 267, 0, 0, 0, 0, 0, 277, 277, + 0, 277, 277, 277, 277, 277, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 267, 267, 0, 0, 0, 0, 0, 277, + 0, 277, 0, 0, 0, 0, 277, 277, 277, 277, + 277, 277, 277, 277, 277, 277, 277, 277, 0, 0, + 0, 0, 277, 277, 0, 0, 0, 0, 277, 0, + 252, 0, 0, 277, 278, 278, 278, 0, 0, 278, + 278, 278, 0, 278, 0, 0, 0, 277, 0, 0, + 277, 278, 0, 278, 278, 278, 0, 0, 0, 0, + 0, 0, 0, 278, 278, 0, 278, 278, 278, 278, + 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 278, 0, 278, 0, 0, 0, + 0, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 0, 1098, 0, 0, 278, 278, 0, + 0, 0, 0, 278, 0, 0, 0, 0, 278, 0, 267, 267, 267, 0, 0, 267, 267, 267, 0, 267, - 275, 0, 0, 0, 0, 0, 0, 267, 0, 267, + 0, 0, 278, 0, 0, 278, 0, 267, 0, 267, 267, 267, 0, 0, 0, 0, 0, 0, 0, 267, - 267, 0, 267, 267, 267, 267, 267, 0, 0, 0, - 0, 0, 275, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 268, 268, 268, 269, 0, 268, 268, 268, 0, - 268, 267, 267, 0, 269, 267, 267, 0, 268, 0, - 268, 268, 268, 0, 0, 0, 0, 267, 0, 0, - 268, 268, 267, 268, 268, 268, 268, 268, 0, 0, - 0, 0, 0, 0, 0, 269, 267, 0, 269, 267, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 269, 269, 0, 0, 0, 269, 0, 0, - 0, 0, 268, 268, 0, 0, 268, 268, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 268, 0, - 0, 0, 0, 268, 0, 0, 0, 269, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 268, 0, 0, - 268, 0, 0, 0, 0, 0, 0, 270, 0, 275, - 275, 275, 0, 0, 275, 275, 275, 270, 275, 269, - 0, 0, 0, 0, 0, 0, 275, 0, 275, 275, - 275, 0, 0, 0, 0, 0, 0, 0, 275, 275, - 0, 275, 275, 275, 275, 275, 0, 0, 270, 0, - 0, 270, 0, 0, 0, 0, 0, 0, 229, 0, - 229, 229, 229, 229, 229, 270, 270, 0, 0, 0, - 270, 0, 0, 0, 0, 0, 0, 0, 229, 0, - 275, 275, 0, 0, 275, 275, 0, 0, 0, 0, - 0, 0, 229, 0, 0, 0, 275, 0, 684, 0, - 270, 275, 229, 0, 0, 0, 0, 229, 229, 229, - 0, 0, 0, 0, 0, 275, 0, 0, 275, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 270, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 0, 0, 269, 269, 269, 0, - 0, 269, 269, 269, 0, 269, 0, 0, 0, 0, - 0, 0, 0, 269, 0, 269, 269, 269, 0, 0, - 0, 0, 0, 0, 276, 269, 269, 276, 269, 269, - 269, 269, 269, 0, 0, 0, 0, 0, 0, 0, - 0, 276, 276, 0, 0, 0, 276, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 269, 269, 0, - 0, 269, 269, 0, 0, 0, 276, 0, 0, 0, - 0, 0, 0, 269, 0, 0, 0, 0, 269, 0, - 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, - 0, 0, 269, 0, 0, 269, 250, 0, 276, 270, - 270, 270, 0, 0, 270, 270, 270, 0, 270, 0, - 0, 0, 0, 0, 0, 0, 270, 0, 270, 270, - 270, 0, 0, 0, 0, 0, 0, 250, 270, 270, - 250, 270, 270, 270, 270, 270, 251, 0, 0, 0, - 0, 0, 0, 0, 250, 250, 251, 0, 0, 250, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 270, 270, 0, 0, 270, 270, 0, 251, 0, 250, - 251, 0, 0, 0, 0, 0, 270, 0, 0, 0, - 0, 270, 0, 0, 251, 251, 0, 0, 0, 251, - 0, 0, 0, 0, 0, 270, 0, 0, 270, 0, - 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, - 0, 0, 0, 0, 0, 276, 276, 276, 0, 0, - 276, 276, 276, 0, 276, 0, 0, 0, 0, 0, - 246, 0, 276, 0, 276, 276, 276, 0, 0, 0, - 246, 251, 0, 0, 276, 276, 0, 276, 276, 276, - 276, 276, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 246, 0, 0, 246, 0, 214, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 276, 246, 246, - 276, 276, 0, 246, 0, 0, 0, 0, 0, 0, - 0, 0, 276, 0, 214, 0, 214, 276, 214, 0, - 0, 0, 685, 0, 0, 0, 0, 0, 0, 0, - 0, 276, 0, 246, 276, 214, 0, 214, 250, 250, - 250, 0, 0, 250, 250, 250, 0, 250, 0, 0, - 0, 0, 0, 0, 0, 250, 0, 250, 250, 250, - 0, 0, 0, 0, 0, 246, 0, 250, 250, 0, - 250, 250, 250, 250, 250, 247, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 247, 0, 0, 251, 251, - 251, 0, 0, 251, 251, 251, 0, 251, 0, 0, - 0, 0, 0, 0, 0, 251, 0, 251, 251, 251, - 0, 0, 0, 0, 0, 0, 247, 251, 251, 247, - 251, 251, 251, 251, 251, 250, 0, 0, 0, 0, - 250, 0, 0, 247, 247, 0, 0, 0, 247, 0, - 281, 0, 0, 0, 250, 0, 0, 250, 0, 0, - 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 247, 0, - 0, 0, 0, 0, 0, 251, 0, 0, 0, 0, - 251, 281, 0, 0, 281, 283, 0, 0, 0, 0, - 0, 0, 0, 0, 251, 283, 0, 251, 281, 281, - 247, 0, 246, 246, 246, 0, 0, 246, 246, 246, - 0, 246, 0, 0, 0, 0, 0, 0, 0, 246, - 0, 246, 246, 246, 0, 0, 283, 0, 0, 283, - 0, 246, 246, 281, 246, 246, 246, 246, 246, 0, - 0, 0, 0, 283, 283, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 279, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 279, 281, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 283, 0, - 0, 0, 214, 0, 214, 214, 214, 214, 214, 246, - 0, 0, 0, 0, 246, 279, 0, 0, 279, 0, - 0, 0, 214, 0, 0, 0, 0, 0, 246, 0, - 283, 246, 279, 279, 0, 0, 214, 0, 0, 299, - 0, 0, 685, 0, 0, 0, 214, 0, 0, 299, - 0, 214, 214, 214, 0, 0, 0, 247, 247, 247, - 0, 0, 247, 247, 247, 0, 247, 279, 0, 0, - 0, 0, 0, 0, 247, 0, 247, 247, 247, 0, - 299, 0, 0, 299, 0, 0, 247, 247, 0, 247, - 247, 247, 247, 247, 0, 0, 0, 299, 299, 279, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 281, 281, 281, 0, 0, 281, 281, 281, - 0, 281, 299, 0, 0, 0, 0, 0, 0, 281, - 0, 281, 281, 281, 247, 0, 0, 0, 0, 247, - 0, 281, 281, 0, 281, 281, 281, 281, 281, 0, - 0, 0, 0, 247, 299, 0, 247, 283, 283, 283, - 0, 293, 283, 283, 283, 0, 283, 0, 0, 0, - 0, 293, 0, 0, 283, 0, 283, 283, 283, 0, - 0, 0, 0, 0, 0, 0, 283, 283, 0, 283, - 283, 283, 283, 283, 0, 0, 0, 0, 0, 281, - 0, 0, 293, 0, 281, 293, 0, 0, 0, 280, - 0, 0, 0, 0, 0, 0, 0, 0, 281, 280, - 293, 281, 0, 0, 0, 0, 279, 279, 279, 0, - 0, 279, 279, 279, 0, 279, 0, 0, 0, 0, - 0, 0, 0, 279, 283, 279, 279, 279, 0, 283, - 280, 0, 0, 280, 293, 279, 279, 0, 279, 279, - 279, 279, 279, 283, 0, 0, 283, 280, 280, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 282, 0, - 0, 0, 0, 0, 0, 0, 293, 0, 282, 0, - 0, 299, 299, 299, 0, 0, 299, 299, 299, 0, - 299, 0, 280, 0, 0, 0, 0, 0, 299, 0, - 299, 299, 299, 279, 0, 0, 0, 196, 279, 282, - 299, 299, 282, 299, 299, 299, 299, 299, 0, 298, - 0, 0, 279, 0, 280, 279, 282, 282, 0, 298, - 0, 0, 0, 0, 0, 196, 0, 196, 0, 196, - 0, 0, 0, 687, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 196, 0, 196, 0, - 298, 282, 0, 298, 0, 0, 0, 0, 299, 0, - 0, 0, 0, 299, 0, 0, 0, 298, 298, 0, - 0, 0, 0, 0, 0, 0, 0, 299, 0, 0, - 299, 0, 0, 282, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 298, 293, 293, 293, 0, 0, 293, 293, - 293, 0, 293, 0, 0, 0, 0, 0, 0, 0, - 293, 0, 293, 293, 293, 0, 0, 0, 0, 0, - 0, 0, 293, 293, 298, 293, 293, 293, 293, 293, - 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, - 0, 280, 280, 280, 0, 0, 280, 280, 280, 0, - 280, 0, 0, 0, 0, 0, 0, 0, 280, 0, - 280, 280, 280, 0, 0, 0, 0, 0, 0, 0, - 280, 280, 0, 280, 280, 280, 280, 0, 0, 0, - 293, 0, 0, 0, 0, 293, 0, 0, 0, 0, + 267, 0, 267, 267, 267, 267, 267, 0, 265, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 265, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 267, 0, 267, 0, 0, 0, 0, 267, 267, 267, + 267, 267, 267, 267, 267, 267, 267, 267, 267, 265, + 0, 0, 265, 0, 0, 0, 0, 0, 0, 267, + 0, 0, 0, 0, 267, 0, 265, 265, 265, 0, + 265, 265, 0, 0, 0, 0, 0, 0, 267, 0, + 0, 267, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 266, 0, 0, 0, 0, 0, + 0, 265, 265, 0, 266, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 265, 265, 0, 266, 0, 0, 266, 0, + 0, 0, 0, 0, 0, 0, 0, 1080, 1081, 1082, + 1083, 0, 266, 266, 266, 0, 266, 266, 0, 0, + 0, 0, 0, 1084, 1085, 1086, 1087, 0, 0, 0, + 1088, 0, 0, 40, 41, 42, 43, 44, 0, 0, + 0, 0, 0, 306, 0, 0, 0, 266, 266, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, - 0, 0, 293, 0, 0, 0, 0, 0, 0, 0, - 282, 282, 282, 0, 0, 282, 282, 282, 1036, 282, - 0, 0, 0, 0, 0, 0, 0, 282, 280, 282, - 282, 282, 0, 280, 0, 0, 0, 0, 0, 282, - 282, 0, 282, 282, 282, 282, 0, 280, 0, 0, - 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 298, 298, 298, 0, 0, 298, 298, 298, 0, - 298, 0, 0, 0, 0, 0, 0, 0, 298, 0, - 298, 298, 298, 196, 0, 196, 196, 196, 196, 196, - 298, 298, 0, 298, 298, 298, 298, 282, 485, 0, - 0, 0, 282, 196, 0, 0, 0, 0, 485, 0, - 0, 0, 0, 0, 0, 0, 282, 196, 0, 282, - 0, 0, 0, 687, 0, 0, 0, 196, 0, 0, - 0, 315, 196, 196, 196, 485, 485, 0, 0, 485, - 485, 485, 485, 485, 485, 485, 0, 0, 298, 0, - 0, 0, 0, 298, 0, 0, 0, 485, 485, 0, - 485, 485, 0, 0, 0, 0, 0, 298, 0, 0, - 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 485, - 0, 485, 485, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 818, 1018, 1019, 1020, 1021, 0, 0, 0, 0, 0, - 818, 485, 485, 485, 315, 0, 0, 1022, 1023, 1024, - 1025, 0, 0, 0, 1026, 0, 0, 40, 41, 42, - 43, 44, 0, 315, 0, 0, 303, 818, 818, 0, - 0, 818, 818, 818, 818, 818, 818, 818, 0, 0, - 0, 0, 0, 1028, 1029, 0, 0, 0, 0, 818, - 818, 1030, 818, 818, 1031, 0, 1032, 1033, 0, 1034, - 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, - 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 818, 0, 818, 818, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 818, 818, 818, 315, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 315, 315, 315, 0, 315, - 485, 485, 485, 315, 315, 485, 485, 485, 315, 485, - 315, 315, 315, 315, 315, 315, 315, 485, 485, 485, - 485, 0, 315, 315, 315, 315, 315, 315, 315, 485, - 485, 315, 485, 485, 485, 485, 485, 0, 315, 0, - 0, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 0, 0, - 315, 0, 315, 315, 485, 485, 485, 485, 485, 485, - 485, 485, 485, 485, 485, 485, 485, 315, 315, 0, - 0, 485, 485, 485, 485, 315, 0, 485, 315, 315, - 315, 315, 485, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 315, 0, 315, 315, 485, 315, 315, 315, - 0, 315, 818, 818, 818, 315, 315, 818, 818, 818, - 315, 818, 315, 315, 315, 315, 315, 315, 315, 818, - 818, 818, 818, 0, 315, 315, 315, 315, 315, 315, - 315, 818, 818, 315, 818, 818, 818, 818, 818, 0, - 315, 0, 0, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 0, 0, 315, 0, 315, 315, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 315, - 315, 0, 0, 818, 818, 818, 818, 315, 0, 818, - 315, 315, 315, 315, 818, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 355, 315, 315, 818, 0, - 0, 0, 0, 0, 0, 355, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 315, 0, - 0, 0, 355, 355, 0, 0, 355, 355, 355, 355, - 355, 355, 355, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 355, 355, 0, 355, 355, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 355, 0, 355, 355, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 677, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 677, 0, 355, - 355, 315, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 788, 0, 0, 0, 677, 677, 0, 788, 677, 677, - 677, 113, 677, 677, 677, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 677, 677, 132, 677, - 677, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 677, 0, - 0, 677, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 788, 677, 677, 788, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 315, 315, 315, 0, 315, 355, 355, 355, - 315, 315, 355, 355, 355, 315, 355, 315, 315, 315, - 315, 315, 315, 315, 355, 0, 355, 355, 0, 315, - 315, 315, 315, 315, 315, 315, 355, 355, 315, 355, - 355, 355, 355, 355, 0, 315, 0, 0, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 0, 0, 315, 0, 315, - 315, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 315, 315, 0, 0, 355, 355, - 355, 355, 315, 0, 355, 315, 315, 315, 315, 355, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 0, 315, 315, 355, 788, 788, 788, 0, 788, 677, - 677, 677, 788, 788, 0, 677, 677, 788, 677, 788, - 788, 788, 788, 788, 788, 788, 677, 788, 0, 0, - 0, 788, 788, 788, 788, 788, 788, 788, 677, 677, - 788, 677, 677, 677, 677, 677, 0, 788, 0, 0, - 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, - 788, 788, 788, 788, 788, 788, 788, 0, 0, 788, - 0, 788, 788, 677, 677, 677, 677, 677, 677, 677, - 677, 677, 677, 677, 677, 677, 788, 788, 0, 0, - 677, 677, 677, 677, 788, 689, 677, 788, 788, 788, - 788, 0, 788, 788, 788, 788, 788, 788, 788, 788, - 788, 788, 680, 788, 788, 677, 0, 0, 0, 0, - 0, 0, 680, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 789, 0, 0, 0, 680, - 680, 0, 789, 680, 680, 680, 116, 680, 680, 680, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 680, 680, 135, 680, 680, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 680, 0, 0, 680, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 795, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 795, 789, 680, 680, 789, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 791, 0, 0, - 0, 795, 795, 0, 791, 795, 795, 795, 127, 795, - 795, 795, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 795, 795, 146, 795, 795, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 795, 0, 0, 795, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 795, 795, 795, - 791, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, - 789, 789, 0, 789, 680, 680, 680, 789, 789, 0, - 680, 680, 789, 680, 789, 789, 789, 789, 789, 789, - 789, 680, 789, 0, 0, 0, 789, 789, 789, 789, - 789, 789, 789, 680, 680, 789, 680, 680, 680, 680, - 680, 0, 789, 0, 0, 789, 789, 789, 789, 789, - 789, 789, 789, 789, 789, 789, 789, 789, 789, 789, - 789, 789, 0, 0, 789, 0, 789, 789, 680, 680, - 680, 680, 680, 680, 680, 680, 680, 680, 680, 680, - 680, 789, 789, 0, 0, 680, 680, 680, 680, 789, - 692, 680, 789, 789, 789, 789, 0, 789, 789, 789, - 789, 789, 789, 789, 789, 789, 789, 0, 789, 789, - 680, 791, 791, 791, 0, 791, 795, 795, 795, 791, - 791, 0, 795, 795, 791, 795, 791, 791, 791, 791, - 791, 791, 791, 795, 795, 0, 0, 0, 791, 791, - 791, 791, 791, 791, 791, 795, 795, 791, 795, 795, - 795, 795, 795, 0, 791, 0, 0, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 0, 0, 791, 0, 791, 791, - 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, - 795, 795, 795, 791, 791, 0, 0, 795, + 0, 1090, 1091, 0, 0, 0, 0, 0, 0, 1092, + 0, 0, 1093, 0, 1094, 1095, 0, 1096, 266, 266, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 293, 0, 0, 293, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 293, 293, 293, + 0, 293, 293, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 265, 265, 0, 0, 265, 265, 265, 0, 265, + 0, 0, 293, 0, 0, 0, 0, 265, 0, 265, + 265, 265, 0, 0, 0, 0, 0, 0, 0, 265, + 265, 0, 265, 265, 265, 265, 265, 0, 0, 0, + 0, 270, 0, 0, 293, 0, 0, 0, 0, 0, + 0, 270, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 0, 265, 0, 0, 0, 0, 265, 265, 265, + 265, 265, 265, 265, 265, 265, 265, 265, 265, 0, + 0, 0, 270, 0, 0, 270, 266, 266, 266, 265, + 0, 266, 266, 266, 265, 266, 0, 0, 0, 270, + 270, 0, 0, 266, 270, 266, 266, 266, 265, 0, + 0, 265, 0, 0, 0, 266, 266, 0, 266, 266, + 266, 266, 266, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 270, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 266, 0, 266, 0, + 0, 0, 0, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 0, 270, 0, 294, 0, + 0, 0, 0, 0, 0, 266, 0, 0, 294, 0, + 266, 293, 293, 293, 0, 0, 293, 293, 293, 0, + 293, 0, 0, 0, 266, 0, 0, 266, 293, 0, + 293, 293, 293, 0, 0, 0, 0, 0, 0, 294, + 293, 293, 294, 293, 293, 293, 293, 293, 0, 0, + 0, 0, 0, 0, 0, 0, 294, 294, 294, 0, + 294, 294, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 293, 0, 293, 0, 0, 0, 0, 293, 293, + 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, + 293, 0, 0, 0, 0, 293, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 271, 0, 0, 0, 293, + 0, 0, 293, 294, 0, 271, 0, 0, 0, 0, + 0, 0, 0, 270, 270, 270, 0, 0, 270, 270, + 270, 0, 270, 0, 0, 0, 0, 0, 0, 0, + 270, 0, 270, 270, 270, 0, 271, 0, 0, 271, + 0, 0, 270, 270, 0, 270, 270, 270, 270, 270, + 0, 0, 0, 271, 271, 0, 0, 0, 271, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 270, 0, 270, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 270, 270, 271, 0, + 270, 270, 0, 0, 0, 272, 0, 0, 0, 0, + 0, 0, 270, 0, 0, 272, 0, 270, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 271, 270, 0, 0, 270, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 272, 0, 0, 272, + 294, 294, 294, 0, 0, 294, 294, 294, 0, 294, + 0, 0, 0, 272, 272, 0, 0, 294, 272, 294, + 294, 294, 0, 0, 0, 0, 0, 0, 0, 294, + 294, 0, 294, 294, 294, 294, 294, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 272, 0, + 0, 279, 0, 0, 0, 0, 0, 0, 0, 0, + 294, 279, 294, 0, 0, 0, 0, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 0, + 272, 0, 0, 0, 0, 0, 0, 0, 0, 294, + 0, 0, 279, 0, 294, 279, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 294, 279, + 279, 294, 0, 0, 279, 0, 0, 271, 271, 271, + 0, 0, 271, 271, 271, 0, 271, 0, 0, 0, + 0, 0, 0, 0, 271, 0, 271, 271, 271, 0, + 0, 0, 0, 0, 279, 0, 271, 271, 0, 271, + 271, 271, 271, 271, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 273, 0, 0, 0, 279, 271, 0, 271, + 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, + 271, 271, 0, 0, 271, 271, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 271, 0, 0, 0, + 0, 271, 0, 273, 0, 0, 273, 272, 272, 272, + 0, 0, 272, 272, 272, 271, 272, 0, 271, 0, + 273, 273, 0, 0, 272, 273, 272, 272, 272, 0, + 0, 0, 0, 0, 0, 0, 272, 272, 0, 272, + 272, 272, 272, 272, 0, 0, 0, 0, 274, 0, + 0, 0, 0, 0, 0, 273, 0, 0, 274, 0, + 0, 0, 0, 0, 0, 0, 0, 272, 0, 272, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 272, 272, 0, 0, 272, 272, 0, 273, 0, 274, + 0, 0, 274, 0, 0, 0, 272, 0, 0, 0, + 0, 272, 0, 279, 279, 279, 274, 274, 279, 279, + 279, 274, 279, 0, 0, 272, 0, 0, 272, 0, + 279, 0, 279, 279, 279, 0, 0, 0, 0, 0, + 0, 0, 279, 279, 0, 279, 279, 279, 279, 279, + 0, 274, 0, 280, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 280, 0, 0, 0, 0, 160, 0, + 0, 0, 0, 279, 0, 279, 0, 0, 0, 0, + 0, 0, 0, 274, 0, 0, 279, 279, 0, 0, + 279, 279, 0, 0, 280, 0, 160, 280, 160, 0, + 160, 0, 279, 0, 681, 0, 0, 279, 0, 0, + 0, 280, 280, 0, 0, 0, 280, 160, 0, 160, + 0, 279, 0, 0, 279, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 273, 273, 273, 0, 0, 273, + 273, 273, 0, 273, 0, 0, 280, 0, 0, 0, + 0, 273, 0, 273, 273, 273, 0, 0, 0, 0, + 0, 0, 0, 273, 273, 0, 273, 273, 273, 273, + 273, 0, 0, 0, 0, 254, 0, 0, 280, 0, + 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, + 0, 0, 0, 0, 273, 0, 273, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 273, 273, 0, + 0, 273, 273, 0, 0, 0, 254, 0, 0, 254, + 274, 274, 274, 273, 0, 274, 274, 274, 273, 274, + 0, 0, 0, 254, 254, 0, 0, 274, 254, 274, + 274, 274, 273, 0, 0, 273, 0, 0, 0, 274, + 274, 0, 274, 274, 274, 274, 274, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 274, 0, 274, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 274, 274, 0, 0, 274, 274, 0, + 254, 0, 255, 0, 0, 0, 0, 0, 0, 274, + 0, 0, 255, 0, 274, 280, 280, 280, 0, 0, + 280, 280, 280, 0, 280, 0, 0, 0, 274, 0, + 0, 274, 280, 0, 280, 280, 280, 0, 0, 0, + 0, 0, 0, 255, 280, 280, 255, 280, 280, 280, + 280, 280, 0, 0, 0, 0, 0, 0, 0, 0, + 255, 255, 0, 0, 160, 255, 160, 160, 160, 160, + 160, 0, 0, 0, 0, 280, 0, 280, 0, 0, + 0, 0, 0, 0, 0, 0, 160, 0, 0, 280, + 0, 0, 280, 280, 0, 255, 0, 0, 0, 0, + 160, 0, 0, 0, 280, 0, 681, 0, 0, 280, + 160, 0, 0, 0, 0, 160, 160, 160, 250, 0, + 0, 0, 0, 280, 0, 0, 280, 255, 250, 0, + 0, 0, 0, 0, 0, 0, 0, 254, 254, 254, + 0, 0, 254, 254, 254, 0, 254, 0, 0, 0, + 0, 0, 0, 0, 254, 0, 254, 254, 254, 250, + 0, 0, 250, 0, 0, 251, 254, 254, 0, 254, + 254, 254, 254, 254, 0, 251, 250, 250, 0, 0, + 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 254, 0, 254, + 0, 0, 0, 0, 0, 0, 251, 0, 0, 251, + 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 251, 251, 0, 254, 0, 251, 0, + 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 250, 0, 254, 0, 0, 254, 0, + 0, 281, 0, 0, 0, 0, 0, 0, 251, 0, + 0, 281, 0, 0, 255, 255, 255, 0, 0, 255, + 255, 255, 0, 255, 0, 0, 0, 0, 0, 0, + 0, 255, 0, 255, 255, 255, 0, 0, 0, 0, + 251, 0, 281, 255, 255, 281, 255, 255, 255, 255, + 255, 286, 0, 0, 0, 0, 0, 0, 0, 281, + 281, 286, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 0, 255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 286, 0, 281, 286, 0, 0, 0, 0, + 0, 0, 0, 255, 0, 0, 0, 0, 255, 286, + 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 255, 0, 0, 255, 281, 0, 0, 0, + 250, 250, 250, 0, 0, 250, 250, 250, 0, 250, + 0, 0, 0, 0, 286, 0, 0, 250, 0, 250, + 250, 250, 0, 0, 0, 0, 0, 0, 0, 250, + 250, 0, 250, 250, 250, 250, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 286, 251, 251, 251, + 0, 0, 251, 251, 251, 282, 251, 0, 0, 0, + 250, 0, 250, 0, 251, 282, 251, 251, 251, 0, + 0, 0, 0, 0, 0, 0, 251, 251, 0, 251, + 251, 251, 251, 251, 0, 0, 0, 0, 0, 250, + 0, 0, 0, 0, 250, 0, 282, 0, 0, 282, + 0, 0, 0, 0, 0, 0, 0, 251, 250, 251, + 0, 250, 0, 282, 282, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 281, 281, 281, 251, 0, 281, 281, + 281, 251, 281, 0, 0, 0, 0, 0, 282, 0, + 281, 0, 281, 281, 281, 251, 0, 0, 251, 0, + 0, 0, 281, 281, 0, 281, 281, 281, 281, 281, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 282, 0, 0, 286, 286, 286, 0, 0, 286, 286, + 286, 287, 286, 281, 0, 281, 0, 0, 0, 0, + 286, 287, 286, 286, 286, 0, 0, 0, 0, 0, + 0, 0, 286, 286, 0, 286, 286, 286, 286, 286, + 0, 0, 281, 0, 0, 0, 0, 281, 0, 0, + 0, 0, 287, 0, 0, 287, 0, 0, 304, 0, + 0, 281, 0, 286, 281, 286, 0, 0, 304, 287, + 287, 0, 0, 161, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 286, 0, 0, 0, 0, 286, 0, 304, + 0, 161, 304, 161, 287, 161, 0, 0, 0, 684, + 0, 286, 0, 0, 286, 0, 304, 304, 0, 0, + 0, 0, 161, 0, 161, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 287, 282, 282, 282, + 0, 0, 282, 282, 282, 0, 282, 0, 0, 0, + 0, 304, 0, 0, 282, 0, 282, 282, 282, 0, + 0, 0, 0, 0, 0, 0, 282, 282, 0, 282, + 282, 282, 282, 282, 0, 495, 0, 0, 0, 0, + 0, 0, 0, 304, 0, 495, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 282, 0, 282, + 0, 0, 0, 0, 0, 0, 0, 0, 320, 0, + 0, 0, 495, 495, 0, 0, 495, 495, 495, 495, + 495, 495, 495, 0, 0, 0, 282, 0, 0, 0, + 0, 282, 0, 0, 495, 495, 0, 495, 495, 0, + 0, 0, 0, 0, 0, 282, 0, 0, 282, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 495, 0, 495, 495, + 0, 0, 0, 287, 287, 287, 0, 0, 287, 287, + 287, 0, 287, 0, 0, 0, 0, 0, 0, 0, + 287, 0, 287, 287, 287, 0, 0, 0, 495, 495, + 495, 320, 287, 287, 0, 287, 287, 287, 287, 287, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 304, 304, 304, 0, 0, 304, 304, 304, 0, 304, + 0, 0, 0, 287, 0, 287, 0, 304, 0, 304, + 304, 304, 0, 0, 0, 0, 0, 0, 0, 304, + 304, 0, 304, 304, 304, 304, 304, 0, 0, 0, + 0, 0, 287, 0, 0, 0, 0, 287, 0, 161, + 0, 161, 161, 161, 161, 161, 0, 0, 0, 0, + 304, 287, 304, 0, 287, 0, 0, 0, 0, 0, + 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 161, 0, 0, 0, 304, + 0, 684, 0, 0, 304, 161, 0, 0, 0, 0, + 161, 161, 161, 0, 0, 0, 0, 0, 304, 0, + 0, 304, 320, 320, 320, 0, 320, 495, 495, 495, + 320, 320, 495, 495, 495, 320, 495, 320, 320, 320, + 320, 320, 320, 320, 495, 495, 495, 495, 0, 320, + 320, 320, 320, 320, 320, 320, 495, 495, 320, 495, + 495, 495, 495, 495, 0, 320, 0, 0, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 0, 0, 495, 320, 495, + 0, 320, 320, 495, 495, 495, 495, 495, 495, 495, + 495, 495, 495, 495, 495, 495, 320, 320, 0, 0, + 495, 495, 495, 495, 320, 0, 495, 320, 320, 320, + 320, 495, 320, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 821, 320, 320, 495, 0, 0, 0, 0, + 0, 0, 821, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 320, 0, 0, 0, 821, + 821, 0, 0, 821, 821, 821, 821, 821, 821, 821, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 821, 821, 0, 821, 821, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 821, 0, 821, 821, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 353, + 0, 0, 0, 0, 0, 821, 821, 821, 320, 353, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 794, 0, 0, 0, 353, 353, 0, 794, + 353, 353, 353, 353, 353, 353, 353, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 353, 353, + 152, 353, 353, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 353, 0, 353, 353, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 353, 353, 794, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, + 320, 320, 0, 320, 821, 821, 821, 320, 320, 821, + 821, 821, 320, 821, 320, 320, 320, 320, 320, 320, + 320, 821, 821, 821, 821, 0, 320, 320, 320, 320, + 320, 320, 320, 821, 821, 320, 821, 821, 821, 821, + 821, 0, 320, 0, 0, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 0, 0, 821, 320, 821, 0, 320, 320, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 821, 821, 320, 320, 0, 0, 821, 821, 821, + 821, 320, 0, 821, 320, 320, 320, 320, 821, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 320, 0, + 320, 320, 821, 0, 0, 0, 794, 794, 794, 0, + 794, 353, 353, 353, 794, 794, 353, 353, 353, 794, + 353, 794, 794, 794, 794, 794, 794, 794, 353, 0, + 353, 353, 0, 794, 794, 794, 794, 794, 794, 794, + 353, 353, 794, 353, 353, 353, 353, 353, 0, 794, + 0, 0, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 0, + 0, 353, 794, 353, 0, 794, 794, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 794, 794, 0, 0, 353, 353, 353, 353, 794, 0, + 353, 794, 794, 794, 794, 353, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 681, 794, 794, 353, + 0, 0, 0, 0, 0, 0, 681, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 793, + 0, 0, 0, 681, 681, 0, 793, 681, 681, 681, + 117, 681, 681, 681, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 681, 681, 136, 681, 681, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 681, 0, 0, + 681, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 684, 0, 0, 0, 0, 0, 793, + 681, 681, 793, 684, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 794, 0, 0, 0, + 684, 684, 0, 794, 684, 684, 684, 120, 684, 684, + 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 684, 684, 139, 684, 684, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 684, 0, 0, 684, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 794, 684, 684, 794, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 793, 793, 793, 0, 793, 681, 681, + 681, 793, 793, 0, 681, 681, 793, 681, 793, 793, + 793, 793, 793, 793, 793, 681, 793, 0, 0, 0, + 793, 793, 793, 793, 793, 793, 793, 681, 681, 793, + 681, 681, 681, 681, 681, 0, 793, 0, 0, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 0, 0, 681, 793, + 681, 0, 793, 793, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 793, 793, 0, + 0, 681, 681, 681, 681, 793, 693, 681, 793, 793, + 793, 793, 0, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 0, 793, 793, 681, 0, 0, 0, + 794, 794, 794, 0, 794, 684, 684, 684, 794, 794, + 0, 684, 684, 794, 684, 794, 794, 794, 794, 794, + 794, 794, 684, 794, 0, 0, 0, 794, 794, 794, + 794, 794, 794, 794, 684, 684, 794, 684, 684, 684, + 684, 684, 0, 794, 0, 0, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 0, 0, 684, 794, 684, 0, 794, + 794, 684, 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 794, 794, 0, 0, 684, 684, + 684, 684, 794, 696, 684, 794, 794, 794, 794, 0, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 360, 794, 794, 684, 0, 0, 0, 0, 0, 0, + 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 320, 0, 0, 0, 360, 360, 0, + 0, 360, 360, 360, 360, 360, 360, 360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 360, + 360, 0, 360, 360, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 0, 360, 360, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 798, 0, 0, + 0, 0, 0, 0, 360, 360, 320, 798, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 793, 0, 0, 0, 798, 798, 0, 793, 798, 798, + 798, 131, 798, 798, 798, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 798, 798, 150, 798, + 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 798, 0, + 0, 798, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 798, 798, 798, 793, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 320, 320, 320, + 0, 320, 360, 360, 360, 320, 320, 360, 360, 360, + 320, 360, 320, 320, 320, 320, 320, 320, 320, 360, + 0, 360, 360, 0, 320, 320, 320, 320, 320, 320, + 320, 360, 360, 320, 360, 360, 360, 360, 360, 0, + 320, 0, 0, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 0, 0, 360, 320, 360, 0, 320, 320, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + 360, 320, 320, 0, 0, 360, 360, 360, 360, 320, + 0, 360, 320, 320, 320, 320, 360, 320, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 0, 320, 320, + 360, 0, 0, 0, 793, 793, 793, 0, 793, 798, + 798, 798, 793, 793, 0, 798, 798, 793, 798, 793, + 793, 793, 793, 793, 793, 793, 798, 798, 0, 0, + 0, 793, 793, 793, 793, 793, 793, 793, 798, 798, + 793, 798, 798, 798, 798, 798, 0, 793, 0, 0, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 0, 0, 798, + 793, 798, 0, 793, 793, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 793, 793, + 0, 0, 798, 798, 798, 798, 793, 0, 798, 793, + 793, 793, 793, 0, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 798, 0, 0, + 0, 0, 0, 0, 793, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 793, 0, 0, + 0, 793, 793, 0, 793, 793, 793, 793, 130, 793, + 793, 793, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 793, 793, 149, 793, 793, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, }; } - private static final short[] yyTable3() { - return new short[] { + private static final int[] yyTable3() { + return new int[] { - 795, 795, 795, 791, 0, 795, 791, 791, 791, 791, - 0, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 795, 0, 0, 0, 0, 0, - 0, 791, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 791, 0, 0, 0, 791, 791, - 0, 791, 791, 791, 791, 126, 791, 791, 791, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 791, 791, 145, 791, 791, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 791, 0, 0, 791, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 792, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 792, 791, 791, 791, 791, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 792, 0, 0, 0, - 792, 792, 0, 792, 792, 792, 792, 128, 792, 792, - 792, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 792, 792, 147, 792, 792, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 792, 0, 0, 792, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 792, 792, 792, 792, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 791, 791, - 791, 0, 791, 791, 791, 791, 791, 791, 0, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 0, 0, 0, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 0, 791, 0, 0, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 0, 0, 791, 0, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 0, 0, 791, 791, 791, 791, 791, 0, - 791, 791, 791, 791, 791, 0, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 0, 791, 791, 791, - 792, 792, 792, 0, 792, 792, 792, 792, 792, 792, - 0, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 0, 0, 0, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 0, 792, 0, 0, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 0, 0, 792, 0, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 0, 0, 792, 792, 792, 792, - 792, 0, 792, 792, 792, 792, 792, 0, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 795, 792, - 792, 792, 0, 0, 0, 0, 0, 0, 795, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 791, 0, 0, 0, 795, 795, 0, 791, 795, - 795, 795, 795, 795, 795, 795, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 795, 795, 146, - 795, 795, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 795, - 0, 0, 795, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 791, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 791, 795, 795, 795, 791, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 791, 0, 0, 0, 791, 791, 0, - 791, 791, 791, 791, 791, 791, 791, 791, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 791, - 791, 145, 791, 791, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 791, 0, 0, 791, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 791, 791, 791, 791, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 791, 791, 791, 0, 791, - 795, 795, 795, 791, 791, 0, 795, 795, 791, 795, - 791, 791, 791, 791, 791, 791, 791, 795, 795, 0, - 0, 0, 791, 791, 791, 791, 791, 791, 791, 795, - 795, 791, 795, 795, 795, 795, 795, 0, 791, 0, - 0, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 0, 0, - 791, 0, 791, 791, 795, 795, 795, 795, 795, 795, - 795, 795, 795, 795, 795, 795, 795, 791, 791, 0, - 0, 795, 795, 795, 795, 791, 0, 795, 791, 791, - 791, 791, 0, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 0, 791, 791, 795, 791, 791, 791, - 0, 791, 791, 791, 791, 791, 791, 0, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 0, 0, 0, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 0, - 791, 0, 0, 791, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 0, 0, 791, 0, 791, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, - 791, 0, 0, 791, 791, 791, 791, 791, 0, 791, - 791, 791, 791, 791, 0, 791, 791, 791, 791, 791, - 791, 791, 791, 791, 791, 792, 791, 791, 791, 0, - 0, 0, 0, 0, 0, 792, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 792, 0, - 0, 0, 792, 792, 0, 792, 792, 792, 792, 792, - 792, 792, 792, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 792, 792, 147, 792, 792, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 792, 0, 0, 792, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 348, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 348, 792, 792, - 792, 792, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 792, 0, 0, 0, 348, 348, 0, 792, 348, 348, - 348, 129, 348, 348, 348, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 348, 348, 148, 348, - 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, - 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 348, 348, 792, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 792, 792, 792, 0, 792, 792, 792, 792, - 792, 792, 0, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 0, 0, 0, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 0, 792, 0, 0, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 0, 0, 792, 0, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 0, 0, 792, 792, - 792, 792, 792, 0, 792, 792, 792, 792, 792, 0, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 0, 792, 792, 792, 792, 792, 792, 0, 792, 348, - 348, 348, 792, 792, 0, 348, 348, 792, 348, 792, - 792, 792, 792, 792, 792, 792, 348, 0, 0, 0, - 0, 792, 792, 792, 792, 792, 792, 792, 348, 348, - 792, 348, 348, 348, 348, 348, 0, 792, 0, 0, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 0, 0, 792, - 0, 792, 792, 348, 348, 348, 348, 348, 348, 348, - 348, 348, 348, 348, 348, 348, 792, 792, 0, 0, - 348, 348, 348, 348, 792, 0, 348, 792, 792, 792, - 792, 0, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 348, 792, 792, 348, 0, 0, 0, 0, - 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 792, 0, 0, 0, 348, - 348, 0, 792, 348, 348, 348, 348, 348, 348, 348, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 348, 348, 148, 348, 348, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 348, 0, 0, 348, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 818, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 818, 0, 348, 348, 792, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 315, 0, 0, - 0, 0, 0, 0, 0, 818, 0, 0, 0, 0, - 818, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 818, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 197, 0, 197, 0, - 197, 0, 0, 0, 686, 0, 0, 818, 0, 818, - 315, 0, 0, 0, 0, 0, 0, 197, 0, 197, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 792, - 792, 792, 0, 792, 348, 348, 348, 792, 792, 0, - 348, 348, 792, 348, 792, 792, 792, 792, 792, 792, - 792, 348, 0, 0, 0, 0, 792, 792, 792, 792, - 792, 792, 792, 348, 348, 792, 348, 348, 348, 348, - 348, 0, 792, 0, 0, 792, 792, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 792, 0, 0, 792, 0, 792, 792, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 792, 792, 0, 0, 348, 348, 348, 348, 792, - 0, 348, 792, 792, 792, 792, 0, 792, 792, 792, - 792, 792, 792, 792, 792, 792, 792, 0, 792, 792, - 348, 315, 315, 315, 0, 315, 818, 818, 818, 315, - 315, 818, 818, 818, 315, 818, 315, 315, 315, 315, - 315, 315, 315, 818, 818, 818, 0, 0, 315, 315, - 315, 315, 315, 315, 315, 818, 818, 315, 818, 818, - 818, 818, 818, 0, 315, 0, 0, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 0, 0, 315, 0, 315, 315, - 0, 0, 0, 0, 0, 0, 382, 0, 0, 0, - 0, 0, 0, 315, 315, 0, 382, 0, 0, 818, - 818, 315, 0, 0, 315, 315, 315, 315, 0, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 0, - 315, 315, 818, 382, 382, 0, 0, 382, 382, 382, - 382, 382, 382, 382, 197, 0, 197, 197, 197, 197, - 197, 0, 0, 0, 0, 382, 382, 0, 382, 382, - 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, - 0, 0, 0, 0, 686, 0, 0, 382, 197, 382, - 382, 383, 0, 197, 197, 197, 0, 0, 0, 0, - 0, 383, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 382, 382, 0, 0, 0, 0, 0, 0, 383, 383, - 0, 0, 383, 383, 383, 383, 383, 383, 383, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 383, 383, 0, 383, 383, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 383, 0, 383, 383, 0, 0, 0, 352, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 352, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 383, 383, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 352, 352, 0, 0, - 352, 352, 352, 352, 352, 352, 352, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 352, 352, - 0, 352, 352, 0, 0, 0, 0, 0, 382, 382, - 382, 0, 0, 382, 382, 382, 0, 382, 0, 0, - 0, 0, 0, 0, 0, 382, 0, 382, 382, 0, - 352, 0, 352, 352, 0, 0, 0, 382, 382, 0, - 382, 382, 382, 382, 382, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 352, 352, 0, 0, 0, 0, 0, - 0, 0, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 0, 0, 0, 0, 382, - 382, 382, 382, 0, 0, 382, 0, 0, 0, 0, - 382, 0, 0, 383, 383, 383, 0, 0, 383, 383, - 383, 0, 383, 198, 382, 0, 0, 0, 0, 0, - 383, 0, 383, 383, 0, 0, 0, 0, 0, 0, - 0, 0, 383, 383, 0, 383, 383, 383, 383, 383, - 0, 198, 0, 198, 0, 198, 0, 0, 0, 688, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 198, 0, 198, 0, 0, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 0, 0, 0, 0, 383, 383, 383, 383, 0, 0, - 383, 0, 0, 0, 0, 383, 0, 0, 0, 0, - 0, 352, 352, 352, 0, 0, 352, 352, 352, 383, - 352, 0, 0, 0, 0, 0, 0, 0, 352, 0, - 352, 352, 0, 0, 0, 0, 0, 0, 0, 0, - 352, 352, 0, 352, 352, 352, 352, 352, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 486, 0, 352, 352, 352, 352, 352, - 352, 352, 352, 352, 352, 352, 352, 352, 0, 0, - 0, 0, 352, 352, 352, 352, 0, 0, 352, 0, - 486, 486, 0, 352, 486, 486, 486, 125, 486, 486, - 486, 0, 0, 0, 0, 0, 0, 352, 0, 0, - 0, 0, 486, 486, 144, 486, 486, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 486, 486, 0, 0, 486, 0, 0, - 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 486, 486, 486, 0, - 486, 486, 0, 0, 486, 486, 486, 486, 486, 486, - 486, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 486, 486, 144, 486, 486, 0, 0, 198, - 0, 198, 198, 198, 198, 198, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, - 0, 0, 0, 0, 486, 683, 0, 486, 0, 0, - 0, 0, 0, 198, 0, 683, 0, 0, 0, 688, - 0, 0, 0, 198, 0, 0, 0, 0, 198, 198, - 198, 0, 0, 0, 0, 0, 486, 486, 486, 0, - 0, 0, 683, 683, 0, 0, 683, 683, 683, 119, - 683, 683, 683, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 683, 683, 138, 683, 683, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 486, 486, 486, 0, 0, - 0, 486, 486, 0, 486, 0, 683, 0, 0, 683, - 0, 0, 486, 486, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 486, 486, 0, 486, 486, 486, - 486, 486, 0, 0, 0, 0, 0, 0, 0, 683, - 683, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 486, - 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 486, 486, 0, 0, 0, 0, 486, 486, 486, 486, - 0, 0, 486, 0, 0, 486, 486, 486, 0, 0, - 0, 486, 486, 0, 486, 0, 0, 0, 0, 0, - 0, 486, 486, 486, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 486, 486, 0, 486, 486, 486, - 486, 486, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 486, - 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 486, 486, 0, 0, 0, 0, 486, 486, 486, 486, - 0, 0, 486, 0, 0, 0, 0, 683, 683, 683, - 0, 0, 0, 683, 683, 0, 683, 0, 0, 0, - 0, 486, 0, 0, 683, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 683, 683, 0, 683, - 683, 683, 683, 683, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 682, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 682, 0, - 0, 683, 683, 683, 683, 683, 683, 683, 683, 683, - 683, 683, 683, 683, 0, 0, 0, 0, 683, 683, - 683, 683, 0, 695, 683, 682, 682, 0, 0, 682, - 682, 682, 118, 682, 682, 682, 0, 0, 0, 0, - 0, 0, 0, 683, 0, 0, 0, 682, 682, 137, - 682, 682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 684, 682, - 0, 0, 682, 0, 0, 0, 0, 0, 684, 0, + 793, 0, 0, 793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 794, 0, 0, 0, + 0, 0, 793, 793, 793, 793, 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 682, 682, 0, 684, 684, 0, 0, 684, - 684, 684, 120, 684, 684, 684, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 684, 684, 139, - 684, 684, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 794, + 0, 0, 0, 794, 794, 0, 794, 794, 794, 794, + 132, 794, 794, 794, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 794, 794, 151, 794, 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 684, - 685, 0, 684, 0, 0, 0, 0, 0, 0, 0, - 685, 377, 372, 0, 0, 0, 375, 373, 0, 374, - 0, 376, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 684, 684, 369, 0, 368, 685, 685, 0, - 0, 685, 685, 685, 121, 685, 685, 685, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 685, - 685, 140, 685, 685, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 682, 682, 682, 0, 0, 0, 682, 682, 0, 682, - 0, 685, 0, 0, 685, 0, 0, 682, 370, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 682, - 682, 0, 682, 682, 682, 682, 682, 0, 0, 0, - 0, 0, 0, 0, 685, 685, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 0, 0, 0, - 0, 682, 682, 682, 682, 0, 694, 682, 0, 0, - 684, 684, 684, 0, 0, 0, 684, 684, 0, 684, - 0, 0, 0, 0, 0, 0, 682, 684, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 684, - 684, 0, 684, 684, 684, 684, 684, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 684, 684, 684, 684, 684, 684, - 684, 684, 684, 684, 684, 684, 684, 0, 0, 0, - 0, 684, 684, 684, 684, 0, 696, 684, 0, 0, - 0, 0, 685, 685, 685, 0, 0, 0, 685, 685, - 0, 685, 0, 0, 0, 0, 684, 0, 0, 685, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 685, 685, 0, 685, 685, 685, 685, 685, 0, - 351, 352, 353, 354, 355, 356, 357, 0, 0, 360, - 361, 0, 0, 687, 0, 0, 0, 364, 365, 0, - 0, 0, 0, 687, 0, 0, 685, 685, 685, 685, - 685, 685, 685, 685, 685, 685, 685, 685, 685, 0, - 0, 0, 0, 685, 685, 685, 685, 0, 697, 685, - 687, 687, 0, 0, 687, 687, 687, 123, 687, 687, - 687, 0, 0, 0, 0, 0, 0, 0, 685, 0, - 0, 0, 687, 687, 142, 687, 687, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 686, 687, 0, 0, 687, 0, 0, - 0, 0, 0, 686, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 687, 687, 0, - 686, 686, 0, 0, 686, 686, 686, 122, 686, 686, - 686, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 686, 686, 141, 686, 686, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 686, 688, 0, 686, 0, 0, - 0, 0, 0, 0, 0, 688, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 686, 686, 0, - 0, 0, 688, 688, 0, 0, 688, 688, 688, 124, - 688, 688, 688, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 688, 688, 143, 688, 688, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 687, 687, 687, 0, 0, - 0, 687, 687, 0, 687, 0, 688, 0, 0, 688, - 0, 0, 687, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 687, 687, 0, 687, 687, 687, - 687, 687, 0, 0, 0, 0, 0, 0, 0, 688, - 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 0, 0, 0, 0, 687, 687, 687, 687, - 0, 699, 687, 0, 0, 686, 686, 686, 0, 0, - 0, 686, 686, 0, 686, 0, 0, 0, 0, 0, - 0, 687, 686, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 686, 686, 0, 686, 686, 686, - 686, 686, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 794, 0, 0, + 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 686, - 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, - 686, 686, 0, 0, 0, 0, 686, 686, 686, 686, - 0, 698, 686, 0, 0, 0, 0, 688, 688, 688, - 0, 0, 0, 688, 688, 0, 688, 0, 0, 0, - 0, 686, 0, 0, 688, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 688, 688, 0, 688, - 688, 688, 688, 688, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, - 0, 688, 688, 688, 688, 688, 688, 688, 688, 688, - 688, 688, 688, 688, 0, 0, 0, 0, 688, 688, - 688, 688, 0, 700, 688, 679, 679, 0, 0, 679, - 679, 679, 115, 679, 679, 679, 0, 0, 0, 0, - 0, 0, 0, 688, 0, 0, 0, 679, 679, 134, - 679, 679, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 678, 679, - 0, 0, 679, 0, 0, 0, 0, 0, 678, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 679, 679, 0, 678, 678, 0, 0, 678, - 678, 678, 114, 678, 678, 678, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 678, 678, 133, - 678, 678, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, - 681, 0, 678, 0, 0, 0, 0, 0, 0, 0, - 681, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 794, + 794, 794, 794, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 793, 793, 793, 0, + 793, 793, 793, 793, 793, 793, 0, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 0, 0, 0, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 0, 793, + 0, 0, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 0, + 0, 793, 793, 793, 0, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 0, 0, 793, 793, 793, 793, 793, 0, + 793, 793, 793, 793, 793, 0, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 0, 793, 793, 793, + 0, 0, 0, 794, 794, 794, 0, 794, 794, 794, + 794, 794, 794, 0, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 0, 0, 0, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 0, 794, 0, 0, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 0, 0, 794, 794, + 794, 0, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 0, + 0, 794, 794, 794, 794, 794, 0, 794, 794, 794, + 794, 794, 0, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 798, 794, 794, 794, 0, 0, 0, + 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 678, 678, 0, 0, 0, 681, 681, 0, - 0, 681, 681, 681, 117, 681, 681, 681, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 681, - 681, 136, 681, 681, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 679, 679, 679, 0, 0, 0, 679, 679, 0, 679, - 0, 681, 0, 0, 681, 0, 0, 679, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 679, - 679, 0, 679, 679, 679, 679, 679, 0, 0, 0, - 0, 0, 0, 0, 681, 681, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 679, 679, 679, 679, 679, 679, - 679, 679, 679, 679, 679, 679, 679, 0, 0, 0, - 0, 679, 679, 679, 679, 0, 691, 679, 0, 0, - 678, 678, 678, 0, 0, 0, 678, 678, 0, 678, - 0, 0, 0, 0, 0, 0, 679, 678, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, - 678, 0, 678, 678, 678, 678, 678, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 678, 678, 678, 678, 678, 678, - 678, 678, 678, 678, 678, 678, 678, 0, 0, 0, - 0, 678, 678, 678, 678, 0, 690, 678, 0, 0, - 0, 0, 681, 681, 681, 0, 0, 0, 681, 681, - 0, 681, 0, 0, 0, 0, 678, 0, 0, 681, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 681, 681, 0, 681, 681, 681, 681, 681, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 0, - 0, 0, 0, 681, 681, 681, 681, 0, 693, 681, - 339, 339, 0, 0, 339, 339, 339, 131, 339, 339, - 339, 0, 0, 0, 0, 0, 0, 0, 681, 0, - 0, 0, 339, 339, 150, 339, 339, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 349, 339, 0, 0, 339, 0, 0, - 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 339, 339, 0, - 349, 349, 0, 0, 349, 349, 349, 130, 349, 349, - 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 349, 349, 149, 349, 349, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 349, 339, 0, 349, 0, 0, - 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 349, 349, 0, - 0, 0, 339, 339, 0, 0, 339, 339, 339, 339, - 339, 339, 339, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 339, 339, 150, 339, 339, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 339, 339, 339, 0, 0, - 0, 339, 339, 0, 339, 0, 339, 0, 0, 339, - 0, 0, 339, 580, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 580, 339, 339, 0, 339, 339, 339, - 339, 339, 0, 0, 0, 0, 0, 0, 0, 339, - 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 580, 0, 0, 580, 0, 339, - 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - 339, 339, 580, 0, 0, 0, 339, 339, 339, 339, - 0, 0, 339, 0, 0, 349, 349, 349, 0, 0, - 0, 349, 349, 0, 349, 0, 0, 0, 0, 0, - 0, 339, 349, 581, 0, 0, 580, 0, 0, 0, - 0, 0, 0, 581, 349, 349, 0, 349, 349, 349, - 349, 349, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 580, 580, 0, - 0, 0, 0, 0, 581, 0, 0, 581, 0, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 581, 84, 0, 0, 349, 349, 349, 349, - 0, 0, 349, 84, 0, 0, 0, 339, 339, 339, - 0, 0, 0, 339, 339, 0, 339, 0, 0, 0, - 0, 349, 0, 0, 339, 0, 581, 0, 0, 0, - 0, 0, 0, 0, 84, 0, 339, 339, 0, 339, - 339, 339, 339, 339, 0, 0, 0, 0, 0, 0, - 0, 0, 84, 0, 0, 0, 558, 581, 581, 0, - 0, 0, 0, 0, 0, 0, 558, 0, 0, 0, - 0, 339, 339, 339, 339, 339, 339, 339, 339, 339, - 339, 339, 339, 339, 0, 0, 84, 0, 339, 339, - 339, 339, 0, 0, 339, 0, 0, 558, 0, 0, - 558, 0, 0, 0, 0, 580, 580, 580, 0, 0, - 580, 580, 580, 339, 580, 558, 569, 0, 84, 0, - 0, 0, 580, 0, 580, 0, 569, 0, 0, 0, - 0, 0, 0, 0, 580, 580, 0, 580, 580, 580, - 580, 580, 0, 0, 0, 0, 0, 0, 0, 558, - 0, 0, 0, 0, 0, 0, 0, 569, 0, 0, - 569, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 544, 569, 0, 0, 0, 0, - 0, 558, 0, 0, 544, 0, 0, 0, 0, 0, - 0, 0, 580, 0, 0, 581, 581, 581, 0, 0, - 581, 581, 581, 0, 581, 0, 0, 0, 0, 569, - 0, 580, 581, 0, 581, 544, 0, 0, 561, 0, - 0, 0, 0, 0, 581, 581, 0, 581, 581, 581, - 581, 581, 0, 544, 0, 568, 0, 0, 0, 0, - 0, 569, 0, 0, 0, 568, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 84, 84, 84, 0, 0, - 84, 84, 84, 0, 84, 0, 0, 544, 0, 0, - 0, 0, 84, 0, 84, 84, 568, 0, 0, 568, - 0, 0, 581, 0, 84, 84, 0, 84, 84, 84, - 84, 84, 0, 0, 568, 0, 0, 561, 0, 544, - 0, 581, 0, 0, 0, 0, 0, 561, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 558, 558, - 558, 0, 0, 558, 558, 558, 0, 558, 568, 0, - 0, 0, 0, 0, 0, 558, 0, 558, 561, 0, - 0, 561, 0, 0, 0, 0, 0, 558, 558, 0, - 558, 558, 558, 558, 558, 0, 561, 563, 0, 0, - 568, 84, 0, 0, 0, 0, 0, 563, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 569, 569, - 569, 0, 0, 569, 569, 569, 0, 569, 0, 0, - 561, 0, 0, 0, 0, 569, 0, 569, 563, 554, - 0, 0, 0, 0, 0, 0, 0, 569, 569, 554, - 569, 569, 569, 569, 569, 0, 563, 0, 0, 0, - 0, 0, 561, 0, 558, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 544, 544, 544, 0, - 554, 544, 544, 544, 0, 544, 0, 0, 0, 0, - 563, 0, 573, 544, 0, 544, 0, 0, 554, 0, - 0, 0, 573, 0, 0, 544, 544, 0, 544, 544, - 544, 544, 544, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 563, 0, 569, 0, 0, 0, 0, 0, - 0, 0, 554, 573, 0, 0, 0, 568, 568, 568, - 0, 0, 568, 568, 568, 0, 568, 0, 545, 0, - 0, 573, 0, 0, 568, 0, 568, 0, 545, 0, - 0, 0, 0, 0, 554, 0, 568, 568, 0, 568, - 568, 568, 568, 568, 0, 0, 0, 0, 0, 0, - 0, 0, 544, 0, 0, 573, 564, 0, 0, 545, - 0, 0, 0, 0, 0, 0, 564, 0, 0, 561, - 561, 561, 0, 0, 561, 561, 561, 545, 561, 0, - 0, 0, 0, 0, 0, 0, 561, 573, 561, 0, - 0, 0, 0, 0, 0, 0, 549, 564, 561, 561, - 0, 561, 561, 561, 561, 561, 549, 0, 0, 0, - 0, 545, 0, 568, 0, 564, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 563, - 563, 563, 0, 0, 563, 563, 563, 549, 563, 0, - 0, 0, 0, 545, 0, 0, 563, 0, 563, 564, - 0, 0, 0, 0, 0, 549, 0, 0, 563, 563, - 0, 563, 563, 563, 563, 563, 0, 0, 0, 0, - 0, 554, 554, 554, 0, 561, 554, 554, 554, 0, - 554, 564, 0, 0, 0, 0, 546, 0, 554, 549, - 554, 0, 0, 0, 0, 0, 546, 0, 0, 0, - 554, 554, 0, 554, 554, 554, 554, 554, 0, 0, - 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, - 0, 549, 0, 0, 573, 573, 573, 546, 0, 573, - 573, 573, 0, 573, 0, 563, 0, 0, 0, 0, - 0, 573, 0, 573, 156, 546, 156, 0, 156, 0, - 0, 0, 677, 573, 573, 0, 573, 573, 573, 573, - 573, 0, 0, 0, 0, 156, 0, 156, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 554, 0, 546, - 545, 545, 545, 0, 0, 545, 545, 545, 0, 545, - 0, 0, 0, 0, 0, 0, 0, 545, 0, 545, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 545, - 545, 546, 545, 545, 545, 545, 545, 0, 564, 564, - 564, 555, 0, 564, 564, 564, 0, 564, 0, 0, - 573, 555, 0, 0, 0, 564, 0, 564, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 564, 564, 0, - 564, 564, 564, 564, 564, 0, 0, 0, 549, 549, - 549, 0, 555, 549, 549, 549, 547, 549, 0, 0, - 0, 0, 0, 0, 0, 549, 547, 549, 0, 0, - 555, 0, 0, 0, 0, 0, 545, 549, 549, 0, - 549, 549, 549, 549, 549, 0, 0, 0, 0, 0, - 0, 0, 0, 550, 0, 0, 0, 547, 0, 0, - 0, 0, 0, 550, 555, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 564, 547, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 550, 0, 555, 0, 546, 546, - 546, 548, 0, 546, 546, 546, 0, 546, 0, 547, - 0, 548, 550, 0, 549, 546, 0, 546, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 546, 546, 0, - 546, 546, 546, 546, 546, 0, 0, 0, 0, 76, - 0, 547, 548, 0, 0, 0, 550, 0, 0, 76, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, - 548, 0, 156, 0, 156, 156, 156, 156, 156, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 550, 0, - 76, 0, 156, 0, 0, 0, 0, 157, 0, 157, - 0, 157, 0, 0, 548, 680, 156, 0, 76, 0, - 0, 0, 677, 0, 546, 0, 156, 0, 157, 0, - 157, 156, 156, 156, 0, 0, 0, 78, 0, 0, - 0, 0, 0, 0, 0, 0, 548, 78, 0, 0, - 0, 0, 0, 555, 555, 555, 0, 0, 555, 555, - 555, 0, 555, 0, 0, 0, 0, 0, 0, 0, - 555, 0, 555, 0, 0, 0, 0, 0, 78, 0, - 79, 0, 555, 555, 76, 555, 555, 555, 555, 555, - 79, 0, 0, 0, 0, 0, 78, 0, 547, 547, - 547, 0, 0, 547, 547, 547, 0, 547, 0, 0, - 0, 0, 0, 0, 0, 547, 0, 547, 0, 513, - 0, 79, 0, 0, 0, 0, 0, 547, 547, 513, - 547, 547, 547, 547, 547, 550, 550, 550, 0, 79, - 550, 550, 550, 0, 550, 0, 0, 0, 0, 0, - 0, 0, 550, 0, 550, 0, 0, 0, 0, 555, - 513, 0, 78, 0, 550, 550, 514, 550, 550, 550, - 550, 550, 0, 0, 0, 0, 514, 0, 513, 0, - 0, 0, 0, 548, 548, 548, 0, 0, 548, 548, - 548, 0, 548, 0, 0, 0, 0, 0, 0, 0, - 548, 0, 548, 0, 547, 79, 0, 514, 0, 0, - 0, 0, 548, 548, 0, 548, 548, 548, 548, 548, - 0, 76, 76, 76, 0, 514, 76, 76, 76, 554, - 76, 0, 0, 0, 0, 0, 0, 0, 76, 554, - 76, 550, 0, 0, 513, 0, 0, 0, 0, 0, - 76, 76, 0, 76, 76, 76, 76, 76, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 554, 0, 0, 0, 0, 157, 0, 157, 157, 157, - 157, 157, 555, 0, 0, 0, 0, 0, 554, 548, - 0, 514, 555, 0, 0, 157, 0, 0, 0, 78, - 78, 78, 0, 0, 78, 78, 78, 0, 78, 157, - 0, 0, 0, 0, 0, 680, 78, 0, 78, 157, - 0, 0, 0, 555, 157, 157, 157, 76, 78, 78, - 0, 78, 78, 78, 78, 78, 0, 0, 0, 0, - 0, 555, 79, 79, 79, 0, 0, 79, 79, 79, - 328, 79, 0, 0, 554, 0, 0, 0, 0, 79, - 328, 79, 0, 0, 0, 0, 0, 0, 0, 249, - 0, 79, 79, 0, 79, 79, 79, 79, 79, 0, - 0, 513, 513, 513, 0, 0, 513, 513, 513, 0, - 513, 328, 0, 0, 324, 0, 377, 372, 513, 0, - 513, 375, 373, 0, 374, 78, 376, 555, 0, 328, - 513, 513, 0, 513, 513, 513, 513, 513, 0, 369, - 0, 368, 367, 0, 0, 0, 0, 0, 514, 514, - 514, 0, 0, 514, 514, 514, 0, 514, 0, 0, - 0, 0, 0, 0, 0, 514, 0, 514, 79, 0, - 0, 0, 0, 371, 0, 0, 0, 514, 514, 0, - 514, 514, 514, 514, 514, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 328, 0, 0, 0, 151, - 0, 0, 0, 370, 0, 0, 0, 513, 0, 0, - 0, 554, 554, 554, 0, 0, 554, 554, 554, 0, - 554, 0, 151, 0, 0, 0, 0, 0, 554, 788, - 554, 0, 0, 0, 0, 677, 0, 0, 0, 0, - 554, 554, 0, 554, 554, 554, 554, 554, 151, 151, - 0, 0, 0, 0, 514, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 555, 555, 555, 0, 0, 555, - 555, 555, 0, 555, 0, 0, 0, 0, 0, 0, - 677, 555, 0, 555, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 555, 555, 0, 555, 555, 555, 555, - 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 788, 0, 0, 151, 0, 554, 0, 0, - 0, 0, 0, 152, 0, 0, 0, 0, 0, 0, - 0, 0, 328, 328, 328, 0, 0, 328, 328, 328, - 0, 328, 0, 0, 0, 0, 152, 0, 0, 328, - 0, 0, 0, 789, 0, 0, 0, 0, 0, 680, - 0, 0, 0, 0, 328, 328, 328, 328, 328, 0, - 555, 0, 152, 152, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 680, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 0, 328, - 0, 0, 364, 365, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 789, 0, 328, 152, - 0, 0, 0, 0, 0, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 0, 0, 151, 151, - 0, 151, 151, 151, 151, 151, 151, 151, 0, 788, - 0, 0, 0, 151, 151, 151, 151, 151, 151, 151, - 0, 0, 151, 0, 0, 0, 0, 0, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 0, 151, 151, 151, 151, 151, 151, 151, 0, - 0, 151, 0, 151, 151, 0, 0, 0, 806, 525, - 0, 0, 0, 0, 0, 0, 0, 0, 151, 151, - 0, 0, 0, 0, 677, 677, 151, 0, 0, 151, - 151, 151, 151, 0, 151, 0, 0, 151, 151, 151, - 151, 151, 151, 151, 0, 151, 151, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 0, 0, 152, 152, 0, 152, 152, 152, 152, 152, - 152, 152, 0, 789, 0, 0, 0, 152, 152, 152, - 152, 152, 152, 152, 0, 0, 152, 0, 0, 0, - 0, 0, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 0, 152, 152, 152, 152, - 152, 152, 152, 0, 0, 152, 0, 152, 152, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 152, 152, 0, 151, 0, 0, 680, 680, - 152, 0, 0, 152, 152, 152, 152, 0, 152, 0, - 0, 152, 152, 152, 152, 152, 152, 152, 151, 152, - 152, 0, 0, 0, 0, 791, 0, 0, 0, 0, - 0, 795, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 151, 151, 0, 0, 0, 0, - 0, 0, 525, 525, 525, 525, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 525, 525, - 525, 525, 0, 0, 0, 525, 795, 525, 525, 525, - 525, 525, 525, 0, 0, 0, 0, 525, 0, 0, - 0, 525, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 525, 525, 0, 152, 795, 0, - 0, 151, 525, 0, 0, 525, 0, 525, 525, 0, - 525, 525, 0, 525, 525, 525, 525, 525, 525, 525, - 152, 525, 525, 0, 0, 0, 0, 792, 0, 0, - 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 152, 152, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 377, 372, 0, 0, 0, 375, 373, 348, 374, - 0, 376, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 369, 0, 368, 367, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 152, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 371, 0, - 0, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 0, 0, 151, 151, 0, 151, 151, 151, - 151, 151, 151, 151, 0, 795, 0, 0, 370, 151, - 151, 151, 151, 151, 151, 151, 0, 0, 151, 0, - 0, 0, 0, 226, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 0, 151, 151, - 151, 151, 151, 151, 151, 0, 0, 151, 0, 151, - 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 151, 151, 0, 0, 0, 0, - 795, 795, 151, 0, 0, 151, 151, 151, 151, 0, - 151, 0, 0, 151, 151, 151, 151, 151, 151, 151, - 0, 151, 151, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 0, 0, 152, 152, 0, 152, - 152, 152, 152, 152, 152, 152, 68, 0, 0, 0, - 0, 152, 152, 152, 152, 152, 152, 152, 0, 0, - 152, 0, 0, 0, 0, 0, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 0, - 152, 152, 152, 152, 152, 152, 152, 152, 0, 152, - 0, 152, 152, 350, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 152, 152, 0, 0, - 152, 0, 348, 348, 152, 0, 0, 152, 152, 152, - 152, 0, 152, 349, 0, 152, 152, 152, 152, 152, - 152, 152, 0, 152, 152, 0, 152, 152, 0, 0, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 0, 0, 0, 0, 364, 365, 0, - 0, 0, 0, 366, 0, 0, 0, 0, 349, 0, - 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, - 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, - 11, 0, 12, 13, 14, 15, 16, 17, 18, 406, - 0, 0, 0, 152, 19, 20, 21, 206, 207, 208, - 209, 0, 0, 210, 0, 0, 0, 0, 0, 0, - 28, 0, 406, 211, 212, 213, 214, 35, 215, 216, - 217, 218, 219, 40, 41, 42, 43, 44, 45, 46, - 0, 0, 47, 0, 48, 49, 0, 0, 406, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 51, 0, 0, 0, 0, 0, 0, 220, 0, 0, - 221, 54, 55, 56, 0, 222, 223, 224, 58, 59, - 225, 61, 62, 63, 64, 0, 65, 66, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 406, 806, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 0, 0, 152, 152, 0, 152, - 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, - 0, 152, 152, 152, 152, 152, 152, 152, 0, 524, - 152, 0, 0, 0, 0, 0, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 0, - 152, 152, 152, 152, 152, 152, 152, 0, 0, 152, - 0, 152, 152, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 152, 152, 0, 0, - 0, 0, 349, 349, 152, 0, 0, 152, 152, 152, - 152, 0, 152, 0, 0, 152, 152, 152, 152, 152, - 152, 152, 0, 152, 152, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 0, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 0, - 0, 0, 0, 406, 406, 406, 406, 406, 406, 406, - 0, 0, 406, 0, 0, 0, 709, 0, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 0, 406, 406, 406, 406, 406, 406, 406, 709, - 0, 406, 0, 406, 406, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 406, 406, - 0, 0, 0, 0, 0, 709, 406, 706, 0, 406, - 406, 406, 406, 0, 406, 0, 0, 406, 406, 406, - 406, 406, 406, 406, 0, 406, 406, 0, 0, 0, - 0, 0, 524, 524, 524, 524, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 524, 524, - 524, 524, 0, 0, 0, 524, 0, 524, 524, 524, - 524, 524, 524, 0, 0, 0, 0, 524, 705, 0, - 0, 524, 709, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 524, 524, 0, 0, 0, 0, - 0, 705, 524, 0, 0, 524, 0, 524, 524, 0, - 524, 524, 0, 524, 524, 524, 524, 524, 524, 524, - 0, 524, 524, 0, 0, 0, 0, 705, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 377, 372, 0, 0, 0, 375, 373, 0, 374, - 0, 376, 0, 0, 705, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 369, 0, 368, 367, 0, 0, - 0, 0, 709, 709, 709, 709, 709, 709, 709, 709, - 709, 709, 709, 0, 0, 709, 709, 0, - }; - } - - private static final short[] yyTable4() { - return new short[] { - - 709, 709, 709, 709, 709, 709, 709, 0, 0, 0, - 371, 0, 709, 709, 709, 709, 709, 709, 709, 0, - 0, 709, 0, 0, 0, 0, 0, 709, 709, 709, - 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, - 370, 709, 709, 709, 709, 709, 709, 709, 0, 0, - 709, 0, 709, 709, 0, 0, 0, 0, 0, 818, - 0, 0, 0, 0, 0, 0, 0, 709, 709, 0, - 0, 0, 0, 0, 0, 709, 0, 0, 709, 709, - 709, 709, 818, 709, 0, 0, 709, 709, 709, 709, - 709, 709, 709, 0, 709, 709, 705, 705, 705, 705, - 705, 705, 705, 705, 705, 705, 705, 0, 818, 705, - 705, 0, 705, 705, 705, 705, 705, 705, 705, 0, - 0, 0, 0, 0, 705, 705, 705, 705, 705, 705, - 705, 0, 0, 705, 0, 0, 0, 0, 0, 705, - 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, - 705, 705, 0, 705, 705, 705, 705, 705, 705, 705, - 0, 0, 705, 0, 705, 705, 0, 0, 0, 0, - 0, 818, 0, 0, 0, 818, 0, 0, 0, 705, - 705, 0, 0, 0, 0, 0, 0, 705, 0, 0, - 705, 705, 705, 705, 818, 705, 0, 0, 705, 705, - 705, 705, 705, 705, 705, 0, 705, 705, 0, 0, - 0, 0, 0, 0, 931, 0, 0, 0, 0, 0, - 818, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 0, 0, 0, 0, 364, - 365, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 377, 372, 0, 0, 0, 375, - 373, 0, 374, 0, 376, 0, 818, 818, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 369, 0, 368, - 367, 0, 0, 0, 0, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 0, 0, 818, 818, - 0, 818, 818, 818, 818, 818, 818, 818, 0, 0, - 0, 371, 0, 818, 818, 818, 818, 818, 818, 818, - 0, 0, 818, 0, 0, 0, 0, 0, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 370, 818, 818, 818, 818, 818, 818, 818, 0, - 0, 818, 249, 818, 818, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 818, 818, - 0, 0, 0, 0, 0, 226, 818, 0, 0, 818, - 818, 818, 818, 0, 818, 0, 0, 818, 818, 818, - 818, 818, 818, 818, 0, 818, 818, 818, 818, 818, - 818, 818, 818, 0, 0, 0, 818, 818, 0, 0, - 0, 818, 0, 818, 818, 818, 818, 818, 818, 818, - 0, 0, 0, 0, 0, 818, 818, 818, 818, 818, - 818, 818, 0, 0, 818, 0, 0, 0, 0, 0, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 0, 818, 818, 818, 818, 818, 818, - 818, 0, 0, 818, 339, 818, 818, 0, 68, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 818, 818, 0, 0, 0, 0, 0, 67, 818, 0, - 0, 818, 818, 818, 818, 0, 818, 0, 0, 818, - 818, 818, 818, 818, 818, 818, 0, 818, 818, 0, - 0, 0, 0, 338, 0, 933, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 0, 0, 0, 0, - 364, 365, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, - 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 67, 4, - 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, - 0, 0, 11, 0, 12, 13, 14, 15, 16, 17, - 18, 0, 0, 0, 0, 0, 19, 20, 21, 206, - 207, 208, 209, 0, 0, 210, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 211, 212, 213, 214, 35, - 215, 216, 217, 218, 219, 40, 41, 42, 43, 44, - 45, 46, 0, 0, 47, 0, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 50, 51, 0, 0, 0, 0, 0, 0, 220, - 0, 68, 221, 54, 55, 56, 0, 222, 223, 224, - 58, 59, 225, 61, 62, 63, 64, 0, 65, 66, - 67, 4, 5, 6, 0, 8, 0, 0, 0, 9, - 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, - 16, 17, 18, 0, 0, 0, 0, 0, 19, 20, - 21, 206, 207, 208, 209, 0, 0, 26, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 211, 212, 213, - 214, 35, 215, 216, 217, 218, 0, 40, 41, 42, - 43, 44, 45, 46, 0, 0, 47, 0, 48, 49, + 0, 0, 0, 0, 0, 0, 793, 0, 0, 0, + 798, 798, 0, 793, 798, 798, 798, 798, 798, 798, + 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 798, 798, 150, 798, 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, - 0, 220, 0, 68, 221, 54, 55, 56, 0, 0, - 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, - 65, 66, 4, 5, 6, 0, 8, 67, 0, 0, - 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, - 15, 16, 17, 18, 0, 0, 0, 0, 0, 19, - 20, 21, 206, 207, 208, 209, 0, 0, 26, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 211, 212, - 213, 214, 35, 215, 216, 217, 218, 0, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 48, - 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, - 0, 0, 220, 0, 0, 221, 54, 55, 56, 0, - 68, 0, 0, 58, 59, 60, 61, 62, 63, 64, - 0, 65, 66, 3, 4, 5, 6, 7, 8, 0, - 67, 0, 9, 10, 0, 0, 0, 11, 0, 12, - 13, 14, 15, 16, 17, 18, 0, 0, 0, 0, - 0, 19, 20, 21, 22, 23, 24, 25, 0, 0, - 26, 0, 0, 0, 0, 0, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 0, - 40, 41, 42, 43, 44, 45, 46, 0, 0, 47, - 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 50, 51, 0, 0, - 0, 0, 0, 0, 52, 0, 0, 53, 54, 55, - 56, 0, 57, 68, 0, 58, 59, 60, 61, 62, - 63, 64, 0, 65, 66, 0, 0, 0, 0, 0, - 270, 4, 5, 6, 7, 8, 0, 0, 0, 9, - 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, - 16, 17, 18, 0, 0, 0, 0, 0, 19, 20, - 21, 22, 23, 24, 25, 0, 0, 26, 0, 0, - 0, 0, 0, 27, 28, 271, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 67, 40, 41, 42, - 43, 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 598, 50, 51, 0, 0, 0, 0, 0, - 0, 52, 0, 0, 272, 54, 55, 56, 0, 57, - 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, - 65, 66, 0, 270, 4, 5, 6, 7, 8, 0, - 0, 0, 9, 10, 0, 0, 0, 11, 0, 12, - 13, 14, 15, 16, 17, 18, 0, 0, 0, 0, - 0, 19, 20, 21, 22, 23, 24, 25, 0, 68, - 26, 0, 0, 0, 0, 0, 27, 28, 271, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 67, - 40, 41, 42, 43, 44, 45, 46, 0, 0, 47, - 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 598, 50, 51, 0, 0, - 0, 0, 0, 0, 52, 0, 0, 53, 54, 55, - 56, 0, 57, 0, 0, 58, 59, 60, 61, 62, - 63, 64, 0, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 798, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 793, 0, 0, 0, 0, 0, 798, 798, 798, 793, + 793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 793, 0, 0, 0, 793, 793, 0, + 793, 793, 793, 793, 793, 793, 793, 793, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 793, + 793, 149, 793, 793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 6, 7, 8, 0, 67, 0, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, - 17, 18, 0, 0, 0, 0, 0, 19, 20, 21, - 22, 23, 24, 25, 0, 0, 26, 0, 0, 0, - 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 0, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 52, 0, 0, 53, 54, 55, 56, 0, 57, 68, - 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, - 66, 0, 0, 4, 5, 6, 7, 8, 0, 67, - 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, - 14, 15, 16, 17, 18, 0, 0, 0, 0, 0, - 19, 20, 21, 22, 23, 24, 25, 0, 0, 26, - 0, 0, 0, 0, 0, 27, 28, 271, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 0, 40, - 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, - 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 0, 52, 0, 0, 53, 54, 55, 56, - 0, 57, 68, 0, 58, 59, 60, 61, 62, 63, - 64, 0, 65, 66, 0, 0, 0, 0, 0, 0, - 4, 5, 6, 7, 8, 0, 226, 0, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, - 17, 18, 0, 0, 0, 0, 0, 19, 20, 21, - 22, 23, 24, 25, 0, 0, 26, 0, 0, 0, - 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 0, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, + 0, 793, 0, 0, 793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 52, 0, 0, 53, 54, 55, 56, 0, 57, 68, - 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, - 66, 0, 0, 4, 5, 6, 7, 8, 0, 226, - 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, - 14, 15, 16, 17, 18, 0, 0, 0, 0, 0, - 19, 20, 21, 22, 23, 24, 25, 0, 0, 26, - 0, 0, 0, 0, 0, 27, 28, 0, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 0, 40, - 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, - 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 0, 52, 0, 0, 53, 54, 55, 56, - 0, 57, 68, 0, 58, 59, 60, 61, 62, 63, - 64, 0, 65, 66, 0, 0, 0, 0, 0, 0, - 4, 5, 6, 0, 8, 0, 0, 0, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, - 17, 18, 0, 226, 0, 0, 0, 19, 20, 21, - 206, 207, 208, 209, 0, 0, 210, 0, 0, 0, - 0, 0, 0, 28, 0, 0, 211, 212, 213, 214, - 35, 215, 216, 217, 218, 219, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 493, 0, 0, 0, 0, 0, 0, - 220, 0, 0, 221, 54, 55, 56, 0, 222, 223, - 224, 58, 59, 225, 61, 62, 63, 64, 0, 65, - 66, 0, 0, 4, 5, 6, 68, 8, 0, 0, - 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, - 14, 258, 259, 17, 18, 315, 0, 0, 0, 0, - 19, 260, 261, 206, 207, 208, 209, 0, 0, 210, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 211, - 212, 213, 214, 35, 215, 216, 217, 218, 219, 40, - 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, - 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 0, 220, 0, 0, 221, 54, 55, 56, - 0, 707, 223, 224, 58, 59, 225, 61, 62, 63, - 64, 0, 65, 66, 0, 0, 0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 226, 4, 5, 6, - 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, - 11, 0, 12, 13, 14, 258, 259, 17, 18, 0, - 0, 0, 0, 0, 19, 260, 261, 206, 207, 208, - 209, 0, 0, 210, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 211, 212, 213, 214, 35, 215, 216, - 217, 218, 219, 40, 41, 42, 43, 44, 45, 46, - 0, 0, 47, 0, 48, 49, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 493, 0, 0, 0, 0, 0, 0, 220, 0, 68, - 221, 54, 55, 56, 0, 707, 223, 224, 58, 59, - 225, 61, 62, 63, 64, 0, 65, 66, 226, 315, - 315, 315, 0, 315, 0, 0, 0, 315, 315, 0, - 0, 0, 315, 0, 315, 315, 315, 315, 315, 315, - 315, 0, 0, 0, 0, 0, 315, 315, 315, 315, - 315, 315, 315, 0, 0, 315, 0, 0, 0, 0, - 0, 0, 315, 0, 0, 315, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 315, 315, 0, 0, 315, 0, 315, 315, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 315, 315, 0, 0, 0, 0, 0, 0, 315, - 0, 68, 315, 315, 315, 315, 0, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 0, 315, 315, - 4, 5, 6, 0, 8, 0, 0, 226, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 258, 259, - 17, 18, 0, 0, 0, 0, 0, 19, 260, 261, - 206, 207, 208, 209, 0, 0, 210, 0, 0, 0, - 0, 0, 0, 28, 0, 0, 211, 212, 213, 214, - 35, 215, 216, 217, 218, 219, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 220, 0, 0, 221, 54, 55, 56, 0, 222, 223, - 68, 58, 59, 225, 61, 62, 63, 64, 0, 65, - 66, 0, 4, 5, 6, 0, 8, 0, 0, 0, - 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, - 258, 259, 17, 18, 226, 0, 0, 0, 0, 19, - 260, 261, 206, 207, 208, 209, 0, 0, 210, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 211, 212, - 213, 214, 35, 215, 216, 217, 218, 219, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 48, - 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, - 0, 0, 220, 0, 0, 221, 54, 55, 56, 0, - 0, 223, 224, 58, 59, 225, 61, 62, 63, 64, - 0, 65, 66, 0, 0, 0, 0, 68, 0, 0, - 0, 4, 5, 6, 0, 8, 0, 0, 0, 9, - 10, 0, 0, 0, 11, 0, 12, 13, 14, 258, - 259, 17, 18, 226, 0, 0, 0, 0, 19, 260, - 261, 206, 207, 208, 209, 0, 0, 210, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 211, 212, 213, - 214, 35, 215, 216, 217, 218, 219, 40, 41, 42, - 43, 44, 45, 46, 0, 0, 47, 0, 48, 49, + 0, 0, 0, 793, 793, 793, 793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, - 0, 220, 0, 0, 221, 54, 55, 56, 0, 707, - 223, 0, 58, 59, 225, 61, 62, 63, 64, 0, - 65, 66, 0, 0, 0, 0, 68, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, - 6, 0, 8, 0, 0, 226, 9, 10, 0, 0, - 0, 11, 0, 12, 13, 14, 258, 259, 17, 18, - 0, 0, 0, 0, 0, 19, 260, 261, 206, 207, - 208, 209, 0, 0, 210, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 211, 212, 213, 214, 35, 215, - 216, 217, 218, 219, 40, 41, 42, 43, 44, 45, - 46, 0, 0, 47, 0, 48, 49, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 50, 51, 0, 0, 0, 0, 0, 0, 220, 0, - 0, 221, 54, 55, 56, 0, 0, 223, 68, 58, - 59, 225, 61, 62, 63, 64, 0, 65, 66, 0, - 0, 0, 0, 0, 0, 0, 226, 4, 5, 6, - 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, - 11, 0, 12, 13, 14, 15, 16, 17, 18, 0, - 0, 0, 0, 0, 19, 20, 21, 206, 207, 208, - 209, 0, 0, 210, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 211, 212, 213, 214, 35, 215, 216, - 217, 218, 0, 40, 41, 42, 43, 44, 45, 46, - 0, 0, 47, 0, 48, 49, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 51, 0, 0, 0, 0, 0, 0, 220, 0, 68, - 221, 54, 55, 56, 0, 826, 0, 0, 58, 59, - 60, 61, 62, 63, 64, 0, 65, 66, 226, 4, - 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, - 0, 0, 11, 0, 12, 13, 14, 258, 259, 17, - 18, 0, 0, 0, 0, 0, 19, 260, 261, 206, - 207, 208, 209, 0, 0, 210, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 211, 212, 213, 214, 35, - 215, 216, 217, 218, 0, 40, 41, 42, 43, 44, - 45, 46, 0, 0, 47, 0, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 50, 51, 0, 0, 0, 0, 0, 0, 220, - 0, 68, 221, 54, 55, 56, 0, 826, 0, 0, - 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, - 4, 5, 6, 0, 8, 0, 226, 0, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 258, 259, - 17, 18, 0, 0, 0, 0, 0, 19, 260, 261, - 206, 207, 208, 209, 0, 0, 210, 0, 0, 0, - 0, 0, 0, 28, 0, 0, 211, 212, 213, 214, - 35, 215, 216, 217, 218, 0, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 220, 0, 0, 221, 54, 55, 56, 0, 980, 68, - 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, - 66, 0, 4, 5, 6, 0, 8, 0, 0, 806, - 9, 10, 0, 0, 0, 11, 806, 12, 13, 14, - 258, 259, 17, 18, 0, 0, 0, 0, 0, 19, - 260, 261, 206, 207, 208, 209, 0, 0, 210, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 211, 212, - 213, 214, 35, 215, 216, 217, 218, 0, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 48, - 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, - 0, 0, 220, 0, 0, 221, 54, 55, 56, 0, - 1092, 0, 806, 58, 59, 60, 61, 62, 63, 64, - 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 6, 0, 8, 0, 818, 0, 9, 10, - 0, 0, 0, 11, 0, 12, 13, 14, 258, 259, - 17, 18, 0, 0, 0, 0, 0, 19, 260, 261, - 206, 207, 208, 209, 0, 0, 210, 0, 0, 0, - 0, 0, 0, 28, 0, 0, 211, 212, 213, 214, - 35, 215, 216, 217, 218, 0, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 47, 0, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 220, 0, 0, 221, 54, 55, 56, 0, 1200, 818, - 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, - 66, 0, 0, 806, 806, 806, 0, 806, 226, 0, - 0, 806, 806, 0, 0, 0, 806, 0, 806, 806, - 806, 806, 806, 806, 806, 0, 0, 0, 0, 0, - 806, 806, 806, 806, 806, 806, 806, 0, 0, 806, - 0, 0, 0, 0, 0, 0, 806, 0, 0, 806, - 806, 806, 806, 806, 806, 806, 806, 806, 0, 806, - 806, 806, 806, 806, 806, 806, 0, 0, 806, 0, - 806, 806, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 806, 806, 0, 0, 0, - 0, 0, 0, 806, 0, 0, 806, 806, 806, 806, - 0, 68, 0, 0, 806, 806, 806, 806, 806, 806, - 806, 0, 806, 806, 0, 0, 0, 0, 0, 226, - 818, 818, 818, 0, 818, 0, 0, 0, 818, 818, - 0, 0, 0, 818, 0, 818, 818, 818, 818, 818, - 818, 818, 0, 0, 0, 0, 0, 818, 818, 818, - 818, 818, 818, 818, 0, 0, 818, 0, 0, 0, - 0, 0, 0, 818, 0, 0, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 0, 818, 818, 818, 818, - 818, 818, 818, 0, 0, 818, 0, 818, 818, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 818, 818, 0, 0, 0, 0, 0, 0, - 818, 0, 68, 818, 818, 818, 818, 0, 818, 0, - 0, 818, 818, 818, 818, 818, 818, 818, 0, 818, - 818, 67, 4, 5, 6, 0, 8, 0, 0, 0, - 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, - 258, 259, 17, 18, 0, 0, 0, 0, 0, 19, - 260, 261, 206, 207, 208, 209, 0, 0, 210, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 211, 212, - 213, 214, 35, 215, 216, 217, 218, 0, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 48, - 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, - 0, 0, 220, 0, 68, 221, 54, 55, 56, 0, - 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, - 0, 65, 66, 4, 5, 6, 0, 8, 806, 0, - 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, - 14, 15, 16, 17, 18, 0, 0, 0, 0, 0, - 19, 20, 21, 206, 207, 208, 209, 0, 0, 210, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 211, - 212, 213, 214, 35, 215, 216, 217, 218, 0, 40, - 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, - 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 0, 220, 0, 0, 221, 54, 55, 56, - 0, 806, 0, 0, 58, 59, 60, 61, 62, 63, - 64, 0, 65, 66, 0, 4, 5, 6, 0, 8, - 277, 0, 0, 9, 10, 0, 0, 0, 11, 0, - 12, 13, 14, 15, 16, 17, 18, 0, 0, 0, - 0, 0, 19, 20, 21, 206, 207, 208, 209, 0, - 0, 26, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 211, 212, 213, 214, 35, 215, 216, 217, 218, - 0, 40, 41, 42, 43, 44, 45, 46, 0, 0, - 47, 0, 48, 49, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, - 0, 0, 0, 0, 0, 220, 0, 0, 221, 54, - 55, 56, 0, 277, 0, 0, 58, 59, 60, 61, - 62, 63, 64, 0, 65, 66, 0, 0, 0, 0, - 0, 818, 806, 806, 806, 0, 806, 0, 0, 0, - 806, 806, 0, 0, 0, 806, 0, 806, 806, 806, - 806, 806, 806, 806, 0, 0, 0, 0, 0, 806, - 806, 806, 806, 806, 806, 806, 0, 0, 806, 0, - 0, 0, 0, 0, 0, 806, 0, 0, 806, 806, - 806, 806, 806, 806, 806, 806, 806, 0, 806, 806, - 806, 806, 806, 806, 806, 0, 0, 806, 0, 806, - 806, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 806, 806, 0, 0, 0, 0, - 0, 0, 806, 0, 818, 806, 806, 806, 806, 0, - 0, 0, 0, 806, 806, 806, 806, 806, 806, 806, - 0, 806, 806, 0, 277, 277, 277, 0, 277, 0, - 0, 0, 277, 277, 0, 0, 0, 277, 0, 277, - 277, 277, 277, 277, 277, 277, 0, 0, 0, 0, - 0, 277, 277, 277, 277, 277, 277, 277, 0, 0, - 277, 0, 0, 0, 0, 0, 0, 277, 0, 0, - 277, 277, 277, 277, 277, 277, 277, 277, 277, 0, - 277, 277, 277, 277, 277, 277, 277, 0, 0, 277, - 0, 277, 277, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 277, 277, 0, 0, - 0, 0, 0, 0, 277, 0, 0, 277, 277, 277, - 277, 1036, 0, 0, 0, 277, 277, 277, 277, 277, - 277, 277, 0, 277, 277, 818, 818, 818, 0, 818, - 0, 0, 0, 818, 818, 0, 0, 0, 818, 0, - 818, 818, 818, 818, 818, 818, 818, 0, 0, 0, - 0, 0, 818, 818, 818, 818, 818, 818, 818, 0, - 0, 818, 0, 0, 0, 0, 0, 0, 818, 0, - 0, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 0, 818, 818, 818, 818, 818, 818, 818, 0, 0, - 818, 0, 818, 818, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 818, 818, 0, - 0, 0, 0, 0, 0, 818, 0, 0, 818, 818, - 818, 818, 0, 0, 0, 0, 818, 818, 818, 818, - 818, 818, 818, 197, 818, 818, 0, 196, 191, 0, - 0, 0, 194, 192, 0, 193, 0, 195, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 188, 0, 187, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 190, 0, 199, 0, 0, 0, - 0, 0, 0, 0, 1018, 1019, 1020, 1021, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1022, 1023, 1024, 1025, 189, 0, 198, 1026, 0, 1027, - 40, 41, 42, 43, 44, 0, 197, 0, 0, 303, - 196, 191, 0, 563, 0, 194, 192, 0, 193, 0, - 195, 0, 0, 0, 0, 0, 1028, 1029, 0, 0, - 0, 0, 0, 188, 1030, 187, 0, 1031, 0, 1032, - 1033, 0, 1034, 567, 0, 58, 59, 1035, 61, 62, - 63, 64, 0, 65, 66, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 190, 0, 199, + 793, 793, 793, 0, 793, 798, 798, 798, 793, 793, + 0, 798, 798, 793, 798, 793, 793, 793, 793, 793, + 793, 793, 798, 798, 0, 0, 0, 793, 793, 793, + 793, 793, 793, 793, 798, 798, 793, 798, 798, 798, + 798, 798, 0, 793, 0, 0, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 0, 0, 798, 793, 798, 0, 793, + 793, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 793, 793, 0, 0, 798, 798, + 798, 798, 793, 0, 798, 793, 793, 793, 793, 0, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 0, 793, 793, 798, 0, 0, 0, 793, 793, 793, + 0, 793, 793, 793, 793, 793, 793, 0, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 0, 0, 0, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 0, + 793, 0, 0, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 0, 0, 793, 793, 793, 0, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 0, 0, 793, 793, 793, 793, 793, + 0, 793, 793, 793, 793, 793, 0, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 794, 793, 793, + 793, 0, 0, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 189, 0, 198, + 794, 0, 0, 0, 794, 794, 0, 794, 794, 794, + 794, 794, 794, 794, 794, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 794, 794, 151, 794, + 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 794, 0, + 0, 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 0, 0, 0, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 0, 0, 0, 0, 0, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 251, 0, - 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 0, 0, 179, 180, 0, 0, 0, - 0, 181, 182, 183, 184, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 185, 186, 0, 0, 59, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 0, 0, 1036, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 0, 0, 0, - 0, 0, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 0, 0, 169, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 0, 0, - 0, 0, 0, 0, 0, 0, 197, 0, 185, 186, - 196, 191, 59, 438, 0, 194, 192, 0, 193, 0, - 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 188, 0, 187, 0, 0, 0, 0, + 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, + 794, 794, 794, 794, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 794, 0, 0, + 0, 353, 353, 0, 794, 353, 353, 353, 133, 353, + 353, 353, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 353, 353, 152, 353, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 190, 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 353, 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 189, 0, 198, - 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, - 196, 191, 0, 0, 0, 194, 192, 0, 193, 0, - 195, 0, 0, 0, 0, 0, 0, 0, 0, 1018, - 1019, 1020, 1021, 188, 0, 187, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1022, 1023, 1024, 1025, 0, - 0, 0, 1026, 0, 0, 40, 41, 42, 43, 44, - 0, 0, 0, 0, 303, 0, 0, 190, 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1028, 1029, 0, 0, 0, 0, 0, 0, 1030, - 0, 0, 1031, 0, 1032, 1033, 0, 189, 0, 198, - 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 0, 0, 0, 0, 0, 0, 353, 353, + 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 794, 794, 794, 0, 794, 794, + 794, 794, 794, 794, 0, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 0, 0, + 0, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 0, 794, 0, 0, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 0, 0, 794, + 794, 794, 0, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 0, 0, 794, 794, 794, 794, 794, 0, 794, 794, + 794, 794, 794, 0, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 0, 794, 794, 794, 0, 0, + 0, 794, 794, 794, 0, 794, 353, 353, 353, 794, + 794, 0, 353, 353, 794, 353, 794, 794, 794, 794, + 794, 794, 794, 353, 0, 0, 0, 0, 794, 794, + 794, 794, 794, 794, 794, 353, 353, 794, 353, 353, + 353, 353, 353, 0, 794, 0, 0, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 0, 0, 353, 794, 353, 1098, + 794, 794, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 794, 794, 0, 0, 353, + 353, 353, 353, 794, 0, 353, 794, 794, 794, 794, + 0, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 353, 794, 794, 353, 0, 0, 0, 0, 0, + 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 794, 0, 0, 0, 353, 353, + 0, 794, 353, 353, 353, 353, 353, 353, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 0, 0, 0, 150, 151, 152, - 429, 430, 431, 432, 157, 158, 159, 0, 0, 0, - 0, 0, 160, 161, 162, 163, 433, 434, 435, 436, - 168, 415, 416, 437, 418, 0, 0, 305, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 185, 186, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 0, 0, 0, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 0, 0, 0, - 0, 0, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 313, 314, 169, 315, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 0, 0, - 0, 197, 0, 0, 0, 196, 191, 0, 185, 186, - 194, 192, 0, 193, 0, 195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, - 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 353, 353, 152, 353, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 190, 0, 199, 0, 0, 0, 0, 0, + 0, 0, 353, 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 6, 0, 8, 0, 0, 0, 9, 10, - 0, 0, 189, 11, 198, 12, 13, 14, 258, 259, - 17, 18, 0, 0, 665, 0, 0, 19, 260, 261, - 290, 291, 292, 293, 0, 0, 210, 0, 0, 0, - 0, 0, 0, 294, 0, 0, 295, 296, 297, 298, - 35, 299, 300, 301, 302, 0, 40, 41, 42, 43, - 44, 45, 46, 0, 0, 303, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 304, 0, 0, 221, 54, 55, 56, 0, 0, 0, - 0, 58, 59, 60, 61, 62, 63, 64, 197, 65, - 66, 0, 196, 191, 0, 245, 0, 194, 192, 0, - 193, 0, 195, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 188, 0, 187, 0, 0, - 0, 0, 0, 0, 0, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 190, - 0, 199, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 0, 0, 0, 0, 0, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 0, 0, 169, 189, - 0, 198, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 0, 0, 179, 180, 0, 0, 0, 0, 181, - 182, 183, 184, 0, 0, 0, 0, 4, 5, 6, - 0, 8, 0, 185, 186, 9, 10, 0, 0, 0, - 11, 0, 12, 13, 14, 258, 259, 17, 18, 0, - 0, 0, 0, 0, 19, 260, 261, 290, 291, 292, - 293, 0, 0, 210, 0, 0, 0, 0, 0, 0, - 294, 0, 0, 295, 296, 297, 298, 35, 299, 300, - 301, 302, 0, 40, 41, 42, 43, 44, 45, 46, - 0, 0, 303, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 304, 0, 0, - 221, 54, 55, 56, 0, 0, 0, 0, 58, 59, - 60, 61, 62, 63, 64, 0, 65, 66, 0, 0, - 0, 197, 0, 0, 0, 196, 191, 0, 245, 0, - 194, 192, 0, 193, 0, 195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, - 187, 637, 638, 0, 0, 639, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 0, 0, - 179, 180, 190, 0, 199, 0, 181, 182, 183, 184, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, - 185, 186, 0, 196, 191, 0, 245, 0, 194, 192, - 0, 193, 189, 195, 198, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 188, 0, 187, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, - 0, 0, 196, 191, 0, 245, 0, 194, 192, 0, - 193, 0, 195, 0, 0, 0, 0, 0, 0, 0, - 190, 0, 199, 0, 0, 188, 0, 187, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 197, 0, 0, - 0, 196, 191, 0, 245, 0, 194, 192, 0, 193, - 189, 195, 198, 0, 0, 0, 0, 0, 0, 190, - 0, 199, 0, 0, 188, 0, 187, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, - 196, 191, 0, 245, 0, 194, 192, 0, 193, 189, - 195, 198, 0, 0, 0, 0, 0, 0, 190, 0, - 199, 0, 0, 188, 0, 187, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 821, 0, + 0, 0, 0, 0, 0, 353, 353, 794, 821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 189, 0, - 198, 0, 0, 0, 0, 0, 197, 190, 0, 199, - 196, 191, 0, 245, 0, 194, 192, 0, 193, 0, - 195, 0, 0, 0, 646, 647, 0, 0, 648, 0, - 0, 0, 0, 188, 0, 187, 0, 189, 0, 198, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 0, 0, 179, 180, 0, 0, 0, 0, 181, - 182, 183, 184, 0, 0, 0, 0, 190, 0, 199, - 0, 0, 0, 185, 186, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 189, 0, 198, - 0, 0, 702, 638, 0, 0, 703, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 0, - 0, 179, 180, 0, 0, 0, 0, 181, 182, 183, - 184, 705, 647, 0, 0, 706, 0, 0, 0, 0, - 0, 185, 186, 0, 0, 0, 0, 0, 0, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 0, 0, - 179, 180, 0, 0, 0, 0, 181, 182, 183, 184, - 737, 638, 0, 0, 738, 0, 0, 0, 0, 0, - 185, 186, 0, 0, 0, 0, 0, 0, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 0, 0, 179, - 180, 0, 0, 0, 0, 181, 182, 183, 184, 740, - 647, 0, 0, 741, 0, 0, 0, 0, 0, 185, - 186, 0, 0, 0, 0, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 0, 0, - 0, 0, 0, 0, 0, 377, 372, 0, 185, 186, - 375, 373, 0, 374, 0, 376, 0, 0, 0, 843, - 638, 0, 0, 844, 0, 0, 0, 0, 369, 0, - 368, 367, 0, 0, 0, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 0, 0, - 0, 0, 371, 0, 0, 0, 197, 0, 185, 186, - 196, 191, 0, 245, 0, 194, 192, 0, 193, 0, - 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 370, 188, 0, 187, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 197, 0, 0, 0, 196, - 191, 0, 245, 0, 194, 192, 0, 193, 0, 195, - 0, 0, 0, 0, 0, 0, 0, 190, 0, 199, - 0, 0, 188, 0, 187, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 197, 0, 0, 0, 196, 191, - 0, 245, 0, 194, 192, 0, 193, 189, 195, 198, - 0, 0, 0, 0, 0, 0, 190, 0, 199, 0, - 0, 188, 0, 187, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 197, 0, 0, 0, 196, 191, 0, - 245, 0, 194, 192, 0, 193, 189, 195, 198, 0, - 0, 0, 0, 0, 0, 190, 0, 199, 0, 0, - 188, 0, 187, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 197, 0, 0, 0, 196, 191, 0, 245, - 0, 194, 192, 0, 193, 189, 195, 198, 0, 0, - 0, 0, 0, 0, 190, 0, 199, 0, 0, 188, - 0, 187, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 197, 0, 0, 0, 196, 191, 0, 245, 0, - 194, 192, 0, 193, 189, 195, 198, 0, 0, 0, - 0, 0, 0, 190, 0, 199, 0, 0, 188, 0, - 187, 0, 0, 0, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, - 0, 364, 365, 189, 0, 198, 0, 0, 0, 0, - 0, 0, 190, 0, 199, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 658, - 647, 0, 0, 659, 0, 0, 0, 0, 0, 0, - 0, 0, 189, 0, 198, 0, 0, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 0, 0, 179, 180, - 0, 0, 0, 0, 181, 182, 183, 184, 858, 638, - 0, 0, 859, 0, 0, 0, 0, 0, 185, 186, - 0, 0, 0, 0, 0, 0, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 0, 0, 179, 180, 0, - 0, 0, 0, 181, 182, 183, 184, 861, 647, 0, - 0, 862, 0, 0, 0, 0, 0, 185, 186, 0, - 0, 0, 0, 0, 0, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 0, 0, 179, 180, 0, 0, - 0, 0, 181, 182, 183, 184, 1086, 638, 0, 0, - 1087, 0, 0, 0, 0, 0, 185, 186, 0, 0, - 0, 0, 0, 0, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 0, 0, 179, 180, 0, 0, 0, - 0, 181, 182, 183, 184, 1089, 647, 0, 0, 1090, - 0, 0, 0, 0, 0, 185, 186, 0, 0, 0, - 0, 0, 0, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 0, 1036, 179, 180, 0, 0, 0, 0, - 181, 182, 183, 184, 1284, 638, 0, 0, 1285, 0, - 0, 0, 0, 0, 185, 186, 0, 0, 0, 0, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 0, 0, 179, 180, 0, 0, 0, 0, 181, - 182, 183, 184, 0, 0, 0, 0, 0, 0, 0, - 0, 197, 0, 185, 186, 196, 191, 0, 245, 0, - 194, 192, 0, 193, 0, 195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, - 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 197, 0, 0, 0, 196, 191, 0, 245, 0, 194, - 192, 0, 193, 0, 195, 0, 0, 0, 0, 0, - 0, 0, 190, 0, 199, 0, 0, 188, 0, 187, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, - 0, 0, 0, 196, 191, 0, 0, 0, 194, 192, - 0, 193, 189, 195, 198, 0, 0, 0, 0, 0, - 0, 190, 0, 199, 0, 0, 188, 0, 187, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 377, 372, - 0, 0, 0, 375, 373, 0, 374, 0, 376, 0, - 0, 189, 0, 198, 0, 0, 1018, 1019, 1020, 1021, - 190, 369, 199, 368, 367, 0, 0, 0, 0, 0, - 0, 0, 1022, 1023, 1024, 1025, 0, 0, 0, 1026, - 0, 0, 40, 41, 42, 43, 44, 0, 0, 0, - 189, 303, 198, 0, 0, 371, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1028, 1029, - 0, 0, 0, 0, 0, 0, 1030, 0, 0, 1031, - 0, 1032, 1033, 0, 1223, 370, 0, 58, 59, 60, - 61, 62, 63, 64, 0, 65, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1036, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 320, 1080, 1081, 1082, 1083, 0, 0, 0, 821, + 0, 0, 0, 0, 821, 0, 0, 0, 1084, 1085, + 1086, 1087, 0, 0, 0, 1088, 0, 821, 40, 41, + 42, 43, 44, 0, 0, 0, 0, 0, 306, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1090, 1091, 0, 0, + 0, 0, 0, 0, 1092, 0, 0, 1093, 0, 1094, + 1095, 0, 1096, 0, 0, 58, 59, 60, 61, 62, + 63, 64, 0, 65, 66, 0, 0, 0, 0, 0, + 0, 821, 0, 821, 320, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 794, 794, + 794, 0, 794, 353, 353, 353, 794, 794, 0, 353, + 353, 794, 353, 794, 794, 794, 794, 794, 794, 794, + 353, 0, 0, 0, 0, 794, 794, 794, 794, 794, + 794, 794, 353, 353, 794, 353, 353, 353, 353, 353, + 0, 794, 0, 0, 794, 794, 794, 794, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, + 794, 0, 0, 353, 794, 353, 0, 794, 794, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 794, 794, 0, 0, 353, 353, 353, 353, + 794, 0, 353, 794, 794, 794, 794, 0, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, 0, 794, + 794, 353, 0, 0, 0, 320, 320, 320, 0, 320, + 821, 821, 821, 320, 320, 821, 821, 821, 320, 821, + 320, 320, 320, 320, 320, 320, 320, 821, 821, 821, + 0, 0, 320, 320, 320, 320, 320, 320, 320, 821, + 821, 320, 821, 821, 821, 821, 821, 0, 320, 0, + 0, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 0, 0, + 821, 320, 821, 0, 320, 320, 0, 0, 0, 0, + 0, 0, 388, 0, 0, 0, 0, 0, 0, 320, + 320, 0, 388, 0, 0, 821, 821, 320, 0, 0, + 320, 320, 320, 320, 0, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 0, 320, 320, 821, 388, + 388, 0, 0, 388, 388, 388, 388, 388, 388, 388, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 388, 388, 0, 388, 388, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 389, 388, 0, 388, 388, 0, 0, 0, + 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 388, 388, 0, 389, + 389, 0, 0, 389, 389, 389, 389, 389, 389, 389, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 389, 389, 0, 389, 389, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 389, 0, 389, 389, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 389, 389, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 357, 357, 0, 0, 357, 357, 357, + 357, 357, 357, 357, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 357, 357, 0, 357, 357, + 0, 0, 0, 0, 388, 388, 388, 0, 0, 388, + 388, 388, 0, 388, 0, 0, 0, 0, 0, 0, + 0, 388, 0, 388, 388, 0, 0, 357, 0, 357, + 357, 0, 0, 388, 388, 0, 388, 388, 388, 388, + 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 357, 0, 0, 388, 0, 388, 0, 0, 0, + 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, + 388, 388, 388, 0, 0, 0, 0, 388, 388, 388, + 388, 0, 0, 388, 389, 389, 389, 0, 388, 389, + 389, 389, 0, 389, 0, 0, 0, 0, 0, 0, + 0, 389, 388, 389, 389, 0, 0, 0, 0, 0, + 0, 0, 0, 389, 389, 0, 389, 389, 389, 389, + 389, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 389, 0, 389, 0, 0, 0, + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 0, 0, 0, 0, 389, 389, 389, + 389, 0, 0, 389, 0, 0, 0, 0, 389, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 357, 357, + 357, 0, 389, 357, 357, 357, 0, 357, 0, 0, + 0, 0, 0, 0, 0, 357, 0, 357, 357, 0, + 0, 0, 0, 0, 0, 0, 0, 357, 357, 0, + 357, 357, 357, 357, 357, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 496, 0, 0, 0, 0, 0, 357, 0, + 357, 0, 496, 0, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 0, 0, 0, + 0, 357, 357, 357, 357, 0, 0, 357, 0, 496, + 496, 0, 357, 496, 496, 496, 129, 496, 496, 496, + 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, + 0, 496, 496, 148, 496, 496, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 496, 496, 0, 496, 0, 0, 0, + 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 496, 496, 496, 0, 0, + 0, 496, 496, 0, 0, 496, 496, 496, 496, 496, + 496, 496, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 496, 496, 148, 496, 496, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 687, 496, 0, 0, 496, 0, + 0, 0, 0, 0, 687, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 496, 496, 496, + 0, 687, 687, 0, 0, 687, 687, 687, 123, 687, + 687, 687, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 687, 687, 142, 687, 687, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 496, 496, 496, 0, 0, 0, + 496, 496, 0, 496, 0, 687, 0, 0, 687, 0, + 0, 496, 496, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 496, 496, 0, 496, 496, 496, 496, + 496, 0, 0, 0, 0, 0, 0, 0, 687, 687, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 496, 0, 496, 0, 0, 0, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 0, 0, 0, 0, 496, 496, 496, + 496, 0, 0, 496, 0, 0, 496, 496, 496, 0, + 0, 0, 496, 496, 0, 496, 0, 0, 0, 0, + 0, 0, 496, 496, 496, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 496, 496, 0, 496, 496, + 496, 496, 496, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 496, 0, 496, 0, + 0, 0, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 0, 0, 0, 0, 496, + 496, 496, 496, 0, 0, 496, 687, 687, 687, 0, + 0, 0, 687, 687, 0, 687, 0, 0, 0, 0, + 0, 0, 0, 687, 496, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 687, 687, 0, 687, 687, + 687, 687, 687, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 686, + 0, 0, 0, 0, 0, 0, 687, 0, 687, 686, + 0, 0, 687, 687, 687, 687, 687, 687, 687, 687, + 687, 687, 687, 687, 687, 0, 0, 0, 0, 687, + 687, 687, 687, 0, 699, 687, 686, 686, 0, 0, + 686, 686, 686, 122, 686, 686, 686, 0, 0, 0, + 0, 0, 0, 0, 687, 0, 0, 0, 686, 686, + 141, 686, 686, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 688, + 686, 0, 0, 686, 0, 0, 0, 0, 0, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 686, 686, 0, 688, 688, 0, 0, + 688, 688, 688, 124, 688, 688, 688, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 688, 688, + 143, 688, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1287, 647, 0, 0, 1288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 0, 0, 179, 180, 0, 0, 0, 0, 181, - 182, 183, 184, 1341, 638, 0, 0, 1342, 0, 0, - 0, 0, 0, 185, 186, 0, 0, 0, 0, 0, - 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 0, 0, 179, 180, 0, 0, 0, 0, 181, 182, - 183, 184, 658, 647, 0, 0, 659, 0, 0, 0, - 0, 0, 185, 186, 0, 0, 0, 0, 0, 0, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 949, - 0, 179, 180, 0, 0, 0, 0, 181, 182, 183, - 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 185, 186, 0, 0, 0, 0, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 1018, 1019, 1020, 1021, 364, 365, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1022, 1023, 1024, 1025, - 0, 0, 0, 1026, 0, 0, 40, 41, 42, 43, - 44, 0, 0, 0, 0, 303, 0, 0, 0, 0, + 688, 689, 0, 688, 0, 0, 0, 0, 0, 0, + 0, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1028, 1029, 0, 0, 0, 0, 0, 0, - 1030, 0, 0, 1031, 0, 1032, 1033, 0, 1034, 0, - 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, - 66, 4, 5, 6, 0, 8, 0, 0, 0, 9, - 10, 0, 0, 0, 11, 0, 12, 13, 14, 258, - 259, 17, 18, 0, 0, 0, 0, 0, 19, 260, - 261, 290, 291, 292, 293, 0, 0, 210, 0, 0, - 0, 0, 0, 0, 294, 0, 0, 295, 296, 297, - 298, 35, 299, 300, 301, 302, 0, 40, 41, 42, - 43, 44, 45, 46, 0, 0, 303, 0, 0, 0, + 0, 0, 0, 688, 688, 0, 0, 0, 689, 689, + 0, 0, 689, 689, 689, 125, 689, 689, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 689, 689, 144, 689, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 304, 0, 0, 402, 54, 55, 56, 0, 403, - 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, - 65, 66, 4, 5, 6, 0, 8, 0, 0, 0, - 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, - 258, 259, 17, 18, 0, 0, 0, 0, 0, 19, - 260, 261, 407, 408, 409, 410, 0, 0, 210, 0, - 0, 0, 0, 0, 0, 294, 0, 0, 411, 412, - 413, 414, 35, 415, 416, 417, 418, 0, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 303, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 419, 0, - 0, 0, 420, 0, 0, 221, 54, 55, 56, 0, - 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, - 0, 65, 66, 4, 5, 6, 0, 8, 0, 0, - 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, - 14, 258, 259, 17, 18, 0, 0, 0, 0, 0, - 19, 260, 261, 446, 447, 448, 449, 0, 0, 210, - 0, 0, 0, 0, 0, 0, 294, 0, 0, 450, - 451, 452, 453, 35, 454, 455, 456, 457, 0, 40, - 41, 42, 43, 44, 45, 46, 0, 0, 303, 0, + 0, 686, 686, 686, 0, 0, 0, 686, 686, 0, + 686, 0, 689, 0, 0, 689, 0, 0, 686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 686, 686, 0, 686, 686, 686, 686, 686, 0, 0, + 0, 0, 0, 0, 0, 689, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 458, 0, 0, 53, 54, 55, 56, - 0, 57, 0, 0, 58, 59, 60, 61, 62, 63, - 64, 0, 65, 66, 4, 5, 6, 0, 8, 0, - 0, 0, 9, 10, 0, 0, 0, 11, 0, 12, - 13, 14, 258, 259, 17, 18, 0, 0, 0, 0, - 0, 19, 260, 261, 407, 408, 409, 410, 0, 0, - 210, 0, 0, 0, 0, 0, 0, 294, 0, 0, - 411, 412, 413, 414, 35, 415, 416, 417, 418, 0, - 40, 41, 42, 43, 44, 45, 46, 0, 0, 303, + 0, 686, 0, 686, 0, 0, 0, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 0, 0, 0, 0, 686, 686, 686, 686, 0, 698, + 686, 688, 688, 688, 0, 0, 0, 688, 688, 0, + 688, 0, 0, 0, 0, 0, 0, 0, 688, 686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 688, 688, 0, 688, 688, 688, 688, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 420, 0, 0, 221, 54, 55, - 56, 0, 0, 0, 0, 58, 59, 60, 61, 62, - 63, 64, 0, 65, 66, 4, 5, 6, 0, 8, - 0, 0, 0, 9, 10, 0, 0, 0, 11, 0, - 12, 13, 14, 258, 259, 17, 18, 0, 0, 0, - 0, 0, 19, 260, 261, 290, 291, 292, 293, 0, - 0, 210, 0, 0, 0, 0, 0, 0, 294, 0, - 0, 295, 296, 297, 298, 35, 299, 300, 301, 302, - 0, 40, 41, 42, 43, 44, 45, 46, 0, 0, - 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 304, 0, 0, 402, 54, - 55, 56, 0, 0, 0, 0, 58, 59, 60, 61, - 62, 63, 64, 0, 65, 66, 4, 5, 6, 0, - 8, 0, 0, 0, 9, 10, 0, 0, 0, 11, - 0, 12, 13, 14, 258, 259, 17, 18, 0, 0, - 0, 0, 0, 19, 260, 261, 1122, 1123, 1124, 1125, - 0, 0, 210, 0, 0, 0, 0, 0, 0, 294, - 0, 0, 1126, 1127, 1128, 1129, 35, 1130, 1131, 1132, - 1133, 0, 40, 41, 42, 43, 44, 45, 46, 0, - 0, 303, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1134, 0, 0, 221, - 54, 55, 56, 0, 0, 0, 0, 58, 59, 60, - 61, 62, 63, 64, 0, 65, 66, 4, 5, 6, - 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, - 11, 0, 12, 13, 14, 258, 259, 17, 18, 0, - 0, 0, 0, 0, 19, 260, 261, 407, 408, 409, - 410, 0, 0, 210, 0, 0, 0, 0, 0, 0, - 294, 0, 0, 411, 412, 413, 1262, 35, 415, 416, - 1263, 418, 0, 40, 41, 42, 43, 44, 45, 46, - 0, 0, 303, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1264, 0, 0, - 221, 54, 55, 56, 0, 0, 0, 0, 58, 59, - 60, 61, 62, 63, 64, 0, 65, 66, + 0, 688, 0, 688, 0, 0, 0, 688, 688, 688, + 688, 688, 688, 688, 688, 688, 688, 688, 688, 688, + 0, 0, 0, 0, 688, 688, 688, 688, 0, 700, + 688, 0, 0, 689, 689, 689, 0, 0, 0, 689, + 689, 0, 689, 0, 0, 0, 0, 0, 0, 688, + 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 689, 689, 0, 689, 689, 689, 689, 689, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, + 0, 0, 0, 689, 0, 689, 691, 0, 0, 689, + 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, + 689, 689, 0, 0, 0, 0, 689, 689, 689, 689, + 0, 701, 689, 691, 691, 0, 0, 691, 691, 691, + 127, 691, 691, 691, 0, 0, 0, 0, 0, 0, + 0, 689, 0, 0, 0, 691, 691, 146, 691, 691, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 690, 691, 0, 0, + 691, 0, 0, 0, 0, 0, 690, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 691, 691, 0, 690, 690, 0, 0, 690, 690, 690, + 126, 690, 690, 690, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 690, 690, 145, 690, 690, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 690, 692, 0, + 690, 0, 0, 0, 0, 0, 0, 0, 692, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 690, 690, 0, 0, 0, 692, 692, 0, 0, 692, + 692, 692, 128, 692, 692, 692, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 692, 692, 147, + 692, 692, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 691, 691, + 691, 0, 0, 0, 691, 691, 0, 691, 0, 692, + 0, 0, 692, 0, 0, 691, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 691, 691, 0, + 691, 691, 691, 691, 691, 0, 0, 0, 0, 0, + 0, 0, 692, 692, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, + 691, 0, 0, 0, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 0, 0, 0, + 0, 691, 691, 691, 691, 0, 703, 691, 690, 690, + 690, 0, 0, 0, 690, 690, 0, 690, 0, 0, + 0, 0, 0, 0, 0, 690, 691, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 690, 690, 0, + 690, 690, 690, 690, 690, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 690, 0, + 690, 0, 0, 0, 690, 690, 690, 690, 690, 690, + 690, 690, 690, 690, 690, 690, 690, 0, 0, 0, + 0, 690, 690, 690, 690, 0, 702, 690, 0, 0, + 692, 692, 692, 0, 0, 0, 692, 692, 0, 692, + 0, 0, 0, 0, 0, 0, 690, 692, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 692, + 692, 0, 692, 692, 692, 692, 692, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 683, 0, 0, 0, 0, 0, 0, + 692, 0, 692, 683, 0, 0, 692, 692, 692, 692, + 692, 692, 692, 692, 692, 692, 692, 692, 692, 0, + 0, 0, 0, 692, 692, 692, 692, 0, 704, 692, + 683, 683, 0, 0, 683, 683, 683, 119, 683, 683, + 683, 0, 0, 0, 0, 0, 0, 0, 692, 0, + 0, 0, 683, 683, 138, 683, 683, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 682, 683, 0, 0, 683, 0, 0, + 0, 0, 0, 682, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 683, 683, 0, + 682, 682, 0, 0, 682, 682, 682, 118, 682, 682, + 682, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 682, 682, 137, 682, 682, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 682, 685, 0, 682, 0, 0, + 0, 0, 0, 0, 0, 685, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 682, 682, 0, + 0, 0, 685, 685, 0, 0, 685, 685, 685, 121, + 685, 685, 685, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 685, 685, 140, 685, 685, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 683, 683, 683, 0, 0, + 0, 683, 683, 0, 683, 0, 685, 0, 0, 685, + 0, 0, 683, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 683, 683, 0, 683, 683, 683, + 683, 683, 0, 0, 0, 0, 0, 0, 0, 685, + 685, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 683, 0, 683, 0, 0, + 0, 683, 683, 683, 683, 683, 683, 683, 683, 683, + 683, 683, 683, 683, 0, 0, 0, 0, 683, 683, + 683, 683, 0, 695, 683, 682, 682, 682, 0, 0, + 0, 682, 682, 0, 682, 0, 0, 0, 0, 0, + 0, 0, 682, 683, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 682, 682, 0, 682, 682, 682, + 682, 682, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 682, 0, 682, 0, 0, + 0, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 0, 0, 0, 0, 682, 682, + 682, 682, 0, 694, 682, 0, 0, 685, 685, 685, + 0, 0, 0, 685, 685, 0, 685, 0, 0, 0, + 0, 0, 0, 682, 685, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 685, 685, 0, 685, + 685, 685, 685, 685, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 346, 0, 0, 0, 0, 0, 0, 685, 0, 685, + 346, 0, 0, 685, 685, 685, 685, 685, 685, 685, + 685, 685, 685, 685, 685, 685, 0, 0, 0, 0, + 685, 685, 685, 685, 0, 697, 685, 346, 346, 0, + 0, 346, 346, 346, 135, 346, 346, 346, 0, 0, + 0, 0, 0, 0, 0, 685, 0, 0, 0, 346, + 346, 154, 346, 346, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 354, 346, 0, 0, 346, 0, 0, 0, 0, 0, + 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 346, 346, 0, 354, 354, 0, + 0, 354, 354, 354, 134, 354, 354, 354, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, + 354, 153, 354, 354, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 354, 346, 0, 354, 0, 0, 0, 0, 0, + 0, 0, 346, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 354, 354, 0, 0, 0, 346, + 346, 0, 0, 346, 346, 346, 346, 346, 346, 346, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 346, 346, 154, 346, 346, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 346, 346, 346, 0, 0, 0, 346, 346, + 0, 346, 0, 346, 0, 0, 346, 0, 0, 346, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 346, 346, 0, 346, 346, 346, 346, 346, 0, + 0, 0, 0, 0, 0, 0, 346, 346, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 346, 0, 346, 0, 0, 0, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 0, 0, 0, 0, 346, 346, 346, 346, 0, + 792, 346, 354, 354, 354, 0, 0, 0, 354, 354, + 792, 354, 0, 0, 0, 0, 0, 0, 0, 354, + 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 354, 354, 0, 354, 354, 354, 354, 354, 0, + 0, 792, 0, 0, 792, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 792, + 0, 0, 354, 0, 354, 0, 0, 0, 354, 354, + 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + 354, 0, 0, 0, 0, 354, 354, 354, 354, 0, + 0, 354, 0, 792, 346, 346, 346, 0, 326, 0, + 346, 346, 0, 346, 0, 0, 0, 0, 326, 0, + 354, 346, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 346, 346, 792, 346, 346, 346, 346, + 346, 0, 0, 0, 0, 0, 0, 0, 0, 326, + 0, 0, 326, 0, 0, 328, 0, 0, 0, 0, + 0, 0, 0, 0, 346, 328, 346, 326, 0, 0, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 0, 0, 0, 0, 346, 346, 346, + 346, 0, 0, 346, 581, 0, 328, 0, 0, 328, + 0, 326, 0, 0, 581, 0, 0, 0, 0, 0, + 0, 0, 346, 0, 328, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 326, 0, 581, 0, 0, 581, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, + 0, 0, 0, 581, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 792, 792, 792, 0, 0, 792, 792, 792, + 328, 792, 0, 0, 0, 0, 0, 581, 0, 792, + 0, 792, 792, 0, 0, 0, 0, 0, 0, 0, + 0, 792, 792, 588, 792, 792, 792, 792, 792, 0, + 0, 0, 0, 588, 0, 0, 0, 0, 581, 581, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 792, 0, 792, 0, 0, 0, 0, 0, + 0, 0, 584, 0, 588, 0, 0, 588, 0, 0, + 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 588, 0, 0, 0, 792, 0, 0, 0, + 326, 326, 326, 0, 0, 326, 326, 326, 0, 326, + 792, 0, 0, 584, 0, 0, 584, 326, 0, 326, + 326, 0, 0, 0, 0, 0, 588, 0, 0, 326, + 326, 584, 326, 326, 326, 326, 326, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 328, 328, 328, + 0, 0, 328, 328, 328, 0, 328, 588, 588, 0, + 326, 0, 326, 0, 328, 584, 328, 328, 0, 0, + 0, 0, 0, 0, 0, 0, 328, 328, 0, 328, + 328, 328, 328, 328, 0, 0, 581, 581, 581, 0, + 0, 581, 581, 581, 326, 581, 584, 584, 0, 0, + 0, 0, 0, 581, 0, 581, 0, 328, 326, 328, + 0, 0, 0, 585, 0, 581, 581, 0, 581, 581, + 581, 581, 581, 585, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 328, 0, 0, 0, 0, 581, 0, 581, 0, + 0, 0, 0, 0, 585, 328, 0, 585, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 585, 0, 0, 581, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 581, 588, 588, 588, 0, 0, + 588, 588, 588, 0, 588, 0, 585, 0, 0, 0, + 0, 0, 588, 0, 588, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 588, 588, 0, 588, 588, 588, + 588, 588, 528, 0, 584, 584, 584, 585, 585, 584, + 584, 584, 528, 584, 0, 0, 0, 0, 0, 0, + 0, 584, 0, 584, 0, 588, 0, 588, 0, 0, + 0, 0, 0, 584, 584, 0, 584, 584, 584, 584, + 584, 562, 0, 528, 0, 0, 528, 0, 0, 0, + 0, 562, 0, 0, 588, 0, 0, 0, 0, 0, + 0, 528, 0, 0, 584, 0, 584, 0, 0, 0, + 0, 0, 0, 588, 0, 0, 0, 0, 0, 573, + 0, 0, 562, 0, 0, 562, 0, 0, 0, 573, + 0, 0, 0, 584, 0, 528, 0, 0, 0, 0, + 562, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, + 573, 0, 0, 573, 0, 0, 550, 528, 0, 0, + 0, 0, 0, 0, 562, 0, 550, 0, 573, 0, + 0, 0, 0, 0, 0, 585, 585, 585, 0, 0, + 585, 585, 585, 0, 585, 0, 0, 0, 0, 0, + 0, 0, 585, 0, 585, 0, 562, 550, 0, 0, + 565, 0, 573, 0, 585, 585, 0, 585, 585, 585, + 585, 585, 0, 0, 0, 550, 0, 0, 0, 572, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 572, + 0, 0, 0, 0, 573, 585, 0, 585, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 550, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 572, 0, 0, 572, 585, 0, 565, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 565, 0, 572, 0, + 0, 550, 0, 585, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 528, 528, 528, 0, 0, 528, + 528, 528, 0, 528, 0, 553, 0, 565, 0, 0, + 565, 528, 572, 528, 0, 553, 0, 0, 0, 0, + 0, 0, 0, 528, 528, 565, 528, 528, 528, 528, + 528, 0, 0, 562, 562, 562, 0, 0, 562, 562, + 562, 0, 562, 0, 572, 0, 553, 0, 0, 0, + 562, 0, 562, 0, 528, 0, 528, 0, 0, 565, + 0, 0, 562, 562, 553, 562, 562, 562, 562, 562, + 0, 573, 573, 573, 0, 0, 573, 573, 573, 0, + 573, 0, 0, 528, 0, 0, 0, 0, 573, 0, + 573, 565, 0, 562, 0, 562, 0, 0, 553, 559, + 573, 573, 528, 573, 573, 573, 573, 573, 0, 559, + 0, 0, 0, 0, 0, 0, 0, 0, 550, 550, + 550, 0, 0, 550, 550, 550, 0, 550, 0, 0, + 553, 573, 0, 573, 0, 550, 0, 550, 0, 0, + 559, 562, 0, 0, 0, 0, 0, 550, 550, 0, + 550, 550, 550, 550, 550, 0, 0, 0, 559, 0, + 0, 0, 554, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 554, 0, 0, 0, 0, 0, 550, 573, + 550, 572, 572, 572, 0, 0, 572, 572, 572, 0, + 572, 0, 559, 0, 0, 0, 0, 0, 572, 0, + 572, 0, 0, 554, 0, 0, 0, 0, 0, 0, + 572, 572, 79, 572, 572, 572, 572, 572, 0, 0, + 0, 554, 79, 0, 559, 0, 550, 0, 565, 565, + 565, 0, 0, 565, 565, 565, 0, 565, 0, 0, + 0, 572, 0, 572, 0, 565, 0, 565, 0, 0, + 0, 0, 0, 79, 0, 554, 0, 565, 565, 0, + 565, 565, 565, 565, 565, 0, 0, 553, 553, 553, + 0, 79, 553, 553, 553, 81, 553, 0, 0, 0, + 0, 0, 0, 0, 553, 81, 553, 554, 565, 572, + 565, 0, 0, 0, 0, 0, 553, 553, 0, 553, + 553, 553, 553, 553, 0, 0, 0, 0, 0, 0, + 0, 0, 82, 0, 0, 0, 81, 0, 0, 0, + 0, 0, 82, 0, 0, 0, 0, 553, 0, 553, + 0, 0, 0, 0, 81, 0, 565, 79, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, + 0, 559, 559, 559, 0, 0, 559, 559, 559, 0, + 559, 82, 0, 0, 0, 553, 0, 0, 559, 0, + 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 559, 559, 0, 559, 559, 559, 559, 559, 0, 0, + 81, 0, 0, 0, 520, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, + 0, 559, 0, 559, 554, 554, 554, 0, 0, 554, + 554, 554, 0, 554, 0, 0, 0, 82, 0, 0, + 0, 554, 0, 554, 0, 520, 0, 0, 0, 0, + 0, 0, 0, 554, 554, 0, 554, 554, 554, 554, + 554, 0, 0, 520, 0, 0, 0, 0, 0, 559, + 0, 0, 0, 0, 79, 79, 79, 0, 0, 79, + 79, 79, 0, 79, 554, 0, 554, 0, 0, 521, + 0, 79, 0, 79, 0, 0, 0, 0, 0, 521, + 0, 0, 0, 79, 79, 0, 79, 79, 79, 79, + 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 520, + 521, 0, 554, 0, 79, 0, 79, 81, 81, 81, + 0, 0, 81, 81, 81, 0, 81, 0, 521, 0, + 0, 0, 0, 558, 81, 0, 81, 0, 0, 0, + 0, 0, 0, 558, 0, 0, 81, 81, 0, 81, + 81, 81, 81, 81, 82, 82, 82, 0, 0, 82, + 82, 82, 79, 82, 0, 0, 0, 0, 0, 0, + 0, 82, 0, 82, 558, 0, 0, 81, 0, 81, + 0, 0, 0, 82, 82, 559, 82, 82, 82, 82, + 82, 0, 558, 0, 521, 559, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 82, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 81, 559, 69, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 0, 0, 559, 0, 520, 520, 520, 0, + 0, 520, 520, 520, 0, 520, 0, 0, 558, 0, + 0, 0, 82, 520, 0, 520, 0, 0, 69, 0, + 0, 0, 0, 0, 0, 520, 520, 0, 520, 520, + 520, 520, 520, 0, 0, 0, 69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 520, 0, 520, 0, + 559, 0, 333, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, + 0, 521, 521, 521, 0, 0, 521, 521, 521, 0, + 521, 0, 0, 0, 0, 0, 0, 0, 521, 30, + 521, 0, 69, 333, 520, 0, 326, 0, 0, 30, + 521, 521, 55, 521, 521, 521, 521, 521, 0, 0, + 0, 333, 55, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 521, 0, 521, 0, 558, 558, 558, 0, 0, + 558, 558, 558, 55, 558, 0, 0, 0, 30, 0, + 0, 0, 558, 0, 558, 0, 0, 0, 0, 0, + 0, 55, 0, 0, 558, 558, 0, 558, 558, 558, + 558, 558, 0, 0, 51, 0, 0, 333, 0, 521, + 0, 0, 0, 0, 51, 0, 0, 559, 559, 559, + 0, 0, 559, 559, 559, 558, 559, 558, 0, 0, + 0, 0, 0, 0, 559, 0, 559, 0, 0, 0, + 0, 0, 0, 0, 30, 51, 559, 559, 0, 559, + 559, 559, 559, 559, 0, 0, 0, 55, 0, 69, + 69, 69, 0, 51, 69, 69, 69, 0, 69, 0, + 0, 0, 52, 558, 0, 0, 0, 559, 69, 559, + 0, 0, 52, 0, 0, 0, 0, 0, 69, 69, + 0, 69, 69, 69, 69, 69, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 52, 57, 0, 0, 0, 0, 69, + 0, 69, 0, 0, 57, 559, 0, 0, 0, 51, + 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 333, 333, 333, 0, 0, 0, + 333, 333, 0, 333, 0, 57, 0, 0, 0, 0, + 0, 333, 0, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 0, 57, 0, 0, 333, 333, 333, 333, + 333, 30, 30, 30, 0, 0, 0, 30, 30, 0, + 30, 0, 41, 0, 55, 55, 55, 52, 30, 0, + 55, 55, 41, 55, 333, 0, 333, 0, 0, 0, + 0, 55, 56, 30, 30, 30, 30, 30, 0, 0, + 0, 0, 56, 0, 0, 0, 55, 55, 55, 55, + 55, 0, 0, 41, 0, 0, 0, 0, 0, 57, + 0, 30, 0, 30, 0, 0, 0, 0, 0, 0, + 0, 41, 333, 56, 55, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 51, 51, 0, + 0, 56, 51, 51, 0, 51, 0, 0, 0, 0, + 0, 0, 0, 51, 0, 0, 0, 0, 0, 30, + 0, 0, 0, 0, 0, 0, 0, 0, 51, 51, + 51, 51, 55, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 0, 51, 0, + 0, 0, 0, 0, 52, 52, 52, 56, 0, 0, + 52, 52, 0, 52, 0, 0, 0, 0, 0, 0, + 0, 52, 0, 0, 0, 0, 155, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 52, 52, 52, 52, + 0, 0, 0, 0, 51, 0, 57, 57, 57, 155, + 0, 0, 57, 57, 0, 57, 793, 0, 0, 0, + 0, 0, 681, 57, 52, 0, 52, 0, 0, 0, + 0, 0, 0, 0, 0, 155, 155, 0, 57, 57, + 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 57, 681, 57, 0, + 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 41, 41, 41, 0, 0, 0, + 41, 41, 0, 41, 0, 0, 0, 0, 0, 793, + 0, 41, 155, 0, 56, 56, 56, 0, 0, 0, + 56, 56, 156, 56, 57, 0, 41, 41, 41, 41, + 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 156, 56, 56, 56, 56, + 0, 0, 794, 0, 41, 0, 41, 0, 684, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 156, 156, 0, 56, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 41, 684, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 794, 0, 0, 156, 0, + 0, 0, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 0, 0, 155, 155, 0, 155, 155, + 155, 155, 155, 155, 155, 0, 793, 0, 0, 0, + 155, 155, 155, 155, 155, 155, 155, 0, 0, 155, + 0, 0, 0, 0, 0, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 0, 155, + 155, 155, 155, 155, 155, 155, 0, 0, 155, 155, + 0, 0, 155, 155, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 155, 155, 0, + 0, 0, 0, 681, 681, 155, 0, 0, 155, 155, + 155, 155, 0, 155, 0, 0, 155, 155, 155, 155, + 155, 155, 155, 0, 155, 155, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 0, + 0, 156, 156, 0, 156, 156, 156, 156, 156, 156, + 156, 0, 794, 0, 0, 0, 156, 156, 156, 156, + 156, 156, 156, 0, 0, 156, 0, 0, 0, 0, + 0, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 0, 156, 156, 156, 156, 156, + 156, 156, 0, 0, 156, 156, 0, 0, 156, 156, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 156, 156, 0, 155, 0, 0, 684, + 684, 156, 0, 0, 156, 156, 156, 156, 0, 156, + 0, 0, 156, 156, 156, 156, 156, 156, 156, 155, + 156, 156, 0, 0, 0, 0, 793, 0, 0, 0, + 0, 0, 798, 0, 0, 0, 1103, 1103, 0, 0, + 0, 0, 0, 0, 0, 155, 155, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 798, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1103, 1103, 0, 0, 1103, 0, 798, + 156, 0, 155, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, + 794, 1103, 0, 0, 0, 0, 353, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, + 156, 0, 1103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1103, 0, 0, 0, 1103, 0, 0, 0, 0, 0, + 0, 353, 0, 0, 0, 0, 0, 1103, 1103, 1103, + 1103, 0, 0, 0, 1103, 1103, 0, 1103, 0, 0, + 0, 403, 398, 0, 0, 0, 401, 399, 0, 400, + 0, 402, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 0, 0, 0, 395, 0, 394, 393, 0, 0, + 0, 0, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 0, 0, 155, 155, 0, 155, 155, + 155, 155, 155, 155, 155, 0, 798, 0, 397, 0, + 155, 155, 155, 155, 155, 155, 155, 0, 0, 155, + 0, 0, 0, 0, 0, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 396, 155, + 155, 155, 155, 155, 155, 155, 0, 0, 155, 155, + 0, 0, 155, 155, 0, 1103, 0, 0, 1103, 0, + 0, 0, 0, 0, 0, 0, 1103, 155, 155, 0, + 0, 0, 0, 798, 798, 155, 0, 0, 155, 155, + 155, 155, 0, 155, 0, 0, 155, 155, 155, 155, + 155, 155, 155, 0, 155, 155, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 0, 0, 156, + 156, 0, 156, 156, 156, 156, 156, 156, 156, 0, + 0, 0, 0, 1103, 156, 156, 156, 156, 156, 156, + 156, 0, 0, 156, 0, 0, 0, 0, 0, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 0, 156, 156, 156, 156, 156, 156, 156, + 0, 0, 156, 156, 0, 0, 156, 156, 0, 0, + 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, + 0, 156, 156, 0, 0, 0, 0, 353, 353, 156, + 0, 0, 156, 156, 156, 156, 0, 156, 156, 0, + 156, 156, 156, 156, 156, 156, 156, 0, 156, 156, + 0, 354, 954, 0, 1104, 1104, 0, 0, 0, 0, + 0, 0, 0, 0, 156, 156, 1105, 1105, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 0, 354, 0, 0, 390, + 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1104, 1104, 0, 0, 1104, 0, 0, 0, 414, + 0, 156, 0, 1105, 1105, 0, 0, 1105, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 414, 0, 0, 0, 0, 0, 0, 1104, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1105, 0, 0, 0, 0, 0, 0, 414, 0, + 1104, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1105, 0, 0, 0, 0, 0, 1104, 0, + 0, 0, 1104, 0, 0, 0, 0, 0, 0, 0, + 1105, 0, 0, 0, 1105, 1104, 1104, 1104, 1104, 0, + 0, 0, 1104, 1104, 0, 1104, 0, 1105, 1105, 1105, + 1105, 0, 0, 0, 1105, 1105, 0, 1105, 0, 0, + 0, 0, 0, 0, 0, 414, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 0, 0, 156, 156, 0, 156, 156, 156, + 156, 156, 156, 156, 0, 0, 0, 0, 0, 156, + 156, 156, 156, 156, 156, 156, 0, 0, 156, 0, + 0, 0, 0, 0, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 0, 156, 156, + 156, 156, 156, 156, 156, 0, 0, 156, 156, 0, + 0, 156, 156, 1104, 0, 0, 1104, 0, 0, 0, + 0, 0, 0, 0, 1104, 1105, 156, 156, 1105, 0, + 0, 0, 354, 354, 156, 0, 1105, 156, 156, 156, + 156, 0, 156, 0, 0, 156, 156, 156, 156, 156, + 156, 156, 0, 156, 156, 414, 414, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 0, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 414, 414, 0, + 0, 1104, 0, 414, 414, 414, 414, 414, 414, 414, + 0, 0, 414, 1105, 0, 0, 713, 0, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, + 414, 0, 414, 414, 414, 414, 414, 414, 414, 713, + 0, 414, 414, 0, 0, 414, 414, 0, 0, 0, + 0, 0, 1106, 1106, 0, 0, 0, 0, 0, 0, + 414, 414, 0, 0, 0, 713, 0, 710, 414, 0, + 0, 414, 414, 414, 414, 0, 414, 0, 0, 414, + 414, 414, 414, 414, 414, 414, 0, 414, 414, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1106, + 1106, 0, 0, 1106, 0, 0, 0, 0, 0, 0, + 709, 0, 713, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 709, 0, 0, 0, 1106, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1106, 709, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1106, 0, 0, 0, + 1106, 0, 0, 0, 252, 0, 0, 0, 0, 0, + 0, 0, 0, 1106, 1106, 1106, 1106, 0, 0, 0, + 1106, 1106, 0, 1106, 0, 0, 0, 0, 0, 0, + 0, 403, 398, 0, 0, 0, 401, 399, 0, 400, + 0, 402, 0, 0, 0, 0, 709, 0, 0, 0, + 0, 0, 0, 0, 395, 0, 394, 393, 0, 0, + 0, 0, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 0, }; } - private static final short[] yyCheck1() { - return new short[] { + private static final int[] yyTable4() { + return new int[] { - 2, 123, 124, 59, 420, 336, 60, 15, 16, 388, - 67, 109, 53, 485, 21, 21, 237, 7, 27, 96, - 95, 2, 3, 467, 87, 102, 587, 7, 387, 57, - 763, 390, 765, 245, 15, 16, 575, 27, 121, 398, - 579, 335, 870, 57, 763, 2, 3, 27, 320, 321, - 767, 767, 330, 55, 56, 10, 528, 335, 3, 10, - 123, 44, 38, 119, 765, 15, 16, 44, 87, 59, - 1204, 284, 53, 54, 330, 288, 57, 46, 10, 335, - 481, 109, 84, 85, 485, 936, 67, 115, 116, 47, - 97, 97, 85, 123, 122, 426, 866, 54, 15, 16, - 479, 10, 10, 272, 59, 55, 114, 53, 10, 40, - 565, 123, 46, 288, 10, 1163, 903, 541, 10, 478, - 663, 480, 657, 0, 40, 10, 661, 662, 109, 119, - 1251, 306, 905, 114, 115, 116, 44, 118, 55, 56, - 283, 122, 123, 124, 320, 41, 0, 59, 44, 41, - 59, 59, 44, 44, 513, 232, 41, 59, 32, 44, - 539, 46, 10, 59, 114, 61, 41, 59, 248, 37, - 61, 225, 291, 292, 42, 91, 61, 37, 38, 47, - 221, 540, 42, 43, 59, 45, 263, 47, 1322, 365, - 32, 1070, 123, 41, 1028, 1029, 10, 114, 118, 279, - 10, 281, 312, 123, 124, 40, 91, 305, 40, 85, - 10, 274, 124, 61, 1335, 256, 326, 283, 935, 936, - 10, 343, 344, 345, 346, 227, 228, 41, 371, 10, - 44, 272, 309, 402, 242, 228, 244, 245, 123, 10, - 221, 665, 785, 245, 274, 59, 356, 719, 125, 59, - 360, 1102, 254, 10, 261, 274, 1304, 264, 674, 59, - 41, 242, 10, 244, 245, 10, 999, 248, 280, 250, - 320, 125, 10, 254, 10, 256, 497, 305, 59, 10, - 767, 553, 657, 555, 1003, 10, 661, 774, 59, 270, - 10, 272, 242, 41, 244, 245, 675, 254, 999, 46, - 755, 756, 1181, 41, 10, 371, 123, 10, 38, 40, - 124, 59, 691, 270, 307, 365, 717, 676, 719, 44, - 123, 59, 444, 306, 305, 242, 272, 244, 248, 1116, - 250, 1165, 1166, 692, 59, 41, 93, 1070, 44, 59, - 291, 292, 1115, 124, 91, 303, 677, 46, 93, 280, - 331, 227, 228, 59, 915, 336, 59, 93, 267, 267, - 341, 402, 343, 344, 345, 346, 347, 348, 349, 908, - 909, 910, 349, 912, 1202, 403, 345, 346, 917, 281, - 388, 357, 459, 390, 341, 1102, 388, 283, 279, 403, - 347, 283, 91, 395, 279, 280, 341, 399, 400, 401, - 390, 464, 443, 804, 445, 940, 941, 388, 398, 489, - 945, 946, 346, 368, 32, 839, 496, 349, 124, 499, - 500, 402, 403, 343, 344, 345, 346, 271, 348, 349, - 346, 279, 1202, 32, 464, 279, 1153, 517, 419, 10, - 349, 349, 522, 541, 310, 426, 320, 41, 903, 743, - 905, 10, 10, 1170, 1171, 1172, 402, 267, 326, 704, - 345, 346, 443, 444, 445, 743, 326, 267, 41, 283, - 10, 479, 10, 480, 360, 371, 748, 479, 320, 371, - 752, 1032, 484, 343, 344, 487, 488, 743, 59, 710, - 480, 46, 572, 264, 739, 369, 370, 506, 479, 419, - 59, 59, 283, 32, 0, 717, 513, 763, 46, 765, - 46, 842, 514, 541, 10, 1343, 506, 989, 1251, 59, - 1253, 59, 735, 513, 444, 10, 506, 369, 370, 32, - 124, 539, 595, 540, 1253, 283, 91, 539, 982, 520, - 1257, 1257, 267, 93, 1079, 283, 269, 267, 271, 40, - 540, 124, 46, 91, 125, 91, 1091, 371, 539, 269, - 541, 935, 936, 59, 481, 940, 941, 665, 1012, 279, - 945, 946, 306, 952, 59, 125, 310, 283, 1117, 1118, - 1119, 1120, 312, 1070, 664, 26, 594, 28, 989, 597, - 371, 593, 951, 887, 953, 46, 326, 91, 345, 346, - 657, 846, 1335, 10, 661, 662, 663, 524, 282, 887, - 693, 10, 1331, 594, 1030, 860, 597, 61, 288, 1170, - 1171, 1182, 10, 371, 687, 46, 356, 357, 1189, 125, - 961, 887, 46, 371, 641, 641, 306, 665, 736, 680, - 91, 10, 10, 650, 650, 44, 345, 346, 650, 10, - 348, 10, 59, 660, 660, 696, 1100, 263, 660, 880, - 1115, 1116, 60, 269, 62, 371, 56, 675, 348, 676, - 91, 59, 41, 675, 10, 44, 657, 91, 10, 759, - 661, 662, 663, 691, 665, 692, 676, 37, 697, 691, - 41, 59, 42, 43, 675, 45, 677, 47, 59, 680, - 59, 682, 692, 10, 1079, 41, 264, 697, 736, 41, - 691, 269, 662, 663, 10, 696, 10, 697, 10, 841, - 10, 728, 729, 263, 264, 61, 1292, 729, 1102, 267, - 271, 1297, 61, 268, 269, 38, 124, 44, 279, 816, - 1071, 839, 723, 999, 1283, 41, 44, 822, 310, 41, - 44, 1167, 1313, 37, 1198, 736, 124, 10, 42, 43, - 1326, 45, 682, 47, 1251, 124, 1253, 15, 16, 59, - 1257, 851, 306, 1260, 125, 320, 310, 840, 44, 264, - 1111, 783, 10, 785, 269, 46, 10, 1032, 41, 40, - 345, 346, 10, 349, 279, 44, 852, 93, 800, 801, - 717, 881, 882, 723, 348, 807, 808, 345, 346, 345, - 346, 839, 40, 44, 1070, 348, 44, 41, 46, 61, - 365, 901, 863, 10, 369, 370, 2, 3, 46, 219, - 91, 59, 222, 223, 224, 785, 10, 61, 1217, 15, - 16, 59, 40, 1088, 1331, 326, 1333, 849, 1335, 971, - 1337, 345, 346, 294, 41, 10, 326, 1163, 839, 1218, - 841, 842, 852, 91, 1170, 1171, 114, 41, 870, 1356, - 348, 873, 874, 91, 876, 877, 10, 53, 54, 41, - 125, 93, 863, 940, 941, 926, 41, 804, 945, 946, - 125, 67, 337, 338, 345, 346, 124, 310, 1153, 962, - 1145, 1146, 657, 264, 59, 123, 661, 41, 269, 10, - 271, 262, 263, 264, 41, 1170, 1171, 268, 269, 93, - 271, 841, 44, 1168, 345, 346, 928, 61, 279, 970, - 10, 345, 346, 331, 332, 61, 938, 939, 114, 354, - 41, 943, 118, 279, 952, 926, 953, 123, 124, 61, - 952, 10, 954, 323, 10, 10, 711, 0, 713, 940, - 941, 41, 320, 953, 945, 946, 10, 10, 1009, 950, - 125, 952, 262, 263, 264, 730, 326, 44, 959, 269, - 961, 1035, 41, 1011, 986, 41, 41, 765, 10, 970, - 971, 769, 93, 950, 242, 1251, 244, 1253, 125, 1244, - 1245, 1246, 959, 306, 59, 308, 309, 310, 311, 312, - 596, 369, 370, 10, 372, 59, 59, 368, 60, 41, - 10, 310, 1079, 326, 279, 40, 10, 803, 1009, 44, - 1011, 46, 10, 1074, 1091, 811, 59, 340, 1160, 10, - 61, 1286, 326, 61, 41, 221, 632, 350, 38, 267, - 636, 971, 42, 356, 357, 279, 41, 41, 1135, 343, - 344, 44, 280, 41, 61, 1106, 242, 312, 244, 245, - 44, 1112, 248, 1114, 250, 46, 91, 125, 254, 1335, - 256, 326, 44, 61, 345, 346, 125, 477, 59, 1169, - 1071, 481, 678, 1074, 270, 485, 272, 1138, 1079, 44, - 686, 46, 688, 294, 295, 10, 44, 262, 263, 264, - 1091, 356, 10, 268, 269, 360, 271, 345, 346, 1121, - 91, 44, 10, 44, 279, 1106, 44, 345, 346, 44, - 1111, 1112, 264, 1114, 524, 262, 263, 264, 528, 44, - 1220, 268, 269, 41, 271, 279, 91, 306, 1270, 1271, - 306, 10, 279, 41, 59, 331, 1197, 1138, 10, 1187, - 336, 1241, 1242, 1243, 10, 341, 308, 343, 344, 345, - 346, 347, 348, 349, 1228, 262, 318, 319, 123, 1160, - 348, 622, 41, 2, 3, 940, 941, 348, 10, 41, - 945, 946, 306, 307, 584, 41, 15, 16, 0, 44, - 1202, 125, 61, 44, 645, 348, 1187, 59, 10, 1217, - 348, 1218, 388, 368, 10, 1217, 1197, 1219, 267, 124, - 264, 999, 44, 1001, 268, 269, 402, 1005, 1218, 984, - 985, 271, 987, 988, 53, 54, 1217, 59, 1266, 41, - 1160, 368, 44, 419, 279, 41, 10, 32, 67, 348, - 426, 10, 263, 264, 399, 400, 401, 59, 269, 348, - 32, 847, 320, 704, 279, 61, 1268, 443, 444, 445, - 348, 348, 662, 663, 44, 10, 44, 41, 1319, 865, - 44, 40, 868, 61, 298, 1266, 298, 46, 348, 1270, - 1271, 58, 1070, 93, 10, 114, 267, 61, 739, 118, - 59, 279, 124, 479, 123, 124, 41, 365, 698, 125, - 298, 369, 370, 61, 372, 44, 306, 707, 308, 309, - 310, 311, 312, 125, 1079, 41, 61, 717, 298, 719, - 345, 346, 91, 269, 279, 280, 326, 10, 1319, 484, - 348, 1343, 487, 488, 520, 61, 44, 44, 44, 0, - 1270, 1271, 44, 1108, 320, 321, 44, 306, 349, 10, - 350, 124, 10, 539, 123, 355, 356, 357, 41, 514, - 44, 306, 46, 44, 345, 346, 44, 963, 10, 124, - 44, 967, 772, 313, 314, 315, 316, 44, 61, 975, - 41, 44, 978, 44, 320, 785, 44, 983, 41, 10, - 345, 346, 221, 369, 370, 846, 38, 59, 59, 320, - 42, 59, 263, 61, 804, 1147, 10, 91, 594, 860, - 279, 597, 349, 242, 310, 244, 245, 59, 44, 248, - 125, 250, 1210, 44, 306, 254, 826, 256, 44, 365, - 44, 1173, 44, 369, 370, 124, 40, 44, 59, 125, - 41, 270, 46, 272, 365, 44, 368, 46, 369, 370, - 262, 263, 264, 44, 44, 59, 268, 269, 44, 271, - 124, 310, 44, 1251, 125, 44, 124, 279, 44, 869, - 10, 657, 1260, 279, 44, 661, 662, 663, 320, 44, - 2, 3, 294, 295, 296, 297, 298, 91, 44, 675, - 44, 677, 91, 320, 680, 93, 682, 125, 267, 1095, - 40, 41, 331, 124, 44, 691, 46, 336, 41, 271, - 696, 280, 341, 93, 343, 344, 345, 346, 347, 348, - 349, 61, 320, 365, 40, 125, 93, 369, 370, 320, - 372, 53, 54, 58, 279, 57, 93, 723, 365, 10, - 271, 992, 369, 370, 264, 1333, 70, 1335, 125, 1337, - 1292, 91, 555, 279, 116, 1297, 368, 852, 958, 388, - 254, 1268, 1304, 516, 520, 1219, 660, 365, 1356, 1121, - 1070, 369, 370, 402, 365, 46, 345, 346, 369, 370, - 980, 1032, 1033, 119, 1326, 1253, 763, 109, 59, 989, - 419, 10, 755, 115, 116, 279, 279, 426, 903, 939, - 122, 262, 263, 264, 1346, 767, 1257, 268, 269, 1205, - 271, 1322, 652, 385, 443, 444, 445, 823, 279, 1070, - 91, 306, 41, 308, 309, 310, 311, 122, 1343, 1164, - 291, 292, 1162, 294, 295, 296, 297, 1088, 2, 3, - 59, 1172, 98, 1172, 783, 800, 801, 1229, 308, 309, - 479, 311, 807, 808, 1188, 841, 842, -1, 318, 319, - -1, 345, 346, 267, 306, 350, 308, 309, 310, 311, - 312, 294, 295, 296, 297, 298, 306, 863, 308, 309, - 279, 311, -1, -1, 326, -1, -1, -1, 349, 53, - 54, 520, 1092, 57, 1145, 1146, -1, -1, 340, 221, - 10, -1, -1, -1, -1, 1105, 125, 368, 350, -1, - 539, -1, -1, 355, 356, 357, -1, 1168, 873, 874, - 350, 876, 877, 306, -1, 308, 309, 310, 311, -1, - 1181, -1, 254, -1, 256, -1, 46, -1, -1, 279, - 926, 345, 346, -1, -1, 109, 345, 346, 270, 59, - 272, 115, 116, -1, 940, 941, -1, -1, 122, 945, - 946, 0, -1, -1, 950, 594, 952, 350, 597, -1, - -1, 10, 355, 959, -1, 961, -1, -1, 1229, -1, - -1, 91, -1, 305, 970, 971, -1, -1, 943, -1, - -1, 10, -1, 1244, 1245, 1246, 267, -1, -1, 954, - 1200, -1, 41, -1, -1, 345, 346, -1, 306, 331, - 308, 309, 310, 311, 336, -1, -1, -1, -1, 341, - 59, -1, -1, 1009, -1, 347, 1277, 46, 657, 10, - -1, 986, 661, 662, 663, 1286, -1, 935, 936, -1, - 59, -1, -1, 262, 263, 264, 675, -1, 677, 268, - 269, 680, 271, 682, -1, -1, -1, 221, -1, 40, - 279, -1, 691, 44, -1, 46, 10, 696, -1, 44, - -1, 46, 91, -1, 345, 346, -1, -1, 59, -1, - 402, 403, -1, 10, -1, 1071, 125, -1, 1074, -1, - 254, -1, 256, 1079, 723, -1, 40, -1, -1, -1, - 44, -1, 46, -1, 426, 1091, 270, -1, 272, -1, - 91, -1, -1, 40, -1, 59, 91, 44, -1, 46, - 1106, 443, -1, 445, -1, 1111, 1112, -1, 1114, -1, - 1028, 1029, 59, 10, 1032, 306, -1, 308, 309, 310, - 311, 305, 123, 124, -1, -1, -1, 91, -1, 368, - 40, -1, 1138, -1, 44, -1, 46, 267, -1, -1, - -1, 38, -1, -1, 91, 42, -1, 331, 1066, 10, - -1, -1, 336, -1, 1160, -1, -1, 341, -1, 123, - 124, -1, 59, 347, 61, -1, -1, -1, -1, 2, - 3, -1, -1, -1, -1, -1, 123, 124, 520, 40, - 41, 91, -1, 44, 1102, 46, -1, -1, -1, -1, - -1, 1197, 841, 842, -1, -1, -1, -1, -1, 541, - 61, -1, -1, 262, 263, 264, -1, 10, 267, 268, - 269, 1217, 271, 123, 863, 345, 346, -1, 402, 403, - 53, 54, 281, -1, 57, 1143, -1, -1, 267, 1147, - 91, -1, 291, 292, -1, 294, 295, 296, 297, 298, - -1, -1, 426, 46, -1, 1163, 1164, 1165, 1166, -1, - 10, -1, 1170, 1171, -1, 1173, 59, -1, -1, 443, - -1, 445, 123, -1, 1270, 1271, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 109, 926, 10, 280, - 40, -1, 115, 116, 279, -1, 46, -1, 91, 122, - 10, 940, 941, -1, 10, -1, 945, 946, -1, 59, - -1, 950, -1, 952, 2, 3, 345, 346, -1, 368, - 959, -1, 961, 1319, 46, 657, 280, -1, -1, 661, - 662, 970, 971, 665, -1, -1, 46, 59, -1, -1, - 46, 91, -1, 280, -1, 677, 520, -1, 680, 59, - -1, -1, -1, 59, 345, 346, -1, -1, -1, -1, - 345, 346, 935, 936, 696, 53, 54, 541, -1, 91, - 1009, -1, -1, 123, -1, -1, -1, -1, -1, 279, - 280, 91, -1, -1, 1292, 91, -1, -1, -1, 1297, - -1, 345, 346, -1, -1, -1, 1304, -1, 221, -1, - -1, -1, -1, -1, 736, 10, 40, 0, 345, 346, - 44, -1, 46, 745, 44, -1, 46, 10, 1326, 306, - -1, 308, 309, 310, 311, 312, -1, -1, 279, 280, - -1, 254, 1071, 256, 122, 1074, -1, -1, 1346, 326, - 1079, 46, -1, -1, -1, 345, 346, 270, 41, 272, - -1, 44, 1091, 340, 59, 1028, 1029, 91, -1, 1032, - -1, 91, -1, 350, -1, -1, 59, 1106, 355, 356, - 357, -1, 1111, 1112, 267, 1114, -1, -1, -1, -1, - -1, -1, 305, 657, -1, -1, 91, 661, 662, 123, - -1, 665, 10, 1066, 345, 346, -1, -1, -1, 1138, - 93, -1, 44, 677, 46, 40, 680, 839, 331, 44, - 842, 46, -1, 336, -1, -1, -1, 267, 341, -1, - -1, 1160, 696, -1, 347, -1, 0, -1, 46, 1102, - 280, 863, 125, 221, -1, -1, 10, -1, 40, -1, - -1, 59, 44, -1, 46, 267, -1, -1, -1, 91, - -1, -1, 345, 346, -1, -1, 91, 267, 1197, -1, - -1, 267, 736, -1, -1, -1, 254, 41, 256, -1, - 1143, -1, -1, 91, 1147, -1, -1, -1, 1217, 402, - 403, -1, 270, -1, 272, 59, -1, -1, 123, 91, - 1163, 1164, 1165, 1166, 926, 345, 346, 1170, 1171, -1, - 1173, -1, -1, 426, -1, 44, -1, 46, 940, 941, - -1, -1, -1, 945, 946, -1, -1, -1, 950, -1, - 443, 123, 445, 345, 346, -1, -1, 959, -1, 961, - -1, 1270, 1271, 935, 936, 345, 346, -1, 970, 345, - 346, 2, 3, 331, -1, 279, 280, 10, 336, 279, - -1, 125, 91, 341, -1, -1, -1, -1, -1, 347, - -1, 44, 267, 46, -1, 839, -1, -1, 842, 262, - 263, 264, -1, -1, 267, 268, 269, 1009, 271, 1011, - 1319, -1, -1, 46, -1, -1, 279, -1, 281, 863, - -1, -1, 53, 54, -1, -1, 59, 520, 291, 292, - -1, 294, 295, 296, 297, 298, -1, -1, 91, -1, - -1, 345, 346, -1, 402, 345, 346, -1, 541, 1292, - -1, 935, 936, -1, 1297, -1, 1028, 1029, 91, -1, - 1032, 1304, -1, -1, -1, -1, -1, 279, 426, 1071, - 345, 346, 1074, -1, 279, 280, -1, 1079, -1, 267, - -1, -1, 926, 1326, -1, 443, 349, 445, 0, 1091, - -1, 44, -1, 46, 1066, -1, 940, 941, 10, -1, - -1, 945, 946, 1346, 1106, 368, 950, 279, 280, 1111, - 1112, -1, 1114, -1, -1, 959, -1, 961, 262, 263, - 264, -1, -1, 267, 268, 269, 970, 271, -1, 41, - 1102, -1, 44, 345, 346, 279, 1138, 281, 91, -1, - 345, 346, -1, -1, 1028, 1029, -1, 59, 1032, -1, - 294, 295, 296, 297, 298, -1, -1, 345, 346, -1, - -1, -1, 520, -1, 657, 1009, -1, 1011, 661, 662, - 279, 1143, 665, 345, 346, 1147, -1, -1, -1, -1, - -1, 93, 1066, -1, 677, 1187, 44, 680, 46, -1, - 221, 1163, 1164, 1165, 1166, 1197, -1, -1, 1170, 1171, - -1, 1173, -1, 696, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, 10, -1, -1, -1, 1102, -1, - -1, 10, -1, 254, 368, 256, 279, 1071, -1, -1, - 1074, -1, -1, 91, 267, 1079, 345, 346, -1, 270, - 10, 272, -1, 736, -1, 41, -1, 1091, 44, -1, - 46, 40, 41, -1, -1, 44, -1, 46, -1, 1143, - 10, -1, 1106, 1147, 1266, 61, -1, 1111, 1112, -1, - 1114, 41, 61, -1, 44, -1, 46, -1, -1, 1163, - 1164, 1165, 1166, -1, -1, -1, 1170, 1171, -1, 1173, - 40, 61, 345, 346, 1138, 91, 46, 10, -1, 657, - 331, -1, 91, 661, 662, 336, -1, 935, 936, 59, - 341, -1, 345, 346, -1, -1, 347, 1319, -1, 677, - 1292, 91, 680, -1, -1, 1297, 279, 40, 41, -1, - -1, 44, 1304, 46, 123, -1, -1, -1, 696, -1, - -1, 91, 44, 1187, 46, -1, 839, -1, 61, 842, - 262, 263, 264, 1197, 1326, 267, 268, 269, -1, 271, - 10, -1, -1, -1, -1, -1, -1, 279, -1, 281, - 863, 402, -1, 123, 1346, -1, -1, -1, 91, 291, - 292, -1, 294, 295, 296, 297, 298, -1, 44, 91, - 46, 41, 345, 346, 44, 426, 46, -1, -1, -1, - 1028, 1029, -1, -1, 1032, -1, -1, -1, 1292, -1, - 123, 61, 443, 1297, 445, 10, -1, -1, -1, 40, - 1304, 279, 1266, 44, -1, 46, -1, -1, -1, -1, - -1, -1, -1, 926, -1, 91, -1, 349, 1066, -1, - -1, 91, 1326, -1, -1, 40, -1, 940, 941, -1, - 10, 46, 945, 946, -1, -1, 368, 950, -1, -1, - -1, -1, 1346, -1, 59, -1, 959, 44, 961, 46, - 91, -1, -1, -1, 1102, 1319, -1, 970, -1, -1, - 40, -1, -1, 279, 842, -1, 46, 345, 346, 520, - 279, 280, -1, 10, -1, -1, 91, -1, -1, 59, - -1, -1, 123, -1, -1, 863, -1, -1, -1, 279, - -1, 935, 936, 0, 91, 1143, 1009, 267, 1011, 1147, - -1, -1, -1, 10, 41, -1, -1, 44, 123, 46, - 280, 91, -1, -1, -1, 1163, 1164, 1165, 1166, -1, - -1, -1, 1170, 1171, 61, 1173, -1, -1, -1, 345, - 346, -1, -1, -1, 41, -1, 345, 346, -1, -1, - -1, -1, -1, 123, -1, -1, 279, 280, 926, -1, - -1, -1, 59, -1, 91, 345, 346, 279, 1071, -1, - -1, 1074, 940, 941, -1, -1, 1079, 945, 946, -1, - -1, -1, 950, -1, -1, 345, 346, -1, 1091, -1, - -1, 959, -1, 961, 1028, 1029, -1, -1, 1032, -1, - -1, -1, 970, 1106, -1, -1, -1, -1, 1111, 1112, - -1, 1114, -1, 279, -1, -1, 657, 15, 16, 279, - 661, 662, 345, 346, 935, 936, -1, -1, 125, -1, - -1, -1, 1066, 345, 346, 1138, 677, -1, -1, 680, - -1, 1009, -1, 1011, -1, -1, -1, 10, 279, 280, - 48, 49, 50, 51, 1292, 696, -1, 55, 56, 1297, - -1, -1, 267, -1, -1, -1, 1304, -1, 1102, 67, - 68, -1, -1, -1, -1, 280, -1, 40, 41, 345, - 346, 44, -1, 46, 1187, 345, 346, -1, 1326, -1, - -1, -1, 279, -1, 1197, -1, -1, 267, 61, -1, - -1, -1, -1, 1071, -1, -1, 1074, -1, 1346, 1143, - 280, 1079, -1, 1147, 345, 346, 114, 1028, 1029, -1, - -1, 1032, -1, 1091, -1, -1, -1, -1, 91, 1163, - 1164, 1165, 1166, -1, 38, -1, 1170, 1171, 1106, 1173, - 345, 346, -1, 1111, 1112, -1, 1114, -1, -1, -1, - -1, -1, 279, -1, -1, 1066, 10, -1, 345, 346, - 123, -1, -1, 1266, -1, 262, 263, 264, -1, -1, - 1138, 268, 269, -1, 271, 345, 346, -1, -1, -1, - -1, -1, 279, 935, 936, -1, 40, 41, -1, -1, - 44, 1102, 46, -1, -1, -1, -1, 294, 295, 296, - 297, 842, -1, -1, -1, -1, -1, 61, -1, -1, - -1, -1, -1, -1, -1, -1, 1319, -1, 345, 346, - -1, 219, 863, -1, 222, 223, 224, -1, 226, 1197, - -1, -1, 1143, -1, -1, -1, 1147, 91, -1, -1, - -1, -1, -1, -1, 242, -1, 244, 245, -1, -1, - -1, -1, 1163, 1164, 1165, 1166, -1, -1, 1292, 1170, - 1171, -1, 1173, 1297, 1070, -1, -1, -1, -1, 123, - 1304, 368, -1, -1, -1, -1, 1028, 1029, -1, -1, - 1032, -1, -1, -1, -1, 926, -1, -1, -1, -1, - 10, -1, 1326, -1, -1, -1, -1, -1, -1, 940, - 941, -1, -1, -1, 945, 946, -1, -1, -1, 950, - -1, -1, 1346, -1, 1066, -1, 279, 280, 959, -1, - 961, 41, -1, -1, 44, -1, 46, -1, -1, 970, - -1, -1, -1, -1, -1, 935, 936, -1, -1, -1, - -1, 61, -1, -1, -1, -1, -1, 935, 936, -1, - 1102, 1319, -1, 351, 352, 353, 354, 355, -1, -1, - 358, 359, 360, 361, 362, 363, 364, 365, 1009, 367, - -1, 91, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 1292, 345, 346, -1, -1, 1297, -1, -1, -1, - 388, 1143, -1, 1304, -1, 1147, 394, -1, -1, -1, - -1, -1, 306, -1, 308, 309, 310, 311, 312, -1, - -1, 1163, 1164, 1165, 1166, 1326, -1, -1, 1170, 1171, - -1, 1173, 326, -1, -1, 279, 280, -1, 1028, 1029, - 1071, -1, 1032, 1074, -1, 1346, -1, -1, 1079, -1, - -1, -1, -1, -1, 1032, 1251, 350, 1253, -1, -1, - 1091, 1257, 356, 357, 1260, -1, -1, 1070, -1, -1, - -1, -1, -1, -1, -1, 1106, 1066, -1, -1, -1, - 1111, 1112, -1, 1114, -1, -1, 0, -1, 1066, 477, - -1, 479, -1, 481, -1, -1, 10, 485, -1, -1, - -1, 345, 346, -1, -1, 493, -1, 1138, 0, -1, - 1180, -1, 1102, -1, -1, 1185, -1, -1, 10, -1, - 508, -1, -1, 511, 1102, -1, -1, 41, -1, -1, - -1, -1, -1, -1, -1, 1331, 524, 1333, -1, 1335, - 528, 1337, -1, -1, -1, 59, -1, -1, -1, 41, - 1292, 539, 44, 1143, -1, 1297, -1, 1147, -1, -1, - 1356, 0, 1304, -1, -1, 1143, 1197, 59, -1, 279, - -1, 10, -1, 1163, 1164, 1165, 1166, -1, -1, -1, - 1170, 1171, -1, 1173, 1326, 1163, -1, -1, -1, -1, - -1, 10, 1170, 1171, -1, 10, 584, -1, -1, 38, - -1, 93, 41, -1, 1346, 44, 594, -1, -1, 597, - -1, 125, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, 41, 62, 63, 44, 41, 46, -1, 44, - -1, 46, 10, 125, -1, 345, 346, 1307, 1308, 1309, - 1310, -1, 61, -1, 1314, -1, 61, -1, 1251, -1, - 1253, -1, -1, -1, 93, 94, -1, 1260, -1, -1, - -1, -1, -1, 41, -1, -1, 44, -1, 46, 657, - -1, -1, 91, 661, 662, 663, 91, 1347, 1348, 1349, - 1350, -1, -1, 61, -1, 124, 125, 675, 1319, 1359, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1292, 691, -1, -1, -1, 1297, -1, -1, - 698, 699, 700, 91, 1304, -1, -1, -1, -1, 707, - -1, -1, -1, 711, -1, 713, 714, -1, 1331, 717, - 1333, 719, 1335, -1, 1337, -1, 1326, -1, -1, -1, - -1, -1, 730, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 1356, 268, 269, 1346, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, -1, -1, -1, - 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - 294, 295, 296, 297, 772, -1, 0, 279, -1, 281, - 282, -1, -1, -1, -1, -1, 10, 785, -1, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 804, -1, -1, -1, - -1, -1, -1, 262, 263, 264, -1, 41, 267, 268, - 269, -1, 271, -1, -1, -1, 10, -1, 826, -1, - 279, -1, 281, 282, 283, 59, -1, -1, -1, -1, - -1, -1, 291, 292, 368, 294, 295, 296, 297, 298, - 279, -1, 354, -1, 279, -1, -1, 41, -1, -1, - 44, -1, 46, -1, -1, -1, 368, -1, -1, 93, - -1, 869, -1, -1, -1, -1, -1, 61, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, 279, -1, -1, 343, 344, -1, -1, -1, -1, - 349, 125, -1, -1, -1, 354, -1, 91, -1, -1, - -1, -1, -1, -1, -1, -1, 345, 346, -1, 368, - 345, 346, 371, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 931, 932, 933, 934, -1, -1, 937, - -1, -1, 940, 941, 10, -1, -1, 945, 946, -1, - -1, 949, -1, -1, 952, -1, -1, 345, 346, 0, - 958, -1, -1, -1, -1, -1, -1, -1, -1, 10, - -1, -1, -1, -1, -1, 41, -1, -1, 44, -1, - 46, -1, 980, -1, -1, -1, 984, 985, -1, 987, - 988, 989, 33, -1, -1, 61, 37, 38, -1, 40, - 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, - 61, 62, 63, -1, -1, 91, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - 91, -1, 93, 94, -1, 279, -1, 281, 282, -1, - -1, -1, -1, -1, -1, 10, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - 0, 1079, 123, 124, 125, 126, -1, -1, -1, -1, - 10, -1, -1, 1091, 1092, 279, 41, -1, -1, 44, - -1, 46, -1, -1, -1, -1, -1, 1105, -1, -1, - 1108, -1, -1, 33, -1, -1, 61, 37, 38, -1, - 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, - 354, -1, -1, -1, 10, -1, -1, -1, 58, 59, - 60, 61, 62, 63, 368, -1, 91, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 345, 346, -1, -1, 41, -1, -1, 44, -1, - 46, 91, -1, 93, 94, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1200, 123, 124, 125, 126, -1, -1, -1, - -1, -1, -1, 279, -1, 91, 257, 258, 259, 1217, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, - -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 345, - 346, 322, -1, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - -1, -1, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, 368, -1, -1, - 371, -1, -1, -1, 279, -1, -1, 257, 258, 259, - -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, - 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 345, 346, 322, 279, 324, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, -1, -1, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 0, 366, 367, 368, -1, - -1, 371, -1, -1, -1, 10, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 345, - 346, -1, -1, -1, -1, -1, -1, -1, 33, -1, + 0, 713, 713, 0, 713, 713, 713, 713, 713, 713, + 713, 0, 0, 0, 397, 0, 713, 713, 713, 713, + 713, 713, 713, 0, 0, 713, 0, 0, 0, 0, + 0, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 396, 713, 713, 713, 713, 713, + 713, 713, 0, 0, 713, 713, 0, 1106, 713, 713, + 1106, 0, 0, 0, 0, 821, 0, 0, 1106, 0, + 0, 0, 0, 713, 713, 0, 0, 0, 0, 0, + 0, 713, 0, 0, 713, 713, 713, 713, 821, 713, + 0, 0, 713, 713, 713, 713, 713, 713, 713, 0, + 713, 713, 709, 709, 709, 709, 709, 709, 709, 709, + 709, 709, 709, 0, 821, 709, 709, 0, 709, 709, + 709, 709, 709, 709, 709, 1106, 0, 0, 0, 0, + 709, 709, 709, 709, 709, 709, 709, 0, 0, 709, + 0, 0, 0, 0, 0, 709, 709, 709, 709, 709, + 709, 709, 709, 709, 709, 709, 709, 709, 0, 709, + 709, 709, 709, 709, 709, 709, 0, 0, 709, 709, + 0, 0, 709, 709, 0, 0, 0, 0, 0, 821, + 0, 821, 0, 0, 0, 0, 0, 709, 709, 0, + 0, 0, 0, 0, 0, 709, 0, 0, 709, 709, + 709, 709, 821, 709, 0, 0, 709, 709, 709, 709, + 709, 709, 709, 0, 709, 709, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 821, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 0, 0, 0, 0, 390, 391, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 403, 398, 0, 0, 0, 401, 399, 0, 400, 0, + 402, 0, 0, 0, 821, 821, 0, 0, 0, 0, + 0, 0, 0, 395, 0, 394, 393, 0, 0, 0, + 0, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 821, 0, 0, 821, 821, 0, 821, 821, 821, + 821, 821, 821, 821, 0, 0, 0, 397, 0, 821, + 821, 821, 821, 821, 821, 821, 0, 0, 821, 0, + 0, 0, 0, 0, 821, 821, 821, 821, 821, 821, + 821, 821, 821, 821, 821, 821, 821, 396, 821, 821, + 821, 821, 821, 821, 821, 252, 0, 821, 821, 0, + 0, 821, 821, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 821, 821, 230, 0, + 0, 0, 0, 0, 821, 0, 0, 821, 821, 821, + 821, 0, 821, 0, 0, 821, 821, 821, 821, 821, + 821, 821, 0, 821, 821, 821, 821, 821, 821, 821, + 821, 0, 0, 0, 821, 821, 0, 0, 0, 821, + 0, 821, 821, 821, 821, 821, 821, 821, 0, 0, + 0, 0, 0, 821, 821, 821, 821, 821, 821, 821, + 0, 0, 821, 0, 0, 0, 0, 0, 821, 821, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 0, 821, 821, 821, 821, 821, 821, 821, 0, + 365, 68, 821, 0, 0, 821, 821, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 821, 821, 0, 67, 0, 0, 0, 0, 821, 0, + 0, 821, 821, 821, 821, 0, 821, 0, 0, 821, + 821, 821, 821, 821, 821, 821, 0, 821, 821, 364, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 0, 0, 0, 0, 390, 391, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 252, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4, 5, 6, 0, 8, 0, 67, 0, + 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, + 15, 16, 17, 18, 0, 0, 0, 0, 0, 19, + 20, 21, 210, 211, 212, 213, 0, 0, 214, 0, + 0, 0, 0, 0, 0, 28, 0, 0, 215, 216, + 217, 218, 35, 219, 220, 221, 222, 223, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 0, 47, 0, + 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 51, 0, 0, + 0, 0, 0, 0, 224, 0, 0, 225, 54, 55, + 56, 68, 226, 227, 228, 58, 59, 229, 61, 62, + 63, 64, 0, 65, 66, 0, 434, 4, 5, 6, + 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 15, 16, 17, 18, 0, + 0, 0, 0, 0, 19, 20, 21, 210, 211, 212, + 213, 0, 0, 26, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 215, 216, 217, 218, 35, 219, 220, + 221, 222, 0, 40, 41, 42, 43, 44, 45, 46, + 0, 67, 0, 47, 0, 0, 48, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 0, 0, 1107, 1107, 612, 0, 224, + 0, 0, 225, 54, 55, 56, 0, 0, 0, 0, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 4, 5, 6, 0, 8, 0, 0, 0, + 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, + 15, 16, 17, 18, 0, 0, 0, 0, 0, 19, + 20, 21, 210, 211, 212, 213, 0, 0, 26, 0, + 0, 0, 1107, 1107, 68, 28, 1107, 0, 215, 216, + 217, 218, 35, 219, 220, 221, 222, 0, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 0, 47, 0, + 0, 48, 49, 0, 0, 0, 67, 0, 0, 0, + 1107, 0, 0, 0, 0, 0, 50, 51, 0, 0, + 0, 0, 0, 0, 224, 0, 0, 225, 54, 55, + 56, 1107, 612, 0, 0, 58, 59, 60, 61, 62, + 63, 64, 0, 65, 66, 0, 0, 0, 0, 1107, + 0, 0, 0, 1107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1107, 1107, 1107, 1107, + 0, 0, 0, 1107, 1107, 0, 1107, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 3, 4, 5, 6, 7, 8, + 0, 0, 0, 9, 10, 0, 0, 0, 11, 0, + 12, 13, 14, 15, 16, 17, 18, 67, 0, 0, + 0, 0, 19, 20, 21, 22, 23, 24, 25, 0, + 0, 26, 0, 0, 0, 0, 0, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 0, 40, 41, 42, 43, 44, 45, 46, 0, 0, + 0, 47, 0, 0, 48, 49, 0, 0, 0, 0, + 0, 0, 0, 0, 1107, 0, 0, 1107, 0, 50, + 51, 0, 0, 0, 0, 1107, 0, 52, 0, 0, + 53, 54, 55, 56, 0, 57, 0, 0, 58, 59, + 60, 61, 62, 63, 64, 0, 65, 66, 0, 0, + 68, 0, 0, 0, 0, 0, 0, 0, 0, 3, + 4, 5, 6, 7, 8, 0, 0, 0, 9, 10, + 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, + 17, 18, 1107, 67, 0, 0, 0, 19, 20, 21, + 22, 23, 24, 25, 0, 0, 26, 0, 0, 0, + 0, 0, 27, 28, 275, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 0, 40, 41, 42, 43, + 44, 45, 46, 0, 0, 0, 47, 0, 0, 48, + 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 0, 52, 0, 0, 53, 54, 55, 56, 0, + 57, 0, 0, 58, 59, 60, 61, 62, 63, 64, + 0, 65, 66, 0, 0, 0, 68, 0, 0, 0, + 3, 4, 5, 6, 7, 8, 0, 0, 0, 9, + 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, + 16, 17, 18, 67, 0, 0, 0, 0, 19, 20, + 21, 22, 23, 24, 25, 0, 0, 26, 0, 0, + 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 0, 40, 41, 42, + 43, 44, 45, 46, 0, 0, 0, 47, 0, 0, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 0, 52, 0, 0, 53, 54, 55, 56, + 0, 57, 0, 0, 58, 59, 60, 61, 62, 63, + 64, 0, 65, 66, 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, + 7, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 15, 16, 17, 18, 67, + 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, + 25, 0, 0, 26, 0, 0, 0, 0, 0, 27, + 28, 275, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 0, 40, 41, 42, 43, 44, 45, 46, + 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, + 0, 0, 276, 54, 55, 56, 0, 57, 0, 0, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 68, 0, 0, 0, 3, 4, 5, 6, + 7, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 15, 16, 17, 18, 230, + 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, + 25, 0, 0, 26, 0, 0, 0, 0, 0, 27, + 28, 275, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 0, 40, 41, 42, 43, 44, 45, 46, + 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, + 0, 0, 53, 54, 55, 56, 0, 57, 0, 0, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, + 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, + 14, 15, 16, 17, 18, 230, 0, 0, 0, 0, + 19, 20, 21, 22, 23, 24, 25, 0, 0, 26, + 0, 0, 0, 0, 0, 27, 28, 0, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 0, 40, + 41, 42, 43, 44, 45, 46, 0, 0, 0, 47, + 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, + 0, 0, 0, 0, 0, 52, 0, 0, 53, 54, + 55, 56, 0, 57, 0, 0, 58, 59, 60, 61, + 62, 63, 64, 0, 65, 66, 0, 0, 68, 0, + 0, 0, 0, 4, 5, 6, 0, 8, 0, 0, + 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, + 14, 15, 16, 17, 18, 230, 0, 0, 0, 0, + 19, 20, 21, 210, 211, 212, 213, 0, 0, 214, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 215, + 216, 217, 218, 35, 219, 220, 221, 222, 223, 40, + 41, 42, 43, 44, 45, 46, 0, 0, 0, 47, + 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, + 0, 0, 0, 0, 0, 224, 0, 0, 225, 54, + 55, 56, 0, 226, 227, 228, 58, 59, 229, 61, + 62, 63, 64, 0, 65, 66, 0, 0, 68, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, + 0, 0, 11, 0, 12, 13, 14, 15, 16, 17, + 18, 230, 0, 0, 0, 0, 19, 20, 21, 210, + 211, 212, 213, 0, 0, 214, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 215, 216, 217, 218, 35, + 219, 220, 221, 222, 223, 40, 41, 42, 43, 44, + 45, 46, 0, 0, 0, 47, 0, 0, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 498, 0, 0, 0, 0, 0, + 0, 224, 0, 0, 225, 54, 55, 56, 0, 226, + 227, 228, 58, 59, 229, 61, 62, 63, 64, 0, + 65, 66, 0, 0, 68, 0, 0, 0, 0, 4, + 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, + 0, 0, 11, 0, 12, 13, 14, 263, 264, 17, + 18, 320, 0, 0, 0, 0, 19, 20, 265, 210, + 211, 212, 213, 0, 0, 214, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 215, 216, 217, 218, 35, + 219, 220, 221, 222, 223, 40, 41, 42, 43, 44, + 45, 46, 0, 0, 0, 47, 0, 0, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, + 0, 224, 0, 0, 225, 54, 55, 56, 0, 226, + 227, 228, 58, 59, 229, 61, 62, 63, 64, 0, + 65, 66, 0, 0, 320, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 5, 6, 0, 8, + 0, 0, 0, 9, 10, 0, 0, 0, 11, 0, + 12, 13, 14, 263, 264, 17, 18, 230, 0, 0, + 0, 0, 19, 20, 265, 210, 211, 212, 213, 0, + 0, 214, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 215, 216, 217, 218, 35, 219, 220, 221, 222, + 223, 40, 41, 42, 43, 44, 45, 46, 0, 0, + 0, 47, 0, 0, 48, 49, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, + 498, 0, 0, 0, 0, 0, 0, 224, 0, 0, + 225, 54, 55, 56, 0, 226, 227, 228, 58, 59, + 229, 61, 62, 63, 64, 0, 65, 66, 0, 0, + 68, 0, 0, 0, 0, 320, 320, 320, 0, 320, + 0, 0, 0, 320, 320, 0, 0, 0, 320, 0, + 320, 320, 320, 320, 320, 320, 320, 230, 0, 0, + 0, 0, 320, 320, 320, 320, 320, 320, 320, 0, + 0, 320, 0, 0, 0, 0, 0, 0, 320, 0, + 0, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 0, 0, + 0, 320, 0, 0, 320, 320, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, + 320, 0, 0, 0, 0, 0, 0, 320, 0, 0, + 320, 320, 320, 320, 0, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 0, 320, 320, 0, 0, + 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 5, 6, 0, 8, 0, 0, 0, 9, + 10, 0, 0, 0, 11, 0, 12, 13, 14, 263, + 264, 17, 18, 230, 0, 0, 0, 0, 19, 20, + 265, 210, 211, 212, 213, 0, 0, 214, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 215, 216, 217, + 218, 35, 219, 220, 221, 222, 223, 40, 41, 42, + 43, 44, 45, 46, 0, 0, 0, 47, 0, 0, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 0, 224, 0, 0, 225, 54, 55, 56, + 0, 226, 227, 0, 58, 59, 229, 61, 62, 63, + 64, 0, 65, 66, 0, 0, 68, 0, 0, 0, + 0, 4, 5, 6, 0, 8, 0, 0, 0, 9, + 10, 0, 0, 0, 11, 0, 12, 13, 14, 263, + 264, 17, 18, 67, 0, 0, 0, 0, 19, 20, + 265, 210, 211, 212, 213, 0, 0, 214, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 215, 216, 217, + 218, 35, 219, 220, 221, 222, 223, 40, 41, 42, + 43, 44, 45, 46, 0, 0, 0, 47, 0, 0, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 0, 224, 0, 0, 225, 54, 55, 56, + 0, 0, 227, 228, 58, 59, 229, 61, 62, 63, + 64, 0, 65, 66, 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, + 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 263, 264, 17, 18, 230, + 0, 0, 0, 0, 19, 20, 265, 210, 211, 212, + 213, 0, 0, 214, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 215, 216, 217, 218, 35, 219, 220, + 221, 222, 223, 40, 41, 42, 43, 44, 45, 46, + 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 0, 0, 0, 0, 0, 0, 224, + 0, 0, 225, 54, 55, 56, 0, 0, 227, 0, + 58, 59, 229, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 68, 0, 0, 0, 434, 4, 5, 6, + 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 15, 16, 17, 18, 230, + 0, 0, 0, 0, 19, 20, 21, 210, 211, 212, + 213, 0, 0, 26, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 215, 216, 217, 218, 35, 219, 220, + 221, 222, 0, 40, 41, 42, 43, 44, 45, 46, + 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 0, 0, 0, 0, 0, 0, 224, + 0, 0, 225, 54, 55, 56, 0, 0, 0, 0, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 5, 6, 0, 8, 0, 0, + 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, + 14, 15, 16, 17, 18, 230, 0, 0, 0, 0, + 19, 20, 21, 210, 211, 212, 213, 0, 0, 214, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 215, + 216, 217, 218, 35, 219, 220, 221, 222, 0, 40, + 41, 42, 43, 44, 45, 46, 0, 0, 0, 47, + 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, + 0, 0, 0, 0, 0, 224, 0, 0, 225, 54, + 55, 56, 0, 848, 0, 0, 58, 59, 60, 61, + 62, 63, 64, 0, 65, 66, 0, 0, 68, 0, + 0, 0, 0, 4, 5, 6, 0, 8, 0, 0, + 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, + 14, 263, 264, 17, 18, 230, 0, 0, 0, 0, + 19, 20, 265, 210, 211, 212, 213, 0, 0, 214, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 215, + 216, 217, 218, 35, 219, 220, 221, 222, 0, 40, + 41, 42, 43, 44, 45, 46, 0, 0, 0, 47, + 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, + 0, 0, 0, 0, 0, 224, 0, 0, 225, 54, + 55, 56, 0, 983, 0, 0, 58, 59, 60, 61, + 62, 63, 64, 0, 65, 66, 0, 0, 68, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, + 0, 0, 11, 0, 12, 13, 14, 263, 264, 17, + 18, 230, 0, 0, 0, 0, 19, 20, 265, 210, + 211, 212, 213, 0, 0, 214, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 215, 216, 217, 218, 35, + 219, 220, 221, 222, 0, 40, 41, 42, 43, 44, + 45, 46, 0, 0, 0, 47, 0, 0, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, + 0, 224, 0, 0, 225, 54, 55, 56, 0, 1046, + 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, + 65, 66, 0, 0, 68, 0, 0, 0, 0, 4, + 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, + 0, 0, 11, 0, 12, 13, 14, 263, 264, 17, + 18, 0, 0, 0, 0, 0, 19, 20, 265, 210, + 211, 212, 213, 0, 0, 214, 0, 809, 0, 0, + 0, 0, 28, 0, 809, 215, 216, 217, 218, 35, + 219, 220, 221, 222, 0, 40, 41, 42, 43, 44, + 45, 46, 0, 0, 0, 47, 0, 0, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, + 0, 224, 0, 0, 225, 54, 55, 56, 0, 848, + 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, + 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 5, 6, 0, 8, + 809, 0, 0, 9, 10, 0, 0, 0, 11, 0, + 12, 13, 14, 263, 264, 17, 18, 0, 0, 0, + 230, 0, 19, 20, 265, 210, 211, 212, 213, 0, + 0, 214, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 215, 216, 217, 218, 35, 219, 220, 221, 222, + 0, 40, 41, 42, 43, 44, 45, 46, 0, 0, + 0, 47, 0, 0, 48, 49, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, + 51, 0, 0, 0, 0, 0, 0, 224, 0, 0, + 225, 54, 55, 56, 0, 1150, 0, 0, 58, 59, + 60, 61, 62, 63, 64, 0, 65, 66, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 809, 809, 809, 0, 809, 0, 230, 0, 809, + 809, 0, 0, 0, 809, 0, 809, 809, 809, 809, + 809, 809, 809, 0, 0, 0, 0, 0, 809, 809, + 809, 809, 809, 809, 809, 0, 0, 809, 0, 0, + 0, 0, 0, 0, 809, 0, 0, 809, 809, 809, + 809, 809, 809, 809, 809, 809, 0, 809, 809, 809, + 809, 809, 809, 809, 0, 0, 0, 809, 0, 0, + 809, 809, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 809, 809, 0, 0, 0, + 0, 0, 0, 809, 0, 0, 809, 809, 809, 809, + 68, 0, 0, 0, 809, 809, 809, 809, 809, 809, + 809, 0, 809, 809, 4, 5, 6, 0, 8, 0, + 67, 0, 9, 10, 0, 0, 0, 11, 0, 12, + 13, 14, 263, 264, 17, 18, 0, 0, 0, 0, + 0, 19, 20, 265, 210, 211, 212, 213, 0, 0, + 214, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 215, 216, 217, 218, 35, 219, 220, 221, 222, 0, + 40, 41, 42, 43, 44, 45, 46, 0, 0, 0, + 47, 0, 0, 48, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 224, 0, 0, 225, + 54, 55, 56, 68, 0, 0, 0, 58, 59, 60, + 61, 62, 63, 64, 0, 65, 66, 0, 0, 0, + 0, 4, 5, 6, 0, 8, 0, 230, 0, 9, + 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, + 16, 17, 18, 0, 0, 0, 0, 0, 19, 20, + 21, 210, 211, 212, 213, 0, 0, 214, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 215, 216, 217, + 218, 35, 219, 220, 221, 222, 0, 40, 41, 42, + 43, 44, 45, 46, 0, 0, 0, 47, 0, 0, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 0, 224, 0, 0, 225, 54, 55, 56, + 68, 0, 0, 0, 58, 59, 60, 61, 62, 63, + 64, 0, 65, 66, 4, 5, 6, 0, 8, 0, + 230, 0, 9, 10, 0, 0, 0, 11, 0, 12, + 13, 14, 15, 16, 17, 18, 0, 0, 0, 0, + 0, 19, 20, 21, 210, 211, 212, 213, 0, 0, + 26, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 215, 216, 217, 218, 35, 219, 220, 221, 222, 0, + 40, 41, 42, 43, 44, 45, 46, 0, 0, 0, + 47, 0, 0, 48, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 224, 0, 0, 225, + 54, 55, 56, 68, 0, 0, 0, 58, 59, 60, + 61, 62, 63, 64, 0, 65, 66, 0, 0, 0, + 0, 4, 5, 6, 0, 8, 0, 809, 0, 9, + 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, + 16, 17, 18, 0, 0, 0, 0, 0, 19, 20, + 21, 210, 211, 212, 213, 0, 0, 790, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 215, 216, 217, + 218, 35, 219, 220, 221, 222, 0, 40, 41, 42, + 43, 44, 45, 46, 0, 0, 0, 47, 0, 0, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 0, 224, 0, 0, 225, 54, 55, 56, + 809, 0, 0, 0, 58, 59, 60, 61, 62, 63, + 64, 0, 65, 66, 4, 5, 6, 0, 8, 0, + 821, 0, 9, 10, 0, 0, 0, 11, 0, 12, + 13, 14, 263, 264, 17, 18, 0, 0, 0, 0, + 0, 19, 20, 265, 210, 211, 212, 213, 0, 0, + 887, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 215, 216, 217, 218, 35, 219, 220, 221, 222, 0, + 40, 41, 42, 43, 44, 45, 46, 0, 0, 0, + 47, 0, 0, 48, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 224, 0, 0, 225, + 54, 55, 56, 821, 0, 0, 0, 58, 59, 60, + 61, 62, 63, 64, 0, 65, 66, 0, 0, 0, + 0, 809, 809, 809, 0, 809, 0, 0, 0, 809, + 809, 0, 0, 0, 809, 0, 809, 809, 809, 809, + 809, 809, 809, 0, 0, 0, 0, 0, 809, 809, + 809, 809, 809, 809, 809, 0, 0, 809, 0, 0, + 0, 0, 0, 0, 809, 0, 0, 809, 809, 809, + 809, 809, 809, 809, 809, 809, 0, 809, 809, 809, + 809, 809, 809, 809, 0, 0, 0, 809, 0, 0, + 809, 809, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 809, 809, 0, 0, 0, + 0, 0, 0, 809, 0, 0, 809, 809, 809, 809, + 0, 809, 511, 0, 809, 809, 809, 809, 809, 809, + 809, 0, 809, 809, 821, 821, 821, 0, 821, 0, + 0, 0, 821, 821, 0, 0, 0, 821, 0, 821, + 821, 821, 821, 821, 821, 821, 0, 0, 0, 0, + 0, 821, 821, 821, 821, 821, 821, 821, 0, 0, + 821, 0, 0, 0, 0, 0, 0, 821, 0, 0, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 0, + 821, 821, 821, 821, 821, 821, 821, 0, 0, 0, + 821, 0, 0, 821, 821, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 821, 821, + 0, 0, 0, 0, 0, 0, 821, 0, 0, 821, + 821, 821, 821, 0, 0, 0, 0, 821, 821, 821, + 821, 821, 821, 821, 198, 821, 821, 0, 197, 192, + 0, 0, 0, 195, 193, 0, 194, 0, 196, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 189, 0, 188, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 191, 0, 200, 0, 0, + 0, 0, 0, 0, 0, 511, 511, 511, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 511, 511, 511, 511, 190, 0, 199, 511, 0, + 511, 511, 511, 511, 511, 511, 0, 0, 0, 198, + 0, 511, 0, 197, 192, 0, 511, 0, 195, 193, + 0, 194, 0, 196, 0, 0, 0, 0, 0, 511, + 511, 0, 0, 0, 0, 0, 189, 511, 188, 0, + 511, 0, 511, 511, 0, 511, 511, 0, 511, 511, + 511, 511, 511, 511, 511, 0, 511, 511, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 191, 0, 200, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 809, + 190, 0, 199, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 511, 0, 0, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 0, 0, 0, 0, 0, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 254, + 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 0, 0, 180, 181, + 0, 0, 0, 0, 182, 183, 184, 185, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, + 0, 0, 59, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 0, 0, 0, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 0, 0, 0, 0, 0, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 0, 0, 170, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 0, 0, 180, 181, 0, 0, 0, 0, 182, + 183, 184, 185, 0, 0, 0, 0, 0, 0, 0, + 403, 398, 0, 186, 187, 401, 399, 59, 400, 0, + 402, 0, 0, 0, 0, 511, 511, 511, 511, 0, + 0, 0, 0, 395, 0, 394, 393, 0, 0, 0, + 0, 511, 511, 511, 511, 0, 0, 0, 511, 0, + 511, 511, 511, 511, 511, 511, 0, 0, 0, 0, + 0, 511, 0, 0, 0, 0, 511, 397, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 511, + 511, 0, 0, 0, 0, 0, 0, 511, 0, 0, + 511, 0, 511, 511, 0, 511, 511, 396, 511, 511, + 511, 511, 511, 511, 511, 198, 511, 511, 0, 197, + 192, 0, 449, 0, 195, 193, 0, 194, 0, 196, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 189, 0, 188, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 191, 0, 200, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 190, 0, 199, 0, + 0, 0, 0, 0, 0, 0, 0, 198, 0, 0, + 0, 197, 192, 0, 0, 0, 195, 193, 0, 194, + 0, 196, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 189, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 376, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, + 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 190, 0, + 199, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 0, 0, 0, 0, 390, 391, + 0, 0, 0, 0, 392, 0, 0, 0, 0, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 0, 0, 0, 151, 152, 153, 437, + 438, 439, 440, 158, 159, 160, 0, 308, 0, 0, + 0, 161, 162, 163, 164, 441, 442, 443, 444, 169, + 445, 446, 447, 448, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 0, 0, 180, + 181, 0, 0, 0, 0, 182, 183, 184, 185, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, + 187, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 0, 0, 0, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 0, 0, + 0, 0, 0, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 316, 317, 170, 318, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 0, 180, 181, 0, 0, 0, 0, 182, 183, 184, + 185, 0, 0, 0, 198, 0, 0, 0, 197, 192, + 0, 186, 187, 195, 193, 0, 194, 0, 196, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 189, 0, 188, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 5, 6, 0, 8, 191, 0, 200, 9, 10, + 0, 0, 0, 11, 0, 12, 13, 14, 263, 264, + 17, 18, 0, 0, 0, 0, 0, 19, 20, 265, + 293, 294, 295, 296, 0, 190, 214, 199, 0, 0, + 0, 0, 0, 297, 0, 679, 298, 299, 300, 301, + 35, 302, 303, 304, 305, 0, 40, 41, 42, 43, + 44, 45, 46, 0, 0, 0, 306, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 307, 0, 0, 225, 54, 55, 56, 0, + 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, + 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 198, 0, 0, 0, 197, 192, 0, 247, 0, + 195, 193, 0, 194, 0, 196, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 189, 0, + 188, 0, 0, 0, 0, 0, 0, 0, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 191, 0, 200, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 0, 0, 0, 0, 0, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 0, + 0, 170, 190, 0, 199, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 0, 0, 180, 181, + 0, 0, 0, 0, 182, 183, 184, 185, 4, 5, + 6, 0, 8, 0, 0, 0, 9, 10, 186, 187, + 0, 11, 0, 12, 13, 14, 263, 264, 17, 18, + 0, 0, 0, 0, 0, 19, 20, 265, 293, 294, + 295, 296, 0, 0, 214, 0, 0, 0, 0, 0, + 0, 297, 0, 0, 298, 299, 300, 301, 35, 302, + 303, 304, 305, 0, 40, 41, 42, 43, 44, 45, + 46, 0, 198, 0, 306, 0, 197, 192, 0, 247, + 0, 195, 193, 0, 194, 0, 196, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, + 307, 188, 0, 225, 54, 55, 56, 0, 0, 0, + 0, 58, 59, 60, 61, 62, 63, 64, 0, 65, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 191, 0, 200, 0, 198, 0, 0, + 0, 197, 192, 0, 247, 0, 195, 193, 0, 194, + 0, 196, 0, 0, 652, 653, 0, 0, 654, 0, + 0, 0, 0, 190, 189, 199, 188, 0, 0, 0, + 0, 0, 0, 0, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 0, 0, 180, 181, 0, 0, 0, + 0, 182, 183, 184, 185, 0, 0, 0, 191, 0, + 200, 0, 0, 0, 198, 186, 187, 0, 197, 192, + 0, 247, 0, 195, 193, 0, 194, 0, 196, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 190, 0, + 199, 189, 0, 188, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 198, 0, 0, 0, 197, + 192, 0, 247, 0, 195, 193, 0, 194, 0, 196, + 0, 0, 0, 0, 0, 191, 0, 200, 0, 0, + 0, 0, 189, 0, 188, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 190, 0, 199, 0, 0, + 198, 0, 0, 0, 197, 192, 191, 247, 200, 195, + 193, 0, 194, 0, 196, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 189, 0, 188, + 0, 0, 0, 0, 0, 0, 190, 0, 199, 0, + 0, 0, 0, 0, 0, 662, 663, 0, 0, 664, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 191, 0, 200, 0, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 0, 0, 180, 181, 0, 0, + 0, 0, 182, 183, 184, 185, 0, 0, 0, 0, + 0, 190, 0, 199, 198, 0, 186, 187, 197, 192, + 0, 247, 0, 195, 193, 0, 194, 0, 196, 0, + 712, 653, 0, 0, 713, 0, 0, 0, 0, 0, + 0, 189, 0, 188, 0, 0, 0, 0, 0, 0, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 0, 180, 181, 0, 0, 0, 0, 182, 183, 184, + 185, 0, 0, 0, 0, 191, 0, 200, 0, 0, + 0, 186, 187, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 715, 663, 0, + 0, 716, 0, 0, 0, 190, 0, 199, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 0, 0, 180, 181, + 0, 0, 0, 0, 182, 183, 184, 185, 712, 653, + 0, 0, 736, 0, 0, 0, 0, 0, 186, 187, + 0, 0, 0, 0, 0, 0, 0, 0, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 0, 0, 180, + 181, 0, 0, 0, 0, 182, 183, 184, 185, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, + 187, 0, 0, 746, 653, 0, 0, 747, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 0, 0, 180, 181, 0, 0, 0, 0, + 182, 183, 184, 185, 0, 0, 0, 0, 0, 0, + 0, 0, 198, 0, 186, 187, 197, 192, 0, 247, + 0, 195, 193, 0, 194, 0, 196, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, + 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 749, 663, 0, + 0, 750, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 191, 0, 200, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 0, 0, 180, 181, + 0, 0, 0, 0, 182, 183, 184, 185, 0, 0, + 0, 0, 0, 190, 0, 199, 198, 0, 186, 187, + 197, 192, 0, 247, 0, 195, 193, 0, 194, 0, + 196, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 189, 0, 188, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 198, 0, 0, + 0, 197, 192, 0, 247, 0, 195, 193, 0, 194, + 0, 196, 0, 0, 0, 0, 0, 191, 0, 200, + 0, 0, 0, 0, 189, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 198, 0, 0, 0, 197, 192, 190, 247, 199, + 195, 193, 0, 194, 0, 196, 0, 0, 191, 0, + 200, 0, 0, 0, 0, 0, 0, 0, 189, 0, + 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 198, 190, 0, + 199, 197, 192, 0, 247, 0, 195, 193, 0, 194, + 0, 196, 191, 0, 200, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 189, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 190, 0, 199, 806, 653, 0, 0, 807, + 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, + 200, 0, 0, 0, 0, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 0, 0, 180, 181, 0, 0, + 0, 0, 182, 183, 184, 185, 0, 0, 190, 0, + 199, 0, 0, 0, 198, 0, 186, 187, 197, 192, + 0, 247, 0, 195, 193, 0, 194, 0, 196, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 189, 0, 188, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 809, + 663, 0, 0, 810, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 191, 0, 200, 0, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 0, 0, + 180, 181, 0, 0, 0, 0, 182, 183, 184, 185, + 878, 653, 0, 0, 879, 190, 0, 199, 0, 0, + 186, 187, 0, 0, 0, 0, 0, 0, 0, 0, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 0, 180, 181, 0, 0, 0, 0, 182, 183, 184, + 185, 0, 0, 0, 672, 663, 0, 0, 673, 0, + 0, 186, 187, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 0, 0, 180, 181, 0, 0, 0, + 0, 182, 183, 184, 185, 0, 0, 0, 0, 0, + 1040, 653, 0, 0, 1041, 186, 187, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 0, 180, 181, 0, 0, 0, 0, 182, 183, 184, + 185, 0, 0, 0, 0, 0, 0, 0, 0, 198, + 0, 186, 187, 197, 192, 0, 247, 0, 195, 193, + 0, 194, 0, 196, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 189, 0, 188, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1043, 663, 0, + 0, 1044, 0, 0, 0, 0, 0, 0, 0, 0, + 191, 0, 200, 0, 0, 0, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 0, 0, 180, 181, + 0, 0, 0, 0, 182, 183, 184, 185, 0, 0, + 190, 0, 199, 0, 0, 0, 198, 0, 186, 187, + 197, 192, 0, 247, 0, 195, 193, 0, 194, 0, + 196, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 189, 0, 188, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 198, 0, 0, + 0, 197, 192, 0, 247, 0, 195, 193, 0, 194, + 0, 196, 0, 0, 0, 0, 0, 191, 0, 200, + 0, 0, 0, 0, 189, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 190, 0, 199, + 0, 0, 198, 0, 0, 0, 197, 192, 191, 0, + 200, 195, 193, 0, 194, 0, 196, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, + 0, 188, 0, 0, 0, 0, 0, 0, 190, 0, + 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 191, 0, 200, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1332, 653, 0, 0, 1333, 0, 0, 0, + 0, 0, 0, 190, 0, 199, 0, 0, 0, 0, + 0, 0, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 0, 0, 180, 181, 0, 0, 0, 0, 182, + 183, 184, 185, 1098, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 186, 187, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1335, + 663, 0, 0, 1336, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 1098, 0, + 180, 181, 0, 0, 0, 0, 182, 183, 184, 185, + 1382, 653, 0, 0, 1383, 0, 0, 0, 0, 0, + 186, 187, 0, 0, 0, 0, 0, 0, 0, 0, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 0, 180, 181, 0, 0, 0, 0, 182, 183, 184, + 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 186, 187, 0, 0, 672, 663, 0, 0, 673, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 0, 0, 180, 181, 0, 0, + 0, 0, 182, 183, 184, 185, 1080, 1081, 1082, 1083, + 0, 0, 0, 0, 0, 0, 186, 187, 0, 0, + 0, 0, 1084, 1085, 1086, 1087, 0, 0, 0, 1088, + 0, 1089, 40, 41, 42, 43, 44, 0, 0, 0, + 0, 0, 306, 0, 0, 0, 0, 569, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1090, 1091, 0, 0, 0, 0, 0, 0, 1092, 0, + 0, 1093, 0, 1094, 1095, 0, 1096, 573, 0, 58, + 59, 1097, 61, 62, 63, 64, 0, 65, 66, 0, + 0, 1080, 1081, 1082, 1083, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1084, 1085, 1086, + 1087, 0, 0, 0, 1088, 0, 0, 40, 41, 42, + 43, 44, 0, 0, 0, 0, 0, 306, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1090, 1091, 0, 0, 0, + 0, 0, 0, 1092, 0, 0, 1093, 0, 1094, 1095, + 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, + 64, 0, 65, 66, 4, 5, 6, 0, 8, 0, + 0, 0, 9, 10, 0, 0, 0, 11, 0, 12, + 13, 14, 263, 264, 17, 18, 0, 0, 0, 0, + 0, 19, 20, 265, 346, 347, 348, 349, 0, 0, + 214, 0, 0, 0, 0, 0, 0, 297, 0, 0, + 350, 351, 352, 353, 35, 354, 355, 356, 357, 0, + 40, 41, 42, 43, 44, 45, 46, 0, 0, 0, + 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 358, 0, 0, 53, + 54, 55, 56, 0, 57, 0, 0, 58, 59, 60, + 61, 62, 63, 64, 0, 65, 66, 4, 5, 6, + 0, 8, 0, 0, 0, 9, 10, 0, 0, 0, + 11, 0, 12, 13, 14, 263, 264, 17, 18, 0, + 0, 0, 0, 0, 19, 20, 265, 293, 294, 295, + 296, 0, 0, 214, 0, 0, 0, 0, 0, 0, + 297, 0, 0, 298, 299, 300, 301, 35, 302, 303, + 304, 305, 0, 40, 41, 42, 43, 44, 45, 46, + 0, 0, 0, 306, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 307, + 0, 0, 428, 54, 55, 56, 0, 429, 0, 0, + 58, 59, 60, 61, 62, 63, 64, 0, 65, 66, + 4, 5, 6, 0, 8, 0, 0, 0, 9, 10, + 0, 0, 0, 11, 0, 12, 13, 14, 263, 264, + 17, 18, 0, 0, 0, 0, 0, 19, 20, 265, + 458, 459, 460, 461, 0, 0, 214, 0, 0, 0, + 0, 0, 0, 297, 0, 0, 462, 463, 464, 465, + 35, 445, 446, 466, 448, 0, 40, 41, 42, 43, + 44, 45, 46, 0, 0, 0, 306, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 467, 0, + 0, 0, 468, 0, 0, 225, 54, 55, 56, 0, + 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, + 0, 65, 66, 4, 5, 6, 0, 8, 0, 0, + 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, + 14, 263, 264, 17, 18, 0, 0, 0, 0, 0, + 19, 20, 265, 458, 459, 460, 461, 0, 0, 214, + 0, 0, 0, 0, 0, 0, 297, 0, 0, 462, + 463, 464, 465, 35, 445, 446, 466, 448, 0, 40, + 41, 42, 43, 44, 45, 46, 0, 0, 0, 306, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 468, 0, 0, 225, 54, + 55, 56, 0, 0, 0, 0, 58, 59, 60, 61, + 62, 63, 64, 0, 65, 66, 4, 5, 6, 0, + 8, 0, 0, 0, 9, 10, 0, 0, 0, 11, + 0, 12, 13, 14, 263, 264, 17, 18, 0, 0, + 0, 0, 0, 19, 20, 265, 293, 294, 295, 296, + 0, 0, 214, 0, 0, 0, 0, 0, 0, 297, + 0, 0, 298, 299, 300, 301, 35, 302, 303, 304, + 305, 0, 40, 41, 42, 43, 44, 45, 46, 0, + 0, 0, 306, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 307, 0, + 0, 428, 54, 55, 56, 0, 0, 0, 0, 58, + 59, 60, 61, 62, 63, 64, 0, 65, 66, 4, + 5, 6, 0, 8, 0, 0, 0, 9, 10, 0, + 0, 0, 11, 0, 12, 13, 14, 263, 264, 17, + 18, 0, 0, 0, 0, 0, 19, 20, 265, 1204, + 1205, 1206, 1207, 0, 0, 214, 0, 0, 0, 0, + 0, 0, 297, 0, 0, 1208, 1209, 1210, 1211, 35, + 1212, 1213, 1214, 1215, 0, 40, 41, 42, 43, 44, + 45, 46, 0, 0, 0, 306, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1216, 0, 0, 225, 54, 55, 56, 0, 0, + 0, 0, 58, 59, 60, 61, 62, 63, 64, 0, + 65, 66, 4, 5, 6, 0, 8, 0, 0, 0, + 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, + 263, 264, 17, 18, 0, 0, 0, 0, 0, 19, + 20, 265, 458, 459, 460, 461, 0, 0, 214, 0, + 0, 0, 0, 0, 0, 297, 0, 0, 462, 463, + 464, 1325, 35, 445, 446, 1326, 448, 0, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 0, 306, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1327, 0, 0, 225, 54, 55, + 56, 0, 0, 0, 0, 58, 59, 60, 61, 62, + 63, 64, 0, 65, 66, + }; + } + + private static final int[] yyCheck1() { + return new int[] { + + 2, 2, 60, 98, 121, 122, 90, 57, 15, 16, + 59, 53, 54, 99, 340, 2, 242, 13, 14, 105, + 457, 112, 599, 7, 594, 602, 87, 7, 15, 16, + 335, 776, 67, 468, 247, 340, 874, 121, 88, 27, + 335, 57, 490, 27, 414, 340, 494, 27, 772, 53, + 774, 53, 54, 55, 56, 15, 16, 119, 494, 121, + 122, 490, 112, 15, 16, 413, 53, 54, 416, 603, + 57, 120, 603, 123, 124, 772, 424, 10, 10, 59, + 67, 38, 84, 85, 581, 64, 65, 66, 585, 287, + 21, 546, 46, 291, 10, 55, 56, 533, 123, 754, + 529, 88, 10, 55, 15, 16, 47, 30, 44, 123, + 117, 10, 324, 325, 90, 913, 671, 10, 488, 677, + 675, 676, 40, 121, 10, 112, 703, 59, 636, 125, + 117, 101, 119, 571, 121, 122, 123, 124, 10, 487, + 120, 489, 37, 59, 10, 44, 814, 42, 914, 1094, + 236, 59, 47, 276, 283, 870, 126, 117, 44, 10, + 59, 123, 40, 669, 1197, 117, 59, 0, 44, 0, + 101, 229, 520, 59, 544, 41, 1191, 1192, 44, 710, + 774, 267, 46, 225, 10, 61, 10, 59, 10, 251, + 26, 253, 28, 59, 278, 61, 283, 545, 85, 1024, + 10, 40, 320, 1023, 1024, 123, 117, 1296, 59, 1171, + 288, 776, 10, 91, 85, 41, 10, 308, 44, 10, + 10, 10, 1184, 225, 679, 46, 312, 344, 306, 231, + 232, 41, 32, 59, 276, 59, 10, 59, 225, 609, + 247, 1274, 46, 250, 373, 247, 1191, 1192, 10, 367, + 41, 41, 369, 370, 371, 372, 258, 258, 308, 46, + 247, 59, 610, 250, 251, 700, 253, 41, 59, 59, + 91, 258, 276, 359, 276, 1073, 502, 725, 1367, 727, + 278, 123, 344, 93, 1008, 10, 373, 91, 1303, 276, + 250, 727, 125, 46, 125, 247, 725, 59, 250, 93, + 877, 343, 278, 345, 91, 428, 1072, 369, 370, 371, + 372, 979, 374, 375, 1152, 1012, 40, 823, 280, 93, + 44, 308, 46, 10, 1149, 350, 764, 765, 10, 1149, + 60, 701, 62, 256, 265, 267, 350, 268, 91, 250, + 10, 343, 269, 345, 231, 232, 44, 559, 46, 561, + 467, 1313, 279, 40, 702, 925, 343, 344, 345, 306, + 868, 232, 280, 310, 46, 306, 367, 91, 267, 10, + 454, 264, 1314, 281, 44, 268, 269, 59, 826, 429, + 367, 267, 369, 370, 371, 372, 428, 374, 375, 944, + 945, 263, 264, 91, 348, 950, 951, 826, 932, 10, + 41, 932, 359, 279, 10, 467, 861, 414, 324, 91, + 987, 969, 414, 429, 1008, 351, 267, 283, 351, 351, + 61, 918, 919, 920, 428, 922, 428, 414, 10, 322, + 927, 433, 59, 328, 1376, 41, 416, 1152, 44, 310, + 10, 428, 429, 1098, 424, 267, 433, 648, 59, 650, + 322, 10, 351, 59, 370, 546, 454, 283, 1023, 1024, + 38, 297, 993, 310, 10, 606, 264, 772, 475, 774, + 348, 41, 0, 1197, 44, 913, 914, 10, 1033, 32, + 467, 488, 10, 347, 348, 416, 488, 46, 475, 59, + 1045, 46, 283, 283, 720, 41, 546, 124, 421, 362, + 59, 488, 425, 426, 427, 267, 647, 373, 41, 489, + 651, 93, 725, 59, 271, 475, 1302, 601, 124, 1305, + 320, 605, 279, 475, 322, 513, 347, 348, 1366, 513, + 490, 59, 91, 513, 963, 40, 91, 544, 282, 526, + 520, 682, 544, 347, 348, 757, 744, 373, 985, 761, + 611, 999, 263, 264, 124, 279, 10, 544, 489, 546, + 347, 348, 10, 999, 475, 545, 291, 292, 10, 529, + 493, 371, 372, 496, 497, 1320, 41, 1074, 1075, 1076, + 1077, 279, 373, 373, 1149, 267, 41, 957, 679, 520, + 1314, 514, 1316, 600, 347, 348, 603, 599, 521, 41, + 602, 46, 609, 333, 334, 59, 44, 609, 956, 264, + 958, 322, 599, 600, 545, 602, 603, 59, 619, 1316, + 1057, 1198, 609, 347, 348, 687, 1191, 1192, 1193, 679, + 610, 10, 619, 350, 1072, 1073, 671, 283, 279, 320, + 675, 676, 677, 685, 10, 93, 91, 324, 789, 347, + 348, 693, 1376, 264, 745, 796, 671, 1092, 269, 124, + 675, 10, 704, 264, 666, 347, 348, 322, 894, 124, + 732, 125, 674, 291, 292, 1372, 1002, 283, 44, 610, + 59, 10, 124, 685, 671, 46, 367, 657, 675, 676, + 677, 693, 679, 370, 701, 745, 666, 1002, 685, 701, + 687, 703, 704, 1008, 674, 1275, 693, 1002, 267, 1146, + 59, 322, 1282, 283, 701, 44, 703, 704, 350, 707, + 1297, 322, 702, 707, 676, 677, 657, 707, 869, 41, + 91, 872, 40, 10, 312, 666, 738, 61, 1303, 1236, + 93, 882, 1068, 674, 61, 732, 308, 59, 2, 844, + 328, 44, 838, 1188, 41, 1320, 318, 319, 745, 876, + 683, 15, 16, 1068, 41, 725, 10, 373, 320, 811, + 861, 702, 125, 1068, 10, 124, 46, 776, 757, 758, + 358, 359, 761, 762, 783, 1222, 10, 10, 347, 348, + 1360, 875, 347, 348, 0, 10, 40, 938, 46, 53, + 54, 637, 46, 373, 10, 40, 737, 738, 44, 811, + 320, 861, 288, 67, 876, 59, 93, 41, 867, 371, + 372, 91, 374, 59, 811, 661, 269, 310, 271, 475, + 306, 972, 44, 351, 46, 10, 59, 61, 125, 10, + 981, 283, 10, 91, 59, 986, 10, 91, 989, 320, + 1090, 1091, 774, 59, 10, 501, 778, 367, 504, 976, + 506, 863, 864, 117, 320, 119, 826, 121, 122, 44, + 41, 1171, 874, 10, 861, 877, 40, 523, 714, 91, + 44, 44, 46, 350, 59, 41, 10, 867, 124, 876, + 877, 59, 1197, 10, 1194, 59, 367, 10, 821, 822, + 271, 124, 347, 348, 988, 901, 829, 830, 279, 944, + 945, 367, 748, 44, 976, 950, 951, 41, 1288, 125, + 263, 264, 59, 1064, 41, 932, 269, 91, 41, 944, + 945, 373, 578, 975, 37, 950, 951, 61, 350, 42, + 43, 1289, 45, 10, 47, 932, 1186, 1187, 61, 124, + 957, 825, 10, 61, 790, 957, 320, 944, 945, 833, + 124, 268, 269, 950, 951, 888, 889, 969, 891, 892, + 957, 225, 808, 975, 41, 262, 263, 264, 958, 322, + 714, 268, 269, 40, 271, 987, 347, 348, 975, 976, + 940, 328, 279, 247, 61, 10, 250, 251, 1033, 253, + 987, 59, 1302, 367, 258, 1305, 339, 340, 10, 1314, + 1045, 1316, 10, 1313, 748, 306, 350, 969, 1033, 310, + 1062, 41, 276, 267, 328, 948, 41, 958, 93, 1071, + 1026, 1027, 678, 294, 295, 322, 959, 324, 1039, 1097, + 125, 10, 44, 41, 59, 881, 1033, 1048, 1050, 264, + 1052, 887, 1039, 310, 269, 279, 271, 59, 1045, 705, + 1062, 1048, 10, 10, 1181, 413, 124, 279, 416, 1071, + 1370, 1376, 41, 996, 808, 1062, 424, 347, 348, 10, + 817, 10, 819, 370, 1071, 44, 1008, 32, 1010, 343, + 344, 345, 1014, 41, 41, 1145, 264, 10, 1140, 347, + 348, 269, 1144, 347, 348, 61, 1148, 322, 1058, 61, + 41, 279, 41, 367, 61, 369, 370, 371, 372, 1181, + 374, 375, 124, 769, 310, 262, 263, 264, 41, 1131, + 1132, 1217, 269, 309, 310, 347, 348, 10, 1140, 487, + 671, 489, 1144, 1093, 675, 1095, 1148, 881, 61, 279, + 1152, 2, 356, 1140, 322, 279, 10, 1144, 1145, 1201, + 414, 1148, 1184, 44, 15, 16, 279, 59, 41, 1191, + 1192, 519, 520, 10, 428, 60, 1293, 1294, 1220, 433, + 44, 123, 46, 347, 348, 322, 61, 41, 61, 1231, + 721, 61, 723, 41, 1181, 543, 1198, 545, 1197, 1201, + 320, 44, 53, 54, 1345, 10, 1042, 1265, 739, 46, + 44, 1198, 46, 467, 1201, 44, 67, 125, 1220, 1221, + 866, 475, 59, 942, 943, 328, 41, 91, 44, 1231, + 1280, 1293, 1294, 1220, 488, 44, 41, 1159, 10, 1189, + 1190, 44, 345, 346, 1231, 44, 10, 367, 44, 895, + 896, 371, 372, 1176, 91, 44, 61, 91, 1094, 1095, + 608, 306, 610, 306, 125, 911, 117, 350, 119, 10, + 121, 122, 526, 44, 46, 1197, 350, 41, 350, 1329, + 10, 1288, 44, 1285, 267, 279, 1288, 59, 1290, 123, + 544, 10, 271, 1280, 10, 1297, 1338, 61, 125, 40, + 41, 1288, 44, 44, 350, 46, 1293, 1294, 1042, 1289, + 1297, 41, 350, 350, 44, 1314, 320, 1316, 1154, 91, + 61, 1320, 38, 350, 1323, 40, 42, 46, 61, 44, + 44, 46, 279, 1169, 1170, 298, 1338, 298, 58, 350, + 59, 93, 1329, 59, 125, 599, 600, 298, 602, 603, + 91, 1338, 700, 1189, 702, 609, 61, 44, 1289, 10, + 1094, 1197, 298, 367, 1366, 619, 279, 371, 372, 262, + 374, 269, 91, 1372, 225, 1374, 91, 1376, 10, 1378, + 37, 38, 123, 350, 44, 42, 43, 38, 45, 125, + 47, 42, 1314, 125, 44, 1394, 247, 44, 44, 250, + 251, 1323, 253, 44, 123, 306, 279, 258, 123, 41, + 44, 10, 46, 944, 945, 279, 44, 671, 320, 950, + 951, 675, 676, 677, 44, 276, 1262, 1263, 1264, 61, + 267, 685, 263, 687, 351, 1169, 1170, 44, 1274, 693, + 306, 124, 41, 44, 44, 279, 280, 701, 0, 703, + 704, 124, 1374, 320, 1376, 1189, 1378, 91, 10, 44, + 59, 351, 125, 994, 995, 367, 997, 998, 306, 371, + 372, 37, 1394, 41, 279, 310, 42, 43, 732, 45, + 59, 47, 44, 347, 348, 312, 44, 44, 44, 41, + 44, 10, 343, 344, 345, 267, 44, 44, 1334, 124, + 367, 328, 1033, 44, 371, 372, 1342, 59, 320, 125, + 347, 348, 1348, 347, 348, 279, 367, 10, 369, 370, + 371, 372, 41, 374, 375, 44, 125, 46, 1262, 1263, + 1264, 358, 124, 2, 310, 362, 1067, 44, 279, 280, + 44, 93, 61, 44, 1190, 125, 15, 16, 267, 44, + 44, 44, 44, 44, 46, 367, 93, 811, 271, 371, + 372, 280, 374, 414, 279, 280, 59, 41, 61, 320, + 321, 93, 91, 125, 125, 347, 348, 428, 313, 314, + 315, 316, 433, 320, 53, 54, 40, 93, 58, 271, + 306, 1237, 308, 309, 310, 311, 312, 93, 67, 91, + 1334, 1247, 125, 44, 123, 70, 347, 348, 956, 124, + 958, 561, 328, 1259, 1260, 1261, 467, 867, 933, 934, + 371, 372, 876, 877, 475, 258, 342, 367, 347, 348, + 367, 124, 347, 348, 371, 372, 352, 488, 522, 954, + 955, 357, 358, 359, 526, 279, 1221, 279, 117, 964, + 119, 1290, 121, 122, 1285, 306, 10, 308, 309, 310, + 311, 312, 674, 262, 263, 264, 1316, 1197, 120, 268, + 269, 328, 271, 772, 913, 526, 764, 328, 932, 1132, + 279, 776, 306, 1320, 308, 309, 40, 311, 345, 346, + 944, 945, 46, 544, 0, 1367, 950, 951, 845, 411, + 44, 352, 46, 957, 10, 59, 357, 358, 359, 88, + 262, 263, 264, 347, 348, 267, 268, 269, 44, 271, + 46, 975, 976, 322, 1366, 324, 1185, 279, 352, 281, + 282, 1183, 10, 987, 100, 41, 1193, 91, 44, 291, + 292, 967, 294, 295, 296, 297, 298, 91, 599, 600, + 1348, 602, 603, 59, 1193, 514, 225, 1281, 609, 312, + 279, 280, 328, 41, -1, 91, 44, 10, 619, 123, + 322, 370, 324, -1, -1, 328, -1, -1, 247, 1033, + 320, 250, 251, 61, 253, 1039, -1, 279, 44, 258, + 46, 1045, -1, -1, 1048, -1, 306, 40, 308, 309, + 310, 311, -1, 46, 356, 358, -1, 276, 1062, 362, + 10, -1, -1, -1, -1, 56, 59, 1071, 370, 125, + 671, 320, -1, -1, 675, 676, 677, 367, 347, 348, + -1, 371, 372, 10, 685, 91, 687, -1, -1, -1, + 40, 41, 693, -1, 44, 320, 46, -1, 91, -1, + 701, -1, 703, 704, -1, 347, 348, 320, -1, -1, + 44, 61, 46, 40, 41, 320, -1, 44, 367, 46, + -1, -1, 371, 372, 343, 344, 345, -1, 320, -1, + 123, 732, -1, -1, 61, -1, 1140, -1, 10, -1, + 1144, 91, 367, -1, 1148, -1, 371, 372, 367, -1, + 369, 370, 371, 372, 367, 374, 375, 91, 371, 372, + -1, -1, 367, 267, 91, -1, 371, 372, 40, -1, + -1, -1, 44, 123, 46, 367, 280, 1181, -1, 371, + 372, -1, -1, -1, -1, 279, -1, 59, -1, 1287, + -1, 1289, -1, -1, 1198, 414, 123, 1201, 44, -1, + 46, -1, -1, 279, -1, -1, 262, 263, 264, 428, + 811, 267, 268, 269, 433, 271, 1220, -1, -1, 91, + -1, -1, -1, 279, -1, 1023, 1024, 1231, -1, -1, + 10, 10, 223, -1, -1, 226, 227, 228, 294, 295, + 296, 297, 298, 347, 348, 91, -1, -1, 467, -1, + 2, 123, 124, 347, 348, -1, 475, 40, 38, -1, + -1, 44, 42, 46, -1, 1363, 322, 46, 324, 488, + -1, 347, 348, 279, 267, 876, 877, -1, -1, 59, + 59, 61, -1, -1, 1288, -1, 10, 280, -1, 1293, + 1294, -1, -1, 1297, -1, 351, -1, 10, -1, -1, + -1, 53, 54, -1, -1, 57, -1, 526, 91, -1, + -1, -1, 91, -1, 370, -1, 40, 41, -1, -1, + 44, -1, 46, -1, -1, 544, -1, 40, 10, 279, + 280, 932, -1, 46, 1338, -1, 88, 61, -1, -1, + 123, 347, 348, 944, 945, 279, 59, -1, -1, 950, + 951, 1149, 279, 280, 347, 348, 957, -1, 0, -1, + 112, -1, -1, -1, 46, -1, -1, 91, 10, -1, + -1, 123, 124, -1, 975, 976, -1, 59, 91, -1, + 599, 600, -1, 602, 603, -1, 987, -1, -1, -1, + 609, -1, -1, 1191, 1192, 1193, -1, 347, 348, 41, + 619, -1, -1, -1, 46, -1, -1, -1, 280, 91, + 123, -1, -1, 347, 348, 308, 309, 59, 311, -1, + 347, 348, -1, -1, -1, 318, 319, -1, 10, -1, + -1, -1, 1033, 279, -1, -1, -1, -1, 1039, -1, + 1023, 1024, -1, -1, 1045, -1, 306, 1048, 308, 309, + 310, 311, 671, -1, -1, -1, 675, 676, 677, 41, + -1, 1062, 44, -1, 46, 2, 685, -1, 687, -1, + 1071, -1, -1, 225, 693, 347, 348, -1, 10, 61, + -1, 0, 701, 125, 703, 704, -1, -1, 267, -1, + -1, 10, 352, -1, -1, 486, 279, 280, -1, 490, + -1, 347, 348, 494, -1, 1303, 258, 1090, 1091, 91, + -1, 1094, -1, 732, 46, -1, 53, 54, -1, -1, + 57, -1, 41, -1, 276, 44, 306, 59, 308, 309, + 310, 311, 312, 294, 295, 296, 297, 298, 529, 1140, + 59, -1, 533, 1144, -1, 1128, -1, 1148, 328, -1, + -1, 88, -1, -1, 267, 279, 308, -1, -1, 91, + -1, -1, 342, -1, 347, 348, 1149, 280, 347, 348, + -1, -1, 352, -1, 93, 112, -1, 357, 358, 359, + 1181, -1, -1, -1, 1167, 267, 123, 124, 1171, 2, + -1, 343, 811, 345, -1, -1, 44, 1198, 46, 590, + 1201, 1184, 1185, 1186, 1187, -1, 125, -1, 1191, 1192, + -1, 1194, -1, -1, -1, 367, -1, -1, -1, 1220, + 262, 263, 264, 347, 348, 267, 268, 269, -1, 271, + 1231, -1, -1, 10, 347, 348, -1, 279, -1, 281, + 53, 54, -1, 91, 57, -1, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, 876, 877, -1, + -1, -1, -1, 40, 41, 347, 348, 44, -1, 46, + -1, -1, -1, 10, -1, 88, 428, 429, -1, -1, + 322, 433, 324, -1, 61, 676, 677, 1288, 225, -1, + -1, -1, 1293, 1294, -1, -1, 1297, 279, -1, 112, + -1, -1, -1, 40, 41, 347, 348, 44, -1, 46, + 123, 124, -1, 932, 91, -1, -1, 708, -1, 1302, + -1, 258, 1305, -1, 61, 944, 945, -1, 370, -1, + 1313, 950, 951, -1, 725, 267, 727, 1338, 957, 276, + -1, -1, -1, 262, 263, 264, 123, -1, 267, 268, + 269, -1, 271, -1, 91, 10, 975, 976, -1, -1, + 279, -1, 281, 282, 283, 347, 348, -1, 987, -1, + -1, 308, 291, 292, 526, 294, 295, 296, 297, 298, + -1, -1, -1, -1, -1, 40, 123, 1370, -1, 44, + 781, 46, -1, 44, 546, 46, 306, -1, 308, 309, + 310, 311, -1, 322, 59, 324, 343, -1, 345, 1197, + -1, -1, 225, -1, 1033, 347, 348, -1, -1, -1, + 1039, -1, -1, -1, -1, 10, 1045, -1, -1, 1048, + 367, 279, 351, -1, -1, 826, 91, 356, -1, 10, + 91, -1, -1, 1062, -1, 258, -1, 599, -1, -1, + 602, 370, 1071, -1, 373, -1, 41, 848, -1, 44, + -1, 46, -1, 276, -1, -1, 2, 619, 123, 124, + 41, -1, -1, 44, -1, 46, 61, -1, 1023, 1024, + 10, -1, 873, -1, -1, -1, -1, 2, -1, -1, + 61, 428, 429, -1, -1, 308, 433, -1, -1, 347, + 348, -1, 279, 280, 1197, -1, 91, -1, -1, -1, + -1, 41, -1, -1, 44, -1, 46, 53, 54, 671, + 91, 1140, -1, 675, 676, 1144, 1314, 679, 1316, 1148, + 343, 61, 345, 685, -1, 1323, -1, -1, 53, 54, + -1, 693, 279, 280, -1, 1090, 1091, -1, -1, 1094, + -1, 703, 704, -1, 367, -1, -1, -1, -1, -1, + -1, 91, 1181, -1, 10, -1, -1, -1, -1, 10, + 347, 348, 963, 88, -1, -1, -1, -1, 969, 1198, + -1, -1, 1201, 1128, 1372, -1, 1374, -1, 1376, 526, + 1378, -1, 983, 745, 40, -1, -1, -1, -1, 10, + 46, 1220, 754, -1, 1149, 46, 1394, -1, 999, 546, + 347, 348, 1231, 59, -1, 428, 429, -1, 59, -1, + 433, 1314, 1167, 1316, -1, 280, 1171, 1320, 279, 40, + 1323, -1, -1, -1, -1, 46, -1, 10, -1, 1184, + 1185, 1186, 1187, -1, -1, 91, 1191, 1192, 59, 1194, + 91, -1, -1, -1, -1, 1046, -1, -1, -1, 811, + -1, -1, 599, -1, -1, 602, -1, -1, -1, 1288, + 1061, -1, -1, 46, 1293, 1294, -1, 123, 1297, 1372, + 91, 1374, 619, 1376, -1, 1378, 59, -1, 0, 225, + -1, -1, 347, 348, 279, -1, 347, 348, 10, -1, + -1, 1394, -1, -1, -1, -1, -1, -1, 279, 861, + 225, -1, 123, 526, -1, -1, -1, -1, 91, 1338, + -1, -1, 258, -1, -1, 877, -1, -1, -1, 41, + -1, -1, 44, 546, 671, 10, -1, -1, 675, 676, + 276, -1, 679, 258, -1, -1, 58, 59, 685, 279, + 306, 63, 308, 309, 310, 311, 693, 1302, -1, 1150, + 1305, 276, 347, 348, -1, 40, 703, 704, 1313, 44, + -1, 46, -1, 1023, 1024, -1, 347, 348, -1, -1, + -1, 93, -1, -1, 59, -1, 599, -1, -1, 602, + -1, -1, 944, 945, -1, -1, 352, -1, 950, 951, + -1, 357, -1, -1, -1, 10, 619, 343, 745, 345, + -1, -1, -1, 125, -1, -1, 91, 347, 348, -1, + -1, 267, -1, 975, -1, 1370, 267, -1, 343, -1, + 345, 367, -1, -1, 280, 987, -1, -1, -1, -1, + -1, 46, -1, -1, 1094, -1, -1, -1, 123, 124, + -1, -1, 367, -1, 59, -1, 267, -1, 671, -1, + -1, -1, 675, 676, -1, -1, 679, 10, -1, 280, + -1, -1, 685, -1, 811, -1, -1, -1, 1128, -1, + 693, 1033, -1, -1, -1, -1, 91, 1039, -1, -1, + 703, 704, 428, 1045, 267, 10, 1048, 433, -1, 1149, + -1, 347, 348, 46, -1, -1, 347, 348, -1, -1, + 1062, -1, -1, 428, -1, -1, 59, 1167, 433, 1071, + -1, -1, -1, 38, 861, 40, -1, 42, -1, -1, + -1, 46, 745, -1, 1184, -1, 347, 348, -1, -1, + 877, 1191, 1192, -1, 59, -1, 61, -1, 91, -1, + 262, 263, 264, 10, -1, 267, 268, 269, -1, 271, + -1, -1, -1, -1, -1, -1, -1, 279, -1, 281, + 282, 283, -1, -1, 347, 348, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, 1140, 46, + 526, -1, 1144, 1145, -1, -1, 1148, 38, 811, 40, + -1, 42, 59, -1, -1, 280, -1, 944, 945, 10, + 322, 526, 324, 950, 951, -1, -1, -1, -1, -1, + -1, -1, -1, 335, 336, -1, -1, 339, 340, -1, + -1, -1, -1, -1, 91, -1, -1, -1, 975, 351, + 41, -1, -1, 44, 356, 46, 1198, -1, 861, 1201, + 987, -1, -1, -1, -1, -1, -1, 0, 370, -1, + 61, 373, 267, 599, 877, -1, 602, 10, 1220, -1, + 40, -1, 347, 348, 44, -1, 46, -1, -1, 1231, + -1, -1, -1, 619, 599, -1, -1, 602, -1, -1, + 91, -1, -1, -1, -1, -1, 1033, -1, 41, -1, + -1, 44, 1039, -1, 619, -1, -1, -1, 1045, -1, + -1, 1048, 37, 38, -1, -1, 59, 42, 43, -1, + 45, 91, 47, -1, 267, 1062, -1, -1, 1280, -1, + -1, 944, 945, -1, 1071, 671, -1, 950, 951, 675, + 676, -1, 347, 348, -1, 1297, -1, -1, -1, 685, + 93, -1, -1, 123, -1, -1, 671, 693, -1, -1, + 675, 676, 975, -1, -1, -1, -1, 703, 704, 94, + 685, -1, -1, -1, 987, -1, -1, 1329, 693, -1, + -1, -1, 125, -1, -1, 10, 1338, -1, 703, 704, + -1, 306, -1, 308, 309, 310, 311, 312, -1, 124, + -1, -1, -1, 1140, 347, 348, -1, 1144, 1145, -1, + 267, 1148, -1, 328, -1, -1, 41, -1, -1, 44, + 1033, 46, -1, 10, -1, -1, 1039, 342, -1, -1, + -1, -1, 1045, 348, -1, 1048, 61, 352, -1, -1, + -1, -1, 357, 358, 359, -1, -1, -1, -1, 1062, + -1, -1, -1, 41, 41, -1, -1, 44, 1071, 46, + -1, 1198, -1, -1, 1201, 306, 91, 308, 309, 310, + 311, 312, -1, -1, 61, 811, -1, -1, 279, -1, + -1, -1, -1, 1220, -1, -1, -1, 328, -1, -1, + 347, 348, -1, -1, 1231, -1, 811, -1, -1, 40, + -1, 342, -1, 44, 91, 46, -1, -1, -1, 279, + 280, 352, -1, -1, -1, -1, 357, 358, 359, 262, + 263, 264, -1, -1, 267, 268, 269, 1140, 271, -1, + -1, 1144, 1145, -1, -1, 1148, 279, 125, 281, 282, + 10, 877, -1, 1280, -1, -1, 347, 348, 291, 292, + 91, 294, 295, 296, 297, 298, -1, -1, -1, -1, + 1297, -1, 877, -1, 15, 16, -1, -1, 38, -1, + 40, -1, 42, -1, -1, -1, 46, 347, 348, 322, + -1, 324, 123, -1, -1, 1198, -1, -1, 1201, 59, + -1, 61, 1329, -1, -1, -1, -1, 48, 49, 50, + 51, 1338, -1, 328, 55, 56, -1, 1220, 944, 945, + -1, -1, -1, 356, 950, 951, 67, 68, 1231, -1, + 345, 346, 1023, 1024, -1, -1, -1, 370, -1, 944, + 945, -1, -1, -1, -1, 950, 951, -1, -1, 975, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 987, -1, -1, 279, -1, -1, -1, -1, -1, + 975, -1, -1, -1, -1, -1, 117, 1280, -1, -1, + -1, -1, 987, -1, 262, 263, 264, -1, -1, -1, + 268, 269, -1, 271, 1297, -1, -1, -1, -1, 1090, + 1091, 279, 279, 1094, -1, -1, -1, 1033, -1, -1, + -1, -1, -1, 1039, -1, -1, -1, -1, -1, 1045, + 0, -1, 1048, -1, -1, -1, 1329, -1, 1033, -1, + 10, -1, 347, 348, 1039, 1338, 1062, 1128, -1, -1, + 1045, -1, -1, 1048, 322, 1071, 324, -1, 279, 280, + -1, -1, -1, -1, -1, -1, -1, 1062, 1149, -1, + -1, 41, -1, -1, 44, -1, 1071, -1, -1, -1, + 347, 348, -1, -1, -1, -1, 1167, 10, -1, 59, + 1171, -1, 223, -1, -1, 226, 227, 228, -1, 230, + -1, -1, 370, 1184, 1185, 1186, 1187, -1, -1, -1, + 1191, 1192, -1, 1194, -1, -1, 247, -1, 41, 250, + -1, 44, -1, 46, 1140, -1, 347, 348, 1144, -1, + -1, -1, 1148, 38, -1, -1, -1, 42, 61, -1, + -1, -1, -1, -1, 10, 1140, -1, -1, -1, 1144, + 1145, -1, -1, 1148, -1, 125, 306, -1, 308, 309, + 310, 311, 312, -1, -1, -1, -1, -1, 91, -1, + -1, -1, 38, -1, 40, -1, 42, -1, 328, -1, + 46, -1, 1198, -1, -1, 1201, -1, -1, -1, -1, + -1, -1, 342, 59, -1, 61, -1, -1, 348, -1, + -1, -1, 352, 1198, 1220, -1, 1201, 357, 358, 359, + -1, -1, -1, -1, -1, 1231, -1, -1, -1, -1, + -1, 1302, -1, -1, 1305, 1220, -1, -1, -1, -1, + -1, -1, 1313, -1, -1, -1, 1231, -1, -1, -1, + -1, 0, -1, -1, -1, -1, 377, 378, 379, 380, + 381, 10, -1, 384, 385, 386, 387, 388, 389, 390, + 391, -1, 393, -1, -1, 396, 397, 398, 399, 400, + 401, 402, 403, 404, -1, -1, -1, -1, -1, -1, + 10, 1297, 41, 414, -1, 44, 417, 10, -1, 1370, + -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, + 59, 271, 1297, -1, -1, 0, -1, -1, -1, 279, + -1, 41, -1, -1, 44, 10, 46, -1, 41, -1, + -1, 44, 1338, 46, 294, 295, 296, 297, 298, -1, + -1, 61, -1, -1, 93, -1, -1, -1, 61, -1, + -1, -1, -1, 1338, 475, -1, 41, -1, -1, -1, + -1, -1, 322, -1, 324, 486, 279, 488, -1, 490, + -1, 91, -1, 494, 59, -1, 125, 498, 91, -1, + -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, + -1, 351, -1, -1, 10, 516, -1, 518, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 529, -1, + 370, 306, 533, 308, 309, 310, 311, 312, -1, -1, + -1, 37, 38, 544, -1, 41, 42, 43, 44, 45, + 46, 47, -1, 328, 347, 348, -1, -1, -1, -1, + 125, -1, 58, 59, 60, 61, 62, 63, -1, -1, + 306, -1, 308, 309, 310, 311, 312, 352, -1, -1, + -1, -1, 357, 358, 359, -1, -1, -1, -1, 590, + 40, -1, 328, -1, 44, 91, 46, 93, 94, 600, + -1, -1, 603, -1, -1, -1, 342, -1, 609, -1, + -1, -1, 348, -1, -1, -1, 352, -1, -1, -1, + -1, 357, 358, 359, -1, -1, -1, 123, 124, 125, + -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, 91, 271, -1, -1, -1, -1, -1, -1, -1, + 279, -1, 281, 282, -1, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + 671, -1, -1, 123, 675, 676, 677, -1, -1, 279, + -1, -1, -1, -1, 0, -1, 279, -1, -1, -1, + -1, -1, -1, 322, 10, 324, -1, 262, 263, 264, + 701, -1, 267, 268, 269, -1, 271, 708, 709, 710, + -1, -1, -1, -1, 279, -1, 281, -1, -1, -1, + 721, -1, 723, 724, 725, 41, 727, 356, 44, 294, + 295, 296, 297, 298, -1, -1, -1, -1, 739, -1, + -1, 370, 58, 59, -1, -1, -1, 347, 348, -1, + -1, -1, 1023, 1024, 347, 348, -1, 322, -1, 324, + -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, + -1, 267, 268, 269, -1, 271, -1, 93, -1, -1, + 781, -1, -1, 279, 280, 281, 282, 283, -1, -1, + -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, 370, -1, -1, -1, 125, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1090, + 1091, -1, -1, 1094, -1, 826, 322, -1, 324, 279, + 280, 10, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, -1, 848, 0, 345, + 346, 347, 348, -1, -1, 351, -1, 1128, 10, -1, + 356, -1, 41, -1, -1, 44, -1, 46, -1, -1, + -1, -1, 873, -1, 370, -1, -1, 373, 1149, -1, + -1, 33, 61, -1, -1, 37, 38, -1, 40, 41, + 42, 43, 44, 45, 46, 47, 1167, 347, 348, -1, + 1171, -1, -1, -1, -1, -1, 58, 59, 60, 61, + 62, 63, 91, 1184, 1185, 1186, 1187, -1, -1, -1, + 1191, 1192, -1, 1194, -1, -1, -1, -1, -1, -1, + -1, 932, -1, -1, -1, -1, -1, -1, -1, 91, + 941, 93, 94, 944, 945, -1, 262, 263, 264, 950, + 951, 267, 268, 269, -1, 271, 957, -1, -1, -1, + -1, -1, 963, 279, -1, 281, 282, 283, 969, -1, + -1, 123, 124, 125, 126, 291, 292, -1, 294, 295, + 296, 297, 983, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 993, 994, 995, -1, 997, 998, 999, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, 10, -1, -1, -1, 37, 38, -1, 1020, + 1021, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, 1302, 1033, -1, 1305, 351, -1, 1038, -1, 60, + 356, 62, 1313, 41, 1045, 1046, 44, 38, 46, -1, + -1, 42, -1, -1, 370, -1, -1, 373, -1, -1, + 1061, -1, -1, 61, -1, -1, 1067, -1, -1, -1, + -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 91, -1, -1, -1, -1, -1, 1370, + 279, -1, -1, 124, -1, 257, 258, 259, -1, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 38, 300, 1150, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 347, 348, + 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, -1, -1, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 0, 368, 369, 370, -1, + -1, 373, -1, -1, -1, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, 63, -1, - -1, -1, -1, -1, 287, 288, 289, 290, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 303, 304, 305, -1, -1, -1, 91, -1, 93, 94, - 313, 314, 315, 316, 317, -1, -1, -1, -1, 322, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, 123, 124, - 125, 126, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, 33, -1, -1, -1, 37, + -1, 279, -1, -1, -1, -1, -1, 1288, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 91, 328, 93, 94, + -1, -1, 333, 334, -1, 306, -1, 308, 309, 310, + 311, 312, -1, 1273, 345, 346, -1, -1, 1278, -1, + -1, -1, 0, -1, -1, -1, -1, 328, 123, 124, + 125, 126, 10, -1, -1, -1, -1, -1, -1, 347, + 348, 342, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 352, -1, -1, -1, 33, 357, 358, 359, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, 93, 94, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 123, 124, 125, 126, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1354, 1355, 1356, 1357, -1, -1, + -1, 1361, -1, -1, -1, 306, -1, 308, 309, 310, + 311, 312, -1, 91, -1, 93, 94, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 328, 1388, 1389, + 1390, 1391, -1, -1, -1, -1, -1, 1397, -1, -1, + -1, 342, -1, -1, -1, 123, 124, 125, 126, -1, + -1, 352, -1, -1, -1, -1, -1, 358, 359, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, + 295, 296, 297, 298, 38, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, -1, -1, 343, 344, - 345, 346, 347, -1, 349, 350, 351, 352, 353, 354, + 315, 316, 317, 318, 319, -1, -1, 322, 323, 324, + -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, -1, -1, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 368, -1, -1, 371, -1, -1, 257, + 365, 366, -1, 368, 369, 370, -1, -1, 373, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, + 318, 319, -1, -1, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, -1, -1, 343, 344, 345, 346, 347, - -1, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, 0, 366, 367, - 368, -1, -1, 371, -1, -1, -1, 10, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, - 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, - 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, - 123, 124, 125, 126, 10, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, - -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, - 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, -1, 93, 94, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, - 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, - 343, 344, 345, 346, 347, -1, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, 368, -1, -1, 371, -1, - -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, -1, -1, 343, 344, 345, - 346, 347, -1, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 0, - 366, 367, 368, -1, -1, 371, -1, -1, -1, 10, + 338, 339, 340, 341, 342, -1, -1, 345, 346, 347, + 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 0, + 368, 369, 370, -1, -1, 373, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 306, -1, 308, 309, 310, 311, 312, -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, 123, 124, 125, 126, 10, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 123, 124, 125, 126, 10, -1, 352, -1, + -1, -1, -1, -1, 358, 359, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, + 287, 288, 289, 290, 58, 59, 60, 61, 62, 63, + -1, -1, -1, -1, -1, -1, 303, 304, 305, -1, + -1, -1, -1, -1, -1, -1, 313, 314, 315, 316, + 317, -1, -1, -1, -1, -1, 323, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, - 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, + 124, 125, 126, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, -1, - -1, 322, -1, 324, 325, 326, 327, 328, 329, 330, + -1, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - -1, -1, 343, 344, 345, 346, 347, -1, 349, 350, + 341, 342, -1, -1, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, 368, -1, -1, - 371, -1, -1, 257, 258, 259, -1, 261, 262, 263, + 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, + -1, -1, 373, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, -1, -1, 343, - 344, 345, 346, 347, -1, 349, 350, 351, 352, 353, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, -1, + -1, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 0, 366, 367, 368, -1, -1, 371, -1, -1, - -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + 364, 365, 366, 0, 368, 369, 370, -1, -1, 373, + -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, - -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, - -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, - -1, -1, 91, -1, 93, 94, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, + 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, -1, -1, -1, 124, 125, 126, -1, -1, - -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, 38, - -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, - -1, -1, -1, -1, 124, -1, -1, -1, -1, 58, - 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, 93, 94, -1, -1, -1, -1, + -1, -1, -1, -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 38, -1, 40, -1, 42, -1, -1, -1, 46, - -1, -1, -1, -1, 123, 124, 125, -1, -1, -1, - -1, -1, 59, -1, 61, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, - 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, -1, -1, 343, 344, 345, 346, 347, -1, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 326, 366, 367, 368, - -1, -1, 371, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, 343, 344, -1, -1, -1, -1, -1, - 279, 280, 281, 282, 283, -1, -1, -1, -1, -1, - -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 10, -1, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, -1, -1, -1, 343, 344, 345, 346, -1, -1, - 349, -1, 37, 38, -1, 354, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, 368, - -1, -1, 371, 58, 59, 60, 61, 62, 63, 306, - -1, 308, 309, 310, 311, 312, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - -1, -1, -1, -1, -1, -1, 91, -1, 93, 94, - 0, -1, -1, 340, -1, -1, -1, -1, -1, 346, - 10, -1, -1, 350, -1, -1, -1, -1, 355, 356, - 357, -1, -1, -1, -1, -1, -1, -1, -1, 124, - 125, -1, -1, -1, -1, -1, -1, 37, 38, -1, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + 0, -1, -1, -1, -1, -1, 123, 124, 125, 126, + 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, + 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, - 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, + 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 38, -1, 40, -1, 42, - -1, 91, -1, 93, 94, -1, -1, -1, 0, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 58, 59, 60, 61, - 62, 63, -1, -1, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, - -1, -1, -1, -1, 279, -1, 281, 282, 283, 91, - -1, 93, 94, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, - -1, -1, 124, 125, -1, 10, -1, -1, -1, -1, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - 345, 346, -1, 348, 349, -1, 41, -1, -1, 354, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, 368, 59, -1, 371, -1, -1, 279, - -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, - -1, -1, -1, -1, 38, -1, -1, -1, 42, -1, - -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, - 42, -1, -1, -1, -1, -1, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - 125, -1, -1, 343, 344, 345, 346, -1, 348, 349, - -1, -1, -1, 306, 354, 308, 309, 310, 311, 312, - 262, 263, 264, -1, -1, 267, 268, 269, 368, 271, - -1, 371, -1, 326, -1, -1, -1, 279, -1, 281, - 282, 283, -1, -1, -1, -1, -1, 340, -1, 291, - 292, -1, 294, 295, 296, 297, 298, 350, -1, -1, - -1, -1, 355, 356, 357, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 10, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 345, 346, -1, 348, 349, -1, 37, - 38, -1, 354, 41, 42, 43, 44, 45, 46, 47, - -1, -1, -1, -1, -1, -1, 368, -1, -1, 371, - 58, 59, 60, 61, 62, 63, -1, 262, 263, 264, - -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, - -1, -1, -1, -1, 279, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, 93, 94, 0, -1, 294, - 295, 296, 297, 298, -1, -1, -1, 10, -1, -1, + -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, - -1, -1, -1, -1, 37, 38, -1, -1, 41, 42, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 123, 124, 125, 126, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, -1, -1, 322, 323, 324, -1, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, -1, -1, 345, 346, + 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, 370, -1, -1, 373, 257, 258, 259, + -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, + 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + -1, -1, 322, 323, 324, -1, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, -1, -1, 345, 346, 347, 348, 349, + -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 0, 368, 369, + 370, -1, -1, 373, -1, -1, -1, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, - 63, -1, 306, -1, 308, 309, 310, 311, 312, -1, - -1, -1, -1, 368, 306, -1, 308, 309, 310, 311, - 312, -1, 326, -1, -1, -1, -1, -1, 91, -1, - 93, 94, -1, -1, 326, 0, 340, -1, -1, -1, - -1, -1, -1, -1, -1, 10, 350, -1, -1, -1, - -1, 355, 356, 357, -1, -1, -1, -1, 350, -1, - -1, 124, 125, 355, 356, 357, -1, -1, -1, -1, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, 59, 60, 61, 62, 63, -1, - -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, - 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, - -1, 279, -1, 281, 282, 283, 91, -1, 93, 94, - -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, - 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, 124, - 125, -1, 10, -1, -1, -1, -1, -1, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, -1, -1, -1, -1, 343, 344, 345, 346, -1, - 348, 349, -1, 41, -1, -1, 354, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, - 368, 59, -1, 371, -1, -1, 279, -1, 281, 282, - 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, - -1, 294, 295, 296, 297, 298, -1, 37, 38, -1, - -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 60, -1, 62, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, -1, 125, -1, -1, - 343, 344, 345, 346, -1, 348, 349, -1, -1, -1, - -1, 354, -1, -1, 94, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, 368, 271, -1, 371, -1, - -1, -1, -1, -1, 279, -1, 281, 282, 283, -1, - -1, -1, -1, -1, 124, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, + 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - 345, 346, -1, 348, 349, -1, 37, 38, -1, 354, - 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, - -1, -1, -1, 368, -1, -1, 371, 58, 59, 60, - 61, 62, 63, -1, 262, 263, 264, -1, -1, -1, - 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, - -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, - 91, -1, 93, 94, 0, -1, 294, 295, 296, 297, - 298, -1, -1, -1, 10, -1, -1, -1, -1, -1, + 123, 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, - -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, - 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, 59, 60, 61, 62, 63, -1, -1, + -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, + 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 368, -1, -1, -1, -1, -1, 326, -1, -1, -1, - -1, 331, 332, -1, -1, 91, -1, 93, 94, -1, - -1, -1, 0, 343, 344, -1, -1, -1, -1, -1, - -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 124, 125, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, - 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, + 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + -1, 38, -1, 40, -1, 42, -1, -1, -1, 46, + -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, + -1, -1, 59, -1, 61, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, + 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + -1, -1, 345, 346, 347, 348, 349, -1, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, 370, -1, -1, + 373, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - 281, 282, 283, 91, -1, 93, 94, -1, -1, -1, + 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - -1, -1, -1, -1, -1, -1, 124, 125, -1, 10, - -1, -1, -1, -1, -1, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, - -1, -1, 343, 344, 345, 346, -1, 348, 349, -1, - 41, -1, -1, 354, -1, -1, 262, 263, 264, -1, - -1, 267, 268, 269, -1, 271, -1, 368, 59, -1, - 371, -1, -1, 279, -1, 281, 282, 283, -1, -1, - -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, - 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, + -1, 322, -1, 324, -1, 10, -1, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, -1, -1, 345, 346, 347, 348, -1, 350, + 351, -1, 37, 38, -1, 356, 41, 42, 43, 44, + 45, 46, 47, -1, -1, -1, -1, -1, -1, 370, + -1, -1, 373, 58, 59, 60, 61, 62, 63, 306, + -1, 308, 309, 310, 311, 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 326, 327, 328, 329, 330, 331, 332, - }; - } - - private static final short[] yyCheck2() { - return new short[] { - - 333, 334, 335, 336, 337, 338, -1, 125, -1, -1, - 343, 344, 345, 346, -1, 348, 349, -1, -1, -1, - -1, 354, -1, -1, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, 368, 271, -1, 371, -1, - -1, -1, -1, -1, 279, -1, 281, 282, 283, -1, - -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - 345, 346, -1, 348, 349, -1, 37, 38, -1, 354, - 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, - -1, -1, -1, 368, -1, -1, 371, 58, 59, 60, - 61, 62, 63, -1, 262, 263, 264, -1, -1, -1, - 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, - -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, - 91, -1, 93, 94, 0, -1, 294, 295, 296, 297, - 298, -1, -1, -1, 10, -1, -1, -1, -1, -1, + -1, 328, -1, -1, -1, -1, 91, -1, 93, 94, + 0, -1, -1, -1, -1, 342, -1, -1, -1, -1, + 10, 348, -1, -1, -1, 352, -1, -1, -1, -1, + 357, 358, 359, -1, -1, -1, -1, -1, -1, 124, + 125, -1, -1, -1, -1, -1, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, + 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, - -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, - 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 368, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, -1, 93, 94, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, - 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, 91, -1, 93, 94, -1, -1, -1, 0, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - 281, 282, 283, 91, -1, 93, 94, -1, -1, -1, - 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - -1, -1, -1, -1, -1, 123, 124, 125, -1, 10, - -1, -1, -1, -1, -1, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, - -1, -1, 343, 344, 345, 346, -1, 348, 349, -1, - 41, -1, -1, 354, -1, -1, 262, 263, 264, -1, - -1, 267, 268, 269, -1, 271, -1, 368, 59, -1, - 371, -1, -1, 279, 280, 281, 282, 283, -1, -1, - -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, - 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, 38, -1, -1, 41, + 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 58, 59, 60, 61, + 62, 63, -1, -1, -1, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, -1, -1, -1, 279, -1, 281, 282, 283, 91, + -1, 93, 94, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 124, 125, -1, -1, -1, 322, -1, 324, + -1, -1, -1, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, -1, -1, -1, -1, + 345, 346, 347, 348, -1, 350, 351, -1, -1, -1, + -1, 356, 262, 263, 264, -1, -1, 267, 268, 269, + -1, 271, -1, -1, -1, 370, -1, -1, 373, 279, + -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, + -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, -1, 125, -1, -1, 343, 344, 345, - 346, -1, -1, 349, -1, -1, -1, -1, 354, -1, - -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, - 268, 269, 368, 271, -1, 371, -1, -1, -1, -1, - -1, 279, 280, 281, 282, 283, -1, -1, -1, -1, - -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, - 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 10, -1, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, -1, -1, -1, -1, 343, 344, 345, 346, -1, - -1, 349, -1, 37, 38, -1, 354, 41, 42, 43, - 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, - 368, -1, -1, 371, 58, 59, 60, 61, 62, 63, - -1, 262, 263, 264, -1, -1, -1, 268, 269, -1, - 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, - 94, 0, -1, 294, 295, 296, 297, 298, -1, -1, - -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, + -1, -1, 322, -1, 324, -1, -1, 10, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, -1, 345, 346, 347, 348, -1, + 350, 351, -1, -1, -1, -1, 356, -1, 41, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + 370, -1, -1, 373, -1, -1, 59, 279, -1, 281, + 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 124, 125, -1, -1, -1, -1, -1, -1, 37, 38, - -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, + 93, -1, -1, -1, 0, -1, -1, -1, -1, -1, + 322, -1, 324, -1, 10, -1, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, 125, 345, 346, 347, 348, -1, 350, 351, + -1, 37, 38, -1, 356, 41, 42, 43, 44, 45, + 46, 47, -1, -1, -1, -1, -1, -1, 370, -1, + -1, 373, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, 93, 94, -1, -1, -1, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 91, -1, 93, 94, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, - 91, -1, 93, 94, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, -1, 124, 125, -1, 10, -1, -1, -1, - -1, -1, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, -1, -1, -1, -1, 343, - 344, 345, 346, -1, -1, 349, -1, 41, -1, -1, - 354, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, -1, 368, 59, -1, 371, -1, -1, - 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, - -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + 61, 62, 63, -1, -1, -1, -1, -1, -1, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, + -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, + 91, -1, 93, 94, -1, -1, -1, 0, 291, 292, + -1, 294, 295, 296, 297, 298, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 124, 125, -1, -1, -1, -1, 322, + -1, 324, -1, -1, 37, 38, -1, -1, 41, 42, + 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, + 63, -1, -1, 356, -1, -1, 262, 263, 264, -1, + -1, 267, 268, 269, -1, 271, -1, 370, -1, -1, + -1, -1, -1, 279, -1, 281, 282, 283, 91, -1, + 93, 94, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, 125, -1, -1, 343, 344, 345, 346, -1, -1, - 349, -1, -1, -1, -1, 354, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, 368, - 271, -1, 371, -1, -1, -1, -1, -1, 279, -1, + -1, 124, 125, -1, -1, -1, 322, -1, 324, -1, + -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, -1, -1, -1, 345, + 346, 347, 348, -1, 350, 351, -1, -1, -1, -1, + 356, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, 370, -1, -1, 373, 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, - -1, -1, 343, 344, 345, 346, -1, -1, 349, -1, - 37, 38, -1, 354, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, 368, -1, -1, - 371, 58, 59, 60, -1, 62, 63, -1, 262, 263, - 264, -1, -1, -1, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, + -1, 322, -1, 324, -1, -1, 10, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, -1, -1, 345, 346, 347, 348, -1, 350, + 351, -1, -1, -1, -1, 356, -1, 41, -1, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, 370, + -1, -1, 373, -1, -1, 59, 279, -1, 281, 282, + 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, + -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, + -1, -1, -1, 0, -1, -1, -1, -1, -1, 322, + -1, 324, -1, 10, -1, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, + -1, 125, 345, 346, 347, 348, -1, 350, 351, -1, + 37, 38, -1, 356, 41, 42, 43, 44, 45, 46, + 47, -1, -1, -1, -1, -1, -1, 370, -1, -1, + 373, 58, 59, 60, 61, 62, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, 94, 0, -1, - 294, 295, 296, 297, -1, -1, -1, -1, 10, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - -1, 93, 94, -1, -1, -1, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 58, 59, 60, 61, + 62, 63, -1, -1, -1, -1, -1, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, + -1, -1, -1, -1, -1, 279, -1, 281, 282, 91, + -1, 93, 94, -1, -1, -1, 0, 291, 292, -1, + 294, 295, 296, 297, 298, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, + -1, -1, 124, 125, -1, -1, -1, -1, 322, -1, + 324, -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, + -1, -1, -1, -1, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, + 267, 268, 269, -1, 271, -1, 370, -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, 91, -1, 93, 94, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, - 124, 125, -1, -1, 10, -1, -1, -1, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, - -1, -1, 349, -1, -1, 41, -1, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, -1, -1, -1, 322, -1, 324, -1, -1, + -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + 347, 348, -1, 350, 351, -1, -1, -1, -1, 356, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - -1, 368, -1, 59, 371, -1, -1, 279, -1, 281, + -1, -1, -1, 370, -1, -1, 373, 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 10, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, 125, - -1, 343, 344, 345, 346, -1, -1, 349, -1, -1, - -1, -1, 354, 41, -1, -1, 44, -1, 262, 263, - 264, -1, -1, 267, 268, 269, 368, 271, -1, 371, - -1, 59, -1, -1, -1, 279, -1, 281, 282, 283, + -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, + 322, -1, 324, -1, -1, 10, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, -1, 345, 346, 347, 348, -1, 350, 351, + -1, -1, -1, -1, 356, -1, 41, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, 370, -1, + -1, 373, -1, -1, 59, 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, - 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 10, -1, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, -1, -1, 125, -1, 343, - 344, 345, 346, -1, -1, 349, -1, 37, 38, -1, - 354, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, -1, -1, 368, -1, -1, 371, 58, 59, - 60, -1, 62, 63, -1, -1, 262, 263, 264, -1, - -1, -1, 268, 269, -1, 271, -1, -1, -1, -1, - -1, -1, -1, 279, -1, -1, -1, -1, -1, -1, - -1, 91, -1, 93, 94, 0, -1, -1, 294, 295, - 296, 297, -1, -1, -1, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, + -1, -1, 0, -1, -1, -1, -1, -1, 322, -1, + 324, -1, 10, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + 125, 345, 346, 347, 348, -1, 350, 351, -1, 37, + 38, -1, 356, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, 370, -1, -1, 373, + 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, - 268, 269, 368, 271, -1, -1, -1, -1, -1, -1, - -1, 279, -1, 281, 282, -1, -1, -1, 93, 94, - -1, 0, -1, 291, 292, -1, 294, 295, 296, 297, - 298, 10, 37, 38, -1, -1, -1, 42, 43, -1, - 45, -1, 47, -1, -1, -1, -1, -1, -1, 124, - 125, -1, -1, -1, -1, 60, -1, 62, 37, 38, - -1, -1, 41, 42, 43, 44, 45, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, -1, 62, 63, -1, 354, -1, -1, 94, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - 368, 271, -1, -1, -1, -1, -1, -1, -1, 279, - -1, 281, 282, 283, 93, 94, -1, -1, -1, 124, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 0, -1, -1, -1, 124, 125, -1, -1, -1, - -1, 10, -1, -1, -1, -1, -1, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - -1, -1, -1, 343, 344, 345, 346, -1, -1, 349, - -1, -1, 41, -1, 354, 44, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, 368, -1, - 59, 371, -1, -1, 279, -1, 281, 282, 283, -1, - -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, + -1, -1, -1, 91, -1, 93, 94, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, 125, -1, 343, 344, - -1, -1, -1, -1, 349, -1, -1, -1, -1, 354, - -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, 368, -1, -1, 371, -1, -1, -1, - 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, - -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, -1, -1, -1, 0, -1, -1, 343, 344, - -1, -1, -1, -1, -1, 10, -1, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, -1, -1, -1, 343, 344, -1, -1, -1, -1, - 349, -1, 37, 38, -1, 354, 41, 42, 43, 44, - 45, -1, 47, -1, -1, -1, -1, -1, -1, 368, - -1, -1, 371, 58, 59, 60, -1, 62, 63, -1, - -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, + -1, -1, -1, -1, -1, 123, 124, 125, -1, -1, + -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, + 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 60, 61, 62, + 63, -1, -1, -1, -1, -1, -1, 262, 263, 264, + -1, -1, 267, 268, + }; + } + + private static final int[] yyCheck2() { + return new int[] { + 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, - 279, -1, 281, 282, -1, -1, -1, -1, 93, 94, - 0, -1, 291, 292, -1, 294, 295, 296, 297, 298, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, - 125, -1, -1, -1, -1, -1, -1, 37, 38, -1, - -1, 41, 42, 43, 44, 45, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, - 60, -1, 62, 63, -1, 354, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, -1, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 10, 37, 38, -1, - -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, - 60, -1, 62, 37, 38, -1, -1, 41, 42, 43, - 44, 45, -1, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, - -1, -1, -1, -1, 94, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, - -1, -1, -1, -1, 279, -1, 281, 282, 283, 93, - 94, -1, -1, -1, 124, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, - 124, 125, -1, -1, -1, 10, -1, -1, -1, -1, - -1, -1, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - -1, -1, -1, -1, 349, -1, 41, -1, -1, 354, - 0, -1, 262, 263, 264, -1, -1, 267, 268, 269, - 10, 271, -1, 368, 59, -1, 371, -1, -1, 279, - -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, - -1, 41, -1, -1, 44, -1, -1, -1, 93, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, -1, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - 125, -1, -1, 343, 344, -1, -1, -1, -1, 349, - -1, -1, -1, -1, 354, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, 368, -1, - -1, 371, -1, -1, -1, 279, -1, 281, 282, 283, - -1, -1, -1, -1, -1, 125, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, 326, 327, 328, 329, - 330, 331, 332, 333, -1, 335, 336, -1, -1, -1, - 0, -1, -1, 343, 344, -1, -1, -1, -1, -1, - 10, -1, -1, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, -1, -1, -1, -1, 343, - 344, -1, -1, -1, -1, 349, -1, 37, 38, -1, - 354, 41, 42, 43, 44, 45, -1, 47, -1, -1, - -1, -1, -1, -1, 368, -1, -1, 371, 58, 59, - 60, -1, 62, 63, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, - -1, -1, -1, -1, 279, -1, 281, 282, -1, -1, - -1, -1, -1, 93, 94, 0, 291, 292, -1, 294, - 295, 296, 297, 298, -1, 10, -1, -1, -1, -1, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, -1, 124, 125, -1, -1, -1, 279, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, -1, 47, -1, 294, 295, 296, 297, 298, -1, - -1, -1, -1, 58, 59, 60, -1, 62, 63, 354, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, - -1, 0, -1, -1, -1, -1, -1, -1, -1, 349, + 279, -1, 281, 282, 91, -1, 93, 94, -1, -1, + -1, 0, 291, 292, -1, 294, 295, 296, 297, 298, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 368, 124, - 125, -1, -1, -1, -1, -1, -1, -1, 37, 38, - -1, -1, 41, 42, 43, 44, 45, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, + -1, -1, -1, 322, -1, 324, -1, -1, 37, 38, + -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, -1, -1, -1, -1, -1, -1, 279, - -1, 281, 282, 283, 93, 94, -1, -1, -1, -1, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + -1, 370, -1, -1, -1, -1, -1, 279, 280, 281, + 282, 283, 91, -1, 93, 94, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, -1, -1, -1, -1, 124, 125, -1, -1, -1, - 10, -1, -1, -1, -1, -1, -1, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - -1, -1, -1, 343, 344, -1, -1, -1, -1, 349, - -1, 41, -1, -1, 354, 0, 46, 262, 263, 264, - -1, -1, 267, 268, 269, 10, 271, -1, 368, 59, - -1, 371, -1, -1, 279, -1, 281, 282, 283, -1, - -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, 41, -1, -1, 44, + -1, -1, -1, -1, 123, 124, 125, -1, -1, -1, + 322, -1, 324, -1, -1, -1, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, -1, 345, 346, 347, 348, -1, -1, 351, + -1, -1, -1, -1, 356, 262, 263, 264, -1, -1, + 267, 268, 269, -1, 271, -1, -1, -1, 370, -1, + -1, 373, 279, -1, 281, 282, 283, -1, -1, -1, + -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, + 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, - -1, -1, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, 125, -1, -1, 343, 344, - -1, -1, -1, -1, 349, -1, -1, -1, 93, 354, - -1, 0, -1, 262, 263, 264, -1, -1, 267, 268, - 269, 10, 271, 368, -1, -1, 371, -1, -1, -1, - 279, -1, 281, 282, 283, -1, -1, -1, -1, 124, - 125, -1, 291, 292, -1, 294, 295, 296, 297, 298, - -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, - 59, -1, -1, -1, -1, 10, -1, -1, 327, 328, + 0, -1, -1, -1, -1, 322, -1, 324, -1, -1, + 10, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + 347, 348, -1, -1, 351, -1, -1, -1, -1, 356, + -1, 41, -1, 262, 263, 264, -1, -1, 267, 268, + 269, -1, 271, 370, -1, -1, 373, -1, -1, 59, + 279, 280, 281, 282, 283, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 93, -1, -1, -1, 0, -1, -1, + -1, -1, -1, 322, -1, 324, -1, 10, -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, -1, -1, -1, 343, 344, -1, -1, -1, -1, - 349, -1, 37, 38, 93, 354, 41, 42, 43, 44, - 45, -1, 47, -1, -1, -1, -1, -1, -1, 368, - -1, -1, 371, 58, 59, -1, -1, -1, 63, -1, - -1, -1, 262, 263, 264, -1, 125, 267, 268, 269, + 339, 340, -1, -1, -1, 125, 345, 346, 347, 348, + -1, -1, 351, -1, 37, 38, -1, 356, 41, 42, + 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, + -1, 370, -1, -1, 373, 58, 59, 60, 61, 62, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, + 93, 94, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 124, 125, -1, -1, -1, -1, -1, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, + -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, 279, - -1, 281, -1, -1, -1, -1, -1, -1, 93, 94, + -1, 281, 282, 91, -1, 93, 94, -1, -1, -1, 0, 291, 292, -1, 294, 295, 296, 297, 298, -1, - 10, -1, -1, -1, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, -1, 124, - 125, -1, -1, -1, 279, -1, 281, -1, 38, -1, - -1, 41, -1, 43, 44, 45, 291, 292, -1, 294, - 295, 296, 297, 298, -1, 345, 346, -1, 58, 59, - 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, + 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, + -1, -1, 322, -1, 324, -1, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, + 60, -1, 62, 63, -1, -1, -1, -1, -1, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, + 370, -1, -1, -1, -1, -1, 279, -1, 281, 282, + 283, 91, -1, 93, 94, -1, -1, -1, 291, 292, + -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, -1, 0, -1, -1, -1, - -1, -1, -1, -1, 349, -1, 10, -1, -1, -1, - -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, 368, 124, 125, -1, -1, -1, -1, - 279, -1, 281, 282, 38, -1, -1, 41, -1, 43, - 44, 45, 291, 292, -1, 294, 295, 296, 297, 298, + -1, -1, -1, -1, 124, 125, -1, -1, -1, 322, + -1, 324, -1, -1, -1, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, + -1, -1, 345, 346, 347, 348, -1, -1, 351, -1, + -1, -1, -1, 356, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, 370, -1, -1, + 373, 279, -1, 281, 282, 283, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + -1, -1, -1, -1, 322, -1, 324, -1, -1, 10, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, 347, + 348, -1, -1, 351, -1, -1, -1, -1, 356, -1, + 41, -1, 262, 263, 264, -1, -1, 267, 268, 269, + -1, 271, 370, -1, -1, 373, -1, -1, 59, 279, + -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, + -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 93, -1, -1, -1, 0, -1, -1, -1, + -1, -1, 322, -1, 324, -1, 10, -1, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, 125, 345, 346, 347, 348, -1, + -1, 351, -1, 37, 38, -1, 356, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + 370, -1, -1, 373, 58, 59, 60, -1, 62, 63, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, + 94, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, -1, -1, -1, -1, -1, -1, 37, 38, + -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, + 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, + -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, + 281, -1, 91, -1, 93, 94, -1, -1, -1, 0, + 291, 292, -1, 294, 295, 296, 297, 298, -1, 10, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, + -1, 322, -1, 324, -1, -1, 37, 38, -1, -1, + 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, + -1, 62, 63, -1, -1, -1, -1, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, -1, 370, + -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, + 91, -1, 93, 94, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 124, 125, -1, -1, -1, 322, -1, + 324, -1, -1, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, 347, 348, -1, -1, 351, -1, -1, + -1, -1, 356, 262, 263, 264, -1, 0, 267, 268, + 269, -1, 271, -1, -1, -1, 370, 10, -1, 373, + 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, 0, -1, -1, + -1, -1, -1, 322, -1, 324, 59, 10, -1, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, -1, -1, -1, -1, 345, 346, 347, 348, + -1, -1, 351, -1, -1, -1, -1, 356, 41, -1, + -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, 370, -1, -1, 373, -1, 59, -1, 279, -1, + 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, + 291, 292, 125, 294, 295, 296, 297, 298, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 93, -1, -1, -1, -1, 0, -1, -1, -1, -1, + -1, 322, -1, 324, -1, 10, -1, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, 125, -1, 345, 346, 347, 348, -1, -1, + 351, -1, 37, 38, -1, 356, 41, 42, 43, 44, + 45, 46, 47, -1, -1, -1, -1, -1, -1, 370, + -1, -1, 373, 58, 59, 60, -1, 62, 63, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 91, -1, 93, 94, + 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 10, -1, -1, -1, -1, -1, -1, -1, -1, 262, + 263, 264, -1, -1, -1, 268, 269, -1, 271, 124, + 125, -1, -1, -1, -1, -1, 279, 37, 38, -1, + -1, 41, 42, 43, 44, 45, -1, 47, 291, 292, + -1, 294, 295, 296, 297, -1, -1, -1, 58, 59, + 60, -1, 62, 63, -1, -1, -1, -1, -1, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, 322, + -1, 324, -1, -1, -1, -1, 279, -1, 281, -1, + -1, -1, -1, 93, 94, -1, 0, -1, 291, 292, + -1, 294, 295, 296, 297, 298, 10, -1, 351, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124, 125, -1, 370, -1, 322, + -1, 324, -1, 37, 38, -1, -1, 41, 42, 43, + 44, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, -1, 267, 268, 269, -1, 271, 370, -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, 93, 94, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 0, -1, -1, 368, - 124, 125, -1, -1, -1, -1, 10, -1, -1, -1, - -1, 326, 327, 328, 329, 330, -1, -1, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - -1, -1, -1, -1, 349, -1, -1, 41, -1, 354, - 44, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, 368, 58, 59, 371, -1, -1, 279, + -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, + 124, 125, -1, -1, -1, -1, -1, 322, 10, 324, + -1, -1, -1, -1, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, -1, -1, -1, -1, + 345, 346, 347, 348, -1, -1, 351, 10, -1, 41, + -1, 356, 262, 263, 264, -1, -1, 267, 268, 269, + -1, 271, -1, -1, -1, 370, -1, 59, 373, 279, + -1, 281, 282, 283, -1, 38, -1, 40, -1, 42, + -1, 291, 292, 46, 294, 295, 296, 297, 298, -1, + -1, -1, -1, -1, -1, -1, 59, -1, 61, -1, + -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, -1, 324, -1, -1, -1, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, 125, -1, 345, 346, -1, -1, -1, + -1, 351, -1, -1, -1, -1, 356, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, + 370, -1, -1, 373, -1, 279, -1, 281, 282, 283, + -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, -1, -1, 322, -1, + 324, -1, 10, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, -1, -1, -1, -1, 351, -1, 37, + 38, -1, 356, 41, 42, 43, 44, 45, -1, 47, + -1, -1, -1, -1, -1, -1, 370, -1, -1, 373, + 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + -1, -1, -1, -1, -1, -1, -1, 279, -1, 281, + -1, -1, -1, -1, -1, 93, 94, 0, -1, 291, + 292, -1, 294, 295, 296, 297, 298, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, + 322, -1, 324, -1, 37, 38, -1, -1, 41, 42, + 43, 44, 45, 306, 47, 308, 309, 310, 311, 312, + -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, + 63, -1, -1, -1, -1, 328, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 370, 342, + -1, -1, -1, -1, -1, 348, -1, -1, -1, 352, + 93, 94, -1, 0, 357, 358, 359, -1, -1, -1, + -1, -1, -1, 10, 37, 38, -1, -1, -1, 42, + 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, + -1, 124, 125, -1, -1, -1, -1, 60, -1, 62, + 37, 38, -1, -1, 41, 42, 43, 44, 45, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, + -1, 94, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, 282, 283, 93, 94, -1, -1, + -1, 124, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, -1, 124, 125, -1, + -1, -1, -1, -1, 322, 10, 324, -1, -1, -1, + -1, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, -1, + -1, -1, -1, 351, 10, -1, 41, -1, 356, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, + -1, -1, 370, -1, 59, 373, 279, -1, 281, 282, + 283, -1, 38, -1, 40, -1, 42, -1, 291, 292, + 46, 294, 295, 296, 297, 298, -1, -1, -1, -1, + -1, -1, -1, 59, -1, 61, -1, -1, 93, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, + -1, 324, -1, -1, -1, -1, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, + 125, -1, 345, 346, -1, -1, -1, -1, 351, -1, + -1, -1, -1, 356, -1, 262, 263, 264, -1, -1, + 267, 268, 269, -1, 271, -1, -1, 370, -1, -1, + 373, -1, 279, -1, 281, 282, 283, -1, -1, -1, + -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, + 297, 298, -1, -1, -1, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, -1, -1, -1, 0, + -1, -1, 345, 346, -1, 322, -1, 324, -1, 10, + -1, -1, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + -1, -1, -1, -1, 351, -1, 37, 38, -1, 356, + 41, 42, 43, 44, 45, -1, 47, -1, -1, -1, + -1, -1, -1, 370, -1, -1, 373, 58, 59, 60, + -1, 62, 63, -1, -1, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, -1, -1, -1, 279, -1, 281, -1, -1, -1, + -1, -1, 93, 94, 0, -1, 291, 292, -1, 294, + 295, 296, 297, 298, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 124, 125, -1, -1, 322, -1, 324, + -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, + 306, 47, 308, 309, 310, 311, 312, -1, -1, -1, + -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, + -1, -1, 328, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 370, 342, -1, -1, -1, + -1, -1, 348, -1, -1, -1, 352, 93, 94, -1, + 0, 357, 358, 359, -1, -1, -1, -1, -1, -1, + 10, 37, 38, -1, -1, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, -1, -1, 124, 125, + -1, -1, -1, -1, 60, -1, 62, 37, 38, -1, + -1, 41, 42, 43, 44, 45, -1, 47, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, + 60, -1, 62, 63, -1, -1, -1, -1, 94, -1, + -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, + 281, 282, 283, 93, 94, -1, -1, -1, 124, -1, + 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, 124, 125, -1, -1, -1, -1, + -1, 322, 10, 324, -1, -1, -1, -1, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, -1, -1, 345, 346, -1, -1, -1, -1, + 351, 10, -1, 41, -1, 356, 262, 263, 264, -1, + -1, 267, 268, 269, -1, 271, -1, -1, -1, 370, + -1, 59, 373, 279, -1, 281, 282, 283, -1, 38, + -1, 40, -1, 42, -1, 291, 292, 46, 294, 295, + 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, + 59, -1, 61, -1, -1, 93, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, -1, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, -1, 125, -1, 345, + 346, -1, -1, -1, -1, 351, -1, -1, -1, -1, + 356, -1, 262, 263, 264, -1, -1, 267, 268, 269, + -1, 271, -1, -1, 370, -1, -1, 373, -1, 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, + -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, + -1, 337, 338, -1, -1, -1, 0, -1, -1, 345, + 346, -1, 322, -1, 324, -1, 10, -1, -1, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, -1, 345, 346, -1, -1, -1, + -1, 351, -1, 37, 38, -1, 356, 41, 42, 43, + 44, 45, -1, 47, -1, -1, -1, -1, -1, -1, + 370, -1, -1, 373, 58, 59, 60, -1, 62, 63, + -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, -1, -1, -1, -1, -1, 93, + 94, 0, -1, 291, 292, -1, 294, 295, 296, 297, + 298, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, -1, -1, 322, -1, 324, -1, 37, 38, + -1, -1, 41, 42, 43, 44, 45, 306, 47, 308, + 309, 310, 311, 312, -1, -1, -1, -1, -1, 58, + 59, 60, -1, 62, 63, -1, -1, -1, -1, 328, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 370, 342, -1, -1, -1, -1, -1, 348, + -1, -1, -1, 352, 93, 94, -1, 0, 357, 358, + 359, -1, -1, -1, -1, -1, -1, 10, 37, 38, + -1, -1, -1, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, + -1, 60, -1, 62, 37, 38, -1, -1, 41, 42, + 43, 44, 45, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, + 63, -1, -1, -1, -1, 94, -1, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, + -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, + 93, 94, -1, -1, -1, 124, -1, 291, 292, -1, + 294, 295, 296, 297, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + -1, 124, 125, -1, -1, -1, -1, -1, 322, 10, + 324, -1, -1, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, -1, -1, -1, -1, 351, -1, -1, + 41, 0, 356, 262, 263, 264, -1, -1, 267, 268, + 269, 10, 271, -1, -1, -1, 370, -1, 59, 373, + 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, -1, + -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, + -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, + 59, -1, -1, 322, -1, 324, -1, -1, -1, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, -1, -1, 125, -1, 345, 346, -1, -1, + -1, -1, 351, -1, -1, -1, -1, 356, -1, 262, + 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, + -1, 370, -1, -1, 373, -1, 279, -1, 281, 282, + 283, -1, -1, -1, -1, -1, 125, -1, 291, 292, + -1, 294, 295, 296, 297, -1, -1, -1, -1, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, 0, -1, -1, 345, 346, -1, 322, + -1, 324, -1, 10, -1, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, + -1, -1, 345, 346, -1, -1, -1, -1, 351, -1, + 37, 38, -1, 356, 41, 42, 43, 44, 45, -1, + 47, -1, -1, -1, -1, -1, -1, 370, -1, -1, + 373, 58, 59, -1, -1, -1, 63, -1, -1, -1, + -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, + 281, -1, -1, -1, -1, -1, 93, 94, 0, -1, + 291, 292, -1, 294, 295, 296, 297, 298, 10, -1, + -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, -1, 271, -1, -1, -1, -1, 124, 125, -1, + 279, 322, -1, 324, -1, -1, 38, -1, -1, 41, + -1, 43, 44, 45, -1, 294, 295, 296, 297, 298, + -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, + 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 322, -1, 324, -1, -1, -1, 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - -1, 125, -1, 343, 344, -1, -1, -1, -1, 349, - -1, -1, -1, -1, 354, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, 368, -1, - -1, 371, -1, -1, -1, 279, -1, 281, 282, 283, - -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, 0, -1, -1, + -1, 93, 94, -1, 0, -1, -1, -1, -1, -1, + -1, -1, 351, -1, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 370, 124, 125, -1, -1, -1, -1, -1, -1, + -1, -1, 38, -1, -1, 41, -1, 43, 44, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, + -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, + 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, + -1, -1, 279, -1, 281, 282, 283, 93, 94, -1, + -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, + 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 124, 125, + -1, -1, -1, -1, -1, 322, -1, 324, -1, -1, + -1, 328, 329, 330, 331, 332, -1, -1, 335, 336, + 337, 338, 339, 340, -1, 0, -1, -1, 345, 346, + -1, -1, -1, -1, 351, 10, -1, -1, -1, 356, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + -1, -1, -1, 370, -1, -1, 373, 279, -1, 281, + 282, 283, -1, -1, -1, -1, 41, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 322, -1, 324, -1, -1, -1, -1, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, -1, 345, 346, -1, -1, -1, -1, 351, + -1, -1, -1, -1, 356, -1, 262, 263, 264, -1, + -1, 267, 268, 269, -1, 271, -1, -1, 370, -1, + 125, 373, -1, 279, -1, 281, 282, 283, -1, -1, + -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, -1, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 38, -1, -1, 41, 345, + 346, 44, -1, -1, -1, 351, -1, -1, -1, -1, + 356, -1, -1, -1, -1, 58, 59, 60, -1, 62, + 63, -1, -1, -1, 370, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 38, -1, -1, 41, 343, - 344, 44, -1, -1, -1, 349, -1, -1, -1, -1, - 354, -1, -1, -1, -1, 58, 59, 60, -1, 62, - 63, -1, -1, -1, 368, -1, -1, 371, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - 93, 94, 0, -1, -1, 279, -1, 281, 282, 283, - -1, -1, 10, -1, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, - 38, -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 93, 94, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, 262, 263, 264, + -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, + -1, 124, 125, -1, 279, -1, -1, -1, -1, -1, + 38, -1, -1, 41, -1, -1, 44, -1, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 349, -1, -1, -1, -1, - 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 368, 93, 94, 371, 0, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, 324, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 93, 94, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, -1, -1, -1, 370, 124, 125, -1, -1, + -1, -1, -1, -1, -1, -1, 38, -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, -1, 271, 10, + 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, 93, 94, -1, -1, -1, -1, -1, 291, 292, - -1, 294, 295, 296, 297, 298, -1, 38, -1, 40, - -1, 42, -1, -1, -1, 46, -1, -1, -1, -1, - -1, -1, 124, 125, -1, -1, -1, -1, 59, -1, - 61, -1, -1, -1, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, -1, -1, -1, 0, - 343, 344, -1, -1, -1, -1, 349, -1, -1, 10, - -1, 354, -1, -1, 262, 263, 264, -1, -1, 267, - 268, 269, -1, 271, -1, 368, -1, -1, 371, -1, - -1, 279, -1, 281, 282, 283, -1, -1, -1, -1, - 41, -1, -1, 291, 292, -1, 294, 295, 296, 297, - 298, -1, -1, -1, -1, -1, -1, -1, 59, -1, + -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, -1, 93, -1, -1, -1, -1, 0, -1, -1, - -1, 349, -1, -1, -1, -1, 354, 10, -1, -1, + -1, -1, 124, 125, -1, -1, -1, -1, -1, 322, + -1, 324, -1, -1, -1, -1, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, + -1, -1, 345, 346, -1, -1, -1, -1, 351, -1, + 10, -1, -1, 356, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, 370, -1, -1, + 373, 279, -1, 281, 282, 283, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, + -1, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, 94, -1, -1, 345, 346, -1, + -1, -1, -1, 351, -1, -1, -1, -1, 356, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - 368, -1, -1, 371, 125, -1, -1, 279, -1, 281, - 282, 283, -1, -1, -1, -1, -1, -1, 41, 291, - 292, 44, 294, 295, 296, 297, 298, -1, -1, -1, - -1, -1, -1, -1, -1, 58, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - 93, 94, -1, 0, -1, -1, -1, 349, -1, -1, - -1, -1, 354, 10, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 368, -1, -1, 371, - -1, 124, 125, -1, -1, 306, -1, 308, 309, 310, - 311, 312, -1, -1, 41, -1, -1, 44, -1, -1, - -1, -1, -1, -1, -1, 326, -1, -1, -1, -1, - -1, 58, 59, 60, -1, 62, 63, -1, -1, 340, - -1, 262, 263, 264, -1, 346, 267, 268, 269, 350, - 271, -1, -1, -1, 355, 356, 357, -1, 279, -1, - 281, 282, -1, -1, -1, -1, 93, -1, 0, -1, - 291, 292, -1, 294, 295, 296, 297, 298, 10, -1, + -1, -1, 370, -1, -1, 373, -1, 279, -1, 281, + 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, 0, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, - -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + 322, -1, 324, -1, -1, -1, -1, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 41, + -1, -1, 44, -1, -1, -1, -1, -1, -1, 351, + -1, -1, -1, -1, 356, -1, 58, 59, 60, -1, + 62, 63, -1, -1, -1, -1, -1, -1, 370, -1, + -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, + -1, 93, 94, -1, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 124, 125, -1, 41, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, -1, 287, 288, 289, + 290, -1, 58, 59, 60, -1, 62, 63, -1, -1, + -1, -1, -1, 303, 304, 305, 306, -1, -1, -1, + 310, -1, -1, 313, 314, 315, 316, 317, -1, -1, + -1, -1, -1, 323, -1, -1, -1, 93, 94, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, + -1, 341, 342, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, -1, 354, 355, -1, 357, 124, 125, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, + -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + -1, -1, 93, -1, -1, -1, -1, 279, -1, 281, + 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, 0, -1, -1, 125, -1, -1, -1, -1, -1, + -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + 322, -1, 324, -1, -1, -1, -1, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, 41, -1, -1, 44, 262, 263, 264, 351, + -1, 267, 268, 269, 356, 271, -1, -1, -1, 58, + 59, -1, -1, 279, 63, 281, 282, 283, 370, -1, + -1, 373, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, -1, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, 125, -1, 0, -1, + -1, -1, -1, -1, -1, 351, -1, -1, 10, -1, + 356, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, 370, -1, -1, 373, 279, -1, + 281, 282, 283, -1, -1, -1, -1, -1, -1, 41, + 291, 292, 44, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, 368, 271, -1, - -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, - 283, 93, -1, -1, -1, -1, -1, -1, 291, 292, - -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, - -1, -1, -1, 125, -1, -1, -1, -1, 10, -1, - -1, -1, -1, -1, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 349, -1, -1, 41, - -1, 354, 44, 0, -1, 262, 263, 264, -1, -1, - 267, 268, 269, 10, 271, 368, 58, 59, 371, -1, - -1, 63, 279, -1, 281, 282, 283, -1, -1, -1, - -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, 41, -1, -1, 44, -1, -1, + 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 322, -1, 324, -1, -1, -1, -1, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, 125, -1, -1, -1, -1, -1, -1, - -1, -1, 349, -1, -1, -1, -1, 354, 0, -1, - 262, 263, 264, -1, -1, 267, 268, 269, 10, 271, - -1, 368, -1, -1, 371, -1, -1, 279, -1, 281, - 282, 283, -1, -1, -1, -1, -1, -1, 125, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, 41, - -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 58, 59, -1, -1, - -1, 63, -1, -1, -1, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 349, -1, -1, - -1, 93, 354, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 368, -1, -1, 371, - -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, - 262, 263, 264, 125, -1, 267, 268, 269, 10, 271, - -1, -1, -1, -1, -1, -1, -1, 279, -1, 281, - 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, 41, - -1, -1, 44, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, -1, 271, -1, 58, 59, -1, 0, - -1, 63, 279, -1, -1, -1, -1, -1, -1, 10, - -1, 333, 334, -1, -1, 337, 338, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, 349, -1, -1, - -1, 93, 354, -1, -1, -1, -1, -1, -1, -1, - 41, -1, -1, 44, -1, -1, 368, -1, -1, 371, - -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, - -1, -1, 63, 125, -1, -1, -1, -1, -1, -1, - -1, -1, 349, -1, -1, -1, -1, -1, -1, -1, + 351, -1, -1, -1, -1, 356, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, -1, -1, -1, 370, + -1, -1, 373, 125, -1, 10, -1, -1, -1, -1, + -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, + 279, -1, 281, 282, 283, -1, 41, -1, -1, 44, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + -1, -1, -1, 58, 59, -1, -1, -1, 63, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 322, -1, 324, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 335, 336, 93, -1, + 339, 340, -1, -1, -1, 0, -1, -1, -1, -1, + -1, -1, 351, -1, -1, 10, -1, 356, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 125, 370, -1, -1, 373, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 41, -1, -1, 44, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - -1, 368, 93, -1, -1, -1, -1, 279, -1, 281, + -1, -1, -1, 58, 59, -1, -1, 279, 63, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, 298, 0, -1, -1, - -1, -1, -1, -1, 125, -1, -1, 10, -1, -1, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, + -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, + 322, 10, 324, -1, -1, -1, -1, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + 125, -1, -1, -1, -1, -1, -1, -1, -1, 351, + -1, -1, 41, -1, 356, 44, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 370, 58, + 59, 373, -1, -1, 63, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, -1, -1, -1, 279, -1, 281, 282, 283, -1, + -1, -1, -1, -1, 93, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, 125, 322, -1, 324, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, + 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, + -1, 356, -1, 41, -1, -1, 44, 262, 263, 264, + -1, -1, 267, 268, 269, 370, 271, -1, 373, -1, + 58, 59, -1, -1, 279, 63, 281, 282, 283, -1, + -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, 0, -1, + -1, -1, -1, -1, -1, 93, -1, -1, 10, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, 324, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 335, 336, -1, -1, 339, 340, -1, 125, -1, 41, + -1, -1, 44, -1, -1, -1, 351, -1, -1, -1, + -1, 356, -1, 262, 263, 264, 58, 59, 267, 268, + 269, 63, 271, -1, -1, 370, -1, -1, 373, -1, + 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + -1, 93, -1, 0, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 10, -1, -1, -1, -1, 10, -1, + -1, -1, -1, 322, -1, 324, -1, -1, -1, -1, + -1, -1, -1, 125, -1, -1, 335, 336, -1, -1, + 339, 340, -1, -1, 41, -1, 38, 44, 40, -1, + 42, -1, 351, -1, 46, -1, -1, 356, -1, -1, + -1, 58, 59, -1, -1, -1, 63, 59, -1, 61, + -1, 370, -1, -1, 373, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, 93, -1, -1, -1, + -1, 279, -1, 281, 282, 283, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, 0, -1, -1, 125, -1, + -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 335, 336, -1, + -1, 339, 340, -1, -1, -1, 41, -1, -1, 44, + 262, 263, 264, 351, -1, 267, 268, 269, 356, 271, + -1, -1, -1, 58, 59, -1, -1, 279, 63, 281, + 282, 283, 370, -1, -1, 373, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 333, 334, -1, -1, 337, 338, -1, 41, -1, - 38, 44, 40, -1, 42, -1, -1, 349, 46, -1, - -1, -1, 354, -1, -1, 58, 59, -1, -1, -1, - 63, 59, -1, 61, -1, -1, 368, -1, -1, 371, + 322, -1, 324, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 335, 336, -1, -1, 339, 340, -1, + 125, -1, 0, -1, -1, -1, -1, -1, -1, 351, + -1, -1, 10, -1, 356, 262, 263, 264, -1, -1, + 267, 268, 269, -1, 271, -1, -1, -1, 370, -1, + -1, 373, 279, -1, 281, 282, 283, -1, -1, -1, + -1, -1, -1, 41, 291, 292, 44, 294, 295, 296, + 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, + 58, 59, -1, -1, 306, 63, 308, 309, 310, 311, + 312, -1, -1, -1, -1, 322, -1, 324, -1, -1, + -1, -1, -1, -1, -1, -1, 328, -1, -1, 336, + -1, -1, 339, 340, -1, 93, -1, -1, -1, -1, + 342, -1, -1, -1, 351, -1, 348, -1, -1, 356, + 352, -1, -1, -1, -1, 357, 358, 359, 0, -1, + -1, -1, -1, 370, -1, -1, 373, 125, 10, -1, + -1, -1, -1, -1, -1, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, -1, -1, -1, 279, -1, 281, 282, 283, 41, + -1, -1, 44, -1, -1, 0, 291, 292, -1, 294, + 295, 296, 297, 298, -1, 10, 58, 59, -1, -1, + -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, 324, + -1, -1, -1, -1, -1, -1, 41, -1, -1, 44, + -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 58, 59, -1, 351, -1, 63, -1, + -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 125, -1, 370, -1, -1, 373, -1, + -1, 0, -1, -1, -1, -1, -1, -1, 93, -1, + -1, 10, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, 282, 283, -1, -1, -1, -1, + 125, -1, 41, 291, 292, 44, 294, 295, 296, 297, + 298, 0, -1, -1, -1, -1, -1, -1, -1, 58, + 59, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 41, -1, 93, 44, -1, -1, -1, -1, + -1, -1, -1, 351, -1, -1, -1, -1, 356, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 370, -1, -1, 373, 125, -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - 93, -1, -1, -1, -1, -1, -1, 279, -1, 281, + -1, -1, -1, -1, 93, -1, -1, 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, - -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 125, 262, 263, 264, + -1, -1, 267, 268, 269, 0, 271, -1, -1, -1, + 322, -1, 324, -1, 279, 10, 281, 282, 283, -1, + -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, -1, 351, + -1, -1, -1, -1, 356, -1, 41, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, 322, 370, 324, + -1, 373, -1, 58, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 262, 263, 264, 351, -1, 267, 268, + 269, 356, 271, -1, -1, -1, -1, -1, 93, -1, + 279, -1, 281, 282, 283, 370, -1, -1, 373, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 262, 263, 264, 0, -1, 267, 268, 269, -1, - 271, 333, 334, -1, 10, 337, 338, -1, 279, -1, - 281, 282, 283, -1, -1, -1, -1, 349, -1, -1, - 291, 292, 354, 294, 295, 296, 297, 298, -1, -1, - -1, -1, -1, -1, -1, 41, 368, -1, 44, 371, + 125, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, 0, 271, 322, -1, 324, -1, -1, -1, -1, + 279, 10, 281, 282, 283, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, + -1, -1, 351, -1, -1, -1, -1, 356, -1, -1, + -1, -1, 41, -1, -1, 44, -1, -1, 0, -1, + -1, 370, -1, 322, 373, 324, -1, -1, 10, 58, + 59, -1, -1, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 351, -1, -1, -1, -1, 356, -1, 41, + -1, 38, 44, 40, 93, 42, -1, -1, -1, 46, + -1, 370, -1, -1, 373, -1, 58, 59, -1, -1, + -1, -1, 59, -1, 61, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 125, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, -1, -1, + -1, 93, -1, -1, 279, -1, 281, 282, 283, -1, + -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, 0, -1, -1, -1, -1, + -1, -1, -1, 125, -1, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, 324, + -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, + -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, + 45, 46, 47, -1, -1, -1, 351, -1, -1, -1, + -1, 356, -1, -1, 59, 60, -1, 62, 63, -1, + -1, -1, -1, -1, -1, 370, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, 59, -1, -1, -1, 63, -1, -1, - -1, -1, 333, 334, -1, -1, 337, 338, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 349, -1, - -1, -1, -1, 354, -1, -1, -1, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, - 371, -1, -1, -1, -1, -1, -1, 0, -1, 262, - 263, 264, -1, -1, 267, 268, 269, 10, 271, 125, - -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, - 283, -1, -1, -1, -1, -1, -1, -1, 291, 292, - -1, 294, 295, 296, 297, 298, -1, -1, 41, -1, - -1, 44, -1, -1, -1, -1, -1, -1, 306, -1, - 308, 309, 310, 311, 312, 58, 59, -1, -1, -1, - 63, -1, -1, -1, -1, -1, -1, -1, 326, -1, - 333, 334, -1, -1, 337, 338, -1, -1, -1, -1, - -1, -1, 340, -1, -1, -1, 349, -1, 346, -1, - 93, 354, 350, -1, -1, -1, -1, 355, 356, 357, - -1, -1, -1, -1, -1, 368, -1, -1, 371, -1, + -1, -1, -1, -1, -1, -1, 91, -1, 93, 94, + -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, + 279, -1, 281, 282, 283, -1, -1, -1, 123, 124, + 125, 126, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 262, 263, 264, -1, - -1, 267, 268, 269, -1, 271, -1, -1, -1, -1, - -1, -1, -1, 279, -1, 281, 282, 283, -1, -1, - -1, -1, -1, -1, 41, 291, 292, 44, 294, 295, - 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, - -1, 58, 59, -1, -1, -1, 63, -1, -1, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + -1, -1, -1, 322, -1, 324, -1, 279, -1, 281, + 282, 283, -1, -1, -1, -1, -1, -1, -1, 291, + 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, -1, 351, -1, -1, -1, -1, 356, -1, 306, + -1, 308, 309, 310, 311, 312, -1, -1, -1, -1, + 322, 370, 324, -1, 373, -1, -1, -1, -1, -1, + -1, 328, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 342, -1, -1, -1, 351, + -1, 348, -1, -1, 356, 352, -1, -1, -1, -1, + 357, 358, 359, -1, -1, -1, -1, -1, 370, -1, + -1, 373, 257, 258, 259, -1, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, -1, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, -1, -1, 322, 323, 324, + -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, -1, -1, + 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 0, 368, 369, 370, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 333, 334, -1, - -1, 337, 338, -1, -1, -1, 93, -1, -1, -1, - -1, -1, -1, 349, -1, -1, -1, -1, 354, -1, - -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, 368, -1, -1, 371, 10, -1, 125, 262, - 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, - -1, -1, -1, -1, -1, -1, 279, -1, 281, 282, - 283, -1, -1, -1, -1, -1, -1, 41, 291, 292, - 44, 294, 295, 296, 297, 298, 0, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 10, -1, -1, 63, + -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 333, 334, -1, -1, 337, 338, -1, 41, -1, 93, - 44, -1, -1, -1, -1, -1, 349, -1, -1, -1, - -1, 354, -1, -1, 58, 59, -1, -1, -1, 63, - -1, -1, -1, -1, -1, 368, -1, -1, 371, -1, - -1, 125, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, - -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, - 0, -1, 279, -1, 281, 282, 283, -1, -1, -1, - 10, 125, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 41, -1, -1, 44, -1, 10, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 334, 58, 59, - 337, 338, -1, 63, -1, -1, -1, -1, -1, -1, - -1, -1, 349, -1, 38, -1, 40, 354, 42, -1, - -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, - -1, 368, -1, 93, 371, 59, -1, 61, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, - -1, -1, -1, -1, -1, 125, -1, 291, 292, -1, - 294, 295, 296, 297, 298, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 10, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 282, 283, - -1, -1, -1, -1, -1, -1, 41, 291, 292, 44, - 294, 295, 296, 297, 298, 349, -1, -1, -1, -1, - 354, -1, -1, 58, 59, -1, -1, -1, 63, -1, - 0, -1, -1, -1, 368, -1, -1, 371, -1, -1, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, - -1, -1, -1, -1, -1, 349, -1, -1, -1, -1, - 354, 41, -1, -1, 44, 0, -1, -1, -1, -1, - -1, -1, -1, -1, 368, 10, -1, 371, 58, 59, - 125, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, -1, -1, -1, -1, -1, -1, 279, - -1, 281, 282, 283, -1, -1, 41, -1, -1, 44, - -1, 291, 292, 93, 294, 295, 296, 297, 298, -1, - -1, -1, -1, 58, 59, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 10, 125, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, - -1, -1, 306, -1, 308, 309, 310, 311, 312, 349, - -1, -1, -1, -1, 354, 41, -1, -1, 44, -1, - -1, -1, 326, -1, -1, -1, -1, -1, 368, -1, - 125, 371, 58, 59, -1, -1, 340, -1, -1, 0, - -1, -1, 346, -1, -1, -1, 350, -1, -1, 10, - -1, 355, 356, 357, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, 93, -1, -1, - -1, -1, -1, -1, 279, -1, 281, 282, 283, -1, - 41, -1, -1, 44, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, 58, 59, 125, + -1, -1, -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + -1, -1, -1, -1, -1, 123, 124, 125, 126, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, 93, -1, -1, -1, -1, -1, -1, 279, - -1, 281, 282, 283, 349, -1, -1, -1, -1, 354, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, - -1, -1, -1, 368, 125, -1, 371, 262, 263, 264, - -1, 0, 267, 268, 269, -1, 271, -1, -1, -1, - -1, 10, -1, -1, 279, -1, 281, 282, 283, -1, - -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, 349, - -1, -1, 41, -1, 354, 44, -1, -1, -1, 0, - -1, -1, -1, -1, -1, -1, -1, -1, 368, 10, - 59, 371, -1, -1, -1, -1, 262, 263, 264, -1, - -1, 267, 268, 269, -1, 271, -1, -1, -1, -1, - -1, -1, -1, 279, 349, 281, 282, 283, -1, 354, - 41, -1, -1, 44, 93, 291, 292, -1, 294, 295, - 296, 297, 298, 368, -1, -1, 371, 58, 59, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, - -1, -1, -1, -1, -1, -1, 125, -1, 10, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, -1, 93, -1, -1, -1, -1, -1, 279, -1, - 281, 282, 283, 349, -1, -1, -1, 10, 354, 41, - 291, 292, 44, 294, 295, 296, 297, 298, -1, 0, - -1, -1, 368, -1, 125, 371, 58, 59, -1, 10, - -1, -1, -1, -1, -1, 38, -1, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, -1, 61, -1, - 41, 93, -1, 44, -1, -1, -1, -1, 349, -1, - -1, -1, -1, 354, -1, -1, -1, 58, 59, -1, - -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, - 371, -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 93, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, - 279, -1, 281, 282, 283, -1, -1, -1, -1, -1, - -1, -1, 291, 292, 125, 294, 295, 296, 297, 298, - -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, - 291, 292, -1, 294, 295, 296, 297, -1, -1, -1, - 349, -1, -1, -1, -1, 354, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, - -1, -1, 371, -1, -1, -1, -1, -1, -1, -1, - 262, 263, 264, -1, -1, 267, 268, 269, 94, 271, - -1, -1, -1, -1, -1, -1, -1, 279, 349, 281, - 282, 283, -1, 354, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, -1, 368, -1, -1, - 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - 281, 282, 283, 306, -1, 308, 309, 310, 311, 312, - 291, 292, -1, 294, 295, 296, 297, 349, 0, -1, - -1, -1, 354, 326, -1, -1, -1, -1, 10, -1, - -1, -1, -1, -1, -1, -1, 368, 340, -1, 371, - -1, -1, -1, 346, -1, -1, -1, 350, -1, -1, - -1, 33, 355, 356, 357, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, 349, -1, - -1, -1, -1, 354, -1, -1, -1, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, 368, -1, -1, - 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 287, 288, 289, 290, -1, -1, -1, -1, -1, - 10, 123, 124, 125, 126, -1, -1, 303, 304, 305, - 306, -1, -1, -1, 310, -1, -1, 313, 314, 315, - 316, 317, -1, 33, -1, -1, 322, 37, 38, -1, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, -1, 339, 340, -1, -1, -1, -1, 59, - 60, 347, 62, 63, 350, -1, 352, 353, -1, 355, - -1, -1, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, + -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, + 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 123, 124, 125, 126, -1, -1, -1, + 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, -1, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, - -1, 343, 344, 345, 346, 347, -1, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, -1, 366, 367, 368, 257, 258, 259, - -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, -1, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, - 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, -1, -1, 343, 344, 345, 346, 347, -1, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 0, 366, 367, 368, -1, - -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, -1, 62, 63, -1, + -1, -1, -1, 124, 125, 126, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, + 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, -1, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, -1, -1, 322, 323, 324, -1, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, -1, -1, 345, 346, 347, + 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, 370, -1, -1, -1, 257, 258, 259, -1, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, + 281, 282, -1, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, + -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, -1, + -1, 322, 323, 324, -1, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, -1, -1, 345, 346, 347, 348, 349, -1, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 0, 368, 369, 370, + -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, + 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 0, -1, -1, -1, -1, -1, 123, + 124, 125, 126, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, + 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, -1, -1, 94, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 123, 124, 125, 126, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, + 264, 265, 266, -1, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, -1, + -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, 370, -1, -1, -1, + 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, + -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, -1, -1, 322, 323, 324, -1, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, -1, -1, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 0, 368, 369, 370, -1, -1, -1, -1, -1, -1, + 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 91, -1, 93, 94, + -1, 91, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 10, -1, 124, - 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124, 125, 126, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, @@ -4730,96 +5031,86 @@ private static final short[] yyCheck2() { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, 126, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, -1, 281, 282, -1, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, -1, -1, 343, 344, - 345, 346, 347, -1, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 368, 257, 258, 259, -1, 261, 262, + -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, + -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + -1, 281, 282, -1, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, + 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + -1, -1, 322, 323, 324, -1, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, -1, -1, 345, 346, 347, 348, 349, + -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + 370, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, - 353, -1, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 0, 366, 367, 368, -1, -1, -1, -1, - -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, - 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, -1, 94, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 10, 123, 124, 125, 126, -1, + 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + -1, -1, 345, 346, 347, 348, 349, -1, 351, 352, + 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 0, 368, 369, 370, -1, -1, + -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, -1, -1, 94, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, - 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, - 258, 259, -1, 261, 262, 263, 264, 265, 266, -1, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, -1, -1, -1, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, -1, -1, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, -1, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, - 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, - 266, -1, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, -1, -1, -1, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, -1, -1, 343, + -1, -1, -1, -1, -1, }; } - private static final short[] yyCheck3() { - return new short[] { + private static final int[] yyCheck3() { + return new int[] { - 344, 345, 346, 347, -1, 349, 350, 351, 352, 353, - -1, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 0, 366, 367, 368, -1, -1, -1, -1, -1, - -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, - -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, + 91, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, + -1, -1, 123, 124, 125, 126, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, 123, 124, 125, 126, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, + 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, + 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, + 261, 262, 263, 264, 265, 266, -1, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, + -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, -1, + -1, 322, 323, 324, -1, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, -1, -1, 345, 346, 347, 348, 349, -1, + 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, + -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, + 264, 265, 266, -1, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, -1, + -1, 345, 346, 347, 348, 349, -1, 351, 352, 353, + 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 0, 368, 369, 370, -1, -1, -1, + -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, @@ -4830,44 +5121,8 @@ private static final short[] yyCheck3() { -1, -1, -1, -1, 91, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, 124, 125, 126, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, - 259, -1, 261, 262, 263, 264, 265, 266, -1, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, -1, -1, -1, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, -1, -1, 343, 344, 345, 346, 347, -1, - 349, 350, 351, 352, 353, -1, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, -1, 366, 367, 368, - 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, - -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, -1, -1, 343, 344, 345, 346, - 347, -1, 349, 350, 351, 352, 353, -1, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 0, 366, - 367, 368, -1, -1, -1, -1, -1, -1, 10, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 10, 123, 124, 125, 126, -1, -1, -1, -1, -1, + 0, -1, -1, -1, -1, -1, 123, 124, 125, 126, + 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, @@ -4880,42 +5135,31 @@ private static final short[] yyCheck3() { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, - 262, 263, 264, 265, 266, -1, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, -1, - -1, -1, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, - -1, 343, 344, 345, 346, 347, -1, 349, 350, 351, - 352, 353, -1, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, -1, 366, 367, 368, 257, 258, 259, + 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, + -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, -1, -1, 322, 323, 324, -1, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, -1, -1, 345, 346, + 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, 370, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, 326, 327, 328, 329, + -1, -1, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, -1, -1, 343, 344, 345, 346, 347, -1, 349, - 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 0, 366, 367, 368, -1, - -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, - -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 340, 341, 342, -1, -1, 345, 346, 347, 348, 349, + -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 0, 368, 369, + 370, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 91, -1, -1, 94, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 10, 123, 124, - 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, @@ -4925,231 +5169,294 @@ private static final short[] yyCheck3() { -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, + 123, 124, 125, 126, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, + 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, - 265, 266, -1, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, -1, -1, 343, 344, - 345, 346, 347, -1, 349, 350, 351, 352, 353, -1, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 368, 257, 258, 259, -1, 261, 262, + -1, -1, -1, -1, -1, 91, -1, -1, 94, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 124, 125, + 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, -1, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, -1, -1, -1, + 273, 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, - 343, 344, 345, 346, 347, -1, 349, 350, 351, 352, - 353, -1, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 0, 366, 367, 368, -1, -1, -1, -1, + 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + -1, -1, 345, 346, 347, 348, 349, -1, 351, 352, + 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, 370, -1, -1, + -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, + 266, -1, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, -1, -1, 322, 323, 324, 94, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, -1, -1, 345, + 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, + -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 0, 368, 369, 370, -1, -1, -1, -1, -1, + -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, + -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 91, -1, -1, 94, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, + -1, -1, -1, -1, -1, 124, 125, 126, 10, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 287, 288, 289, 290, -1, -1, -1, 41, + -1, -1, -1, -1, 46, -1, -1, -1, 303, 304, + 305, 306, -1, -1, -1, 310, -1, 59, 313, 314, + 315, 316, 317, -1, -1, -1, -1, -1, 323, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 341, 342, -1, -1, + -1, -1, -1, -1, 349, -1, -1, 352, -1, 354, + 355, -1, 357, -1, -1, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, -1, -1, -1, -1, -1, + -1, 123, -1, 125, 126, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, -1, 261, 262, 263, 264, 265, 266, -1, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, -1, -1, -1, -1, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, -1, -1, 322, 323, 324, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, -1, -1, 345, 346, 347, 348, + 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, + 369, 370, -1, -1, -1, 257, 258, 259, -1, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + -1, -1, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, -1, 300, -1, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, + 322, 323, 324, -1, 326, 327, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, -1, -1, -1, 341, + 342, -1, 10, -1, -1, 347, 348, 349, -1, -1, + 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, 370, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, 91, -1, 93, 94, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, - 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, 124, 125, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 91, -1, 93, 94, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, 60, -1, 62, 63, + -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, 282, -1, -1, 91, -1, 93, + 94, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, -1, -1, 322, -1, 324, -1, -1, -1, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, 347, + 348, -1, -1, 351, 262, 263, 264, -1, 356, 267, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, 370, 281, 282, -1, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, 347, + 348, -1, -1, 351, -1, -1, -1, -1, 356, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, + 264, -1, 370, 267, 268, 269, -1, 271, -1, -1, + -1, -1, -1, -1, -1, 279, -1, 281, 282, -1, + -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, -1, -1, 322, -1, + 324, -1, 10, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, 347, 348, -1, -1, 351, -1, 37, + 38, -1, 356, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, 370, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, -1, 94, -1, -1, -1, + -1, -1, -1, 91, 0, -1, 94, -1, -1, -1, + -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 10, -1, 124, 125, 126, -1, + -1, -1, -1, -1, -1, 123, 124, 125, -1, -1, + -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, + 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, 91, -1, -1, 94, -1, + -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, + -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, + 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 262, 263, 264, -1, -1, -1, + 268, 269, -1, 271, -1, 91, -1, -1, 94, -1, + -1, 279, 280, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, 124, 125, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, 347, + 348, -1, -1, 351, -1, -1, 262, 263, 264, -1, + -1, -1, 268, 269, -1, 271, -1, -1, -1, -1, + -1, -1, 370, 279, 280, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, -1, -1, -1, 345, + 346, 347, 348, -1, -1, 351, 262, 263, 264, -1, + -1, -1, 268, 269, -1, 271, -1, -1, -1, -1, + -1, -1, -1, 279, 370, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + -1, -1, -1, -1, -1, -1, 322, -1, 324, 10, + -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, -1, -1, -1, 345, + 346, 347, 348, -1, 350, 351, 37, 38, -1, -1, + 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, + -1, -1, -1, -1, 370, -1, -1, -1, 59, 60, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + 91, -1, -1, 94, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, - -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, - 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, + -1, -1, -1, 124, 125, -1, 37, 38, -1, -1, + 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 38, -1, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 123, -1, 125, - 126, -1, -1, -1, -1, -1, -1, 59, -1, 61, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, - 258, 259, -1, 261, 262, 263, 264, 265, 266, -1, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, -1, -1, -1, -1, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, -1, 300, -1, -1, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, -1, -1, 343, 344, 345, 346, 347, - -1, 349, 350, 351, 352, 353, -1, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, - 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, -1, -1, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, -1, -1, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, - -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, - -1, -1, -1, 339, 340, -1, 10, -1, -1, 345, - 346, 347, -1, -1, 350, 351, 352, 353, -1, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, 368, 37, 38, -1, -1, 41, 42, 43, - 44, 45, 46, 47, 306, -1, 308, 309, 310, 311, - 312, -1, -1, -1, -1, 59, 60, -1, 62, 63, - -1, -1, -1, -1, 326, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, - -1, -1, -1, -1, 346, -1, -1, 91, 350, 93, - 94, 0, -1, 355, 356, 357, -1, -1, -1, -1, + 91, 0, -1, 94, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 124, 125, -1, -1, -1, -1, -1, -1, 37, 38, + -1, -1, -1, 124, 125, -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, 93, 94, -1, -1, -1, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, + -1, 262, 263, 264, -1, -1, -1, 268, 269, -1, + 271, -1, 91, -1, -1, 94, -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, - 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 282, -1, - 91, -1, 93, 94, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, - -1, -1, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, -1, -1, -1, -1, 343, - 344, 345, 346, -1, -1, 349, -1, -1, -1, -1, - 354, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, 10, 368, -1, -1, -1, -1, -1, - 279, -1, 281, 282, -1, -1, -1, -1, -1, -1, - -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, - -1, 38, -1, 40, -1, 42, -1, -1, -1, 46, + -1, 322, -1, 324, -1, -1, -1, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, -1, -1, 345, 346, 347, 348, -1, 350, + 351, 262, 263, 264, -1, -1, -1, 268, 269, -1, + 271, -1, -1, -1, -1, -1, -1, -1, 279, 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, 61, -1, -1, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - -1, -1, -1, -1, 343, 344, 345, 346, -1, -1, - 349, -1, -1, -1, -1, 354, -1, -1, -1, -1, - -1, 262, 263, 264, -1, -1, 267, 268, 269, 368, - 271, -1, -1, -1, -1, -1, -1, -1, 279, -1, - 281, 282, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, - -1, -1, 343, 344, 345, 346, -1, -1, 349, -1, - 37, 38, -1, 354, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, 368, -1, -1, - -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 322, -1, 324, -1, -1, -1, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + -1, -1, -1, -1, 345, 346, 347, 348, -1, 350, + 351, -1, -1, 262, 263, 264, -1, -1, -1, 268, + 269, -1, 271, -1, -1, -1, -1, -1, -1, 370, + 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, 91, -1, -1, 94, -1, -1, - -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, + -1, -1, -1, 322, -1, 324, 10, -1, -1, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, -1, -1, -1, -1, 345, 346, 347, 348, + -1, 350, 351, 37, 38, -1, -1, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + -1, 370, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, 124, 125, -1, - 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, 60, 61, 62, 63, -1, -1, 306, - -1, 308, 309, 310, 311, 312, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - -1, -1, -1, -1, 91, 0, -1, 94, -1, -1, - -1, -1, -1, 340, -1, 10, -1, -1, -1, 346, - -1, -1, -1, 350, -1, -1, -1, -1, 355, 356, - 357, -1, -1, -1, -1, -1, 123, 124, 125, -1, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, - -1, 268, 269, -1, 271, -1, 91, -1, -1, 94, - -1, -1, 279, 280, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, 124, - 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, - -1, -1, 349, -1, -1, 262, 263, 264, -1, -1, - -1, 268, 269, -1, 271, -1, -1, -1, -1, -1, - -1, 368, 279, 280, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, 91, -1, -1, + 94, -1, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, -1, 37, 38, -1, -1, 41, 42, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, - -1, -1, 349, -1, -1, -1, -1, 262, 263, 264, - -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, - -1, 368, -1, -1, 279, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - 345, 346, -1, 348, 349, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, 368, -1, -1, -1, 59, 60, 61, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 91, - -1, -1, 94, -1, -1, -1, -1, -1, 10, -1, + -1, -1, -1, -1, -1, -1, -1, 91, 0, -1, + 94, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, -1, 37, 38, -1, -1, 41, + 124, 125, -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, + 264, -1, -1, -1, 268, 269, -1, 271, -1, 91, + -1, -1, 94, -1, -1, 279, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, + -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 322, -1, + 324, -1, -1, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, 347, 348, -1, 350, 351, 262, 263, + 264, -1, -1, -1, 268, 269, -1, 271, -1, -1, + -1, -1, -1, -1, -1, 279, 370, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - 0, -1, 94, -1, -1, -1, -1, -1, -1, -1, - 10, 37, 38, -1, -1, -1, 42, 43, -1, 45, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, 60, -1, 62, 37, 38, -1, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - 60, 61, 62, 63, -1, -1, -1, -1, 94, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, - -1, 91, -1, -1, 94, -1, -1, 279, 124, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 345, 346, -1, 348, 349, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 322, -1, + 324, -1, -1, -1, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, + -1, 345, 346, 347, 348, -1, 350, 351, -1, -1, 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, - -1, -1, -1, -1, -1, -1, 368, 279, -1, -1, + -1, -1, -1, -1, -1, -1, 370, 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 345, 346, -1, 348, 349, -1, -1, - -1, -1, 262, 263, 264, -1, -1, -1, 268, 269, - -1, 271, -1, -1, -1, -1, 368, -1, -1, 279, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, - 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, - 336, -1, -1, 0, -1, -1, -1, 343, 344, -1, - -1, -1, -1, 10, -1, -1, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - -1, -1, -1, 343, 344, 345, 346, -1, 348, 349, + -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, + 322, -1, 324, 10, -1, -1, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, + -1, -1, -1, 345, 346, 347, 348, -1, 350, 351, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, -1, 368, -1, + 47, -1, -1, -1, -1, -1, -1, -1, 370, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -5176,1213 +5483,1258 @@ private static final short[] yyCheck3() { -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, - -1, 348, 349, -1, -1, 262, 263, 264, -1, -1, + -1, -1, -1, -1, -1, 322, -1, 324, -1, -1, + -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + 347, 348, -1, 350, 351, 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, -1, -1, - -1, 368, 279, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 279, 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, - -1, 348, 349, -1, -1, -1, -1, 262, 263, 264, + -1, -1, -1, -1, -1, 322, -1, 324, -1, -1, + -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + 347, 348, -1, 350, 351, -1, -1, 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, - -1, 368, -1, -1, 279, -1, -1, -1, -1, -1, + -1, -1, -1, 370, 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, -1, -1, 343, 344, - 345, 346, -1, 348, 349, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, 368, -1, -1, -1, 59, 60, 61, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 91, - -1, -1, 94, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, -1, -1, -1, -1, -1, -1, 322, -1, 324, + 10, -1, -1, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, -1, -1, -1, -1, + 345, 346, 347, 348, -1, 350, 351, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, -1, -1, -1, 370, -1, -1, -1, 59, + 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, -1, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - 0, -1, 94, -1, -1, -1, -1, -1, -1, -1, + 0, 91, -1, -1, 94, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 125, -1, -1, -1, 37, 38, -1, + -1, -1, -1, -1, 124, 125, -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, - -1, 91, -1, -1, 94, -1, -1, 279, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 345, 346, -1, 348, 349, -1, -1, - 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, - -1, -1, -1, -1, -1, -1, 368, 279, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, - 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, + -1, 91, 0, -1, 94, -1, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124, 125, -1, -1, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 345, 346, -1, 348, 349, -1, -1, -1, -1, 262, 263, 264, -1, -1, -1, 268, 269, - -1, 271, -1, -1, -1, -1, 368, -1, -1, 279, + -1, 271, -1, 91, -1, -1, 94, -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, + -1, -1, -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, -1, - -1, -1, -1, 343, 344, 345, 346, -1, 348, 349, - 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, -1, 368, -1, - -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, -1, 324, -1, -1, -1, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, -1, 345, 346, 347, 348, -1, + 0, 351, 262, 263, 264, -1, -1, -1, 268, 269, + 10, 271, -1, -1, -1, -1, -1, -1, -1, 279, + 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, + -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + -1, -1, 322, -1, 324, -1, -1, -1, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, -1, 345, 346, 347, 348, -1, + -1, 351, -1, 93, 262, 263, 264, -1, 0, -1, + 268, 269, -1, 271, -1, -1, -1, -1, 10, -1, + 370, 279, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 291, 292, 125, 294, 295, 296, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, -1, 322, 10, 324, 59, -1, -1, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, -1, -1, -1, -1, 345, 346, 347, + 348, -1, -1, 351, 0, -1, 41, -1, -1, 44, + -1, 93, -1, -1, 10, -1, -1, -1, -1, -1, + -1, -1, 370, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 0, 91, -1, -1, 94, -1, -1, - -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 125, -1, 41, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, + -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, - 37, 38, -1, -1, 41, 42, 43, 44, 45, 46, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, 60, 61, 62, 63, -1, -1, -1, + -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, + 125, 271, -1, -1, -1, -1, -1, 93, -1, 279, + -1, 281, 282, -1, -1, -1, -1, -1, -1, -1, + -1, 291, 292, 0, 294, 295, 296, 297, 298, -1, + -1, -1, -1, 10, -1, -1, -1, -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, -1, 324, -1, -1, -1, -1, -1, + -1, -1, 0, -1, 41, -1, -1, 44, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 59, -1, -1, -1, 356, -1, -1, -1, + 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, + 370, -1, -1, 41, -1, -1, 44, 279, -1, 281, + 282, -1, -1, -1, -1, -1, 93, -1, -1, 291, + 292, 59, 294, 295, 296, 297, 298, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, 124, 125, -1, + 322, -1, 324, -1, 279, 93, 281, 282, -1, -1, + -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, 262, 263, 264, -1, + -1, 267, 268, 269, 356, 271, 124, 125, -1, -1, + -1, -1, -1, 279, -1, 281, -1, 322, 370, 324, + -1, -1, -1, 0, -1, 291, 292, -1, 294, 295, + 296, 297, 298, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, 0, -1, 94, -1, -1, - -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, + -1, 356, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, -1, -1, 41, 370, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, - -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, - 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, 61, 62, 63, -1, + -1, -1, 59, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, - -1, 268, 269, -1, 271, -1, 91, -1, -1, 94, - -1, -1, 279, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, 124, - 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 41, -1, -1, 44, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 59, -1, -1, -1, 343, 344, 345, 346, - -1, -1, 349, -1, -1, 262, 263, 264, -1, -1, - -1, 268, 269, -1, 271, -1, -1, -1, -1, -1, - -1, 368, 279, 0, -1, -1, 93, -1, -1, -1, - -1, -1, -1, 10, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, 125, -1, - -1, -1, -1, -1, 41, -1, -1, 44, -1, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 59, 0, -1, -1, 343, 344, 345, 346, - -1, -1, 349, 10, -1, -1, -1, 262, 263, 264, - -1, -1, -1, 268, 269, -1, 271, -1, -1, -1, - -1, 368, -1, -1, 279, -1, 93, -1, -1, -1, - -1, -1, -1, -1, 41, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, 0, 124, 125, -1, - -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, - -1, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, -1, -1, 93, -1, 343, 344, - 345, 346, -1, -1, 349, -1, -1, 41, -1, -1, - 44, -1, -1, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, 368, 271, 59, 0, -1, 125, -1, - -1, -1, 279, -1, 281, -1, 10, -1, -1, -1, - -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, -1, -1, -1, -1, -1, 93, - -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, - 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, 59, -1, -1, -1, -1, - -1, 125, -1, -1, 10, -1, -1, -1, -1, -1, - -1, -1, 349, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, -1, 271, -1, -1, -1, -1, 93, - -1, 368, 279, -1, 281, 41, -1, -1, 44, -1, + -1, -1, -1, -1, 370, 262, 263, 264, -1, -1, + 267, 268, 269, -1, 271, -1, 93, -1, -1, -1, + -1, -1, 279, -1, 281, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, 59, -1, 0, -1, -1, -1, -1, - -1, 125, -1, -1, -1, 10, -1, -1, -1, -1, + 297, 298, 0, -1, 262, 263, 264, 124, 125, 267, + 268, 269, 10, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, -1, 322, -1, 324, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, 0, -1, 41, -1, -1, 44, -1, -1, -1, + -1, 10, -1, -1, 351, -1, -1, -1, -1, -1, + -1, 59, -1, -1, 322, -1, 324, -1, -1, -1, + -1, -1, -1, 370, -1, -1, -1, -1, -1, 0, + -1, -1, 41, -1, -1, 44, -1, -1, -1, 10, + -1, -1, -1, 351, -1, 93, -1, -1, -1, -1, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 370, -1, -1, -1, -1, -1, -1, -1, + 41, -1, -1, 44, -1, -1, 0, 125, -1, -1, + -1, -1, -1, -1, 93, -1, 10, -1, 59, -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, - 267, 268, 269, -1, 271, -1, -1, 93, -1, -1, - -1, -1, 279, -1, 281, 282, 41, -1, -1, 44, - -1, -1, 349, -1, 291, 292, -1, 294, 295, 296, - 297, 298, -1, -1, 59, -1, -1, 0, -1, 125, - -1, 368, -1, -1, -1, -1, -1, 10, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, 93, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 41, -1, - -1, 44, -1, -1, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, 59, 0, -1, -1, - 125, 368, -1, -1, -1, -1, -1, 10, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - 93, -1, -1, -1, -1, 279, -1, 281, 41, 0, - -1, -1, -1, -1, -1, -1, -1, 291, 292, 10, - 294, 295, 296, 297, 298, -1, 59, -1, -1, -1, - -1, -1, 125, -1, 368, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, - 41, 267, 268, 269, -1, 271, -1, -1, -1, -1, - 93, -1, 0, 279, -1, 281, -1, -1, 59, -1, - -1, -1, 10, -1, -1, 291, 292, -1, 294, 295, - 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 125, -1, 368, -1, -1, -1, -1, -1, - -1, -1, 93, 41, -1, -1, -1, 262, 263, 264, - -1, -1, 267, 268, 269, -1, 271, -1, 0, -1, - -1, 59, -1, -1, 279, -1, 281, -1, 10, -1, - -1, -1, -1, -1, 125, -1, 291, 292, -1, 294, - 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, - -1, -1, 368, -1, -1, 93, 0, -1, -1, 41, - -1, -1, -1, -1, -1, -1, 10, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, 59, 271, -1, - -1, -1, -1, -1, -1, -1, 279, 125, 281, -1, - -1, -1, -1, -1, -1, -1, 0, 41, 291, 292, - -1, 294, 295, 296, 297, 298, 10, -1, -1, -1, - -1, 93, -1, 368, -1, 59, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, 41, 271, -1, - -1, -1, -1, 125, -1, -1, 279, -1, 281, 93, - -1, -1, -1, -1, -1, 59, -1, -1, 291, 292, - -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, - -1, 262, 263, 264, -1, 368, 267, 268, 269, -1, - 271, 125, -1, -1, -1, -1, 0, -1, 279, 93, - 281, -1, -1, -1, -1, -1, 10, -1, -1, -1, - 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, - -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, - -1, 125, -1, -1, 262, 263, 264, 41, -1, 267, - 268, 269, -1, 271, -1, 368, -1, -1, -1, -1, - -1, 279, -1, 281, 38, 59, 40, -1, 42, -1, - -1, -1, 46, 291, 292, -1, 294, 295, 296, 297, - 298, -1, -1, -1, -1, 59, -1, 61, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 368, -1, 93, - 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, - -1, -1, -1, -1, -1, -1, -1, 279, -1, 281, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, - 292, 125, 294, 295, 296, 297, 298, -1, 262, 263, - 264, 0, -1, 267, 268, 269, -1, 271, -1, -1, - 368, 10, -1, -1, -1, 279, -1, 281, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, 262, 263, - 264, -1, 41, 267, 268, 269, 0, 271, -1, -1, - -1, -1, -1, -1, -1, 279, 10, 281, -1, -1, - 59, -1, -1, -1, -1, -1, 368, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - -1, -1, -1, 0, -1, -1, -1, 41, -1, -1, - -1, -1, -1, 10, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 368, 59, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 41, -1, 125, -1, 262, 263, - 264, 0, -1, 267, 268, 269, -1, 271, -1, 93, - -1, 10, 59, -1, 368, 279, -1, 281, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, 0, - -1, 125, 41, -1, -1, -1, 93, -1, -1, 10, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, - 59, -1, 306, -1, 308, 309, 310, 311, 312, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, - 41, -1, 326, -1, -1, -1, -1, 38, -1, 40, - -1, 42, -1, -1, 93, 46, 340, -1, 59, -1, - -1, -1, 346, -1, 368, -1, 350, -1, 59, -1, - 61, 355, 356, 357, -1, -1, -1, 0, -1, -1, - -1, -1, -1, -1, -1, -1, 125, 10, -1, -1, - -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, - 279, -1, 281, -1, -1, -1, -1, -1, 41, -1, - 0, -1, 291, 292, 125, 294, 295, 296, 297, 298, - 10, -1, -1, -1, -1, -1, 59, -1, 262, 263, - 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, -1, 0, - -1, 41, -1, -1, -1, -1, -1, 291, 292, 10, - 294, 295, 296, 297, 298, 262, 263, 264, -1, 59, 267, 268, 269, -1, 271, -1, -1, -1, -1, -1, - -1, -1, 279, -1, 281, -1, -1, -1, -1, 368, - 41, -1, 125, -1, 291, 292, 0, 294, 295, 296, - 297, 298, -1, -1, -1, -1, 10, -1, 59, -1, - -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, - 269, -1, 271, -1, -1, -1, -1, -1, -1, -1, - 279, -1, 281, -1, 368, 125, -1, 41, -1, -1, - -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, - -1, 262, 263, 264, -1, 59, 267, 268, 269, 0, - 271, -1, -1, -1, -1, -1, -1, -1, 279, 10, - 281, 368, -1, -1, 125, -1, -1, -1, -1, -1, - 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, + -1, -1, 279, -1, 281, -1, 125, 41, -1, -1, + 44, -1, 93, -1, 291, 292, -1, 294, 295, 296, + 297, 298, -1, -1, -1, 59, -1, -1, -1, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, + -1, -1, -1, -1, 125, 322, -1, 324, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 41, -1, -1, -1, -1, 306, -1, 308, 309, 310, - 311, 312, 0, -1, -1, -1, -1, -1, 59, 368, - -1, 125, 10, -1, -1, 326, -1, -1, -1, 262, - 263, 264, -1, -1, 267, 268, 269, -1, 271, 340, - -1, -1, -1, -1, -1, 346, 279, -1, 281, 350, - -1, -1, -1, 41, 355, 356, 357, 368, 291, 292, - -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, - -1, 59, 262, 263, 264, -1, -1, 267, 268, 269, - 0, 271, -1, -1, 125, -1, -1, -1, -1, 279, - 10, 281, -1, -1, -1, -1, -1, -1, -1, 10, - -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, + 41, -1, -1, 44, 351, -1, 0, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 10, -1, 59, -1, + -1, 125, -1, 370, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, 0, -1, 41, -1, -1, + 44, 279, 93, 281, -1, 10, -1, -1, -1, -1, + -1, -1, -1, 291, 292, 59, 294, 295, 296, 297, + 298, -1, -1, 262, 263, 264, -1, -1, 267, 268, + 269, -1, 271, -1, 125, -1, 41, -1, -1, -1, + 279, -1, 281, -1, 322, -1, 324, -1, -1, 93, + -1, -1, 291, 292, 59, 294, 295, 296, 297, 298, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, 41, -1, -1, 44, -1, 37, 38, 279, -1, - 281, 42, 43, -1, 45, 368, 47, 125, -1, 59, - 291, 292, -1, 294, 295, 296, 297, 298, -1, 60, - -1, 62, 63, -1, -1, -1, -1, -1, 262, 263, + 271, -1, -1, 351, -1, -1, -1, -1, 279, -1, + 281, 125, -1, 322, -1, 324, -1, -1, 93, 0, + 291, 292, 370, 294, 295, 296, 297, 298, -1, 10, + -1, -1, -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, - -1, -1, -1, -1, -1, 279, -1, 281, 368, -1, - -1, -1, -1, 94, -1, -1, -1, 291, 292, -1, - 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 125, -1, -1, -1, 10, - -1, -1, -1, 124, -1, -1, -1, 368, -1, -1, + 125, 322, -1, 324, -1, 279, -1, 281, -1, -1, + 41, 370, -1, -1, -1, -1, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, -1, 59, -1, + -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, 322, 370, + 324, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, 93, -1, -1, -1, -1, -1, 279, -1, + 281, -1, -1, 41, -1, -1, -1, -1, -1, -1, + 291, 292, 0, 294, 295, 296, 297, 298, -1, -1, + -1, 59, 10, -1, 125, -1, 370, -1, 262, 263, + 264, -1, -1, 267, 268, 269, -1, 271, -1, -1, + -1, 322, -1, 324, -1, 279, -1, 281, -1, -1, + -1, -1, -1, 41, -1, 93, -1, 291, 292, -1, + 294, 295, 296, 297, 298, -1, -1, 262, 263, 264, + -1, 59, 267, 268, 269, 0, 271, -1, -1, -1, + -1, -1, -1, -1, 279, 10, 281, 125, 322, 370, + 324, -1, -1, -1, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, 41, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, 322, -1, 324, + -1, -1, -1, -1, 59, -1, 370, 125, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, - 271, -1, 33, -1, -1, -1, -1, -1, 279, 40, - 281, -1, -1, -1, -1, 46, -1, -1, -1, -1, - 291, 292, -1, 294, 295, 296, 297, 298, 59, 60, - -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, + 271, 59, -1, -1, -1, 370, -1, -1, 279, -1, + 281, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, + 125, -1, -1, -1, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, + -1, 322, -1, 324, 262, 263, 264, -1, -1, 267, + 268, 269, -1, 271, -1, -1, -1, 125, -1, -1, + -1, 279, -1, 281, -1, 41, -1, -1, -1, -1, + -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, + 298, -1, -1, 59, -1, -1, -1, -1, -1, 370, -1, -1, -1, -1, 262, 263, 264, -1, -1, 267, - 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, - 91, 279, -1, 281, -1, -1, -1, -1, -1, -1, + 268, 269, -1, 271, 322, -1, 324, -1, -1, 0, + -1, 279, -1, 281, -1, -1, -1, -1, -1, 10, -1, -1, -1, 291, 292, -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 123, -1, -1, 126, -1, 368, -1, -1, - -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, - -1, -1, 262, 263, 264, -1, -1, 267, 268, 269, - -1, 271, -1, -1, -1, -1, 33, -1, -1, 279, - -1, -1, -1, 40, -1, -1, -1, -1, -1, 46, - -1, -1, -1, -1, 294, 295, 296, 297, 298, -1, - 368, -1, 59, 60, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, -1, 349, - -1, -1, 343, 344, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, -1, 368, 126, - -1, -1, -1, -1, -1, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, -1, -1, 269, 270, - -1, 272, 273, 274, 275, 276, 277, 278, -1, 280, - -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, - -1, -1, 293, -1, -1, -1, -1, -1, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, -1, 313, 314, 315, 316, 317, 318, 319, -1, - -1, 322, -1, 324, 325, -1, -1, -1, 93, 94, - -1, -1, -1, -1, -1, -1, -1, -1, 339, 340, - -1, -1, -1, -1, 345, 346, 347, -1, -1, 350, - 351, 352, 353, -1, 355, -1, -1, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - -1, -1, 269, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, 280, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, 10, -1, -1, 345, 346, - 347, -1, -1, 350, 351, 352, 353, -1, 355, -1, - -1, 358, 359, 360, 361, 362, 363, 364, 33, 366, - 367, -1, -1, -1, -1, 40, -1, -1, -1, -1, - -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, -1, -1, -1, -1, - -1, -1, 287, 288, 289, 290, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 303, 304, - 305, 306, -1, -1, -1, 310, 91, 312, 313, 314, - 315, 316, 317, -1, -1, -1, -1, 322, -1, -1, - -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, 10, 123, -1, - -1, 126, 347, -1, -1, 350, -1, 352, 353, -1, - 355, 356, -1, 358, 359, 360, 361, 362, 363, 364, - 33, 366, 367, -1, -1, -1, -1, 40, -1, -1, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, 60, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 37, 38, -1, -1, -1, 42, 43, 91, 45, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 125, + 41, -1, 370, -1, 322, -1, 324, 262, 263, 264, + -1, -1, 267, 268, 269, -1, 271, -1, 59, -1, + -1, -1, -1, 0, 279, -1, 281, -1, -1, -1, + -1, -1, -1, 10, -1, -1, 291, 292, -1, 294, + 295, 296, 297, 298, 262, 263, 264, -1, -1, 267, + 268, 269, 370, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, 281, 41, -1, -1, 322, -1, 324, + -1, -1, -1, 291, 292, 0, 294, 295, 296, 297, + 298, -1, 59, -1, 125, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 322, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, 370, 41, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, + -1, -1, -1, -1, 59, -1, 262, 263, 264, -1, + -1, 267, 268, 269, -1, 271, -1, -1, 125, -1, + -1, -1, 370, 279, -1, 281, -1, -1, 41, -1, + -1, -1, -1, -1, -1, 291, 292, -1, 294, 295, + 296, 297, 298, -1, -1, -1, 59, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + 125, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, + -1, 262, 263, 264, -1, -1, 267, 268, 269, -1, + 271, -1, -1, -1, -1, -1, -1, -1, 279, 0, + 281, -1, 125, 41, 370, -1, 44, -1, -1, 10, + 291, 292, 0, 294, 295, 296, 297, 298, -1, -1, + -1, 59, 10, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 41, 322, -1, 324, -1, 262, 263, 264, -1, -1, + 267, 268, 269, 41, 271, -1, -1, -1, 59, -1, + -1, -1, 279, -1, 281, -1, -1, -1, -1, -1, + -1, 59, -1, -1, 291, 292, -1, 294, 295, 296, + 297, 298, -1, -1, 0, -1, -1, 125, -1, 370, + -1, -1, -1, -1, 10, -1, -1, 262, 263, 264, + -1, -1, 267, 268, 269, 322, 271, 324, -1, -1, + -1, -1, -1, -1, 279, -1, 281, -1, -1, -1, + -1, -1, -1, -1, 125, 41, 291, 292, -1, 294, + 295, 296, 297, 298, -1, -1, -1, 125, -1, 262, + 263, 264, -1, 59, 267, 268, 269, -1, 271, -1, + -1, -1, 0, 370, -1, -1, -1, 322, 281, 324, + -1, -1, 10, -1, -1, -1, -1, -1, 291, 292, + -1, 294, 295, 296, 297, 298, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 41, 0, -1, -1, -1, -1, 322, + -1, 324, -1, -1, 10, 370, -1, -1, -1, 125, + -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 262, 263, 264, -1, -1, -1, + 268, 269, -1, 271, -1, 41, -1, -1, -1, -1, + -1, 279, -1, -1, -1, -1, -1, 370, -1, -1, + -1, -1, -1, 59, -1, -1, 294, 295, 296, 297, + 298, 262, 263, 264, -1, -1, -1, 268, 269, -1, + 271, -1, 0, -1, 262, 263, 264, 125, 279, -1, + 268, 269, 10, 271, 322, -1, 324, -1, -1, -1, + -1, 279, 0, 294, 295, 296, 297, 298, -1, -1, + -1, -1, 10, -1, -1, -1, 294, 295, 296, 297, + 298, -1, -1, 41, -1, -1, -1, -1, -1, 125, + -1, 322, -1, 324, -1, -1, -1, -1, -1, -1, + -1, 59, 370, 41, 322, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 262, 263, 264, -1, + -1, 59, 268, 269, -1, 271, -1, -1, -1, -1, + -1, -1, -1, 279, -1, -1, -1, -1, -1, 370, + -1, -1, -1, -1, -1, -1, -1, -1, 294, 295, + 296, 297, 370, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 125, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, 324, -1, + -1, -1, -1, -1, 262, 263, 264, 125, -1, -1, + 268, 269, -1, 271, -1, -1, -1, -1, -1, -1, + -1, 279, -1, -1, -1, -1, 10, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 294, 295, 296, 297, + -1, -1, -1, -1, 370, -1, 262, 263, 264, 33, + -1, -1, 268, 269, -1, 271, 40, -1, -1, -1, + -1, -1, 46, 279, 322, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, 59, 60, -1, 294, 295, + 296, 297, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, 91, 324, -1, + -1, -1, 370, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 262, 263, 264, -1, -1, -1, + 268, 269, -1, 271, -1, -1, -1, -1, -1, 123, + -1, 279, 126, -1, 262, 263, 264, -1, -1, -1, + 268, 269, 10, 271, 370, -1, 294, 295, 296, 297, + -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 294, 295, 296, 297, + -1, -1, 40, -1, 322, -1, 324, -1, 46, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 322, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 370, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 370, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 123, -1, -1, 126, -1, + -1, -1, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, -1, -1, 269, 270, -1, 272, 273, + 274, 275, 276, 277, 278, -1, 280, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, + -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, 347, 348, 349, -1, -1, 352, 353, + 354, 355, -1, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, -1, + -1, 269, 270, -1, 272, 273, 274, 275, 276, 277, + 278, -1, 280, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, + -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, + 318, 319, -1, -1, 322, 323, -1, -1, 326, 327, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 341, 342, -1, 10, -1, -1, 347, + 348, 349, -1, -1, 352, 353, 354, 355, -1, 357, + -1, -1, 360, 361, 362, 363, 364, 365, 366, 33, + 368, 369, -1, -1, -1, -1, 40, -1, -1, -1, + -1, -1, 46, -1, -1, -1, 1023, 1024, -1, -1, + -1, -1, -1, -1, -1, 59, 60, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1090, 1091, -1, -1, 1094, -1, 123, + 10, -1, 126, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, + 40, 1128, -1, -1, -1, -1, 46, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + 60, -1, 1149, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1167, -1, -1, -1, 1171, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, 1184, 1185, 1186, + 1187, -1, -1, -1, 1191, 1192, -1, 1194, -1, -1, + -1, 37, 38, -1, -1, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, 60, -1, 62, 63, -1, -1, + -1, -1, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, -1, -1, 269, 270, -1, 272, 273, + 274, 275, 276, 277, 278, -1, 280, -1, 94, -1, + 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, + -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 124, 313, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + -1, -1, 326, 327, -1, 1302, -1, -1, 1305, -1, + -1, -1, -1, -1, -1, -1, 1313, 341, 342, -1, + -1, -1, -1, 347, 348, 349, -1, -1, 352, 353, + 354, 355, -1, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, -1, -1, 269, + 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, + -1, -1, -1, 1370, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, + -1, -1, 322, 323, -1, -1, 326, 327, -1, -1, + -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, + -1, 341, 342, -1, -1, -1, -1, 347, 348, 349, + -1, -1, 352, 353, 354, 355, -1, 357, 33, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + -1, 46, 298, -1, 1023, 1024, -1, -1, -1, -1, + -1, -1, -1, -1, 59, 60, 1023, 1024, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, -1, 91, -1, -1, 345, + 346, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1090, 1091, -1, -1, 1094, -1, -1, -1, 10, + -1, 126, -1, 1090, 1091, -1, -1, 1094, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 33, -1, -1, -1, -1, -1, -1, 1128, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1128, -1, -1, -1, -1, -1, -1, 59, -1, + 1149, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1149, -1, -1, -1, -1, -1, 1167, -1, + -1, -1, 1171, -1, -1, -1, -1, -1, -1, -1, + 1167, -1, -1, -1, 1171, 1184, 1185, 1186, 1187, -1, + -1, -1, 1191, 1192, -1, 1194, -1, 1184, 1185, 1186, + 1187, -1, -1, -1, 1191, 1192, -1, 1194, -1, -1, + -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, -1, -1, 269, 270, -1, 272, 273, 274, - 275, 276, 277, 278, -1, 280, -1, -1, 124, 284, + 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, 33, 299, 300, 301, 302, 303, 304, + -1, -1, -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - 345, 346, 347, -1, -1, 350, 351, 352, 353, -1, - 355, -1, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, -1, -1, 269, 270, -1, 272, - 273, 274, 275, 276, 277, 278, 126, -1, -1, -1, - -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, - 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, - 313, 314, 315, 316, 317, 318, 319, 10, -1, 322, - -1, 324, 325, 279, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 339, 340, -1, -1, - 33, -1, 345, 346, 347, -1, -1, 350, 351, 352, - 353, -1, 355, 46, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, -1, 59, 60, -1, -1, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, -1, -1, -1, -1, 343, 344, -1, - -1, -1, -1, 349, -1, -1, -1, -1, 91, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, - -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, - 270, -1, 272, 273, 274, 275, 276, 277, 278, 10, - -1, -1, -1, 126, 284, 285, 286, 287, 288, 289, - 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, - 300, -1, 33, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, -1, -1, 59, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, - 340, -1, -1, -1, -1, -1, -1, 347, -1, -1, - 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 126, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, -1, -1, 269, 270, -1, 272, - 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, - -1, 284, 285, 286, 287, 288, 289, 290, -1, 94, - 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 339, 340, -1, -1, - -1, -1, 345, 346, 347, -1, -1, 350, 351, 352, - 353, -1, 355, -1, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, 256, 257, 258, 259, 260, + 315, 316, 317, 318, 319, -1, -1, 322, 323, -1, + -1, 326, 327, 1302, -1, -1, 1305, -1, -1, -1, + -1, -1, -1, -1, 1313, 1302, 341, 342, 1305, -1, + -1, -1, 347, 348, 349, -1, 1313, 352, 353, 354, + 355, -1, 357, -1, -1, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, - -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, - -1, -1, 293, -1, -1, -1, 10, -1, 299, 300, + -1, 1370, -1, 284, 285, 286, 287, 288, 289, 290, + -1, -1, 293, 1370, -1, -1, 10, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, 33, - -1, 322, -1, 324, 325, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 339, 340, - -1, -1, -1, -1, -1, 59, 347, 61, -1, 350, - 351, 352, 353, -1, 355, -1, -1, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, -1, -1, -1, - -1, -1, 287, 288, 289, 290, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 303, 304, - 305, 306, -1, -1, -1, 310, -1, 312, 313, 314, - 315, 316, 317, -1, -1, -1, -1, 322, 10, -1, - -1, 326, 126, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, 33, 347, -1, -1, 350, -1, 352, 353, -1, - 355, 356, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, -1, -1, -1, -1, 59, -1, -1, + -1, 322, 323, -1, -1, 326, 327, -1, -1, -1, + -1, -1, 1023, 1024, -1, -1, -1, -1, -1, -1, + 341, 342, -1, -1, -1, 59, -1, 61, 349, -1, + -1, 352, 353, 354, 355, -1, 357, -1, -1, 360, + 361, 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1090, + 1091, -1, -1, 1094, -1, -1, -1, -1, -1, -1, + 10, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, 1128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1149, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1167, -1, -1, -1, + 1171, -1, -1, -1, 10, -1, -1, -1, -1, -1, + -1, -1, -1, 1184, 1185, 1186, 1187, -1, -1, -1, + 1191, 1192, -1, 1194, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, -1, 42, 43, -1, 45, - -1, 47, -1, -1, 126, -1, -1, -1, -1, -1, + -1, 47, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, 60, -1, 62, 63, -1, -1, -1, -1, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, -1, -1, 269, 270, -1, + 264, 265, 266, -1, }; } - private static final short[] yyCheck4() { - return new short[] { + private static final int[] yyCheck4() { + return new int[] { - 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, - 94, -1, 284, 285, 286, 287, 288, 289, 290, -1, - -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 124, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, 324, 325, -1, -1, -1, -1, -1, 10, - -1, -1, -1, -1, -1, -1, -1, 339, 340, -1, - -1, -1, -1, -1, -1, 347, -1, -1, 350, 351, - 352, 353, 33, 355, -1, -1, 358, 359, 360, 361, - 362, 363, 364, -1, 366, 367, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, -1, 59, 269, - 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, - -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, - 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, -1, -1, -1, -1, - -1, 10, -1, -1, -1, 126, -1, -1, -1, 339, - 340, -1, -1, -1, -1, -1, -1, 347, -1, -1, - 350, 351, 352, 353, 33, 355, -1, -1, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, -1, -1, - -1, -1, -1, -1, 298, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 269, 270, -1, 272, 273, 274, 275, 276, 277, + 278, -1, -1, -1, 94, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, + -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 124, 313, 314, 315, 316, 317, + 318, 319, -1, -1, 322, 323, -1, 1302, 326, 327, + 1305, -1, -1, -1, -1, 10, -1, -1, 1313, -1, + -1, -1, -1, 341, 342, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, 33, 357, + -1, -1, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, -1, 59, 269, 270, -1, 272, 273, + 274, 275, 276, 277, 278, 1370, -1, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, + -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, + 314, 315, 316, 317, 318, 319, -1, -1, 322, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, 10, + -1, 126, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, 33, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, -1, -1, -1, -1, 345, 346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, -1, -1, -1, -1, 343, - 344, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 37, 38, -1, -1, -1, 42, - 43, -1, 45, -1, 47, -1, 125, 126, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 60, -1, 62, - 63, -1, -1, -1, -1, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, -1, -1, 269, 270, + 37, 38, -1, -1, -1, 42, 43, -1, 45, -1, + 47, -1, -1, -1, 125, 126, -1, -1, -1, -1, + -1, -1, -1, 60, -1, 62, 63, -1, -1, -1, + -1, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, -1, -1, 269, 270, -1, 272, 273, 274, + 275, 276, 277, 278, -1, -1, -1, 94, -1, 284, + 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, + -1, -1, -1, -1, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 124, 313, 314, + 315, 316, 317, 318, 319, 10, -1, 322, 323, -1, + -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 341, 342, 33, -1, + -1, -1, -1, -1, 349, -1, -1, 352, 353, 354, + 355, -1, 357, -1, -1, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, 256, 257, 258, 259, 260, + 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, -1, - -1, 94, -1, 284, 285, 286, 287, 288, 289, 290, + -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 124, 313, 314, 315, 316, 317, 318, 319, -1, - -1, 322, 10, 324, 325, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 339, 340, - -1, -1, -1, -1, -1, 33, 347, -1, -1, 350, - 351, 352, 353, -1, 355, -1, -1, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, 256, 257, 258, - 259, 260, 261, -1, -1, -1, 265, 266, -1, -1, - -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, - -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, - 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, -1, 313, 314, 315, 316, 317, 318, - 319, -1, -1, 322, 10, 324, 325, -1, 126, -1, + 311, -1, 313, 314, 315, 316, 317, 318, 319, -1, + 10, 126, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 339, 340, -1, -1, -1, -1, -1, 33, 347, -1, - -1, 350, 351, 352, 353, -1, 355, -1, -1, 358, - 359, 360, 361, 362, 363, 364, -1, 366, 367, -1, - -1, -1, -1, 59, -1, 298, -1, -1, -1, -1, + 341, 342, -1, 33, -1, -1, -1, -1, 349, -1, + -1, 352, 353, 354, 355, -1, 357, -1, -1, 360, + 361, 362, 363, 364, 365, 366, -1, 368, 369, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, -1, -1, -1, -1, - 343, 344, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, - 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, 257, - 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, - -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, - 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, - 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, - -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 339, 340, -1, -1, -1, -1, -1, -1, 347, - -1, 126, 350, 351, 352, 353, -1, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, - 33, 257, 258, 259, -1, 261, -1, -1, -1, 265, - 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, - 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, - 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, - -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, - 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, + -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 10, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 339, 340, -1, -1, -1, -1, -1, - -1, 347, -1, 126, 350, 351, 352, 353, -1, -1, - -1, -1, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, 257, 258, 259, -1, 261, 33, -1, -1, + -1, -1, 257, 258, 259, -1, 261, -1, 33, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, -1, -1, -1, 323, -1, + -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 341, 342, -1, -1, + -1, -1, -1, -1, 349, -1, -1, 352, 353, 354, + 355, 126, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, -1, 256, 257, 258, 259, + -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, + -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, + 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, + -1, 33, -1, 323, -1, -1, 326, 327, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 341, 342, -1, -1, 1023, 1024, 59, -1, 349, + -1, -1, 352, 353, 354, 355, -1, -1, -1, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, + 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, + 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, + 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, + -1, -1, 1090, 1091, 126, 300, 1094, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, -1, 347, -1, -1, 350, 351, 352, 353, -1, - 126, -1, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 256, 257, 258, 259, 260, 261, -1, - 33, -1, 265, 266, -1, -1, -1, 270, -1, 272, - 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, - -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, - 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 339, 340, -1, -1, - -1, -1, -1, -1, 347, -1, -1, 350, 351, 352, - 353, -1, 355, 126, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, -1, -1, -1, -1, -1, + 315, 316, 317, 318, 319, -1, -1, -1, 323, -1, + -1, 326, 327, -1, -1, -1, 33, -1, -1, -1, + 1128, -1, -1, -1, -1, -1, 341, 342, -1, -1, + -1, -1, -1, -1, 349, -1, -1, 352, 353, 354, + 355, 1149, 59, -1, -1, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, -1, -1, -1, -1, 1167, + -1, -1, -1, 1171, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1184, 1185, 1186, 1187, + -1, -1, -1, 1191, 1192, -1, 1194, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, + -1, -1, -1, -1, 256, 257, 258, 259, 260, 261, + -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, + 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, + -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, + -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + -1, 313, 314, 315, 316, 317, 318, 319, -1, -1, + -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, + -1, -1, -1, -1, 1302, -1, -1, 1305, -1, 341, + 342, -1, -1, -1, -1, 1313, -1, 349, -1, -1, + 352, 353, 354, 355, -1, 357, -1, -1, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, + 126, -1, -1, -1, -1, -1, -1, -1, -1, 256, + 257, 258, 259, 260, 261, -1, -1, -1, 265, 266, + -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, + 277, 278, 1370, 33, -1, -1, -1, 284, 285, 286, + 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, + -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, + 317, 318, 319, -1, -1, -1, 323, -1, -1, 326, + 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 341, 342, -1, -1, -1, -1, + -1, -1, 349, -1, -1, 352, 353, 354, 355, -1, + 357, -1, -1, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, -1, -1, -1, 126, -1, -1, -1, 256, 257, 258, 259, 260, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, - 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, + 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 33, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, 339, 340, -1, -1, -1, -1, -1, - -1, 347, -1, -1, 350, 351, 352, 353, -1, 355, - -1, -1, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, -1, 256, 257, 258, 259, 260, 261, -1, - -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, - 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, - -1, 284, 285, 286, 287, 288, 289, 290, -1, 126, - 293, -1, -1, -1, -1, -1, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 33, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, 339, 340, -1, -1, - -1, -1, -1, -1, 347, -1, -1, 350, 351, 352, - 353, -1, 355, -1, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + -1, 357, -1, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, -1, -1, 126, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 256, 257, 258, 259, + 260, 261, -1, -1, -1, 265, 266, -1, -1, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, + -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, + -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 341, 342, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, 353, 354, 355, -1, 357, -1, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + -1, -1, 126, -1, -1, -1, 256, 257, 258, 259, + 260, 261, -1, -1, -1, 265, 266, -1, -1, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, + -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, + -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 341, 342, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, 353, 354, 355, -1, 357, -1, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 257, 258, 259, 260, 261, -1, 33, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 126, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, -1, 257, 258, 259, 260, 261, -1, 33, - -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, - 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, - 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, - -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 339, 340, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 355, 126, -1, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, -1, -1, -1, -1, -1, -1, - 257, 258, 259, 260, 261, -1, 33, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 126, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, -1, 257, 258, 259, 260, 261, -1, 33, + -1, -1, 256, 257, 258, 259, 260, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, - 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, + 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, 299, 300, -1, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 339, 340, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 355, 126, -1, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, -1, -1, -1, -1, -1, -1, - 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, 33, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, -1, 257, 258, 259, 126, 261, -1, -1, + 314, 315, 316, 317, 318, 319, -1, -1, -1, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, -1, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, 126, -1, + -1, -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 339, 340, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, -1, -1, -1, -1, 126, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 33, 257, 258, 259, - -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, - 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, - -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, - 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, - 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, - 340, -1, -1, -1, -1, -1, -1, 347, -1, 126, - 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, 33, 257, + 314, 315, 316, 317, 318, 319, -1, -1, -1, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, 126, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, - 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, + 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, -1, -1, + 318, 319, -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 339, 340, -1, -1, -1, -1, -1, -1, 347, - -1, 126, 350, 351, 352, 353, -1, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, - 257, 258, 259, -1, 261, -1, -1, 33, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, + -1, -1, -1, 341, 342, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, -1, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, -1, -1, 126, -1, -1, -1, -1, 257, + 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, + -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, + 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, + -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 356, - 126, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, 257, 258, 259, -1, 261, -1, -1, -1, - 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, - 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, -1, 347, -1, -1, 350, 351, 352, 353, -1, - -1, 356, 357, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, -1, -1, -1, -1, 126, -1, -1, + -1, -1, -1, 341, 342, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, -1, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, -1, -1, 126, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, + -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, + 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, + -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, + -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, + -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, + 342, -1, -1, -1, -1, -1, -1, 349, -1, -1, + 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, + 126, -1, -1, -1, -1, 257, 258, 259, -1, 261, + -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, + 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, + -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, + -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, -1, -1, + -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, + 342, -1, -1, -1, -1, -1, -1, 349, -1, -1, + 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, + 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, 324, 325, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 339, 340, -1, -1, -1, -1, -1, - -1, 347, -1, -1, 350, 351, 352, 353, -1, 355, - 356, -1, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, -1, -1, -1, -1, 126, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, - 259, -1, 261, -1, -1, 33, 265, 266, -1, -1, - -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, - -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, - 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, - -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, -1, -1, 322, -1, 324, 325, -1, -1, -1, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + -1, 357, 358, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, -1, -1, 126, -1, -1, -1, + -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, + 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, + 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, + -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + -1, -1, 358, 359, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, -1, -1, 126, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, + -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, + -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, + 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 339, 340, -1, -1, -1, -1, -1, -1, 347, -1, - -1, 350, 351, 352, 353, -1, -1, 356, 126, 358, - 359, 360, 361, 362, 363, 364, -1, 366, 367, -1, - -1, -1, -1, -1, -1, -1, 33, 257, 258, 259, + -1, 341, 342, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, 353, 354, 355, -1, -1, 358, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + -1, -1, 126, -1, -1, -1, 256, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, - 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, 324, 325, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, - 340, -1, -1, -1, -1, -1, -1, 347, -1, 126, - 350, 351, 352, 353, -1, 355, -1, -1, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, 33, 257, - 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, - -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, - 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, - 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, - -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, - 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, - 318, 319, -1, -1, 322, -1, 324, 325, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 339, 340, -1, -1, -1, -1, -1, -1, 347, - -1, 126, 350, 351, 352, 353, -1, 355, -1, -1, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, - 257, 258, 259, -1, 261, -1, 33, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 126, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, 257, 258, 259, -1, 261, -1, -1, 33, - 265, 266, -1, -1, -1, 270, 40, 272, 273, 274, - 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, -1, 347, -1, -1, 350, 351, 352, 353, -1, - 355, -1, 126, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, -1, -1, -1, -1, -1, -1, -1, - 257, 258, 259, -1, 261, -1, 33, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, + -1, -1, -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, 355, 126, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, -1, -1, 257, 258, 259, -1, 261, 33, -1, + -1, 341, 342, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, 353, 354, 355, -1, -1, -1, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, - 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, + 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 339, 340, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 126, -1, -1, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, -1, -1, -1, -1, -1, 33, - 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, - -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, - 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, 324, 325, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, 126, 350, 351, 352, 353, -1, 355, -1, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, 33, 257, 258, 259, -1, 261, -1, -1, -1, - 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, - 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, -1, 347, -1, 126, 350, 351, 352, 353, -1, - -1, -1, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 257, 258, 259, -1, 261, 33, -1, + 314, 315, 316, 317, 318, 319, -1, -1, -1, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, -1, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, 126, -1, + -1, -1, -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, - 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, + 274, 275, 276, 277, 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, - 324, 325, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 339, 340, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 126, -1, -1, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, -1, 257, 258, 259, -1, 261, - 33, -1, -1, 265, 266, -1, -1, -1, 270, -1, - 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, - -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, - -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - -1, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, 324, 325, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 339, 340, -1, - -1, -1, -1, -1, -1, 347, -1, -1, 350, 351, - 352, 353, -1, 126, -1, -1, 358, 359, 360, 361, - 362, 363, 364, -1, 366, 367, -1, -1, -1, -1, - -1, 33, 257, 258, 259, -1, 261, -1, -1, -1, - 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, - 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, 324, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 339, 340, -1, -1, -1, -1, - -1, -1, 347, -1, 126, 350, 351, 352, 353, -1, - -1, -1, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, -1, 257, 258, 259, -1, 261, -1, + 314, 315, 316, 317, 318, 319, -1, -1, -1, 323, + -1, -1, 326, 327, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, -1, 357, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, -1, -1, 126, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, + 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, + -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, + 278, 33, -1, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, + -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, + 318, 319, -1, -1, -1, 323, -1, -1, 326, 327, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 341, 342, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, -1, 357, + -1, -1, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, -1, -1, 126, -1, -1, -1, -1, 257, + 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, + -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, + 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, 33, -1, -1, + -1, -1, 300, -1, 40, 303, 304, 305, 306, 307, + 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, + 318, 319, -1, -1, -1, 323, -1, -1, 326, 327, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 341, 342, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, -1, 357, + -1, -1, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, + 126, -1, -1, 265, 266, -1, -1, -1, 270, -1, + 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, + 33, -1, 284, 285, 286, 287, 288, 289, 290, -1, + -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + -1, 313, 314, 315, 316, 317, 318, 319, -1, -1, + -1, 323, -1, -1, 326, 327, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, + 342, -1, -1, -1, -1, -1, -1, 349, -1, -1, + 352, 353, 354, 355, -1, 357, -1, -1, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, + -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 257, 258, 259, -1, 261, -1, 33, -1, 265, + 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, + 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, + -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + 126, -1, -1, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, + 33, -1, 265, 266, -1, -1, -1, 270, -1, 272, + 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, + -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, + 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, + 313, 314, 315, 316, 317, 318, 319, -1, -1, -1, + 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 341, 342, + -1, -1, -1, -1, -1, -1, 349, -1, -1, 352, + 353, 354, 355, 126, -1, -1, -1, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, -1, -1, -1, + -1, 257, 258, 259, -1, 261, -1, 33, -1, 265, + 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, + 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, + -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + 126, -1, -1, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, + 33, -1, 265, 266, -1, -1, -1, 270, -1, 272, + 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, + -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, + 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, + 313, 314, 315, 316, 317, 318, 319, -1, -1, -1, + 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 341, 342, + -1, -1, -1, -1, -1, -1, 349, -1, -1, 352, + 353, 354, 355, 126, -1, -1, -1, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, -1, -1, -1, + -1, 257, 258, 259, -1, 261, -1, 33, -1, 265, + 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, + 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, + -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + 126, -1, -1, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, + 33, -1, 265, 266, -1, -1, -1, 270, -1, 272, + 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, + -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, + 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, + 313, 314, 315, 316, 317, 318, 319, -1, -1, -1, + 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 341, 342, + -1, -1, -1, -1, -1, -1, 349, -1, -1, 352, + 353, 354, 355, 126, -1, -1, -1, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, -1, -1, -1, + -1, 257, 258, 259, -1, 261, -1, -1, -1, 265, + 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, + 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, + -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, + 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, + 326, 327, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, 353, 354, 355, + -1, 93, 94, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, - -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 339, 340, -1, -1, - -1, -1, -1, -1, 347, -1, -1, 350, 351, 352, - 353, 94, -1, -1, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, 257, 258, 259, -1, 261, - -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, - 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, - -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, - -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - -1, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, 324, 325, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 339, 340, -1, - -1, -1, -1, -1, -1, 347, -1, -1, 350, 351, - 352, 353, -1, -1, -1, -1, 358, 359, 360, 361, - 362, 363, 364, 33, 366, 367, -1, 37, 38, -1, - -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, + 313, 314, 315, 316, 317, 318, 319, -1, -1, -1, + 323, -1, -1, 326, 327, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 341, 342, + -1, -1, -1, -1, -1, -1, 349, -1, -1, 352, + 353, 354, 355, -1, -1, -1, -1, 360, 361, 362, + 363, 364, 365, 366, 33, 368, 369, -1, 37, 38, + -1, -1, -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, + -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 94, -1, 96, -1, -1, -1, - -1, -1, -1, -1, 287, 288, 289, 290, -1, -1, + -1, -1, -1, -1, -1, 94, -1, 96, -1, -1, + -1, -1, -1, -1, -1, 287, 288, 289, 290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 303, 304, 305, 306, 124, -1, 126, 310, -1, 312, - 313, 314, 315, 316, 317, -1, 33, -1, -1, 322, - 37, 38, -1, 326, -1, 42, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, 339, 340, -1, -1, - -1, -1, -1, 60, 347, 62, -1, 350, -1, 352, - 353, -1, 355, 356, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 94, -1, 96, + -1, 303, 304, 305, 306, 124, -1, 126, 310, -1, + 312, 313, 314, 315, 316, 317, -1, -1, -1, 33, + -1, 323, -1, 37, 38, -1, 328, -1, 42, 43, + -1, 45, -1, 47, -1, -1, -1, -1, -1, 341, + 342, -1, -1, -1, -1, -1, 60, 349, 62, -1, + 352, -1, 354, 355, -1, 357, 358, -1, 360, 361, + 362, 363, 364, 365, 366, -1, 368, 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 94, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, -1, 126, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + 124, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 94, -1, -1, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, -1, -1, -1, -1, -1, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, -1, 343, 344, 345, 346, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 357, 358, + -1, -1, 361, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + -1, -1, -1, -1, -1, 299, 300, 301, 302, 303, + 304, 305, 306, 307, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, -1, -1, -1, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, -1, -1, -1, -1, -1, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, -1, - 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 324, 325, 326, 327, 328, 329, - 330, 331, 332, -1, -1, 335, 336, -1, -1, -1, - -1, 341, 342, 343, 344, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 355, 356, -1, -1, 359, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, -1, -1, 94, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, -1, -1, 310, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, - -1, -1, -1, -1, -1, -1, 33, -1, 355, 356, - 37, 38, 359, 40, -1, 42, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, + -1, -1, 326, 327, 328, 329, 330, 331, 332, 333, + 334, -1, -1, 337, 338, -1, -1, -1, -1, 343, + 344, 345, 346, -1, -1, -1, -1, -1, -1, -1, + 37, 38, -1, 357, 358, 42, 43, 361, 45, -1, + 47, -1, -1, -1, -1, 287, 288, 289, 290, -1, + -1, -1, -1, 60, -1, 62, 63, -1, -1, -1, + -1, 303, 304, 305, 306, -1, -1, -1, 310, -1, + 312, 313, 314, 315, 316, 317, -1, -1, -1, -1, + -1, 323, -1, -1, -1, -1, 328, 94, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, + 342, -1, -1, -1, -1, -1, -1, 349, -1, -1, + 352, -1, 354, 355, -1, 357, 358, 124, 360, 361, + 362, 363, 364, 365, 366, 33, 368, 369, -1, 37, + 38, -1, 40, -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 94, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 94, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, -1, 126, - -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, - 37, 38, -1, -1, -1, 42, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, -1, -1, -1, 287, - 288, 289, 290, 60, -1, 62, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 303, 304, 305, 306, -1, - -1, -1, 310, -1, -1, 313, 314, 315, 316, 317, - -1, -1, -1, -1, 322, -1, -1, 94, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 339, 340, -1, -1, -1, -1, -1, -1, 347, - -1, -1, 350, -1, 352, 353, -1, 124, -1, 126, - 358, 359, 360, 361, 362, 363, 364, -1, 366, 367, + -1, -1, -1, -1, -1, -1, 124, -1, 126, -1, + -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + -1, 37, 38, -1, -1, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, + 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, -1, 44, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 355, 356, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, -1, -1, -1, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, -1, -1, -1, - -1, -1, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, - -1, 33, -1, -1, -1, 37, 38, -1, 355, 356, - 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, - 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, + 126, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, -1, -1, -1, -1, 345, 346, + -1, -1, -1, -1, 351, -1, -1, -1, -1, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, -1, 44, -1, -1, + -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 326, 327, + 328, 329, 330, 331, 332, 333, 334, -1, -1, 337, + 338, -1, -1, -1, -1, 343, 344, 345, 346, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 357, + 358, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, -1, -1, -1, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, -1, -1, + -1, -1, -1, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, + -1, 337, 338, -1, -1, -1, -1, 343, 344, 345, + 346, -1, -1, -1, 33, -1, -1, -1, 37, 38, + -1, 357, 358, 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 94, -1, 96, -1, -1, -1, -1, -1, + -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, - -1, -1, 124, 270, 126, 272, 273, 274, 275, 276, - 277, 278, -1, -1, 44, -1, -1, 284, 285, 286, - 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, - -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 257, 258, 259, -1, 261, 94, -1, 96, 265, 266, + -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, + 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, + 287, 288, 289, 290, -1, 124, 293, 126, -1, -1, + -1, -1, -1, 300, -1, 44, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, - 317, 318, 319, -1, -1, 322, -1, -1, -1, -1, + 317, 318, 319, -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, 351, 352, 353, -1, -1, -1, - -1, 358, 359, 360, 361, 362, 363, 364, 33, 366, - 367, -1, 37, 38, -1, 40, -1, 42, 43, -1, - 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 60, -1, 62, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 94, - -1, 96, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, -1, -1, -1, -1, -1, 299, 300, 301, - 302, 303, 304, 305, 306, 307, -1, -1, 310, 124, - -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, -1, -1, 335, 336, -1, -1, -1, -1, 341, - 342, 343, 344, -1, -1, -1, -1, 257, 258, 259, - -1, 261, -1, 355, 356, 265, 266, -1, -1, -1, - 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, - -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, - 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, - 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, - 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 349, -1, -1, 352, 353, 354, 355, -1, + -1, -1, -1, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 347, -1, -1, - 350, 351, 352, 353, -1, -1, -1, -1, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, - 62, 306, 307, -1, -1, 310, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, - 335, 336, 94, -1, 96, -1, 341, 342, 343, 344, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 355, 356, -1, 37, 38, -1, 40, -1, 42, 43, - -1, 45, 124, 47, 126, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 60, -1, 62, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, - -1, -1, 37, 38, -1, 40, -1, 42, 43, -1, - 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, - 94, -1, 96, -1, -1, 60, -1, 62, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + 62, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 94, -1, 96, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, -1, -1, -1, -1, -1, + 299, 300, 301, 302, 303, 304, 305, 306, 307, -1, + -1, 310, 124, -1, 126, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, -1, 343, 344, 345, 346, 257, 258, + 259, -1, 261, -1, -1, -1, 265, 266, 357, 358, + -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, + -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, + 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, + -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, -1, 313, 314, 315, 316, 317, 318, + 319, -1, 33, -1, 323, -1, 37, 38, -1, 40, + -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, + 349, 62, -1, 352, 353, 354, 355, -1, -1, -1, + -1, 360, 361, 362, 363, 364, 365, 366, -1, 368, + 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 94, -1, 96, -1, 33, -1, -1, -1, 37, 38, -1, 40, -1, 42, 43, -1, 45, - 124, 47, 126, -1, -1, -1, -1, -1, -1, 94, - -1, 96, -1, -1, 60, -1, 62, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, - 37, 38, -1, 40, -1, 42, 43, -1, 45, 124, - 47, 126, -1, -1, -1, -1, -1, -1, 94, -1, - 96, -1, -1, 60, -1, 62, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 47, -1, -1, 306, 307, -1, -1, 310, -1, + -1, -1, -1, 124, 60, 126, 62, -1, -1, -1, + -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, + 332, 333, 334, -1, -1, 337, 338, -1, -1, -1, + -1, 343, 344, 345, 346, -1, -1, -1, 94, -1, + 96, -1, -1, -1, 33, 357, 358, -1, 37, 38, + -1, 40, -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, - 126, -1, -1, -1, -1, -1, 33, 94, -1, 96, - 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, - 47, -1, -1, -1, 306, 307, -1, -1, 310, -1, - -1, -1, -1, 60, -1, 62, -1, 124, -1, 126, - -1, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, -1, -1, 335, 336, -1, -1, -1, -1, 341, - 342, 343, 344, -1, -1, -1, -1, 94, -1, 96, - -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, -1, 126, - -1, -1, 306, 307, -1, -1, 310, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, - -1, 335, 336, -1, -1, -1, -1, 341, 342, 343, - 344, 306, 307, -1, -1, 310, -1, -1, -1, -1, - -1, 355, 356, -1, -1, -1, -1, -1, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, - 335, 336, -1, -1, -1, -1, 341, 342, 343, 344, - 306, 307, -1, -1, 310, -1, -1, -1, -1, -1, - 355, 356, -1, -1, -1, -1, -1, -1, 324, 325, - 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, - 336, -1, -1, -1, -1, 341, 342, 343, 344, 306, - 307, -1, -1, 310, -1, -1, -1, -1, -1, 355, - 356, -1, -1, -1, -1, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, - -1, -1, -1, -1, -1, 37, 38, -1, 355, 356, - 42, 43, -1, 45, -1, 47, -1, -1, -1, 306, - 307, -1, -1, 310, -1, -1, -1, -1, 60, -1, - 62, 63, -1, -1, -1, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, - -1, -1, 94, -1, -1, -1, 33, -1, 355, 356, - 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 124, 60, -1, 62, -1, -1, -1, -1, + 126, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, 47, - -1, -1, -1, -1, -1, -1, -1, 94, -1, 96, + -1, -1, -1, -1, -1, 94, -1, 96, -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, -1, -1, -1, 37, 38, - -1, 40, -1, 42, 43, -1, 45, 124, 47, 126, - -1, -1, -1, -1, -1, -1, 94, -1, 96, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 124, -1, 126, -1, -1, + 33, -1, -1, -1, 37, 38, 94, 40, 96, 42, + 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 60, -1, 62, + -1, -1, -1, -1, -1, -1, 124, -1, 126, -1, + -1, -1, -1, -1, -1, 306, 307, -1, -1, 310, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 94, -1, 96, -1, 326, 327, 328, 329, 330, + 331, 332, 333, 334, -1, -1, 337, 338, -1, -1, + -1, -1, 343, 344, 345, 346, -1, -1, -1, -1, + -1, 124, -1, 126, 33, -1, 357, 358, 37, 38, + -1, 40, -1, 42, 43, -1, 45, -1, 47, -1, + 306, 307, -1, -1, 310, -1, -1, -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 33, -1, -1, -1, 37, 38, -1, - 40, -1, 42, 43, -1, 45, 124, 47, 126, -1, - -1, -1, -1, -1, -1, 94, -1, 96, -1, -1, - 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 33, -1, -1, -1, 37, 38, -1, 40, - -1, 42, 43, -1, 45, 124, 47, 126, -1, -1, - -1, -1, -1, -1, 94, -1, 96, -1, -1, 60, + 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, + -1, 337, 338, -1, -1, -1, -1, 343, 344, 345, + 346, -1, -1, -1, -1, 94, -1, 96, -1, -1, + -1, 357, 358, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 306, 307, -1, + -1, 310, -1, -1, -1, 124, -1, 126, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, -1, 343, 344, 345, 346, 306, 307, + -1, -1, 310, -1, -1, -1, -1, -1, 357, 358, + -1, -1, -1, -1, -1, -1, -1, -1, 326, 327, + 328, 329, 330, 331, 332, 333, 334, -1, -1, 337, + 338, -1, -1, -1, -1, 343, 344, 345, 346, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 357, + 358, -1, -1, 306, 307, -1, -1, 310, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 326, 327, 328, 329, 330, 331, 332, + 333, 334, -1, -1, 337, 338, -1, -1, -1, -1, + 343, 344, 345, 346, -1, -1, -1, -1, -1, -1, + -1, -1, 33, -1, 357, 358, 37, 38, -1, 40, + -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, -1, -1, -1, 37, 38, -1, 40, -1, - 42, 43, -1, 45, 124, 47, 126, -1, -1, -1, - -1, -1, -1, 94, -1, 96, -1, -1, 60, -1, - 62, -1, -1, -1, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, -1, -1, -1, - -1, 343, 344, 124, -1, 126, -1, -1, -1, -1, - -1, -1, 94, -1, 96, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 306, 307, -1, + -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 94, -1, 96, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, -1, 343, 344, 345, 346, -1, -1, + -1, -1, -1, 124, -1, 126, 33, -1, 357, 358, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + -1, 37, 38, -1, 40, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, -1, 94, -1, 96, + -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, -1, -1, -1, 37, 38, 124, 40, 126, + 42, 43, -1, 45, -1, 47, -1, -1, 94, -1, + 96, -1, -1, -1, -1, -1, -1, -1, 60, -1, + 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, 124, -1, + 126, 37, 38, -1, 40, -1, 42, 43, -1, 45, + -1, 47, 94, -1, 96, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 124, -1, 126, 306, 307, -1, -1, 310, + -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, + 96, -1, -1, -1, -1, 326, 327, 328, 329, 330, + 331, 332, 333, 334, -1, -1, 337, 338, -1, -1, + -1, -1, 343, 344, 345, 346, -1, -1, 124, -1, + 126, -1, -1, -1, 33, -1, 357, 358, 37, 38, + -1, 40, -1, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 306, 307, -1, -1, 310, -1, -1, -1, -1, -1, -1, - -1, -1, 124, -1, 126, -1, -1, 324, 325, 326, - 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, - -1, -1, -1, -1, 341, 342, 343, 344, 306, 307, - -1, -1, 310, -1, -1, -1, -1, -1, 355, 356, - -1, -1, -1, -1, -1, -1, 324, 325, 326, 327, - 328, 329, 330, 331, 332, -1, -1, 335, 336, -1, - -1, -1, -1, 341, 342, 343, 344, 306, 307, -1, - -1, 310, -1, -1, -1, -1, -1, 355, 356, -1, - -1, -1, -1, -1, -1, 324, 325, 326, 327, 328, - 329, 330, 331, 332, -1, -1, 335, 336, -1, -1, - -1, -1, 341, 342, 343, 344, 306, 307, -1, -1, - 310, -1, -1, -1, -1, -1, 355, 356, -1, -1, - -1, -1, -1, -1, 324, 325, 326, 327, 328, 329, - 330, 331, 332, -1, -1, 335, 336, -1, -1, -1, - -1, 341, 342, 343, 344, 306, 307, -1, -1, 310, - -1, -1, -1, -1, -1, 355, 356, -1, -1, -1, - -1, -1, -1, 324, 325, 326, 327, 328, 329, 330, - 331, 332, -1, 94, 335, 336, -1, -1, -1, -1, - 341, 342, 343, 344, 306, 307, -1, -1, 310, -1, - -1, -1, -1, -1, 355, 356, -1, -1, -1, -1, - -1, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, -1, -1, 335, 336, -1, -1, -1, -1, 341, - 342, 343, 344, -1, -1, -1, -1, -1, -1, -1, - -1, 33, -1, 355, 356, 37, 38, -1, 40, -1, - 42, 43, -1, 45, -1, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, - 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 33, -1, -1, -1, 37, 38, -1, 40, -1, 42, - 43, -1, 45, -1, 47, -1, -1, -1, -1, -1, - -1, -1, 94, -1, 96, -1, -1, 60, -1, 62, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - -1, -1, -1, 37, 38, -1, -1, -1, 42, 43, - -1, 45, 124, 47, 126, -1, -1, -1, -1, -1, - -1, 94, -1, 96, -1, -1, 60, -1, 62, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, 38, - -1, -1, -1, 42, 43, -1, 45, -1, 47, -1, - -1, 124, -1, 126, -1, -1, 287, 288, 289, 290, - 94, 60, 96, 62, 63, -1, -1, -1, -1, -1, - -1, -1, 303, 304, 305, 306, -1, -1, -1, 310, - -1, -1, 313, 314, 315, 316, 317, -1, -1, -1, - 124, 322, 126, -1, -1, 94, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 339, 340, - -1, -1, -1, -1, -1, -1, 347, -1, -1, 350, - -1, 352, 353, -1, 355, 124, -1, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 306, 307, -1, -1, 310, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, -1, -1, 335, 336, -1, -1, -1, -1, 341, - 342, 343, 344, 306, 307, -1, -1, 310, -1, -1, - -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, - -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, - -1, -1, 335, 336, -1, -1, -1, -1, 341, 342, - 343, 344, 306, 307, -1, -1, 310, -1, -1, -1, - -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 298, - -1, 335, 336, -1, -1, -1, -1, 341, 342, 343, - 344, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 355, 356, -1, -1, -1, -1, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 287, 288, 289, 290, 343, 344, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 303, 304, 305, 306, - -1, -1, -1, 310, -1, -1, 313, 314, 315, 316, - 317, -1, -1, -1, -1, 322, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, - 347, -1, -1, 350, -1, 352, 353, -1, 355, -1, - -1, 358, 359, 360, 361, 362, 363, 364, -1, 366, - 367, 257, 258, 259, -1, 261, -1, -1, -1, 265, - 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, - 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, - 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, - -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, - 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, - 316, 317, 318, 319, -1, -1, 322, -1, -1, -1, + -1, -1, -1, -1, -1, 94, -1, 96, -1, 326, + 327, 328, 329, 330, 331, 332, 333, 334, -1, -1, + 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, + 306, 307, -1, -1, 310, 124, -1, 126, -1, -1, + 357, 358, -1, -1, -1, -1, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, + -1, 337, 338, -1, -1, -1, -1, 343, 344, 345, + 346, -1, -1, -1, 306, 307, -1, -1, 310, -1, + -1, 357, 358, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 326, 327, 328, 329, 330, 331, + 332, 333, 334, -1, -1, 337, 338, -1, -1, -1, + -1, 343, 344, 345, 346, -1, -1, -1, -1, -1, + 306, 307, -1, -1, 310, 357, 358, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, + -1, 337, 338, -1, -1, -1, -1, 343, 344, 345, + 346, -1, -1, -1, -1, -1, -1, -1, -1, 33, + -1, 357, 358, 37, 38, -1, 40, -1, 42, 43, + -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 306, 307, -1, + -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, + 94, -1, 96, -1, -1, -1, -1, 326, 327, 328, + 329, 330, 331, 332, 333, 334, -1, -1, 337, 338, + -1, -1, -1, -1, 343, 344, 345, 346, -1, -1, + 124, -1, 126, -1, -1, -1, 33, -1, 357, 358, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 60, -1, 62, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + -1, 37, 38, -1, 40, -1, 42, 43, -1, 45, + -1, 47, -1, -1, -1, -1, -1, 94, -1, 96, + -1, -1, -1, -1, 60, -1, 62, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 124, -1, 126, + -1, -1, 33, -1, -1, -1, 37, 38, 94, -1, + 96, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, + -1, 62, -1, -1, -1, -1, -1, -1, 124, -1, + 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 94, -1, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 306, 307, -1, -1, 310, -1, -1, -1, + -1, -1, -1, 124, -1, 126, -1, -1, -1, -1, + -1, -1, 326, 327, 328, 329, 330, 331, 332, 333, + 334, -1, -1, 337, 338, -1, -1, -1, -1, 343, + 344, 345, 346, 94, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 357, 358, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 347, -1, -1, 350, 351, 352, 353, -1, 355, - -1, -1, 358, 359, 360, 361, 362, 363, 364, -1, - 366, 367, 257, 258, 259, -1, 261, -1, -1, -1, - 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, - 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, - -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, - 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, - 315, 316, 317, 318, 319, -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 343, -1, - -1, -1, 347, -1, -1, 350, 351, 352, 353, -1, - -1, -1, -1, 358, 359, 360, 361, 362, 363, 364, - -1, 366, 367, 257, 258, 259, -1, 261, -1, -1, - -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, - 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, - 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, - -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, - 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, - 314, 315, 316, 317, 318, 319, -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 306, + 307, -1, -1, 310, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 94, -1, + 337, 338, -1, -1, -1, -1, 343, 344, 345, 346, + 306, 307, -1, -1, 310, -1, -1, -1, -1, -1, + 357, 358, -1, -1, -1, -1, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, -1, + -1, 337, 338, -1, -1, -1, -1, 343, 344, 345, + 346, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 357, 358, -1, -1, 306, 307, -1, -1, 310, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 326, 327, 328, 329, 330, + 331, 332, 333, 334, -1, -1, 337, 338, -1, -1, + -1, -1, 343, 344, 345, 346, 287, 288, 289, 290, + -1, -1, -1, -1, -1, -1, 357, 358, -1, -1, + -1, -1, 303, 304, 305, 306, -1, -1, -1, 310, + -1, 312, 313, 314, 315, 316, 317, -1, -1, -1, + -1, -1, 323, -1, -1, -1, -1, 328, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 341, 342, -1, -1, -1, -1, -1, -1, 349, -1, + -1, 352, -1, 354, 355, -1, 357, 358, -1, 360, + 361, 362, 363, 364, 365, 366, -1, 368, 369, -1, + -1, 287, 288, 289, 290, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 303, 304, 305, + 306, -1, -1, -1, 310, -1, -1, 313, 314, 315, + 316, 317, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 347, -1, -1, 350, 351, 352, 353, - -1, 355, -1, -1, 358, 359, 360, 361, 362, 363, - 364, -1, 366, 367, 257, 258, 259, -1, 261, -1, + -1, -1, -1, -1, -1, 341, 342, -1, -1, -1, + -1, -1, -1, 349, -1, -1, 352, -1, 354, 355, + -1, -1, -1, -1, 360, 361, 362, 363, 364, 365, + 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, - 313, 314, 315, 316, 317, 318, 319, -1, -1, 322, + 313, 314, 315, 316, 317, 318, 319, -1, -1, -1, + 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 349, -1, -1, 352, + 353, 354, 355, -1, 357, -1, -1, 360, 361, 362, + 363, 364, 365, 366, -1, 368, 369, 257, 258, 259, + -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, + 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, + -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, + 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, + 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, + -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 347, -1, -1, 350, 351, 352, - 353, -1, -1, -1, -1, 358, 359, 360, 361, 362, - 363, 364, -1, 366, 367, 257, 258, 259, -1, 261, - -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, - 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, - -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, - -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - -1, 313, 314, 315, 316, 317, 318, 319, -1, -1, - 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, + -1, -1, 352, 353, 354, 355, -1, 357, -1, -1, + 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, + 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, + -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, + 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, + 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, + -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, + 317, 318, 319, -1, -1, -1, 323, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, -1, -1, 352, 353, 354, 355, -1, + -1, -1, -1, 360, 361, 362, 363, 364, 365, 366, + -1, 368, 369, 257, 258, 259, -1, 261, -1, -1, + -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, + 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, + -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, + 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, + 314, 315, 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 347, -1, -1, 350, 351, - 352, 353, -1, -1, -1, -1, 358, 359, 360, 361, - 362, 363, 364, -1, 366, 367, 257, 258, 259, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 349, -1, -1, 352, 353, + 354, 355, -1, -1, -1, -1, 360, 361, 362, 363, + 364, 365, 366, -1, 368, 369, 257, 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, -1, - -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 349, -1, + -1, 352, 353, 354, 355, -1, -1, -1, -1, 360, + 361, 362, 363, 364, 365, 366, -1, 368, 369, 257, + 258, 259, -1, 261, -1, -1, -1, 265, 266, -1, + -1, -1, 270, -1, 272, 273, 274, 275, 276, 277, + 278, -1, -1, -1, -1, -1, 284, 285, 286, 287, + 288, 289, 290, -1, -1, 293, -1, -1, -1, -1, + -1, -1, 300, -1, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, -1, 313, 314, 315, 316, 317, + 318, 319, -1, -1, -1, 323, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 349, -1, -1, 352, 353, 354, 355, -1, -1, + -1, -1, 360, 361, 362, 363, 364, 365, 366, -1, + 368, 369, 257, 258, 259, -1, 261, -1, -1, -1, + 265, 266, -1, -1, -1, 270, -1, 272, 273, 274, + 275, 276, 277, 278, -1, -1, -1, -1, -1, 284, + 285, 286, 287, 288, 289, 290, -1, -1, 293, -1, + -1, -1, -1, -1, -1, 300, -1, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, -1, 313, 314, + 315, 316, 317, 318, 319, -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 347, -1, -1, 350, - 351, 352, 353, -1, -1, -1, -1, 358, 359, 360, - 361, 362, 363, 364, -1, 366, 367, 257, 258, 259, - -1, 261, -1, -1, -1, 265, 266, -1, -1, -1, - 270, -1, 272, 273, 274, 275, 276, 277, 278, -1, - -1, -1, -1, -1, 284, 285, 286, 287, 288, 289, - 290, -1, -1, 293, -1, -1, -1, -1, -1, -1, - 300, -1, -1, 303, 304, 305, 306, 307, 308, 309, - 310, 311, -1, 313, 314, 315, 316, 317, 318, 319, - -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 347, -1, -1, - 350, 351, 352, 353, -1, -1, -1, -1, 358, 359, - 360, 361, 362, 363, 364, -1, 366, 367, + -1, -1, -1, -1, 349, -1, -1, 352, 353, 354, + 355, -1, -1, -1, -1, 360, 361, 362, 363, 364, + 365, 366, -1, 368, 369, }; } diff --git a/core/src/main/java/org/jruby/parser/skeleton.parser b/core/src/main/java/org/jruby/parser/skeleton.parser index d9fc6eb7985..50e30d5bfa8 100644 --- a/core/src/main/java/org/jruby/parser/skeleton.parser +++ b/core/src/main/java/org/jruby/parser/skeleton.parser @@ -20,7 +20,7 @@ . /** parser tables. . Order is mandated by jay. . */ -. protected static final short[] yyLhs = { +. protected static final int[] yyLhs = { yyLhs . }, yyLen = { yyLen @@ -35,10 +35,10 @@ . }, yyGindex = { yyGindex . }; -. protected static final short[] yyTable = { +. protected static final int[] yyTable = { yyTable . }; -. protected static final short[] yyCheck = { +. protected static final int[] yyCheck = { yyCheck . }; . @@ -51,7 +51,7 @@ . t /** printable rules for debugging. t */ -t protected static final String [] yyRule = { +t protected static final String[] yyRule = { yyRule-strings t }; t @@ -233,7 +233,8 @@ t if (yydebug != null) yydebug.discard(yystate, yytoken, yyNa . t if (yydebug != null) yydebug.reduce(yystate, yystates[yytop-yyLen[yyn]].state, yyn, yyRule[yyn], yyLen[yyn]); . -. ParserState parserState = states[yyn]; +. ParserState parserState = yyn >= states.length ? null : states[yyn]; +.// ParserState parserState = states[yyn]; . if (parserState == null) { . yyVal = yyLen[yyn] > 0 ? yystates[yytop - yyLen[yyn] + 1].value : null; . } else { diff --git a/core/src/main/ruby/jruby/kernel/prelude.rb b/core/src/main/ruby/jruby/kernel/prelude.rb index 5522b4c8680..e68b1f341c9 100644 --- a/core/src/main/ruby/jruby/kernel/prelude.rb +++ b/core/src/main/ruby/jruby/kernel/prelude.rb @@ -14,3 +14,12 @@ def pp(*objs) private :pp end + +autoload :Set, 'set' + +module Enumerable + # Makes a set from the enumerable object with given arguments. + def to_set(klass = Set, *args, &block) + klass.new(self, *args, &block) + end +end diff --git a/pom.rb b/pom.rb index de2043e1296..b7074a69c04 100644 --- a/pom.rb +++ b/pom.rb @@ -73,7 +73,7 @@ 'asm.version' => '9.6', 'jar-dependencies.version' => '0.4.1', 'jffi.version' => '1.3.13', - 'joda.time.version' => '2.12.5' ) + 'joda.time.version' => '2.12.7' ) plugin_management do jar( 'junit:junit:4.13.1', diff --git a/pom.xml b/pom.xml index 4907270353a..b45585e725e 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ DO NOT MODIFY - GENERATED CODE osgi*/pom.xml 0.4.1 1.3.13 - 2.12.5 + 2.12.7 1.1.6 ${project.basedir} 3.0.2 diff --git a/test/mri.extra.index b/test/mri.extra.index index 438507e2f69..c81fb1a2add 100644 --- a/test/mri.extra.index +++ b/test/mri.extra.index @@ -1,11 +1,8 @@ # Heavy subprocess tests that slow down the main suite coverage -# test_racc_command.rb tests all flags in separate child processes -racc objspace test_open3.rb -test_tracer.rb ruby/test_process.rb ruby/test_settracefunc.rb ruby/test_signal.rb diff --git a/test/mri.stdlib.index b/test/mri.stdlib.index index 99e6b30cc00..a0a81bb50f5 100644 --- a/test/mri.stdlib.index +++ b/test/mri.stdlib.index @@ -1,14 +1,8 @@ # MRI stdlib tests -base64 benchmark -bigdecimal cgi -csv -date -dbm digest -#drb dtrace erb etc @@ -26,15 +20,12 @@ fiber/test_storage.rb fiber/test_thread.rb fiber/test_timeout.rb fileutils -gdbm io irb json logger -matrix monitor net -nkf open-uri openssl optparse @@ -42,40 +33,30 @@ ostruct pathname psych rdoc -readline reline resolv -rinda ripper socket stringio strscan -syslog uri win32ole yaml zlib -test_abbrev.rb test_delegate.rb test_extlibs.rb test_find.rb test_forwardable.rb test_ipaddr.rb -test_mutex_m.rb -test_observer.rb test_pp.rb test_prettyprint.rb -test_prime.rb test_pstore.rb test_pty.rb test_rbconfig.rb test_securerandom.rb -test_set.rb test_shellwords.rb test_singleton.rb -test_sorted_set.rb -test_syslog.rb test_tempfile.rb test_time.rb test_timeout.rb diff --git a/test/mri/-ext-/bug_reporter/test_bug_reporter.rb b/test/mri/-ext-/bug_reporter/test_bug_reporter.rb index 81d2ca46742..76f913c2752 100644 --- a/test/mri/-ext-/bug_reporter/test_bug_reporter.rb +++ b/test/mri/-ext-/bug_reporter/test_bug_reporter.rb @@ -4,15 +4,10 @@ require_relative '../../lib/jit_support' class TestBugReporter < Test::Unit::TestCase - def yjit_enabled? - defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled? - end - def test_bug_reporter_add - omit if ENV['RUBY_ON_BUG'] - - description = RUBY_DESCRIPTION - description = description.sub(/\+MJIT /, '') unless JITSupport.mjit_force_enabled? + omit "flaky with RJIT" if JITSupport.rjit_enabled? + description = RUBY_DESCRIPTION.sub(/\+PRISM /, '') + description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled? expected_stderr = [ :*, /\[BUG\]\sSegmentation\sfault.*\n/, @@ -24,9 +19,9 @@ def test_bug_reporter_add tmpdir = Dir.mktmpdir no_core = "Process.setrlimit(Process::RLIMIT_CORE, 0); " if defined?(Process.setrlimit) && defined?(Process::RLIMIT_CORE) - args = ["--disable-gems", "-r-test-/bug_reporter", - "-C", tmpdir] - args.push("--yjit") if yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION + args = ["-r-test-/bug_reporter", "-C", tmpdir] + args.push("--yjit") if JITSupport.yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION + args.unshift({"RUBY_ON_BUG" => nil}) stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$" assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT") ensure diff --git a/test/mri/-ext-/debug/test_debug.rb b/test/mri/-ext-/debug/test_debug.rb index 8a351d74fad..b244eb41eac 100644 --- a/test/mri/-ext-/debug/test_debug.rb +++ b/test/mri/-ext-/debug/test_debug.rb @@ -29,7 +29,7 @@ def binds_check(binds, msg = nil) # check same location assert_equal(loc.path, iseq.path, msg) assert_equal(loc.absolute_path, iseq.absolute_path, msg) - assert_equal(loc.label, iseq.label, msg) + #assert_equal(loc.label, iseq.label, msg) assert_operator(loc.lineno, :>=, iseq.first_lineno, msg) end diff --git a/test/mri/-ext-/debug/test_profile_frames.rb b/test/mri/-ext-/debug/test_profile_frames.rb index d6ae953dd29..bd819266dfd 100644 --- a/test/mri/-ext-/debug/test_profile_frames.rb +++ b/test/mri/-ext-/debug/test_profile_frames.rb @@ -14,6 +14,8 @@ def self.corge(block) end class Sample2 + EVAL_LINE = __LINE__ + 3 + def baz(block) instance_eval "def zab(block) block.call end" [self, zab(block)] @@ -37,6 +39,20 @@ def foo(block) end end +class SampleClassForTestProfileThreadFrames + def initialize(mutex) + @mutex = mutex + end + + def foo(block) + bar(block) + end + + def bar(block) + block.call + end +end + class TestProfileFrames < Test::Unit::TestCase def test_profile_frames obj, frames = Fiber.new{ @@ -112,7 +128,7 @@ def test_profile_frames "SampleClassForTestProfileFrames#foo", "TestProfileFrames#test_profile_frames", ] - paths = [ nil, file=__FILE__, "(eval)", file, file, file, file, file, file, nil ] + paths = [ nil, file=__FILE__, "(eval at #{__FILE__}:#{SampleClassForTestProfileFrames::Sample2::EVAL_LINE})", file, file, file, file, file, file, nil ] absolute_paths = [ "", file, nil, file, file, file, file, file, file, nil ] assert_equal(labels.size, frames.size) @@ -137,13 +153,56 @@ def test_profile_frames } end + def test_profile_thread_frames + mutex = Mutex.new + th = Thread.new do + mutex.lock + Thread.stop + SampleClassForTestProfileThreadFrames.new(mutex).foo(lambda { mutex.unlock; loop { sleep(1) } } ) + end + + # ensure execution has reached SampleClassForTestProfileThreadFrames#bar before running profile_thread_frames + loop { break if th.status == "sleep"; sleep 0.1 } + th.run + mutex.lock # wait until SampleClassForTestProfileThreadFrames#bar has been called + + frames = Bug::Debug.profile_thread_frames(th, 0, 10) + + full_labels = [ + "Kernel#sleep", + "TestProfileFrames#test_profile_thread_frames", + "Kernel#loop", + "TestProfileFrames#test_profile_thread_frames", + "SampleClassForTestProfileThreadFrames#bar", + "SampleClassForTestProfileThreadFrames#foo", + "TestProfileFrames#test_profile_thread_frames", + ] + + frames.each.with_index do |frame, i| + assert_equal(full_labels[i], frame) + end + + ensure + th.kill + th.join + end + + def test_matches_backtrace_locations_main_thread assert_equal(Thread.current, Thread.main) # Keep these in the same line, so the backtraces match exactly backtrace_locations, profile_frames = [Thread.current.backtrace_locations, Bug::Debug.profile_frames(0, 100)] - assert_equal(backtrace_locations.size, profile_frames.size) + errmsg = "backtrace_locations:\n " + backtrace_locations.map.with_index{|loc, i| "#{i} #{loc}"}.join("\n ") + errmsg += "\n\nprofile_frames:\n " + profile_frames.map.with_index{|(path, absolute_path, _, base_label, _, _, _, _, _, full_label, lineno), i| + if lineno + "#{i} #{absolute_path}:#{lineno} // #{full_label}" + else + "#{i} #{absolute_path} #{full_label}" + end + }.join("\n ") + assert_equal(backtrace_locations.size, profile_frames.size, errmsg) # The first entries are not going to match, since one is #backtrace_locations and the other #profile_frames backtrace_locations.shift @@ -177,4 +236,8 @@ def a a end; end + + def test_start + assert_equal Bug::Debug.profile_frames(0, 10).tap(&:shift), Bug::Debug.profile_frames(1, 9) + end end diff --git a/test/mri/-ext-/iseq_load/test_iseq_load.rb b/test/mri/-ext-/iseq_load/test_iseq_load.rb index 6e5bc8e811b..864ce1afbb9 100644 --- a/test/mri/-ext-/iseq_load/test_iseq_load.rb +++ b/test/mri/-ext-/iseq_load/test_iseq_load.rb @@ -123,6 +123,8 @@ def test_break_ensure_def_method assert_equal false, test_break_ensure_def_method omit "failing due to exception entry sp mismatch" assert_iseq_roundtrip(src) + ensure + Object.undef_method(:test_break_ensure_def_method) rescue nil end def test_kwarg diff --git a/test/mri/-ext-/load/test_resolve_symbol.rb b/test/mri/-ext-/load/test_resolve_symbol.rb new file mode 100644 index 00000000000..471d3acebdb --- /dev/null +++ b/test/mri/-ext-/load/test_resolve_symbol.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +require 'test/unit' + +class Test_Load_ResolveSymbol < Test::Unit::TestCase + def test_load_resolve_symbol_resolver + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + feature = "Feature #20005" + assert_raise(LoadError, "resolve_symbol_target is not loaded") { + require '-test-/load/resolve_symbol_resolver' + } + require '-test-/load/resolve_symbol_target' + assert_nothing_raised(LoadError, "#{feature} resolver can be loaded") { + require '-test-/load/resolve_symbol_resolver' + } + assert_not_nil ResolveSymbolResolver + assert_equal "from target", ResolveSymbolResolver.any_method + + assert_raise(LoadError, "tries to resolve missing feature name, and it should raise LoadError") { + ResolveSymbolResolver.try_resolve_fname + } + assert_raise(LoadError, "tries to resolve missing symbol name, and it should raise LoadError") { + ResolveSymbolResolver.try_resolve_sname + } + end; + end +end diff --git a/test/mri/-ext-/load/test_stringify_symbols.rb b/test/mri/-ext-/load/test_stringify_symbols.rb new file mode 100644 index 00000000000..0d9736b5910 --- /dev/null +++ b/test/mri/-ext-/load/test_stringify_symbols.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +require 'test/unit' + +class Test_Load_stringify_symbols < Test::Unit::TestCase + def test_load_stringify_symbol_required_extensions + require '-test-/load/stringify_symbols' + require '-test-/load/stringify_target' + r1 = StringifySymbols.stringify_symbol("-test-/load/stringify_target", "stt_any_method") + assert_not_nil r1 + r2 = StringifySymbols.stringify_symbol("-test-/load/stringify_target.so", "stt_any_method") + assert_equal r1, r2, "resolved symbols should be equal even with or without .so suffix" + end + + def test_load_stringify_symbol_statically_linked + require '-test-/load/stringify_symbols' + # "complex.so" is actually not a statically linked extension. + # But it is registered in $LOADED_FEATURES, so it can be a target of this test. + r1 = StringifySymbols.stringify_symbol("complex", "rb_complex_minus") + assert_not_nil r1 + r2 = StringifySymbols.stringify_symbol("complex.so", "rb_complex_minus") + assert_equal r1, r2 + end + + def test_load_stringify_symbol_missing_target + require '-test-/load/stringify_symbols' + r1 = assert_nothing_raised { + StringifySymbols.stringify_symbol("something_missing", "unknown_method") + } + assert_nil r1 + r2 = assert_nothing_raised { + StringifySymbols.stringify_symbol("complex.so", "unknown_method") + } + assert_nil r2 + end +end diff --git a/test/mri/-ext-/marshal/test_internal_ivar.rb b/test/mri/-ext-/marshal/test_internal_ivar.rb index a32138f6e8f..faabe14ab2d 100644 --- a/test/mri/-ext-/marshal/test_internal_ivar.rb +++ b/test/mri/-ext-/marshal/test_internal_ivar.rb @@ -11,7 +11,7 @@ def test_marshal assert_equal("hello", v.normal) assert_equal("world", v.internal) assert_equal("bye", v.encoding_short) - dump = assert_warn(/instance variable `E' on class \S+ is not dumped/) { + dump = assert_warn(/instance variable 'E' on class \S+ is not dumped/) { ::Marshal.dump(v) } v = assert_nothing_raised {break ::Marshal.load(dump)} diff --git a/test/mri/-ext-/postponed_job/test_postponed_job.rb b/test/mri/-ext-/postponed_job/test_postponed_job.rb index fee0172d114..8c2b3e95d1c 100644 --- a/test/mri/-ext-/postponed_job/test_postponed_job.rb +++ b/test/mri/-ext-/postponed_job/test_postponed_job.rb @@ -2,34 +2,70 @@ require 'test/unit' require '-test-/postponed_job' -module Bug - def self.postponed_job_call_direct_wrapper(*args) - postponed_job_call_direct(*args) +class TestPostponed_job < Test::Unit::TestCase + def test_preregister_and_trigger + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + Bug.postponed_job_preregister_and_call_without_sleep(counters = []) + # i.e. rb_postponed_job_trigger performs coalescing + assert_equal([3], counters) + + # i.e. rb_postponed_job_trigger resets after interrupts are checked + Bug.postponed_job_preregister_and_call_with_sleep(counters = []) + assert_equal([1, 2, 3], counters) + RUBY end - def self.postponed_job_register_wrapper(*args) - postponed_job_register(*args) + def test_multiple_preregistration + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + handles = Bug.postponed_job_preregister_multiple_times + # i.e. rb_postponed_job_preregister returns the same handle if preregistered multiple times + assert_equal [handles[0]], handles.uniq + RUBY end -end -class TestPostponed_job < Test::Unit::TestCase - def test_register - direct, registered = [], [] + def test_multiple_preregistration_with_new_data + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + values = Bug.postponed_job_preregister_calls_with_last_argument + # i.e. the callback is called with the last argument it was preregistered with + assert_equal [3, 4], values + RUBY + end - Bug.postponed_job_call_direct_wrapper(direct) - Bug.postponed_job_register_wrapper(registered) + def test_legacy_register + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + direct, registered = [], [] - assert_equal([0], direct) - assert_equal([3], registered) + Bug.postponed_job_call_direct(direct) + Bug.postponed_job_register(registered) - Bug.postponed_job_register_one(ary = []) - assert_equal [1], ary + assert_equal([0], direct) + assert_equal([3], registered) + + Bug.postponed_job_register_one(ary = []) + assert_equal [1], ary + RUBY + end + + def test_legacy_register_one_same + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + # Registering the same job three times should result in three of the same handle + handles = Bug.postponed_job_register_one_same + assert_equal [handles[0]], handles.uniq + RUBY end if Bug.respond_to?(:postponed_job_register_in_c_thread) - def test_register_in_c_thread - assert Bug.postponed_job_register_in_c_thread(ary = []) - assert_equal [1], ary + def test_legacy_register_in_c_thread + assert_separately([], __FILE__, __LINE__, <<-'RUBY') + require '-test-/postponed_job' + assert Bug.postponed_job_register_in_c_thread(ary = []) + assert_equal [1], ary + RUBY end end end diff --git a/test/mri/-ext-/string/test_capacity.rb b/test/mri/-ext-/string/test_capacity.rb index 0cb7c00761c..2c6c51fdda7 100644 --- a/test/mri/-ext-/string/test_capacity.rb +++ b/test/mri/-ext-/string/test_capacity.rb @@ -23,7 +23,7 @@ def test_capacity_normal def test_s_new_capacity assert_equal("", String.new(capacity: 1000)) assert_equal(String, String.new(capacity: 1000).class) - assert_equal(10000, capa(String.new(capacity: 10000))) + assert_equal(10_000 - 1, capa(String.new(capacity: 10_000))) # Real capa doesn't account for termlen assert_equal("", String.new(capacity: -1000)) assert_equal(capa(String.new(capacity: -10000)), capa(String.new(capacity: -1000))) @@ -66,11 +66,7 @@ def capa(str) end def embed_header_size - if GC.using_rvargc? - 2 * RbConfig::SIZEOF['void*'] + RbConfig::SIZEOF['long'] - else - 2 * RbConfig::SIZEOF['void*'] - end + 3 * RbConfig::SIZEOF['void*'] end def max_embed_len diff --git a/test/mri/-ext-/string/test_fstring.rb b/test/mri/-ext-/string/test_fstring.rb index 5a3456c5664..fcec6be5431 100644 --- a/test/mri/-ext-/string/test_fstring.rb +++ b/test/mri/-ext-/string/test_fstring.rb @@ -15,19 +15,27 @@ def assert_fstring(str) def test_rb_enc_interned_str_autoloaded_encoding assert_separately([], <<~RUBY) require '-test-/string' - assert_include(Encoding::Windows_31J.inspect, 'autoload') - Bug::String.rb_enc_interned_str(Encoding::Windows_31J) + assert_include(Encoding::CESU_8.inspect, 'autoload') + Bug::String.rb_enc_interned_str(Encoding::CESU_8) RUBY end + def test_rb_enc_interned_str_null_encoding + assert_equal Encoding::ASCII_8BIT, Bug::String.rb_enc_interned_str(nil).encoding + end + def test_rb_enc_str_new_autoloaded_encoding assert_separately([], <<~RUBY) require '-test-/string' - assert_include(Encoding::Windows_31J.inspect, 'autoload') - Bug::String.rb_enc_str_new(Encoding::Windows_31J) + assert_include(Encoding::CESU_8.inspect, 'autoload') + Bug::String.rb_enc_str_new(Encoding::CESU_8) RUBY end + def test_rb_enc_str_new_null_encoding + assert_equal Encoding::ASCII_8BIT, Bug::String.rb_enc_str_new(nil).encoding + end + def test_instance_variable str = __method__.to_s * 3 str.instance_variable_set(:@test, 42) @@ -49,6 +57,10 @@ def test_singleton_class assert_raise(TypeError) {fstr.singleton_class} end + def test_fake_str + assert_equal([*"a".."z"].join(""), Bug::String.fstring_fake_str) + end + class S < String end diff --git a/test/mri/-ext-/string/test_set_len.rb b/test/mri/-ext-/string/test_set_len.rb index 67ba961194e..e3eff75d9b9 100644 --- a/test/mri/-ext-/string/test_set_len.rb +++ b/test/mri/-ext-/string/test_set_len.rb @@ -34,4 +34,33 @@ def test_capacity_equals_to_new_size assert_equal 128, Bug::String.capacity(str) assert_equal 127, str.set_len(127).bytesize, bug12757 end + + def test_coderange_after_append + u = -"\u3042" + str = Bug::String.new(encoding: Encoding::UTF_8) + bsize = u.bytesize + str.append(u) + assert_equal 0, str.bytesize + str.set_len(bsize) + assert_equal bsize, str.bytesize + assert_predicate str, :valid_encoding? + assert_not_predicate str, :ascii_only? + assert_equal u, str + end + + def test_coderange_after_trunc + u = -"\u3042" + bsize = u.bytesize + str = Bug::String.new(u) + str.set_len(bsize - 1) + assert_equal bsize - 1, str.bytesize + assert_not_predicate str, :valid_encoding? + assert_not_predicate str, :ascii_only? + str.append(u.byteslice(-1)) + str.set_len(bsize) + assert_equal bsize, str.bytesize + assert_predicate str, :valid_encoding? + assert_not_predicate str, :ascii_only? + assert_equal u, str + end end diff --git a/test/mri/-ext-/string/test_too_many_dummy_encodings.rb b/test/mri/-ext-/string/test_too_many_dummy_encodings.rb new file mode 100644 index 00000000000..b96b40db7b7 --- /dev/null +++ b/test/mri/-ext-/string/test_too_many_dummy_encodings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: false +require 'test/unit' +require "-test-/string" + +class Test_TooManyDummyEncodings < Test::Unit::TestCase + def test_exceed_encoding_table_size + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + require "-test-/string" + assert_raise_with_message(EncodingError, /too many encoding/) do + 1_000.times{|i| Bug::String.rb_define_dummy_encoding("R_#{i}") } # now 256 entries + end + end; + end +end diff --git a/test/mri/-ext-/struct/test_data.rb b/test/mri/-ext-/struct/test_data.rb new file mode 100644 index 00000000000..8dbc9113a52 --- /dev/null +++ b/test/mri/-ext-/struct/test_data.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: false +require 'test/unit' +require "-test-/struct" + +class Bug::Struct::Test_Data < Test::Unit::TestCase + def test_data_new_default + klass = Bug::Struct.data_new(false) + assert_equal Data, klass.superclass + assert_equal %i[mem1 mem2], klass.members + end + + def test_data_new_superclass + superclass = Data.define + klass = Bug::Struct.data_new(superclass) + assert_equal superclass, klass.superclass + assert_equal %i[mem1 mem2], klass.members + end +end diff --git a/test/mri/-ext-/symbol/test_type.rb b/test/mri/-ext-/symbol/test_type.rb index fdee692fe41..2b0fbe5b798 100644 --- a/test/mri/-ext-/symbol/test_type.rb +++ b/test/mri/-ext-/symbol/test_type.rb @@ -134,5 +134,10 @@ def test_check_symbol_invalid_type Bug::Symbol.find(cx) } end + + def test_const_name_type + sym = "\xb5".force_encoding(Encoding::Windows_1253) + assert_not_operator Bug::Symbol, :const?, sym, sym.encode(Encoding::UTF_8) + end end end diff --git a/test/mri/-ext-/test_bug-3571.rb b/test/mri/-ext-/test_bug-3571.rb index c75d2e85232..5952ce2a33c 100644 --- a/test/mri/-ext-/test_bug-3571.rb +++ b/test/mri/-ext-/test_bug-3571.rb @@ -13,8 +13,8 @@ def test_block_call_id SRC out = [ "start() function is unimplemented on this machine", - "-:2:in `start'", - "-:2:in `
'", + "-:2:in 'Bug.start'", + "-:2:in '
'", ] assert_in_out_err(%w"-r-test-/bug_3571", src, [], out, bug3571) end diff --git a/test/mri/-ext-/thread/helper.rb b/test/mri/-ext-/thread/helper.rb new file mode 100644 index 00000000000..3ea2057d15f --- /dev/null +++ b/test/mri/-ext-/thread/helper.rb @@ -0,0 +1,51 @@ +module ThreadInstrumentation + module TestHelper + private + + def record + Bug::ThreadInstrumentation.register_callback(!ENV["GVL_DEBUG"]) + yield + ensure + timeline = Bug::ThreadInstrumentation.unregister_callback + if $! + raise + else + return timeline + end + end + + def timeline_for(thread, timeline) + timeline.select { |t, _| t == thread }.map(&:last) + end + + def assert_consistent_timeline(events) + refute_predicate events, :empty? + + previous_event = nil + events.each do |event| + refute_equal :exited, previous_event, "`exited` must be the final event: #{events.inspect}" + case event + when :started + assert_nil previous_event, "`started` must be the first event: #{events.inspect}" + when :ready + unless previous_event.nil? + assert %i(started suspended).include?(previous_event), "`ready` must be preceded by `started` or `suspended`: #{events.inspect}" + end + when :resumed + unless previous_event.nil? + assert_equal :ready, previous_event, "`resumed` must be preceded by `ready`: #{events.inspect}" + end + when :suspended + unless previous_event.nil? + assert_equal :resumed, previous_event, "`suspended` must be preceded by `resumed`: #{events.inspect}" + end + when :exited + unless previous_event.nil? + assert %i(resumed suspended).include?(previous_event), "`exited` must be preceded by `resumed` or `suspended`: #{events.inspect}" + end + end + previous_event = event + end + end + end +end diff --git a/test/mri/-ext-/thread/test_instrumentation_api.rb b/test/mri/-ext-/thread/test_instrumentation_api.rb index dd620e73803..9a3b67fa108 100644 --- a/test/mri/-ext-/thread/test_instrumentation_api.rb +++ b/test/mri/-ext-/thread/test_instrumentation_api.rb @@ -1,91 +1,289 @@ # frozen_string_literal: false require 'envutil' +require_relative "helper" class TestThreadInstrumentation < Test::Unit::TestCase + include ThreadInstrumentation::TestHelper + def setup pend("No windows support") if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM require '-test-/thread/instrumentation' - Thread.list.each do |thread| - if thread != Thread.current - thread.kill - thread.join rescue nil - end - end - assert_equal [Thread.current], Thread.list - - Bug::ThreadInstrumentation.reset_counters - Bug::ThreadInstrumentation::register_callback + cleanup_threads end def teardown return if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - Bug::ThreadInstrumentation::unregister_callback + Bug::ThreadInstrumentation.unregister_callback + cleanup_threads end THREADS_COUNT = 3 - def test_thread_instrumentation - threads = threaded_cpu_work - assert_equal [false] * THREADS_COUNT, threads.map(&:status) - counters = Bug::ThreadInstrumentation.counters - assert_join_counters(counters) - assert_global_join_counters(counters) + def test_single_thread_timeline + thread = nil + full_timeline = record do + thread = Thread.new { 1 + 1 } + thread.join + end + assert_equal %i(started ready resumed suspended exited), timeline_for(thread, full_timeline) + ensure + thread&.kill + end + + def test_thread_pass_single_thread + full_timeline = record do + Thread.pass + end + assert_equal [], timeline_for(Thread.current, full_timeline) + end + + def test_thread_pass_multi_thread + thread = Thread.new do + cpu_bound_work(0.5) + end + + full_timeline = record do + Thread.pass + end + + assert_equal %i(suspended ready resumed), timeline_for(Thread.current, full_timeline) + ensure + thread&.kill + thread&.join + end + + def test_muti_thread_timeline + threads = nil + full_timeline = record do + threads = threaded_cpu_bound_work(1.0) + results = threads.map(&:value) + results.each do |r| + refute_equal false, r + end + assert_equal [false] * THREADS_COUNT, threads.map(&:status) + end + + threads.each do |thread| + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert timeline.count(:suspended) > 1, "Expected threads to yield suspended at least once: #{timeline.inspect}" + end + + timeline = timeline_for(Thread.current, full_timeline) + assert_consistent_timeline(timeline) + ensure + threads&.each(&:kill) + end + + def test_join_suspends # Bug #18900 + thread = other_thread = nil + full_timeline = record do + other_thread = Thread.new { sleep 0.3 } + thread = Thread.new { other_thread.join } + thread.join + end + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended ready resumed suspended exited), timeline + ensure + other_thread&.kill + thread&.kill end - def test_join_counters # Bug #18900 - thr = Thread.new { fib(30) } - Bug::ThreadInstrumentation.reset_counters - thr.join - assert_join_counters(Bug::ThreadInstrumentation.local_counters) + def test_io_release_gvl + r, w = IO.pipe + thread = nil + full_timeline = record do + thread = Thread.new do + w.write("Hello\n") + end + thread.join + end + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended ready resumed suspended exited), timeline + ensure + r&.close + w&.close + end + + def test_queue_releases_gvl + queue1 = Queue.new + queue2 = Queue.new + + thread = nil + + full_timeline = record do + thread = Thread.new do + queue1 << true + queue2.pop + end + + queue1.pop + queue2 << true + thread.join + end + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended ready resumed suspended exited), timeline + end + + def test_blocking_on_ractor + assert_ractor(<<-"RUBY", require_relative: "helper", require: "-test-/thread/instrumentation") + include ThreadInstrumentation::TestHelper + + ractor = Ractor.new { + Ractor.receive # wait until woke + Thread.current + } + + # Wait for the main thread to block, then wake the ractor + Thread.new do + while Thread.main.status != "sleep" + Thread.pass + end + ractor.send true + end + + full_timeline = record do + ractor.take + end + + timeline = timeline_for(Thread.current, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(suspended ready resumed), timeline + RUBY + end + + def test_sleeping_inside_ractor + assert_ractor(<<-"RUBY", require_relative: "helper", require: "-test-/thread/instrumentation") + include ThreadInstrumentation::TestHelper + + thread = nil + + full_timeline = record do + thread = Ractor.new{ + sleep 0.1 + Thread.current + }.take + sleep 0.1 + end + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended ready resumed suspended exited), timeline + RUBY + end + + def test_thread_blocked_forever_on_mutex + mutex = Mutex.new + mutex.lock + thread = nil + + full_timeline = record do + thread = Thread.new do + mutex.lock + end + 10.times { Thread.pass } + sleep 0.1 + end + + mutex.unlock + thread.join + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended), timeline + end + + def test_thread_blocked_temporarily_on_mutex + mutex = Mutex.new + mutex.lock + thread = nil + + full_timeline = record do + thread = Thread.new do + mutex.lock + end + 10.times { Thread.pass } + sleep 0.1 + mutex.unlock + 10.times { Thread.pass } + sleep 0.1 + end + + thread.join + + timeline = timeline_for(thread, full_timeline) + assert_consistent_timeline(timeline) + assert_equal %i(started ready resumed suspended ready resumed suspended exited), timeline end def test_thread_instrumentation_fork_safe skip "No fork()" unless Process.respond_to?(:fork) - thread_statuses = counters = nil + thread_statuses = full_timeline = nil IO.popen("-") do |read_pipe| if read_pipe thread_statuses = Marshal.load(read_pipe) - counters = Marshal.load(read_pipe) + full_timeline = Marshal.load(read_pipe) else - Bug::ThreadInstrumentation.reset_counters - threads = threaded_cpu_work + threads = threaded_cpu_bound_work.each(&:join) Marshal.dump(threads.map(&:status), STDOUT) - Marshal.dump(Bug::ThreadInstrumentation.counters, STDOUT) + full_timeline = Bug::ThreadInstrumentation.unregister_callback.map { |t, e| [t.to_s, e ] } + Marshal.dump(full_timeline, STDOUT) end end assert_predicate $?, :success? assert_equal [false] * THREADS_COUNT, thread_statuses - assert_join_counters(counters) - assert_global_join_counters(counters) + thread_names = full_timeline.map(&:first).uniq + thread_names.each do |thread_name| + assert_consistent_timeline(timeline_for(thread_name, full_timeline)) + end end def test_thread_instrumentation_unregister - Bug::ThreadInstrumentation::unregister_callback assert Bug::ThreadInstrumentation::register_and_unregister_callbacks end private - def fib(n = 20) + def fib(n = 30) return n if n <= 1 fib(n-1) + fib(n-2) end - def threaded_cpu_work(size = 20) - THREADS_COUNT.times.map { Thread.new { fib(size) } }.each(&:join) + def cpu_bound_work(duration) + deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + duration + i = 0 + while deadline > Process.clock_gettime(Process::CLOCK_MONOTONIC) + fib(25) + i += 1 + end + i > 0 ? i : false end - def assert_join_counters(counters) - counters.each_with_index do |c, i| - assert_operator c, :>, 0, "Call counters[#{i}]: #{counters.inspect}" + def threaded_cpu_bound_work(duration = 0.5) + THREADS_COUNT.times.map do + Thread.new do + cpu_bound_work(duration) + end end end - def assert_global_join_counters(counters) - assert_equal THREADS_COUNT, counters.first + def cleanup_threads + Thread.list.each do |thread| + if thread != Thread.current + thread.kill + thread.join rescue nil + end + end + assert_equal [Thread.current], Thread.list end end diff --git a/test/mri/-ext-/thread/test_lock_native_thread.rb b/test/mri/-ext-/thread/test_lock_native_thread.rb new file mode 100644 index 00000000000..8a5ba78838d --- /dev/null +++ b/test/mri/-ext-/thread/test_lock_native_thread.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: false + +require 'envutil' + +mn_supported_p = -> do + out, *_ = EnvUtil.invoke_ruby([{'RUBY_MN_THREADS' => '1'}, '-v'], '', true) + return /\+MN/ =~ out +end + +if mn_supported_p.call + # test only on MN threads +else + return +end + +class TestThreadLockNativeThread < Test::Unit::TestCase + def test_lock_native_thread + assert_separately([{'RUBY_MN_THREADS' => '1'}], <<-RUBY) + require '-test-/thread/lock_native_thread' + + Thread.new{ + assert_equal true, Thread.current.lock_native_thread + }.join + + # main thread already has DNT + assert_equal false, Thread.current.lock_native_thread + RUBY + end + + def test_lock_native_thread_tls + assert_separately([{'RUBY_MN_THREADS' => '1'}], <<-RUBY) + require '-test-/thread/lock_native_thread' + tn = 10 + ln = 1_000 + + ts = tn.times.map{|i| + Thread.new(i){|i| + Thread.current.set_tls i + assert_equal true, Thread.current.lock_native_thread + + ln.times{ + assert_equal i, Thread.current.get_tls + Thread.pass + } + } + } + ts.each(&:join) + RUBY + end +end diff --git a/test/mri/-ext-/tracepoint/test_tracepoint.rb b/test/mri/-ext-/tracepoint/test_tracepoint.rb index 9d1679602a5..48ffe2605c1 100644 --- a/test/mri/-ext-/tracepoint/test_tracepoint.rb +++ b/test/mri/-ext-/tracepoint/test_tracepoint.rb @@ -11,6 +11,7 @@ def test_not_available_from_ruby def test_tracks_objspace_events result = EnvUtil.suppress_warning {eval(<<-EOS, nil, __FILE__, __LINE__+1)} + # frozen_string_literal: false Bug.tracepoint_track_objspace_events { 99 'abc' diff --git a/test/mri/base64/test_base64.rb b/test/mri/base64/test_base64.rb deleted file mode 100644 index ce716043a8e..00000000000 --- a/test/mri/base64/test_base64.rb +++ /dev/null @@ -1,115 +0,0 @@ -# coding: US-ASCII -# frozen_string_literal: true -require "test/unit" -require "base64" - -class TestBase64 < Test::Unit::TestCase - def test_sample - assert_equal("U2VuZCByZWluZm9yY2VtZW50cw==\n", Base64.encode64('Send reinforcements')) - assert_equal('Send reinforcements', Base64.decode64("U2VuZCByZWluZm9yY2VtZW50cw==\n")) - assert_equal( - "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n", - Base64.encode64("Now is the time for all good coders\nto learn Ruby")) - assert_equal( - "Now is the time for all good coders\nto learn Ruby", - Base64.decode64("Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n")) - assert_equal( - "VGhpcyBpcyBsaW5lIG9uZQpUaGlzIGlzIGxpbmUgdHdvClRoaXMgaXMgbGlu\nZSB0aHJlZQpBbmQgc28gb24uLi4K\n", - Base64.encode64("This is line one\nThis is line two\nThis is line three\nAnd so on...\n")) - assert_equal( - "This is line one\nThis is line two\nThis is line three\nAnd so on...\n", - Base64.decode64("VGhpcyBpcyBsaW5lIG9uZQpUaGlzIGlzIGxpbmUgdHdvClRoaXMgaXMgbGluZSB0aHJlZQpBbmQgc28gb24uLi4K")) - end - - def test_encode64 - assert_equal("", Base64.encode64("")) - assert_equal("AA==\n", Base64.encode64("\0")) - assert_equal("AAA=\n", Base64.encode64("\0\0")) - assert_equal("AAAA\n", Base64.encode64("\0\0\0")) - assert_equal("/w==\n", Base64.encode64("\377")) - assert_equal("//8=\n", Base64.encode64("\377\377")) - assert_equal("////\n", Base64.encode64("\377\377\377")) - assert_equal("/+8=\n", Base64.encode64("\xff\xef")) - end - - def test_decode64 - assert_equal("", Base64.decode64("")) - assert_equal("\0", Base64.decode64("AA==\n")) - assert_equal("\0\0", Base64.decode64("AAA=\n")) - assert_equal("\0\0\0", Base64.decode64("AAAA\n")) - assert_equal("\377", Base64.decode64("/w==\n")) - assert_equal("\377\377", Base64.decode64("//8=\n")) - assert_equal("\377\377\377", Base64.decode64("////\n")) - assert_equal("\xff\xef", Base64.decode64("/+8=\n")) - end - - def test_strict_encode64 - assert_equal("", Base64.strict_encode64("")) - assert_equal("AA==", Base64.strict_encode64("\0")) - assert_equal("AAA=", Base64.strict_encode64("\0\0")) - assert_equal("AAAA", Base64.strict_encode64("\0\0\0")) - assert_equal("/w==", Base64.strict_encode64("\377")) - assert_equal("//8=", Base64.strict_encode64("\377\377")) - assert_equal("////", Base64.strict_encode64("\377\377\377")) - assert_equal("/+8=", Base64.strict_encode64("\xff\xef")) - end - - def test_strict_decode64 - assert_equal("", Base64.strict_decode64("")) - assert_equal("\0", Base64.strict_decode64("AA==")) - assert_equal("\0\0", Base64.strict_decode64("AAA=")) - assert_equal("\0\0\0", Base64.strict_decode64("AAAA")) - assert_equal("\377", Base64.strict_decode64("/w==")) - assert_equal("\377\377", Base64.strict_decode64("//8=")) - assert_equal("\377\377\377", Base64.strict_decode64("////")) - assert_equal("\xff\xef", Base64.strict_decode64("/+8=")) - - assert_raise(ArgumentError) { Base64.strict_decode64("^") } - assert_raise(ArgumentError) { Base64.strict_decode64("A") } - assert_raise(ArgumentError) { Base64.strict_decode64("A^") } - assert_raise(ArgumentError) { Base64.strict_decode64("AA") } - assert_raise(ArgumentError) { Base64.strict_decode64("AA=") } - assert_raise(ArgumentError) { Base64.strict_decode64("AA===") } - assert_raise(ArgumentError) { Base64.strict_decode64("AA=x") } - assert_raise(ArgumentError) { Base64.strict_decode64("AAA") } - assert_raise(ArgumentError) { Base64.strict_decode64("AAA^") } - assert_raise(ArgumentError) { Base64.strict_decode64("AB==") } - assert_raise(ArgumentError) { Base64.strict_decode64("AAB=") } - end - - def test_urlsafe_encode64 - assert_equal("", Base64.urlsafe_encode64("")) - assert_equal("AA==", Base64.urlsafe_encode64("\0")) - assert_equal("AAA=", Base64.urlsafe_encode64("\0\0")) - assert_equal("AAAA", Base64.urlsafe_encode64("\0\0\0")) - assert_equal("_w==", Base64.urlsafe_encode64("\377")) - assert_equal("__8=", Base64.urlsafe_encode64("\377\377")) - assert_equal("____", Base64.urlsafe_encode64("\377\377\377")) - assert_equal("_-8=", Base64.urlsafe_encode64("\xff\xef")) - end - - def test_urlsafe_encode64_unpadded - assert_equal("", Base64.urlsafe_encode64("", padding: false)) - assert_equal("AA", Base64.urlsafe_encode64("\0", padding: false)) - assert_equal("AAA", Base64.urlsafe_encode64("\0\0", padding: false)) - assert_equal("AAAA", Base64.urlsafe_encode64("\0\0\0", padding: false)) - end - - def test_urlsafe_decode64 - assert_equal("", Base64.urlsafe_decode64("")) - assert_equal("\0", Base64.urlsafe_decode64("AA==")) - assert_equal("\0\0", Base64.urlsafe_decode64("AAA=")) - assert_equal("\0\0\0", Base64.urlsafe_decode64("AAAA")) - assert_equal("\377", Base64.urlsafe_decode64("_w==")) - assert_equal("\377\377", Base64.urlsafe_decode64("__8=")) - assert_equal("\377\377\377", Base64.urlsafe_decode64("____")) - assert_equal("\xff\xef", Base64.urlsafe_decode64("_+8=")) - end - - def test_urlsafe_decode64_unpadded - assert_equal("\0", Base64.urlsafe_decode64("AA")) - assert_equal("\0\0", Base64.urlsafe_decode64("AAA")) - assert_equal("\0\0\0", Base64.urlsafe_decode64("AAAA")) - assert_raise(ArgumentError) { Base64.urlsafe_decode64("AA=") } - end -end diff --git a/test/mri/bigdecimal/helper.rb b/test/mri/bigdecimal/helper.rb deleted file mode 100644 index 46721fb9a81..00000000000 --- a/test/mri/bigdecimal/helper.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: false -require "test/unit" -require "bigdecimal" -require 'rbconfig/sizeof' - -module TestBigDecimalBase - if RbConfig::SIZEOF.key?("int64_t") - SIZEOF_DECDIG = RbConfig::SIZEOF["int32_t"] - BASE = 1_000_000_000 - BASE_FIG = 9 - else - SIZEOF_DECDIG = RbConfig::SIZEOF["int16_t"] - BASE = 1000 - BASE_FIG = 4 - end - - def setup - @mode = BigDecimal.mode(BigDecimal::EXCEPTION_ALL) - BigDecimal.mode(BigDecimal::EXCEPTION_ALL, true) - BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, true) - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true) - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP) - BigDecimal.limit(0) - end - - def teardown - [BigDecimal::EXCEPTION_INFINITY, BigDecimal::EXCEPTION_NaN, - BigDecimal::EXCEPTION_UNDERFLOW, BigDecimal::EXCEPTION_OVERFLOW].each do |mode| - BigDecimal.mode(mode, !(@mode & mode).zero?) - end - end - - def under_gc_stress - stress, GC.stress = GC.stress, true - yield - ensure - GC.stress = stress - end -end diff --git a/test/mri/bigdecimal/test_bigdecimal.rb b/test/mri/bigdecimal/test_bigdecimal.rb deleted file mode 100644 index 2fc22d224f6..00000000000 --- a/test/mri/bigdecimal/test_bigdecimal.rb +++ /dev/null @@ -1,2300 +0,0 @@ -# frozen_string_literal: false -require_relative "helper" -require 'bigdecimal/math' - -class TestBigDecimal < Test::Unit::TestCase - include TestBigDecimalBase - - if defined? RbConfig::LIMITS - LIMITS = RbConfig::LIMITS - else - require 'fiddle' - LONG_MAX = (1 << (Fiddle::SIZEOF_LONG*8 - 1)) - 1 - LONG_MIN = [LONG_MAX + 1].pack("L!").unpack("l!")[0] - LLONG_MAX = (1 << (Fiddle::SIZEOF_LONG_LONG*8 - 1)) - 1 - LLONG_MIN = [LLONG_MAX + 1].pack("Q!").unpack("q!")[0] - ULLONG_MAX = (1 << Fiddle::SIZEOF_LONG_LONG*8) - 1 - LIMITS = { - "LLONG_MIN" => LLONG_MIN, - "ULLONG_MAX" => ULLONG_MAX, - "FIXNUM_MIN" => LONG_MIN / 2, - "FIXNUM_MAX" => LONG_MAX / 2, - "INT64_MIN" => -9223372036854775808, - "INT64_MAX" => 9223372036854775807, - "UINT64_MAX" => 18446744073709551615, - }.freeze - end - - ROUNDING_MODE_MAP = [ - [ BigDecimal::ROUND_UP, :up], - [ BigDecimal::ROUND_DOWN, :down], - [ BigDecimal::ROUND_DOWN, :truncate], - [ BigDecimal::ROUND_HALF_UP, :half_up], - [ BigDecimal::ROUND_HALF_UP, :default], - [ BigDecimal::ROUND_HALF_DOWN, :half_down], - [ BigDecimal::ROUND_HALF_EVEN, :half_even], - [ BigDecimal::ROUND_HALF_EVEN, :banker], - [ BigDecimal::ROUND_CEILING, :ceiling], - [ BigDecimal::ROUND_CEILING, :ceil], - [ BigDecimal::ROUND_FLOOR, :floor], - ] - - def assert_nan(x) - assert(x.nan?, "Expected #{x.inspect} to be NaN") - end - - def assert_positive_infinite(x) - assert(x.infinite?, "Expected #{x.inspect} to be positive infinite") - assert_operator(x, :>, 0) - end - - def assert_negative_infinite(x) - assert(x.infinite?, "Expected #{x.inspect} to be negative infinite") - assert_operator(x, :<, 0) - end - - def assert_positive_zero(x) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, x.sign, - "Expected #{x.inspect} to be positive zero") - end - - def assert_negative_zero(x) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, x.sign, - "Expected #{x.inspect} to be negative zero") - end - - def test_not_equal - assert_not_equal BigDecimal("1"), BigDecimal("2") - end - - def test_BigDecimal - assert_equal(1, BigDecimal("1")) - assert_equal(1, BigDecimal("1", 1)) - assert_equal(1, BigDecimal(" 1 ")) - assert_equal(111, BigDecimal("1_1_1_")) - assert_equal(10**(-1), BigDecimal("1E-1"), '#4825') - assert_equal(1234, BigDecimal(" \t\n\r \r1234 \t\n\r \r")) - - assert_raise(ArgumentError) { BigDecimal("1", -1) } - assert_raise_with_message(ArgumentError, /"1__1_1"/) { BigDecimal("1__1_1") } - assert_raise_with_message(ArgumentError, /"_1_1_1"/) { BigDecimal("_1_1_1") } - - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_positive_infinite(BigDecimal("Infinity")) - assert_positive_infinite(BigDecimal("1E1111111111111111111")) - assert_positive_infinite(BigDecimal(" \t\n\r \rInfinity \t\n\r \r")) - assert_negative_infinite(BigDecimal("-Infinity")) - assert_negative_infinite(BigDecimal(" \t\n\r \r-Infinity \t\n\r \r")) - assert_nan(BigDecimal("NaN")) - assert_nan(BigDecimal(" \t\n\r \rNaN \t\n\r \r")) - end - end - - def test_BigDecimal_bug7522 - bd = BigDecimal("1.12", 1) - assert_same(bd, BigDecimal(bd)) - assert_same(bd, BigDecimal(bd, exception: false)) - assert_not_same(bd, BigDecimal(bd, 1)) - assert_not_same(bd, BigDecimal(bd, 1, exception: false)) - end - - def test_BigDecimal_issue_192 - # https://github.com/ruby/bigdecimal/issues/192 - # https://github.com/rails/rails/pull/42125 - if BASE_FIG == 9 - int = 1_000_000_000_12345_0000 - big = BigDecimal("0.100000000012345e19") - else # BASE_FIG == 4 - int = 1_0000_12_00 - big = BigDecimal("0.1000012e9") - end - assert_equal(BigDecimal(int), big, "[ruby/bigdecimal#192]") - end - - def test_BigDecimal_with_invalid_string - [ - '', '.', 'e1', 'd1', '.e', '.d', '1.e', '1.d', '.1e', '.1d', - '2,30', '19,000.0', '-2,30', '-19,000.0', '+2,30', '+19,000.0', - '2.3,0', '19.000,0', '-2.3,0', '-19.000,0', '+2.3,0', '+19.000,0', - '2.3.0', '19.000.0', '-2.3.0', '-19.000.0', '+2.3.0', '+19.000.0', - 'invlaid value', '123 xyz' - ].each do |invalid_string| - assert_raise_with_message(ArgumentError, %Q[invalid value for BigDecimal(): "#{invalid_string}"]) do - BigDecimal(invalid_string) - end - end - - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_raise_with_message(ArgumentError, /"Infinity_"/) { BigDecimal("Infinity_") } - assert_raise_with_message(ArgumentError, /"\+Infinity_"/) { BigDecimal("+Infinity_") } - assert_raise_with_message(ArgumentError, /"-Infinity_"/) { BigDecimal("-Infinity_") } - assert_raise_with_message(ArgumentError, /"NaN_"/) { BigDecimal("NaN_") } - end - end - - def test_BigDecimal_with_integer - assert_equal(BigDecimal("0"), BigDecimal(0)) - assert_equal(BigDecimal("1"), BigDecimal(1)) - assert_equal(BigDecimal("-1"), BigDecimal(-1)) - assert_equal(BigDecimal((2**100).to_s), BigDecimal(2**100)) - assert_equal(BigDecimal((-2**100).to_s), BigDecimal(-2**100)) - - assert_equal(BigDecimal(LIMITS["FIXNUM_MIN"].to_s), BigDecimal(LIMITS["FIXNUM_MIN"])) - - assert_equal(BigDecimal(LIMITS["FIXNUM_MAX"].to_s), BigDecimal(LIMITS["FIXNUM_MAX"])) - - assert_equal(BigDecimal(LIMITS["INT64_MIN"].to_s), BigDecimal(LIMITS["INT64_MIN"])) - - assert_equal(BigDecimal(LIMITS["INT64_MAX"].to_s), BigDecimal(LIMITS["INT64_MAX"])) - - assert_equal(BigDecimal(LIMITS["UINT64_MAX"].to_s), BigDecimal(LIMITS["UINT64_MAX"])) - end - - def test_BigDecimal_with_rational - assert_equal(BigDecimal("0.333333333333333333333"), BigDecimal(1.quo(3), 21)) - assert_equal(BigDecimal("-0.333333333333333333333"), BigDecimal(-1.quo(3), 21)) - assert_raise_with_message(ArgumentError, "can't omit precision for a Rational.") { BigDecimal(42.quo(7)) } - end - - def test_BigDecimal_with_float - assert_equal(BigDecimal("0.1235"), BigDecimal(0.1234567, 4)) - assert_equal(BigDecimal("-0.1235"), BigDecimal(-0.1234567, 4)) - assert_equal(BigDecimal("0.01"), BigDecimal(0.01, Float::DIG + 1)) - assert_raise_with_message(ArgumentError, "can't omit precision for a Float.") { BigDecimal(4.2) } - assert_raise(ArgumentError) { BigDecimal(0.1, Float::DIG + 2) } - assert_nothing_raised { BigDecimal(0.1, Float::DIG + 1) } - - assert_same(BigDecimal(0.0), BigDecimal(0.0)) - assert_same(BigDecimal(-0.0), BigDecimal(-0.0)) - - bug9214 = '[ruby-core:58858]' - assert_equal(BigDecimal(-0.0).sign, -1, bug9214) - - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigDecimal(Float::NAN)) - assert_same(BigDecimal(Float::NAN), BigDecimal(Float::NAN)) - end - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_positive_infinite(BigDecimal(Float::INFINITY)) - assert_same(BigDecimal(Float::INFINITY), BigDecimal(Float::INFINITY)) - assert_negative_infinite(BigDecimal(-Float::INFINITY)) - assert_same(BigDecimal(-Float::INFINITY), BigDecimal(-Float::INFINITY)) - end - end - - def test_BigDecimal_with_complex - assert_equal(BigDecimal("1"), BigDecimal(Complex(1, 0))) - assert_equal(BigDecimal("0.333333333333333333333"), BigDecimal(Complex(1.quo(3), 0), 21)) - assert_equal(BigDecimal("0.1235"), BigDecimal(Complex(0.1234567, 0), 4)) - - assert_raise_with_message(ArgumentError, "Unable to make a BigDecimal from non-zero imaginary number") { BigDecimal(Complex(1, 1)) } - end - - def test_BigDecimal_with_big_decimal - assert_equal(BigDecimal(1), BigDecimal(BigDecimal(1))) - assert_equal(BigDecimal('+0'), BigDecimal(BigDecimal('+0'))) - assert_equal(BigDecimal('-0'), BigDecimal(BigDecimal('-0'))) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_positive_infinite(BigDecimal(BigDecimal('Infinity'))) - assert_negative_infinite(BigDecimal(BigDecimal('-Infinity'))) - assert_nan(BigDecimal(BigDecimal('NaN'))) - end - end - - if RUBY_VERSION < '2.7' - def test_BigDecimal_with_tainted_string - Thread.new { - $SAFE = 1 - BigDecimal('1'.taint) - }.join - ensure - $SAFE = 0 - end - end - - def test_BigDecimal_with_exception_keyword - assert_raise(ArgumentError) { - BigDecimal('.', exception: true) - } - assert_nothing_raised(ArgumentError) { - assert_equal(nil, BigDecimal(".", exception: false)) - } - assert_raise(ArgumentError) { - BigDecimal("1", -1, exception: true) - } - assert_nothing_raised(ArgumentError) { - assert_equal(nil, BigDecimal("1", -1, exception: false)) - } - assert_raise(ArgumentError) { - BigDecimal(42.quo(7), exception: true) - } - assert_nothing_raised(ArgumentError) { - assert_equal(nil, BigDecimal(42.quo(7), exception: false)) - } - assert_raise(ArgumentError) { - BigDecimal(4.2, exception: true) - } - assert_nothing_raised(ArgumentError) { - assert_equal(nil, BigDecimal(4.2, exception: false)) - } - # TODO: support conversion from complex - # assert_raise(RangeError) { - # BigDecimal(1i, exception: true) - # } - # assert_nothing_raised(RangeError) { - # assert_equal(nil, BigDecimal(1i, exception: false)) - # } - assert_raise_with_message(TypeError, "can't convert nil into BigDecimal") { - BigDecimal(nil, exception: true) - } - assert_raise_with_message(TypeError, "can't convert true into BigDecimal") { - BigDecimal(true, exception: true) - } - assert_raise_with_message(TypeError, "can't convert false into BigDecimal") { - BigDecimal(false, exception: true) - } - assert_raise_with_message(TypeError, "can't convert Object into BigDecimal") { - BigDecimal(Object.new, exception: true) - } - assert_nothing_raised(TypeError) { - assert_equal(nil, BigDecimal(nil, exception: false)) - } - assert_nothing_raised(TypeError) { - assert_equal(nil, BigDecimal(:test, exception: false)) - } - assert_nothing_raised(TypeError) { - assert_equal(nil, BigDecimal(Object.new, exception: false)) - } - assert_nothing_raised(TypeError) { - assert_equal(nil, BigDecimal(Object.new, exception: false)) - } - # TODO: support to_d - # assert_nothing_raised(TypeError) { - # o = Object.new - # def o.to_d; 3.14; end - # assert_equal(3.14, BigDecimal(o, exception: false)) - # } - # assert_nothing_raised(RuntimeError) { - # o = Object.new - # def o.to_d; raise; end - # assert_equal(nil, BigDecimal(o, exception: false)) - # } - end - - def test_s_ver - assert_raise_with_message(NoMethodError, /undefined method `ver'/) { BigDecimal.ver } - end - - def test_s_allocate - if RUBY_ENGINE == "truffleruby" - assert_raise_with_message(NoMethodError, /undefined.+allocate.+for BigDecimal/) { BigDecimal.allocate } - else - assert_raise_with_message(TypeError, /allocator undefined for BigDecimal/) { BigDecimal.allocate } - end - end - - def test_s_new - assert_raise_with_message(NoMethodError, /undefined method `new'/) { BigDecimal.new("1") } - end - - def test_s_interpret_loosely - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("1__1_1")) - assert_equal(BigDecimal('2.5'), BigDecimal.interpret_loosely("2.5")) - assert_equal(BigDecimal('2.5'), BigDecimal.interpret_loosely("2.5 degrees")) - assert_equal(BigDecimal('2.5e1'), BigDecimal.interpret_loosely("2.5e1 degrees")) - assert_equal(BigDecimal('0'), BigDecimal.interpret_loosely("degrees 100.0")) - assert_equal(BigDecimal('0.125'), BigDecimal.interpret_loosely("0.1_2_5")) - assert_equal(BigDecimal('0.125'), BigDecimal.interpret_loosely("0.1_2_5__")) - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("1_.125")) - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("1._125")) - assert_equal(BigDecimal('0.1'), BigDecimal.interpret_loosely("0.1__2_5")) - assert_equal(BigDecimal('0.1'), BigDecimal.interpret_loosely("0.1_e10")) - assert_equal(BigDecimal('0.1'), BigDecimal.interpret_loosely("0.1e_10")) - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("0.1e1__0")) - assert_equal(BigDecimal('1.2'), BigDecimal.interpret_loosely("1.2.3")) - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("1.")) - assert_equal(BigDecimal('1'), BigDecimal.interpret_loosely("1e")) - - assert_equal(BigDecimal('0.0'), BigDecimal.interpret_loosely("invalid")) - - assert(BigDecimal.interpret_loosely("2.5").frozen?) - end - - def _test_mode(type) - BigDecimal.mode(type, true) - assert_raise(FloatDomainError) { yield } - - BigDecimal.mode(type, false) - assert_nothing_raised { yield } - end - - def test_mode - assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::EXCEPTION_ALL, 1) } - assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::ROUND_MODE, 256) } - assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::ROUND_MODE, :xyzzy) } - assert_raise(TypeError) { BigDecimal.mode(0xf000, true) } - - begin - saved_mode = BigDecimal.mode(BigDecimal::ROUND_MODE) - - [ BigDecimal::ROUND_UP, - BigDecimal::ROUND_DOWN, - BigDecimal::ROUND_HALF_UP, - BigDecimal::ROUND_HALF_DOWN, - BigDecimal::ROUND_CEILING, - BigDecimal::ROUND_FLOOR, - BigDecimal::ROUND_HALF_EVEN, - ].each do |mode| - BigDecimal.mode(BigDecimal::ROUND_MODE, mode) - assert_equal(mode, BigDecimal.mode(BigDecimal::ROUND_MODE)) - end - ensure - BigDecimal.mode(BigDecimal::ROUND_MODE, saved_mode) - end - - BigDecimal.save_rounding_mode do - ROUNDING_MODE_MAP.each do |const, sym| - BigDecimal.mode(BigDecimal::ROUND_MODE, sym) - assert_equal(const, BigDecimal.mode(BigDecimal::ROUND_MODE)) - end - end - end - - def test_thread_local_mode - begin - saved_mode = BigDecimal.mode(BigDecimal::ROUND_MODE) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_UP) - Thread.start { - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - assert_equal(BigDecimal::ROUND_HALF_EVEN, BigDecimal.mode(BigDecimal::ROUND_MODE)) - }.join - assert_equal(BigDecimal::ROUND_UP, BigDecimal.mode(BigDecimal::ROUND_MODE)) - ensure - BigDecimal.mode(BigDecimal::ROUND_MODE, saved_mode) - end - end - - def test_save_exception_mode - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - mode = BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true) - end - assert_equal(mode, BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW)) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_FLOOR) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - end - assert_equal(BigDecimal::ROUND_HALF_EVEN, BigDecimal.mode(BigDecimal::ROUND_MODE)) - - assert_equal(42, BigDecimal.save_exception_mode { 42 }) - end - - def test_save_rounding_mode - saved_mode = BigDecimal.mode(BigDecimal::ROUND_MODE) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_FLOOR) - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - end - assert_equal(BigDecimal::ROUND_FLOOR, BigDecimal.mode(BigDecimal::ROUND_MODE)) - - assert_equal(42, BigDecimal.save_rounding_mode { 42 }) - ensure - BigDecimal.mode(BigDecimal::ROUND_MODE, saved_mode) - end - - def test_save_limit - begin - old = BigDecimal.limit - BigDecimal.limit(100) - BigDecimal.save_limit do - BigDecimal.limit(200) - end - assert_equal(100, BigDecimal.limit); - ensure - BigDecimal.limit(old) - end - - assert_equal(42, BigDecimal.save_limit { 42 }) - end - - def test_exception_nan - _test_mode(BigDecimal::EXCEPTION_NaN) { BigDecimal("NaN") } - end - - def test_exception_infinity - _test_mode(BigDecimal::EXCEPTION_INFINITY) { BigDecimal("Infinity") } - end - - def test_exception_underflow - _test_mode(BigDecimal::EXCEPTION_UNDERFLOW) do - x = BigDecimal("0.1") - 100.times do - x *= x - end - end - end - - def test_exception_overflow - _test_mode(BigDecimal::EXCEPTION_OVERFLOW) do - x = BigDecimal("10") - 100.times do - x *= x - end - end - end - - def test_exception_zerodivide - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - _test_mode(BigDecimal::EXCEPTION_ZERODIVIDE) { 1 / BigDecimal("0") } - _test_mode(BigDecimal::EXCEPTION_ZERODIVIDE) { -1 / BigDecimal("0") } - end - - def test_round_up - n4 = BigDecimal("4") # n4 / 9 = 0.44444... - n5 = BigDecimal("5") # n5 / 9 = 0.55555... - n6 = BigDecimal("6") # n6 / 9 = 0.66666... - m4, m5, m6 = -n4, -n5, -n6 - n2h = BigDecimal("2.5") - n3h = BigDecimal("3.5") - m2h, m3h = -n2h, -n3h - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_UP) - assert_operator(n4, :<, n4 / 9 * 9) - assert_operator(n5, :<, n5 / 9 * 9) - assert_operator(n6, :<, n6 / 9 * 9) - assert_operator(m4, :>, m4 / 9 * 9) - assert_operator(m5, :>, m5 / 9 * 9) - assert_operator(m6, :>, m6 / 9 * 9) - assert_equal(3, n2h.round) - assert_equal(4, n3h.round) - assert_equal(-3, m2h.round) - assert_equal(-4, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_DOWN) - assert_operator(n4, :>, n4 / 9 * 9) - assert_operator(n5, :>, n5 / 9 * 9) - assert_operator(n6, :>, n6 / 9 * 9) - assert_operator(m4, :<, m4 / 9 * 9) - assert_operator(m5, :<, m5 / 9 * 9) - assert_operator(m6, :<, m6 / 9 * 9) - assert_equal(2, n2h.round) - assert_equal(3, n3h.round) - assert_equal(-2, m2h.round) - assert_equal(-3, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP) - assert_operator(n4, :>, n4 / 9 * 9) - assert_operator(n5, :<, n5 / 9 * 9) - assert_operator(n6, :<, n6 / 9 * 9) - assert_operator(m4, :<, m4 / 9 * 9) - assert_operator(m5, :>, m5 / 9 * 9) - assert_operator(m6, :>, m6 / 9 * 9) - assert_equal(3, n2h.round) - assert_equal(4, n3h.round) - assert_equal(-3, m2h.round) - assert_equal(-4, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_DOWN) - assert_operator(n4, :>, n4 / 9 * 9) - assert_operator(n5, :>, n5 / 9 * 9) - assert_operator(n6, :<, n6 / 9 * 9) - assert_operator(m4, :<, m4 / 9 * 9) - assert_operator(m5, :<, m5 / 9 * 9) - assert_operator(m6, :>, m6 / 9 * 9) - assert_equal(2, n2h.round) - assert_equal(3, n3h.round) - assert_equal(-2, m2h.round) - assert_equal(-3, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - assert_operator(n4, :>, n4 / 9 * 9) - assert_operator(n5, :<, n5 / 9 * 9) - assert_operator(n6, :<, n6 / 9 * 9) - assert_operator(m4, :<, m4 / 9 * 9) - assert_operator(m5, :>, m5 / 9 * 9) - assert_operator(m6, :>, m6 / 9 * 9) - assert_equal(2, n2h.round) - assert_equal(4, n3h.round) - assert_equal(-2, m2h.round) - assert_equal(-4, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_CEILING) - assert_operator(n4, :<, n4 / 9 * 9) - assert_operator(n5, :<, n5 / 9 * 9) - assert_operator(n6, :<, n6 / 9 * 9) - assert_operator(m4, :<, m4 / 9 * 9) - assert_operator(m5, :<, m5 / 9 * 9) - assert_operator(m6, :<, m6 / 9 * 9) - assert_equal(3, n2h.round) - assert_equal(4, n3h.round) - assert_equal(-2, m2h.round) - assert_equal(-3, m3h.round) - - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_FLOOR) - assert_operator(n4, :>, n4 / 9 * 9) - assert_operator(n5, :>, n5 / 9 * 9) - assert_operator(n6, :>, n6 / 9 * 9) - assert_operator(m4, :>, m4 / 9 * 9) - assert_operator(m5, :>, m5 / 9 * 9) - assert_operator(m6, :>, m6 / 9 * 9) - assert_equal(2, n2h.round) - assert_equal(3, n3h.round) - assert_equal(-3, m2h.round) - assert_equal(-4, m3h.round) - end - - def test_zero_p - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(true, BigDecimal("0").zero?) - assert_equal(true, BigDecimal("-0").zero?) - assert_equal(false, BigDecimal("1").zero?) - assert_equal(true, BigDecimal("0E200000000000000").zero?) - assert_equal(false, BigDecimal("Infinity").zero?) - assert_equal(false, BigDecimal("-Infinity").zero?) - assert_equal(false, BigDecimal("NaN").zero?) - end - - def test_nonzero_p - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(nil, BigDecimal("0").nonzero?) - assert_equal(nil, BigDecimal("-0").nonzero?) - assert_equal(BigDecimal("1"), BigDecimal("1").nonzero?) - assert_positive_infinite(BigDecimal("Infinity").nonzero?) - assert_negative_infinite(BigDecimal("-Infinity").nonzero?) - assert_nan(BigDecimal("NaN").nonzero?) - end - - def test_double_fig - assert_kind_of(Integer, BigDecimal.double_fig) - end - - def test_cmp - n1 = BigDecimal("1") - n2 = BigDecimal("2") - assert_equal( 0, n1 <=> n1) - assert_equal( 1, n2 <=> n1) - assert_equal(-1, n1 <=> n2) - assert_operator(n1, :==, n1) - assert_operator(n1, :!=, n2) - assert_operator(n1, :<, n2) - assert_operator(n1, :<=, n1) - assert_operator(n1, :<=, n2) - assert_operator(n2, :>, n1) - assert_operator(n2, :>=, n1) - assert_operator(n1, :>=, n1) - - assert_operator(BigDecimal("-0"), :==, BigDecimal("0")) - assert_operator(BigDecimal("0"), :<, BigDecimal("1")) - assert_operator(BigDecimal("1"), :>, BigDecimal("0")) - assert_operator(BigDecimal("1"), :>, BigDecimal("-1")) - assert_operator(BigDecimal("-1"), :<, BigDecimal("1")) - assert_operator(BigDecimal((2**100).to_s), :>, BigDecimal("1")) - assert_operator(BigDecimal("1"), :<, BigDecimal((2**100).to_s)) - - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - inf = BigDecimal("Infinity") - assert_operator(inf, :>, 1) - assert_operator(1, :<, inf) - - assert_operator(BigDecimal("1E-1"), :==, 10**(-1), '#4825') - assert_equal(0, BigDecimal("1E-1") <=> 10**(-1), '#4825') - end - - def test_cmp_issue9192 - bug9192 = '[ruby-core:58756] [#9192]' - operators = { :== => :==, :< => :>, :> => :<, :<= => :>=, :>= => :<= } - 5.upto(8) do |i| - s = "706.0#{i}" - d = BigDecimal(s) - f = s.to_f - operators.each do |op, inv| - assert_equal(d.send(op, f), f.send(inv, d), - "(BigDecimal(#{s.inspect}) #{op} #{s}) and (#{s} #{inv} BigDecimal(#{s.inspect})) is different #{bug9192}") - end - end - end - - def test_cmp_nan - n1 = BigDecimal("1") - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_equal(nil, BigDecimal("NaN") <=> n1) - assert_equal(false, BigDecimal("NaN") > n1) - assert_equal(nil, BigDecimal("NaN") <=> BigDecimal("NaN")) - assert_equal(false, BigDecimal("NaN") == BigDecimal("NaN")) - end - - def test_cmp_failing_coercion - n1 = BigDecimal("1") - assert_equal(nil, n1 <=> nil) - assert_raise(ArgumentError){n1 > nil} - end - - def test_cmp_coerce - n1 = BigDecimal("1") - n2 = BigDecimal("2") - o1 = Object.new; def o1.coerce(x); [x, BigDecimal("1")]; end - o2 = Object.new; def o2.coerce(x); [x, BigDecimal("2")]; end - assert_equal( 0, n1 <=> o1) - assert_equal( 1, n2 <=> o1) - assert_equal(-1, n1 <=> o2) - assert_operator(n1, :==, o1) - assert_operator(n1, :!=, o2) - assert_operator(n1, :<, o2) - assert_operator(n1, :<=, o1) - assert_operator(n1, :<=, o2) - assert_operator(n2, :>, o1) - assert_operator(n2, :>=, o1) - assert_operator(n1, :>=, 1) - - bug10109 = '[ruby-core:64190]' - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_operator(BigDecimal(0), :<, Float::INFINITY, bug10109) - assert_operator(Float::INFINITY, :>, BigDecimal(0), bug10109) - end - - def test_cmp_bignum - assert_operator(BigDecimal((2**100).to_s), :==, 2**100) - end - - def test_cmp_data - d = Time.now; def d.coerce(x); [x, x]; end - assert_operator(BigDecimal((2**100).to_s), :==, d) - end - - def test_precs_deprecated - assert_warn(/BigDecimal#precs is deprecated and will be removed in the future/) do - Warning[:deprecated] = true if defined?(Warning.[]) - BigDecimal("1").precs - end - end - - def test_precs - assert_separately(["-rbigdecimal"], "#{<<~"begin;"}\n#{<<~'end;'}") - begin; - $VERBOSE = nil - a = BigDecimal("1").precs - assert_instance_of(Array, a) - assert_equal(2, a.size) - assert_kind_of(Integer, a[0]) - assert_kind_of(Integer, a[1]) - end; - end - - def test_hash - a = [] - b = BigDecimal("1") - 10.times { a << b *= 10 } - h = {} - a.each_with_index {|x, i| h[x] = i } - a.each_with_index do |x, i| - assert_equal(i, h[x]) - end - end - - def test_marshal - s = Marshal.dump(BigDecimal("1", 1)) - assert_equal(BigDecimal("1", 1), Marshal.load(s)) - - # corrupt data - s = s.gsub(/BigDecimal.*\z/m) {|x| x.gsub(/\d/m, "-") } - assert_raise(TypeError) { Marshal.load(s) } - end - - def test_finite_infinite_nan - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false) - - x = BigDecimal("0") - assert_equal(true, x.finite?) - assert_equal(nil, x.infinite?) - assert_equal(false, x.nan?) - y = 1 / x - assert_equal(false, y.finite?) - assert_equal(1, y.infinite?) - assert_equal(false, y.nan?) - y = -1 / x - assert_equal(false, y.finite?) - assert_equal(-1, y.infinite?) - assert_equal(false, y.nan?) - - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - y = 0 / x - assert_equal(false, y.finite?) - assert_equal(nil, y.infinite?) - assert_equal(true, y.nan?) - end - - def test_to_i - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - x = BigDecimal("0") - assert_kind_of(Integer, x.to_i) - assert_equal(0, x.to_i) - assert_raise(FloatDomainError){( 1 / x).to_i} - assert_raise(FloatDomainError){(-1 / x).to_i} - assert_raise(FloatDomainError) {( 0 / x).to_i} - x = BigDecimal("1") - assert_equal(1, x.to_i) - x = BigDecimal((2**100).to_s) - assert_equal(2**100, x.to_i) - end - - def test_to_f - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false) - - x = BigDecimal("0") - assert_instance_of(Float, x.to_f) - assert_equal(0.0, x.to_f) - assert_equal( 1.0 / 0.0, ( 1 / x).to_f) - assert_equal(-1.0 / 0.0, (-1 / x).to_f) - assert_nan(( 0 / x).to_f) - x = BigDecimal("1") - assert_equal(1.0, x.to_f) - x = BigDecimal((2**100).to_s) - assert_equal((2**100).to_f, x.to_f) - x = BigDecimal("1" + "0" * 10000) - assert_equal(0, BigDecimal("-0").to_f) - - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true) - assert_raise(FloatDomainError) { x.to_f } - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - assert_kind_of(Float, x .to_f) - assert_kind_of(Float, (-x).to_f) - - bug6944 = '[ruby-core:47342]' - - BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, true) - x = "1e#{Float::MIN_10_EXP - 2*Float::DIG}" - assert_raise(FloatDomainError, x) {BigDecimal(x).to_f} - x = "-#{x}" - assert_raise(FloatDomainError, x) {BigDecimal(x).to_f} - x = "1e#{Float::MIN_10_EXP - Float::DIG}" - assert_nothing_raised(FloatDomainError, x) { - assert_in_delta(0.0, BigDecimal(x).to_f, 10**Float::MIN_10_EXP, bug6944) - } - x = "-#{x}" - assert_nothing_raised(FloatDomainError, x) { - assert_in_delta(0.0, BigDecimal(x).to_f, 10**Float::MIN_10_EXP, bug6944) - } - - BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, false) - x = "1e#{Float::MIN_10_EXP - 2*Float::DIG}" - assert_equal( 0.0, BigDecimal(x).to_f, x) - x = "-#{x}" - assert_equal(-0.0, BigDecimal(x).to_f, x) - x = "1e#{Float::MIN_10_EXP - Float::DIG}" - assert_nothing_raised(FloatDomainError, x) { - assert_in_delta(0.0, BigDecimal(x).to_f, 10**Float::MIN_10_EXP, bug6944) - } - x = "-#{x}" - assert_nothing_raised(FloatDomainError, x) { - assert_in_delta(0.0, BigDecimal(x).to_f, 10**Float::MIN_10_EXP, bug6944) - } - - assert_equal( 0.0, BigDecimal( '9e-325').to_f) - assert_equal( 0.0, BigDecimal( '10e-325').to_f) - assert_equal(-0.0, BigDecimal( '-9e-325').to_f) - assert_equal(-0.0, BigDecimal('-10e-325').to_f) - end - - def test_to_r - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - x = BigDecimal("0") - assert_kind_of(Rational, x.to_r) - assert_equal(0, x.to_r) - assert_raise(FloatDomainError) {( 1 / x).to_r} - assert_raise(FloatDomainError) {(-1 / x).to_r} - assert_raise(FloatDomainError) {( 0 / x).to_r} - - assert_equal(1, BigDecimal("1").to_r) - assert_equal(Rational(3, 2), BigDecimal("1.5").to_r) - assert_equal((2**100).to_r, BigDecimal((2**100).to_s).to_r) - end - - def test_coerce - a, b = BigDecimal("1").coerce(1.0) - assert_instance_of(BigDecimal, a) - assert_instance_of(BigDecimal, b) - assert_equal(2, 1 + BigDecimal("1"), '[ruby-core:25697]') - - a, b = BigDecimal("1").coerce(1.quo(10)) - assert_equal(BigDecimal("0.1"), a, '[ruby-core:34318]') - - a, b = BigDecimal("0.11111").coerce(1.quo(3)) - assert_equal(BigDecimal("0." + "3"*a.precision), a) - - assert_nothing_raised(TypeError, '#7176') do - BigDecimal('1') + Rational(1) - end - end - - def test_uplus - x = BigDecimal("1") - assert_equal(x, x.send(:+@)) - end - - def test_neg - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(BigDecimal("-1"), BigDecimal("1").send(:-@)) - assert_equal(BigDecimal("-0"), BigDecimal("0").send(:-@)) - assert_equal(BigDecimal("0"), BigDecimal("-0").send(:-@)) - assert_equal(BigDecimal("-Infinity"), BigDecimal("Infinity").send(:-@)) - assert_equal(BigDecimal("Infinity"), BigDecimal("-Infinity").send(:-@)) - assert_equal(true, BigDecimal("NaN").send(:-@).nan?) - end - - def test_add - x = BigDecimal("1") - assert_equal(BigDecimal("2"), x + x) - assert_equal(1, BigDecimal("0") + 1) - assert_equal(1, x + 0) - - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal("0") + 0).sign) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal("-0") + 0).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal("-0") + BigDecimal("-0")).sign) - - x = BigDecimal((2**100).to_s) - assert_equal(BigDecimal((2**100+1).to_s), x + 1) - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - inf = BigDecimal("Infinity") - neginf = BigDecimal("-Infinity") - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, true) - assert_raise_with_message(FloatDomainError, "Computation results to 'Infinity'") { inf + inf } - assert_raise_with_message(FloatDomainError, "Computation results to '-Infinity'") { neginf + neginf } - end - - def test_sub - x = BigDecimal("1") - assert_equal(BigDecimal("0"), x - x) - assert_equal(-1, BigDecimal("0") - 1) - assert_equal(1, x - 0) - - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal("0") - 0).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal("-0") - 0).sign) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal("-0") - BigDecimal("-0")).sign) - - x = BigDecimal((2**100).to_s) - assert_equal(BigDecimal((2**100-1).to_s), x - 1) - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - inf = BigDecimal("Infinity") - neginf = BigDecimal("-Infinity") - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, true) - assert_raise_with_message(FloatDomainError, "Computation results to 'Infinity'") { inf - neginf } - assert_raise_with_message(FloatDomainError, "Computation results to '-Infinity'") { neginf - inf } - end - - def test_sub_with_float - assert_kind_of(BigDecimal, BigDecimal("3") - 1.0) - end - - def test_sub_with_rational - assert_kind_of(BigDecimal, BigDecimal("3") - 1.quo(3)) - end - - def test_mult - x = BigDecimal((2**100).to_s) - assert_equal(BigDecimal((2**100 * 3).to_s), (x * 3).to_i) - assert_equal(x, (x * 1).to_i) - assert_equal(x, (BigDecimal("1") * x).to_i) - assert_equal(BigDecimal((2**200).to_s), (x * x).to_i) - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - inf = BigDecimal("Infinity") - neginf = BigDecimal("-Infinity") - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, true) - assert_raise_with_message(FloatDomainError, "Computation results to 'Infinity'") { inf * inf } - assert_raise_with_message(FloatDomainError, "Computation results to '-Infinity'") { neginf * inf } - end - - def test_mult_with_float - assert_kind_of(BigDecimal, BigDecimal("3") * 1.5) - assert_equal(BigDecimal("64.4"), BigDecimal(1) * 64.4) - end - - def test_mult_with_rational - assert_kind_of(BigDecimal, BigDecimal("3") * 1.quo(3)) - end - - def test_mult_with_nil - assert_raise(TypeError) { - BigDecimal('1.1') * nil - } - end - - def test_div - x = BigDecimal((2**100).to_s) - assert_equal(BigDecimal((2**100 / 3).to_s), (x / 3).to_i) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal("0") / 1).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal("-0") / 1).sign) - assert_equal(2, BigDecimal("2") / 1) - assert_equal(-2, BigDecimal("2") / -1) - - assert_equal(BigDecimal('1486.868686869'), - (BigDecimal('1472.0') / BigDecimal('0.99')).round(9), - '[ruby-core:59365] [#9316]') - - assert_in_delta(4.124045235, - (BigDecimal('0.9932') / (700 * BigDecimal('0.344045') / BigDecimal('1000.0'))).round(9, half: :up), - 10**Float::MIN_10_EXP, '[#9305]') - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_positive_zero(BigDecimal("1.0") / BigDecimal("Infinity")) - assert_negative_zero(BigDecimal("-1.0") / BigDecimal("Infinity")) - assert_negative_zero(BigDecimal("1.0") / BigDecimal("-Infinity")) - assert_positive_zero(BigDecimal("-1.0") / BigDecimal("-Infinity")) - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, true) - BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false) - assert_raise_with_message(FloatDomainError, "Computation results in 'Infinity'") { BigDecimal("1") / 0 } - assert_raise_with_message(FloatDomainError, "Computation results in '-Infinity'") { BigDecimal("-1") / 0 } - end - - def test_div_gh220 - x = BigDecimal("1.0") - y = BigDecimal("3672577333.6608990499165058135986328125") - c = BigDecimal("0.272288343892592687909520102748926752911779209181321744700032723729015151607289998e-9") - assert_equal(c, x / y, "[GH-220]") - end - - def test_div_precision - bug13754 = '[ruby-core:82107] [Bug #13754]' - a = BigDecimal('101') - b = BigDecimal('0.9163472602589686') - c = a/b - assert(c.precision > b.precision, - "(101/0.9163472602589686).precision >= (0.9163472602589686).precision #{bug13754}") - end - - def test_div_with_float - assert_kind_of(BigDecimal, BigDecimal("3") / 1.5) - assert_equal(BigDecimal("0.5"), BigDecimal(1) / 2.0) - end - - def test_div_with_rational - assert_kind_of(BigDecimal, BigDecimal("3") / 1.quo(3)) - end - - def test_div_with_complex - q = BigDecimal("3") / 1i - assert_kind_of(Complex, q) - end - - def test_div_error - assert_raise(TypeError) { BigDecimal(20) / '2' } - end - - def test_mod - x = BigDecimal((2**100).to_s) - assert_equal(1, x % 3) - assert_equal(2, (-x) % 3) - assert_equal(-2, x % -3) - assert_equal(-1, (-x) % -3) - end - - def test_mod_with_float - assert_kind_of(BigDecimal, BigDecimal("3") % 1.5) - end - - def test_mod_with_rational - assert_kind_of(BigDecimal, BigDecimal("3") % 1.quo(3)) - end - - def test_remainder - x = BigDecimal((2**100).to_s) - assert_equal(1, x.remainder(3)) - assert_equal(-1, (-x).remainder(3)) - assert_equal(1, x.remainder(-3)) - assert_equal(-1, (-x).remainder(-3)) - end - - def test_remainder_with_float - assert_kind_of(BigDecimal, BigDecimal("3").remainder(1.5)) - end - - def test_remainder_with_rational - assert_kind_of(BigDecimal, BigDecimal("3").remainder(1.quo(3))) - end - - def test_divmod - x = BigDecimal((2**100).to_s) - assert_equal([(x / 3).floor, 1], x.divmod(3)) - assert_equal([(-x / 3).floor, 2], (-x).divmod(3)) - - assert_equal([0, 0], BigDecimal("0").divmod(2)) - - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_raise(ZeroDivisionError){BigDecimal("0").divmod(0)} - end - - def test_divmod_precision - a = BigDecimal('2e55') - b = BigDecimal('1.23456789e10') - q, r = a.divmod(b) - assert_equal((a/b).round(0, :down), q) - assert_equal((a - q*b), r) - - b = BigDecimal('-1.23456789e10') - q, r = a.divmod(b) - assert_equal((a/b).round(0, :down) - 1, q) - assert_equal((a - q*b), r) - end - - def test_divmod_error - assert_raise(TypeError) { BigDecimal(20).divmod('2') } - end - - def test_add_bigdecimal - x = BigDecimal((2**100).to_s) - assert_equal(3000000000000000000000000000000, x.add(x, 1)) - assert_equal(2500000000000000000000000000000, x.add(x, 2)) - assert_equal(2540000000000000000000000000000, x.add(x, 3)) - end - - def test_sub_bigdecimal - x = BigDecimal((2**100).to_s) - assert_equal(1000000000000000000000000000000, x.sub(1, 1)) - assert_equal(1300000000000000000000000000000, x.sub(1, 2)) - assert_equal(1270000000000000000000000000000, x.sub(1, 3)) - end - - def test_mult_bigdecimal - x = BigDecimal((2**100).to_s) - assert_equal(4000000000000000000000000000000, x.mult(3, 1)) - assert_equal(3800000000000000000000000000000, x.mult(3, 2)) - assert_equal(3800000000000000000000000000000, x.mult(3, 3)) - end - - def test_div_bigdecimal - x = BigDecimal((2**100).to_s) - assert_equal(422550200076076467165567735125, x.div(3)) - assert_equal(400000000000000000000000000000, x.div(3, 1)) - assert_equal(420000000000000000000000000000, x.div(3, 2)) - assert_equal(423000000000000000000000000000, x.div(3, 3)) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_equal(0, BigDecimal("0").div(BigDecimal("Infinity"))) - end - end - - def test_div_bigdecimal_with_float_and_precision - x = BigDecimal(5) - y = 5.1 - assert_equal(x.div(BigDecimal(y, 0), 8), - x.div(y, 8)) - - assert_equal(x.div(BigDecimal(y, 0), 100), - x.div(y, 100)) - end - - def test_quo_without_prec - x = BigDecimal(5) - y = BigDecimal(229) - assert_equal(BigDecimal("0.021834061135371179039301310043668122"), x.quo(y)) - end - - def test_quo_with_prec - begin - saved_mode = BigDecimal.mode(BigDecimal::ROUND_MODE) - BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up) - - x = BigDecimal(5) - y = BigDecimal(229) - assert_equal(BigDecimal("0.021834061135371179039301310043668122"), x.quo(y, 0)) - assert_equal(BigDecimal("0.022"), x.quo(y, 2)) - assert_equal(BigDecimal("0.0218"), x.quo(y, 3)) - assert_equal(BigDecimal("0.0218341"), x.quo(y, 6)) - assert_equal(BigDecimal("0.02183406114"), x.quo(y, 10)) - assert_equal(BigDecimal("0.021834061135371179039301310043668122270742358078603"), x.quo(y, 50)) - ensure - BigDecimal.mode(BigDecimal::ROUND_MODE, saved_mode) - end - end - - def test_abs_bigdecimal - x = BigDecimal((2**100).to_s) - assert_equal(1267650600228229401496703205376, x.abs) - x = BigDecimal("-" + (2**100).to_s) - assert_equal(1267650600228229401496703205376, x.abs) - x = BigDecimal("0") - assert_equal(0, x.abs) - x = BigDecimal("-0") - assert_equal(0, x.abs) - - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - x = BigDecimal("Infinity") - assert_equal(BigDecimal("Infinity"), x.abs) - x = BigDecimal("-Infinity") - assert_equal(BigDecimal("Infinity"), x.abs) - - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - x = BigDecimal("NaN") - assert_nan(x.abs) - end - - def test_sqrt_bigdecimal - x = BigDecimal("0.09") - assert_in_delta(0.3, x.sqrt(1), 0.001) - x = BigDecimal((2**100).to_s) - y = BigDecimal("1125899906842624") - e = y.exponent - assert_equal(true, (x.sqrt(100) - y).abs < BigDecimal("1E#{e-100}")) - assert_equal(true, (x.sqrt(200) - y).abs < BigDecimal("1E#{e-200}")) - assert_equal(true, (x.sqrt(300) - y).abs < BigDecimal("1E#{e-300}")) - x = BigDecimal("-" + (2**100).to_s) - assert_raise_with_message(FloatDomainError, "sqrt of negative value") { x.sqrt(1) } - x = BigDecimal((2**200).to_s) - assert_equal(2**100, x.sqrt(1)) - - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_raise_with_message(FloatDomainError, "sqrt of 'NaN'(Not a Number)") { BigDecimal("NaN").sqrt(1) } - assert_raise_with_message(FloatDomainError, "sqrt of negative value") { BigDecimal("-Infinity").sqrt(1) } - - assert_equal(0, BigDecimal("0").sqrt(1)) - assert_equal(0, BigDecimal("-0").sqrt(1)) - assert_equal(1, BigDecimal("1").sqrt(1)) - assert_positive_infinite(BigDecimal("Infinity").sqrt(1)) - end - - def test_sqrt_5266 - x = BigDecimal('2' + '0'*100) - assert_equal('0.14142135623730950488016887242096980785696718753769480731', - x.sqrt(56).to_s(56).split(' ')[0]) - assert_equal('0.1414213562373095048801688724209698078569671875376948073', - x.sqrt(55).to_s(55).split(' ')[0]) - - x = BigDecimal('2' + '0'*200) - assert_equal('0.14142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462', - x.sqrt(110).to_s(110).split(' ')[0]) - assert_equal('0.1414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641572735013846', - x.sqrt(109).to_s(109).split(' ')[0]) - end - - def test_fix - x = BigDecimal("1.1") - assert_equal(1, x.fix) - assert_kind_of(BigDecimal, x.fix) - end - - def test_frac - x = BigDecimal("1.1") - assert_equal(0.1, x.frac) - assert_equal(0.1, BigDecimal("0.1").frac) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigDecimal("NaN").frac) - end - - def test_round - assert_equal(3, BigDecimal("3.14159").round) - assert_equal(9, BigDecimal("8.7").round) - assert_equal(3.142, BigDecimal("3.14159").round(3)) - assert_equal(13300.0, BigDecimal("13345.234").round(-2)) - - x = BigDecimal("111.111") - assert_equal(111 , x.round) - assert_equal(111.1 , x.round(1)) - assert_equal(111.11 , x.round(2)) - assert_equal(111.111, x.round(3)) - assert_equal(111.111, x.round(4)) - assert_equal(110 , x.round(-1)) - assert_equal(100 , x.round(-2)) - assert_equal( 0 , x.round(-3)) - assert_equal( 0 , x.round(-4)) - - x = BigDecimal("2.5") - assert_equal(3, x.round(0, BigDecimal::ROUND_UP)) - assert_equal(2, x.round(0, BigDecimal::ROUND_DOWN)) - assert_equal(3, x.round(0, BigDecimal::ROUND_HALF_UP)) - assert_equal(2, x.round(0, BigDecimal::ROUND_HALF_DOWN)) - assert_equal(2, x.round(0, BigDecimal::ROUND_HALF_EVEN)) - assert_equal(3, x.round(0, BigDecimal::ROUND_CEILING)) - assert_equal(2, x.round(0, BigDecimal::ROUND_FLOOR)) - assert_raise(ArgumentError) { x.round(0, 256) } - - x = BigDecimal("-2.5") - assert_equal(-3, x.round(0, BigDecimal::ROUND_UP)) - assert_equal(-2, x.round(0, BigDecimal::ROUND_DOWN)) - assert_equal(-3, x.round(0, BigDecimal::ROUND_HALF_UP)) - assert_equal(-2, x.round(0, BigDecimal::ROUND_HALF_DOWN)) - assert_equal(-2, x.round(0, BigDecimal::ROUND_HALF_EVEN)) - assert_equal(-2, x.round(0, BigDecimal::ROUND_CEILING)) - assert_equal(-3, x.round(0, BigDecimal::ROUND_FLOOR)) - - ROUNDING_MODE_MAP.each do |const, sym| - assert_equal(x.round(0, const), x.round(0, sym)) - end - - bug3803 = '[ruby-core:32136]' - 15.times do |n| - x = BigDecimal("5#{'0'*n}1") - assert_equal(10**(n+2), x.round(-(n+2), BigDecimal::ROUND_HALF_DOWN), bug3803) - assert_equal(10**(n+2), x.round(-(n+2), BigDecimal::ROUND_HALF_EVEN), bug3803) - x = BigDecimal("0.5#{'0'*n}1") - assert_equal(1, x.round(0, BigDecimal::ROUND_HALF_DOWN), bug3803) - assert_equal(1, x.round(0, BigDecimal::ROUND_HALF_EVEN), bug3803) - x = BigDecimal("-0.5#{'0'*n}1") - assert_equal(-1, x.round(0, BigDecimal::ROUND_HALF_DOWN), bug3803) - assert_equal(-1, x.round(0, BigDecimal::ROUND_HALF_EVEN), bug3803) - end - - assert_instance_of(Integer, x.round) - assert_instance_of(Integer, x.round(0)) - assert_instance_of(Integer, x.round(-1)) - assert_instance_of(BigDecimal, x.round(1)) - end - - def test_round_half_even - assert_equal(BigDecimal('12.0'), BigDecimal('12.5').round(half: :even)) - assert_equal(BigDecimal('14.0'), BigDecimal('13.5').round(half: :even)) - - assert_equal(BigDecimal('2.2'), BigDecimal('2.15').round(1, half: :even)) - assert_equal(BigDecimal('2.2'), BigDecimal('2.25').round(1, half: :even)) - assert_equal(BigDecimal('2.4'), BigDecimal('2.35').round(1, half: :even)) - - assert_equal(BigDecimal('-2.2'), BigDecimal('-2.15').round(1, half: :even)) - assert_equal(BigDecimal('-2.2'), BigDecimal('-2.25').round(1, half: :even)) - assert_equal(BigDecimal('-2.4'), BigDecimal('-2.35').round(1, half: :even)) - - assert_equal(BigDecimal('7.1364'), BigDecimal('7.13645').round(4, half: :even)) - assert_equal(BigDecimal('7.1365'), BigDecimal('7.1364501').round(4, half: :even)) - assert_equal(BigDecimal('7.1364'), BigDecimal('7.1364499').round(4, half: :even)) - - assert_equal(BigDecimal('-7.1364'), BigDecimal('-7.13645').round(4, half: :even)) - assert_equal(BigDecimal('-7.1365'), BigDecimal('-7.1364501').round(4, half: :even)) - assert_equal(BigDecimal('-7.1364'), BigDecimal('-7.1364499').round(4, half: :even)) - end - - def test_round_half_up - assert_equal(BigDecimal('13.0'), BigDecimal('12.5').round(half: :up)) - assert_equal(BigDecimal('14.0'), BigDecimal('13.5').round(half: :up)) - - assert_equal(BigDecimal('2.2'), BigDecimal('2.15').round(1, half: :up)) - assert_equal(BigDecimal('2.3'), BigDecimal('2.25').round(1, half: :up)) - assert_equal(BigDecimal('2.4'), BigDecimal('2.35').round(1, half: :up)) - - assert_equal(BigDecimal('-2.2'), BigDecimal('-2.15').round(1, half: :up)) - assert_equal(BigDecimal('-2.3'), BigDecimal('-2.25').round(1, half: :up)) - assert_equal(BigDecimal('-2.4'), BigDecimal('-2.35').round(1, half: :up)) - - assert_equal(BigDecimal('7.1365'), BigDecimal('7.13645').round(4, half: :up)) - assert_equal(BigDecimal('7.1365'), BigDecimal('7.1364501').round(4, half: :up)) - assert_equal(BigDecimal('7.1364'), BigDecimal('7.1364499').round(4, half: :up)) - - assert_equal(BigDecimal('-7.1365'), BigDecimal('-7.13645').round(4, half: :up)) - assert_equal(BigDecimal('-7.1365'), BigDecimal('-7.1364501').round(4, half: :up)) - assert_equal(BigDecimal('-7.1364'), BigDecimal('-7.1364499').round(4, half: :up)) - end - - def test_round_half_down - assert_equal(BigDecimal('12.0'), BigDecimal('12.5').round(half: :down)) - assert_equal(BigDecimal('13.0'), BigDecimal('13.5').round(half: :down)) - - assert_equal(BigDecimal('2.1'), BigDecimal('2.15').round(1, half: :down)) - assert_equal(BigDecimal('2.2'), BigDecimal('2.25').round(1, half: :down)) - assert_equal(BigDecimal('2.3'), BigDecimal('2.35').round(1, half: :down)) - - assert_equal(BigDecimal('-2.1'), BigDecimal('-2.15').round(1, half: :down)) - assert_equal(BigDecimal('-2.2'), BigDecimal('-2.25').round(1, half: :down)) - assert_equal(BigDecimal('-2.3'), BigDecimal('-2.35').round(1, half: :down)) - - assert_equal(BigDecimal('7.1364'), BigDecimal('7.13645').round(4, half: :down)) - assert_equal(BigDecimal('7.1365'), BigDecimal('7.1364501').round(4, half: :down)) - assert_equal(BigDecimal('7.1364'), BigDecimal('7.1364499').round(4, half: :down)) - - assert_equal(BigDecimal('-7.1364'), BigDecimal('-7.13645').round(4, half: :down)) - assert_equal(BigDecimal('-7.1365'), BigDecimal('-7.1364501').round(4, half: :down)) - assert_equal(BigDecimal('-7.1364'), BigDecimal('-7.1364499').round(4, half: :down)) - end - - def test_round_half_nil - x = BigDecimal("2.5") - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_UP) - assert_equal(3, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_DOWN) - assert_equal(2, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP) - assert_equal(3, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_DOWN) - assert_equal(2, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - assert_equal(2, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_CEILING) - assert_equal(3, x.round(0, half: nil)) - end - - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_FLOOR) - assert_equal(2, x.round(0, half: nil)) - end - end - - def test_round_half_invalid_option - assert_raise_with_message(ArgumentError, "invalid rounding mode (upp)") do - BigDecimal('12.5').round(half: :upp) - end - assert_raise_with_message(ArgumentError, "invalid rounding mode (evenn)") do - BigDecimal('2.15').round(1, half: :evenn) - end - assert_raise_with_message(ArgumentError, "invalid rounding mode (downn)") do - BigDecimal('2.15').round(1, half: :downn) - end - assert_raise_with_message(ArgumentError, "invalid rounding mode (42)") do - BigDecimal('2.15').round(1, half: 42) - end - end - - def test_truncate - assert_equal(3, BigDecimal("3.14159").truncate) - assert_equal(8, BigDecimal("8.7").truncate) - assert_equal(3.141, BigDecimal("3.14159").truncate(3)) - assert_equal(13300.0, BigDecimal("13345.234").truncate(-2)) - - assert_equal(-3, BigDecimal("-3.14159").truncate) - assert_equal(-8, BigDecimal("-8.7").truncate) - assert_equal(-3.141, BigDecimal("-3.14159").truncate(3)) - assert_equal(-13300.0, BigDecimal("-13345.234").truncate(-2)) - end - - def test_floor - assert_equal(3, BigDecimal("3.14159").floor) - assert_equal(-10, BigDecimal("-9.1").floor) - assert_equal(3.141, BigDecimal("3.14159").floor(3)) - assert_equal(13300.0, BigDecimal("13345.234").floor(-2)) - end - - def test_ceil - assert_equal(4, BigDecimal("3.14159").ceil) - assert_equal(-9, BigDecimal("-9.1").ceil) - assert_equal(3.142, BigDecimal("3.14159").ceil(3)) - assert_equal(13400.0, BigDecimal("13345.234").ceil(-2)) - end - - def test_to_s - assert_equal('-123.45678 90123 45678 9', BigDecimal('-123.45678901234567890').to_s('5F')) - assert_equal('+123.45678901 23456789', BigDecimal('123.45678901234567890').to_s('+8F')) - assert_equal(' 123.4567890123456789', BigDecimal('123.45678901234567890').to_s(' F')) - assert_equal('0.1234567890123456789e3', BigDecimal('123.45678901234567890').to_s) - assert_equal('0.12345 67890 12345 6789e3', BigDecimal('123.45678901234567890').to_s(5)) - end - - def test_split - x = BigDecimal('-123.45678901234567890') - assert_equal([-1, "1234567890123456789", 10, 3], x.split) - assert_equal([1, "0", 10, 0], BigDecimal("0").split) - assert_equal([-1, "0", 10, 0], BigDecimal("-0").split) - - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_equal([0, "NaN", 10, 0], BigDecimal("NaN").split) - assert_equal([1, "Infinity", 10, 0], BigDecimal("Infinity").split) - assert_equal([-1, "Infinity", 10, 0], BigDecimal("-Infinity").split) - end - - def test_exponent - x = BigDecimal('-123.45678901234567890') - assert_equal(3, x.exponent) - end - - def test_inspect - assert_equal("0.123456789012e0", BigDecimal("0.123456789012").inspect) - assert_equal("0.123456789012e4", BigDecimal("1234.56789012").inspect) - assert_equal("0.123456789012e-4", BigDecimal("0.0000123456789012").inspect) - end - - def test_power - assert_nothing_raised(TypeError, '[ruby-core:47632]') do - 1000.times { BigDecimal('1001.10')**0.75 } - end - end - - def test_power_with_nil - assert_raise(TypeError) do - BigDecimal(3) ** nil - end - end - - def test_power_of_nan - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigDecimal::NAN ** 0) - assert_nan(BigDecimal::NAN ** 1) - assert_nan(BigDecimal::NAN ** 42) - assert_nan(BigDecimal::NAN ** -42) - assert_nan(BigDecimal::NAN ** 42.0) - assert_nan(BigDecimal::NAN ** -42.0) - assert_nan(BigDecimal::NAN ** BigDecimal(42)) - assert_nan(BigDecimal::NAN ** BigDecimal(-42)) - assert_nan(BigDecimal::NAN ** BigDecimal::INFINITY) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_nan(BigDecimal::NAN ** (-BigDecimal::INFINITY)) - end - end - end - - def test_power_with_Bignum - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_equal(0, BigDecimal(0) ** (2**100)) - - assert_positive_infinite(BigDecimal(0) ** -(2**100)) - assert_positive_infinite((-BigDecimal(0)) ** -(2**100)) - assert_negative_infinite((-BigDecimal(0)) ** -(2**100 + 1)) - - assert_equal(1, BigDecimal(1) ** (2**100)) - - assert_positive_infinite(BigDecimal(3) ** (2**100)) - assert_positive_zero(BigDecimal(3) ** (-2**100)) - - assert_negative_infinite(BigDecimal(-3) ** (2**100)) - assert_positive_infinite(BigDecimal(-3) ** (2**100 + 1)) - assert_negative_zero(BigDecimal(-3) ** (-2**100)) - assert_positive_zero(BigDecimal(-3) ** (-2**100 - 1)) - - assert_positive_zero(BigDecimal(0.5, Float::DIG) ** (2**100)) - assert_positive_infinite(BigDecimal(0.5, Float::DIG) ** (-2**100)) - - assert_negative_zero(BigDecimal(-0.5, Float::DIG) ** (2**100)) - assert_positive_zero(BigDecimal(-0.5, Float::DIG) ** (2**100 - 1)) - assert_negative_infinite(BigDecimal(-0.5, Float::DIG) ** (-2**100)) - assert_positive_infinite(BigDecimal(-0.5, Float::DIG) ** (-2**100 - 1)) - end - end - - def test_power_with_BigDecimal - assert_nothing_raised do - assert_in_delta(3 ** 3, BigDecimal(3) ** BigDecimal(3)) - end - end - - def test_power_of_finite_with_zero - x = BigDecimal(1) - assert_equal(1, x ** 0) - assert_equal(1, x ** 0.quo(1)) - assert_equal(1, x ** 0.0) - assert_equal(1, x ** BigDecimal(0)) - - x = BigDecimal(42) - assert_equal(1, x ** 0) - assert_equal(1, x ** 0.quo(1)) - assert_equal(1, x ** 0.0) - assert_equal(1, x ** BigDecimal(0)) - - x = BigDecimal(-42) - assert_equal(1, x ** 0) - assert_equal(1, x ** 0.quo(1)) - assert_equal(1, x ** 0.0) - assert_equal(1, x ** BigDecimal(0)) - end - - def test_power_of_three - x = BigDecimal(3) - assert_equal(81, x ** 4) - assert_equal(1.quo(81), x ** -4) - assert_in_delta(1.0/81, x ** -4) - end - - def test_power_of_zero - zero = BigDecimal(0) - assert_equal(0, zero ** 4) - assert_equal(0, zero ** 4.quo(1)) - assert_equal(0, zero ** 4.0) - assert_equal(0, zero ** BigDecimal(4)) - assert_equal(1, zero ** 0) - assert_equal(1, zero ** 0.quo(1)) - assert_equal(1, zero ** 0.0) - assert_equal(1, zero ** BigDecimal(0)) - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - assert_positive_infinite(zero ** -1) - assert_positive_infinite(zero ** -1.quo(1)) - assert_positive_infinite(zero ** -1.0) - assert_positive_infinite(zero ** BigDecimal(-1)) - - m_zero = BigDecimal("-0") - assert_negative_infinite(m_zero ** -1) - assert_negative_infinite(m_zero ** -1.quo(1)) - assert_negative_infinite(m_zero ** -1.0) - assert_negative_infinite(m_zero ** BigDecimal(-1)) - assert_positive_infinite(m_zero ** -2) - assert_positive_infinite(m_zero ** -2.quo(1)) - assert_positive_infinite(m_zero ** -2.0) - assert_positive_infinite(m_zero ** BigDecimal(-2)) - end - end - - def test_power_of_positive_infinity - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - assert_positive_infinite(BigDecimal::INFINITY ** 3) - assert_positive_infinite(BigDecimal::INFINITY ** 3.quo(1)) - assert_positive_infinite(BigDecimal::INFINITY ** 3.0) - assert_positive_infinite(BigDecimal::INFINITY ** BigDecimal(3)) - assert_positive_infinite(BigDecimal::INFINITY ** 2) - assert_positive_infinite(BigDecimal::INFINITY ** 2.quo(1)) - assert_positive_infinite(BigDecimal::INFINITY ** 2.0) - assert_positive_infinite(BigDecimal::INFINITY ** BigDecimal(2)) - assert_positive_infinite(BigDecimal::INFINITY ** 1) - assert_positive_infinite(BigDecimal::INFINITY ** 1.quo(1)) - assert_positive_infinite(BigDecimal::INFINITY ** 1.0) - assert_positive_infinite(BigDecimal::INFINITY ** BigDecimal(1)) - assert_equal(1, BigDecimal::INFINITY ** 0) - assert_equal(1, BigDecimal::INFINITY ** 0.quo(1)) - assert_equal(1, BigDecimal::INFINITY ** 0.0) - assert_equal(1, BigDecimal::INFINITY ** BigDecimal(0)) - assert_positive_zero(BigDecimal::INFINITY ** -1) - assert_positive_zero(BigDecimal::INFINITY ** -1.quo(1)) - assert_positive_zero(BigDecimal::INFINITY ** -1.0) - assert_positive_zero(BigDecimal::INFINITY ** BigDecimal(-1)) - assert_positive_zero(BigDecimal::INFINITY ** -2) - assert_positive_zero(BigDecimal::INFINITY ** -2.0) - assert_positive_zero(BigDecimal::INFINITY ** BigDecimal(-2)) - end - end - - def test_power_of_negative_infinity - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - assert_negative_infinite((-BigDecimal::INFINITY) ** 3) - assert_negative_infinite((-BigDecimal::INFINITY) ** 3.quo(1)) - assert_negative_infinite((-BigDecimal::INFINITY) ** 3.0) - assert_negative_infinite((-BigDecimal::INFINITY) ** BigDecimal(3)) - assert_positive_infinite((-BigDecimal::INFINITY) ** 2) - assert_positive_infinite((-BigDecimal::INFINITY) ** 2.quo(1)) - assert_positive_infinite((-BigDecimal::INFINITY) ** 2.0) - assert_positive_infinite((-BigDecimal::INFINITY) ** BigDecimal(2)) - assert_negative_infinite((-BigDecimal::INFINITY) ** 1) - assert_negative_infinite((-BigDecimal::INFINITY) ** 1.quo(1)) - assert_negative_infinite((-BigDecimal::INFINITY) ** 1.0) - assert_negative_infinite((-BigDecimal::INFINITY) ** BigDecimal(1)) - assert_equal(1, (-BigDecimal::INFINITY) ** 0) - assert_equal(1, (-BigDecimal::INFINITY) ** 0.quo(1)) - assert_equal(1, (-BigDecimal::INFINITY) ** 0.0) - assert_equal(1, (-BigDecimal::INFINITY) ** BigDecimal(0)) - assert_negative_zero((-BigDecimal::INFINITY) ** -1) - assert_negative_zero((-BigDecimal::INFINITY) ** -1.quo(1)) - assert_negative_zero((-BigDecimal::INFINITY) ** -1.0) - assert_negative_zero((-BigDecimal::INFINITY) ** BigDecimal(-1)) - assert_positive_zero((-BigDecimal::INFINITY) ** -2) - assert_positive_zero((-BigDecimal::INFINITY) ** -2.quo(1)) - assert_positive_zero((-BigDecimal::INFINITY) ** -2.0) - assert_positive_zero((-BigDecimal::INFINITY) ** BigDecimal(-2)) - end - end - - def test_power_without_prec - pi = BigDecimal("3.14159265358979323846264338327950288419716939937511") - e = BigDecimal("2.71828182845904523536028747135266249775724709369996") - pow = BigDecimal("0.2245915771836104547342715220454373502758931513399678438732330680117143493477164265678321738086407229773690574073268002736527e2") - assert_equal(pow, pi.power(e)) - - n = BigDecimal("2222") - assert_equal(BigDecimal("0.5171353084572525892492416e12"), (n ** 3.5)) - assert_equal(BigDecimal("0.517135308457252592e12"), (n ** 3.5r)) - assert_equal(BigDecimal("0.517135308457252589249241582e12"), (n ** BigDecimal("3.5",15))) - end - - def test_power_with_prec - pi = BigDecimal("3.14159265358979323846264338327950288419716939937511") - e = BigDecimal("2.71828182845904523536028747135266249775724709369996") - pow = BigDecimal("22.459157718361045473") - assert_equal(pow, pi.power(e, 20)) - - b = BigDecimal('1.034482758620689655172413793103448275862068965517241379310344827586206896551724') - assert_equal(BigDecimal('0.114523E1'), b.power(4, 5), '[Bug #8818] [ruby-core:56802]') - end - - def test_limit - BigDecimal.save_limit do - BigDecimal.limit(1) - x = BigDecimal("3") - assert_equal(90, x ** 4) # OK? must it be 80? - # 3 * 3 * 3 * 3 = 10 * 3 * 3 = 30 * 3 = 90 ??? - assert_raise(ArgumentError) { BigDecimal.limit(-1) } - - bug7458 = '[ruby-core:50269] [#7458]' - one = BigDecimal('1') - epsilon = BigDecimal('0.7E-18') - - BigDecimal.limit(0) - assert_equal(BigDecimal("1.0000000000000000007"), one + epsilon, "limit(0) #{bug7458}") - - 1.upto(18) do |lim| - BigDecimal.limit(lim) - assert_equal(BigDecimal("1.0"), one + epsilon, "limit(#{lim}) #{bug7458}") - end - - BigDecimal.limit(19) - assert_equal(BigDecimal("1.000000000000000001"), one + epsilon, "limit(19) #{bug7458}") - - BigDecimal.limit(20) - assert_equal(BigDecimal("1.0000000000000000007"), one + epsilon, "limit(20) #{bug7458}") - end - end - - def test_sign - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false) - - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal("0").sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal("-0").sign) - assert_equal(BigDecimal::SIGN_POSITIVE_FINITE, BigDecimal("1").sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_FINITE, BigDecimal("-1").sign) - assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, (BigDecimal("1") / 0).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_INFINITE, (BigDecimal("-1") / 0).sign) - assert_equal(BigDecimal::SIGN_NaN, (BigDecimal("0") / 0).sign) - end - - def test_inf - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - inf = BigDecimal("Infinity") - - assert_equal(inf, inf + inf) - assert_nan((inf + (-inf))) - assert_nan((inf - inf)) - assert_equal(inf, inf - (-inf)) - assert_equal(inf, inf * inf) - assert_nan((inf / inf)) - - assert_equal(inf, inf + 1) - assert_equal(inf, inf - 1) - assert_equal(inf, inf * 1) - assert_nan((inf * 0)) - assert_equal(inf, inf / 1) - - assert_equal(inf, 1 + inf) - assert_equal(-inf, 1 - inf) - assert_equal(inf, 1 * inf) - assert_equal(-inf, -1 * inf) - assert_nan((0 * inf)) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (1 / inf).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (-1 / inf).sign) - end - - def assert_equal_us_ascii_string(a, b) - assert_equal(a, b) - assert_equal(Encoding::US_ASCII, b.encoding) - end - - def test_to_special_string - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - nan = BigDecimal("NaN") - assert_equal_us_ascii_string("NaN", nan.to_s) - inf = BigDecimal("Infinity") - assert_equal_us_ascii_string("Infinity", inf.to_s) - assert_equal_us_ascii_string(" Infinity", inf.to_s(" ")) - assert_equal_us_ascii_string("+Infinity", inf.to_s("+")) - assert_equal_us_ascii_string("-Infinity", (-inf).to_s) - pzero = BigDecimal("0") - assert_equal_us_ascii_string("0.0", pzero.to_s) - assert_equal_us_ascii_string(" 0.0", pzero.to_s(" ")) - assert_equal_us_ascii_string("+0.0", pzero.to_s("+")) - assert_equal_us_ascii_string("-0.0", (-pzero).to_s) - end - - def test_to_string - assert_equal_us_ascii_string("0.01", BigDecimal("0.01").to_s("F")) - s = "0." + "0" * 100 + "1" - assert_equal_us_ascii_string(s, BigDecimal(s).to_s("F")) - s = "1" + "0" * 100 + ".0" - assert_equal_us_ascii_string(s, BigDecimal(s).to_s("F")) - end - - def test_ctov - assert_equal(0.1, BigDecimal("1E-1")) - assert_equal(10, BigDecimal("1E+1")) - assert_equal(1, BigDecimal("+1")) - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - - assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, BigDecimal("1E1" + "0" * 10000).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_INFINITE, BigDecimal("-1E1" + "0" * 10000).sign) - assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal("1E-1" + "0" * 10000).sign) - assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal("-1E-1" + "0" * 10000).sign) - end - - def test_split_under_gc_stress - bug3258 = '[ruby-dev:41213]' - expect = 10.upto(20).map{|i|[1, "1", 10, i+1].inspect} - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, expect, [], bug3258) - GC.stress = true - 10.upto(20) do |i| - p BigDecimal("1"+"0"*i).split - end - EOS - end - - def test_coerce_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) - expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" - b = BigDecimal("1") - GC.stress = true - 10.times do - begin - b.coerce(:too_long_to_embed_as_string) - rescue => e - raise unless e.is_a?(TypeError) - raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect - end - end - EOS - end - - def test_INFINITY - assert_positive_infinite(BigDecimal::INFINITY) - end - - def test_NAN - assert_nan(BigDecimal::NAN) - end - - def test_exp_with_zero_precision - assert_raise(ArgumentError) do - BigMath.exp(1, 0) - end - end - - def test_exp_with_negative_precision - assert_raise(ArgumentError) do - BigMath.exp(1, -42) - end - end - - def test_exp_with_complex - assert_raise(ArgumentError) do - BigMath.exp(Complex(1, 2), 20) - end - end - - def test_exp_with_negative - x = BigDecimal(-1) - y = BigMath.exp(x, 20) - assert_equal(y, BigMath.exp(-1, 20)) - assert_equal(BigDecimal(-1), x) - end - - def test_exp_with_negative_infinite - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_equal(0, BigMath.exp(-BigDecimal::INFINITY, 20)) - end - end - - def test_exp_with_positive_infinite - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert(BigMath.exp(BigDecimal::INFINITY, 20) > 0) - assert_positive_infinite(BigMath.exp(BigDecimal::INFINITY, 20)) - end - end - - def test_exp_with_nan - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigMath.exp(BigDecimal::NAN, 20)) - end - end - - def test_exp_with_1 - assert_in_epsilon(Math::E, BigMath.exp(1, 20)) - end - - def test_BigMath_exp - prec = 20 - assert_in_epsilon(Math.exp(20), BigMath.exp(BigDecimal("20"), prec)) - assert_in_epsilon(Math.exp(40), BigMath.exp(BigDecimal("40"), prec)) - assert_in_epsilon(Math.exp(-20), BigMath.exp(BigDecimal("-20"), prec)) - assert_in_epsilon(Math.exp(-40), BigMath.exp(BigDecimal("-40"), prec)) - end - - def test_BigMath_exp_with_float - prec = 20 - assert_in_epsilon(Math.exp(20), BigMath.exp(20.0, prec)) - assert_in_epsilon(Math.exp(40), BigMath.exp(40.0, prec)) - assert_in_epsilon(Math.exp(-20), BigMath.exp(-20.0, prec)) - assert_in_epsilon(Math.exp(-40), BigMath.exp(-40.0, prec)) - end - - def test_BigMath_exp_with_fixnum - prec = 20 - assert_in_epsilon(Math.exp(20), BigMath.exp(20, prec)) - assert_in_epsilon(Math.exp(40), BigMath.exp(40, prec)) - assert_in_epsilon(Math.exp(-20), BigMath.exp(-20, prec)) - assert_in_epsilon(Math.exp(-40), BigMath.exp(-40, prec)) - end - - def test_BigMath_exp_with_rational - prec = 20 - assert_in_epsilon(Math.exp(20), BigMath.exp(Rational(40,2), prec)) - assert_in_epsilon(Math.exp(40), BigMath.exp(Rational(80,2), prec)) - assert_in_epsilon(Math.exp(-20), BigMath.exp(Rational(-40,2), prec)) - assert_in_epsilon(Math.exp(-40), BigMath.exp(Rational(-80,2), prec)) - end - - def test_BigMath_exp_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) - expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" - 10.times do - begin - BigMath.exp(:too_long_to_embed_as_string, 6) - rescue => e - raise unless e.is_a?(ArgumentError) - raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect - end - end - EOS - end - - def test_BigMath_log_with_string - assert_raise(ArgumentError) do - BigMath.log("foo", 20) - end - end - - def test_BigMath_log_with_nil - assert_raise(ArgumentError) do - BigMath.log(nil, 20) - end - end - - def test_BigMath_log_with_non_integer_precision - assert_raise(ArgumentError) do - BigMath.log(1, 0.5) - end - end - - def test_BigMath_log_with_nil_precision - assert_raise(ArgumentError) do - BigMath.log(1, nil) - end - end - - def test_BigMath_log_with_complex - assert_raise(Math::DomainError) do - BigMath.log(Complex(1, 2), 20) - end - end - - def test_BigMath_log_with_zero_arg - assert_raise(Math::DomainError) do - BigMath.log(0, 20) - end - end - - def test_BigMath_log_with_negative_arg - assert_raise(Math::DomainError) do - BigMath.log(-1, 20) - end - end - - def test_BigMath_log_with_zero_precision - assert_raise(ArgumentError) do - BigMath.log(1, 0) - end - end - - def test_BigMath_log_with_negative_precision - assert_raise(ArgumentError) do - BigMath.log(1, -42) - end - end - - def test_BigMath_log_with_negative_infinite - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert_raise(Math::DomainError) do - BigMath.log(-BigDecimal::INFINITY, 20) - end - end - end - - def test_BigMath_log_with_positive_infinite - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - assert(BigMath.log(BigDecimal::INFINITY, 20) > 0) - assert_positive_infinite(BigMath.log(BigDecimal::INFINITY, 20)) - end - end - - def test_BigMath_log_with_nan - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigMath.log(BigDecimal::NAN, 20)) - end - end - - def test_BigMath_log_with_float_nan - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - assert_nan(BigMath.log(Float::NAN, 20)) - end - end - - def test_BigMath_log_with_1 - assert_in_delta(0.0, BigMath.log(1, 20)) - assert_in_delta(0.0, BigMath.log(1.0, 20)) - assert_in_delta(0.0, BigMath.log(BigDecimal(1), 20)) - end - - def test_BigMath_log_with_exp_1 - assert_in_delta(1.0, BigMath.log(BigMath.E(10), 10)) - end - - def test_BigMath_log_with_2 - assert_in_delta(Math.log(2), BigMath.log(2, 20)) - assert_in_delta(Math.log(2), BigMath.log(2.0, 20)) - assert_in_delta(Math.log(2), BigMath.log(BigDecimal(2), 20)) - end - - def test_BigMath_log_with_square_of_E - assert_in_delta(2, BigMath.log(BigMath.E(20)**2, 20)) - end - - def test_BigMath_log_with_high_precision_case - e = BigDecimal('2.71828182845904523536028747135266249775724709369996') - e_3 = e.mult(e, 50).mult(e, 50) - log_3 = BigMath.log(e_3, 50) - assert_in_delta(3, log_3, 0.0000000000_0000000000_0000000000_0000000000_0000000001) - end - - def test_BigMath_log_with_42 - assert_in_delta(Math.log(42), BigMath.log(42, 20)) - assert_in_delta(Math.log(42), BigMath.log(42.0, 20)) - assert_in_delta(Math.log(42), BigMath.log(BigDecimal(42), 20)) - end - - def test_BigMath_log_with_101 - # this is mainly a performance test (should be very fast, not the 0.3 s) - assert_in_delta(Math.log(101), BigMath.log(101, 20), 1E-15) - end - - def test_BigMath_log_with_reciprocal_of_42 - assert_in_delta(Math.log(1e-42), BigMath.log(1e-42, 20)) - assert_in_delta(Math.log(1e-42), BigMath.log(BigDecimal("1e-42"), 20)) - end - - def test_BigMath_log_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) - expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" - 10.times do - begin - BigMath.log(:too_long_to_embed_as_string, 6) - rescue => e - raise unless e.is_a?(ArgumentError) - raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect - end - end - EOS - end - - def test_frozen_p - x = BigDecimal(1) - assert(x.frozen?) - assert((x + x).frozen?) - end - - def test_clone - assert_warning(/^$/) do - x = BigDecimal(0) - assert_same(x, x.clone) - end - end - - def test_dup - assert_warning(/^$/) do - [1, -1, 2**100, -2**100].each do |i| - x = BigDecimal(i) - assert_same(x, x.dup) - end - end - end - - def test_new_subclass - c = Class.new(BigDecimal) - assert_raise_with_message(NoMethodError, /undefined method `new'/) { c.new(1) } - end - - def test_to_d - bug6093 = '[ruby-core:42969]' - code = "exit(BigDecimal('10.0') == 10.0.to_d)" - assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093) - end if RUBY_VERSION < '2.5' # mathn was removed from Ruby 2.5 - - def test_bug6406 - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) - Thread.current.keys.to_s - EOS - end - - def test_precision_only_integer - assert_equal(0, BigDecimal(0).precision) - assert_equal(1, BigDecimal(1).precision) - assert_equal(1, BigDecimal(-1).precision) - assert_equal(2, BigDecimal(10).precision) - assert_equal(2, BigDecimal(-10).precision) - assert_equal(9, BigDecimal(100_000_000).precision) - assert_equal(9, BigDecimal(-100_000_000).precision) - assert_equal(12, BigDecimal(100_000_000_000).precision) - assert_equal(12, BigDecimal(-100_000_000_000).precision) - assert_equal(21, BigDecimal(100_000_000_000_000_000_000).precision) - assert_equal(21, BigDecimal(-100_000_000_000_000_000_000).precision) - assert_equal(103, BigDecimal("111e100").precision) - assert_equal(103, BigDecimal("-111e100").precision) - end - - def test_precision_only_fraction - assert_equal(1, BigDecimal("0.1").precision) - assert_equal(1, BigDecimal("-0.1").precision) - assert_equal(2, BigDecimal("0.01").precision) - assert_equal(2, BigDecimal("-0.01").precision) - assert_equal(2, BigDecimal("0.11").precision) - assert_equal(2, BigDecimal("-0.11").precision) - assert_equal(9, BigDecimal("0.000_000_001").precision) - assert_equal(9, BigDecimal("-0.000_000_001").precision) - assert_equal(10, BigDecimal("0.000_000_000_1").precision) - assert_equal(10, BigDecimal("-0.000_000_000_1").precision) - assert_equal(21, BigDecimal("0.000_000_000_000_000_000_001").precision) - assert_equal(21, BigDecimal("-0.000_000_000_000_000_000_001").precision) - assert_equal(100, BigDecimal("111e-100").precision) - assert_equal(100, BigDecimal("-111e-100").precision) - end - - def test_precision_full - assert_equal(5, BigDecimal("11111e-2").precision) - assert_equal(5, BigDecimal("-11111e-2").precision) - assert_equal(5, BigDecimal("11111e-2").precision) - assert_equal(5, BigDecimal("-11111e-2").precision) - assert_equal(21, BigDecimal("100.000_000_000_000_000_001").precision) - assert_equal(21, BigDecimal("-100.000_000_000_000_000_001").precision) - end - - def test_precision_special - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(0, BigDecimal("Infinity").precision) - assert_equal(0, BigDecimal("-Infinity").precision) - assert_equal(0, BigDecimal("NaN").precision) - end - end - - def test_scale_only_integer - assert_equal(0, BigDecimal(0).scale) - assert_equal(0, BigDecimal(1).scale) - assert_equal(0, BigDecimal(-1).scale) - assert_equal(0, BigDecimal(10).scale) - assert_equal(0, BigDecimal(-10).scale) - assert_equal(0, BigDecimal(100_000_000).scale) - assert_equal(0, BigDecimal(-100_000_000).scale) - assert_equal(0, BigDecimal(100_000_000_000).scale) - assert_equal(0, BigDecimal(-100_000_000_000).scale) - assert_equal(0, BigDecimal(100_000_000_000_000_000_000).scale) - assert_equal(0, BigDecimal(-100_000_000_000_000_000_000).scale) - assert_equal(0, BigDecimal("111e100").scale) - assert_equal(0, BigDecimal("-111e100").scale) - end - - def test_scale_only_fraction - assert_equal(1, BigDecimal("0.1").scale) - assert_equal(1, BigDecimal("-0.1").scale) - assert_equal(2, BigDecimal("0.01").scale) - assert_equal(2, BigDecimal("-0.01").scale) - assert_equal(2, BigDecimal("0.11").scale) - assert_equal(2, BigDecimal("-0.11").scale) - assert_equal(21, BigDecimal("0.000_000_000_000_000_000_001").scale) - assert_equal(21, BigDecimal("-0.000_000_000_000_000_000_001").scale) - assert_equal(100, BigDecimal("111e-100").scale) - assert_equal(100, BigDecimal("-111e-100").scale) - end - - def test_scale_full - assert_equal(1, BigDecimal("0.1").scale) - assert_equal(1, BigDecimal("-0.1").scale) - assert_equal(2, BigDecimal("0.01").scale) - assert_equal(2, BigDecimal("-0.01").scale) - assert_equal(2, BigDecimal("0.11").scale) - assert_equal(2, BigDecimal("-0.11").scale) - assert_equal(2, BigDecimal("11111e-2").scale) - assert_equal(2, BigDecimal("-11111e-2").scale) - assert_equal(18, BigDecimal("100.000_000_000_000_000_001").scale) - assert_equal(18, BigDecimal("-100.000_000_000_000_000_001").scale) - end - - def test_scale_special - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(0, BigDecimal("Infinity").scale) - assert_equal(0, BigDecimal("-Infinity").scale) - assert_equal(0, BigDecimal("NaN").scale) - end - end - - def test_precision_scale - assert_equal([2, 0], BigDecimal("11.0").precision_scale) - assert_equal([2, 1], BigDecimal("1.1").precision_scale) - assert_equal([2, 2], BigDecimal("0.11").precision_scale) - - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - assert_equal([0, 0], BigDecimal("Infinity").precision_scale) - end - end - - def test_n_significant_digits_only_integer - assert_equal(0, BigDecimal(0).n_significant_digits) - assert_equal(1, BigDecimal(1).n_significant_digits) - assert_equal(1, BigDecimal(-1).n_significant_digits) - assert_equal(1, BigDecimal(10).n_significant_digits) - assert_equal(1, BigDecimal(-10).n_significant_digits) - assert_equal(3, BigDecimal(101).n_significant_digits) - assert_equal(3, BigDecimal(-101).n_significant_digits) - assert_equal(1, BigDecimal(100_000_000_000_000_000_000).n_significant_digits) - assert_equal(1, BigDecimal(-100_000_000_000_000_000_000).n_significant_digits) - assert_equal(21, BigDecimal(100_000_000_000_000_000_001).n_significant_digits) - assert_equal(21, BigDecimal(-100_000_000_000_000_000_001).n_significant_digits) - assert_equal(3, BigDecimal("111e100").n_significant_digits) - assert_equal(3, BigDecimal("-111e100").n_significant_digits) - end - - def test_n_significant_digits_only_fraction - assert_equal(1, BigDecimal("0.1").n_significant_digits) - assert_equal(1, BigDecimal("-0.1").n_significant_digits) - assert_equal(1, BigDecimal("0.01").n_significant_digits) - assert_equal(1, BigDecimal("-0.01").n_significant_digits) - assert_equal(2, BigDecimal("0.11").n_significant_digits) - assert_equal(2, BigDecimal("-0.11").n_significant_digits) - assert_equal(1, BigDecimal("0.000_000_000_000_000_000_001").n_significant_digits) - assert_equal(1, BigDecimal("-0.000_000_000_000_000_000_001").n_significant_digits) - assert_equal(3, BigDecimal("111e-100").n_significant_digits) - assert_equal(3, BigDecimal("-111e-100").n_significant_digits) - end - - def test_n_significant_digits_full - assert_equal(2, BigDecimal("1.1").n_significant_digits) - assert_equal(2, BigDecimal("-1.1").n_significant_digits) - assert_equal(3, BigDecimal("1.01").n_significant_digits) - assert_equal(3, BigDecimal("-1.01").n_significant_digits) - assert_equal(5, BigDecimal("11111e-2").n_significant_digits) - assert_equal(5, BigDecimal("-11111e-2").n_significant_digits) - assert_equal(21, BigDecimal("100.000_000_000_000_000_001").n_significant_digits) - assert_equal(21, BigDecimal("-100.000_000_000_000_000_001").n_significant_digits) - end - - def test_n_significant_digits_special - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - - assert_equal(0, BigDecimal("Infinity").n_significant_digits) - assert_equal(0, BigDecimal("-Infinity").n_significant_digits) - assert_equal(0, BigDecimal("NaN").n_significant_digits) - end - end - - def test_initialize_copy_dup_clone_frozen_error - bd = BigDecimal(1) - bd2 = BigDecimal(2) - err = RUBY_VERSION >= '2.5' ? FrozenError : TypeError - assert_raise(err) { bd.send(:initialize_copy, bd2) } - assert_raise(err) { bd.send(:initialize_clone, bd2) } - assert_raise(err) { bd.send(:initialize_dup, bd2) } - end - - def test_llong_min_gh_200 - # https://github.com/ruby/bigdecimal/issues/199 - # Between LLONG_MIN and -ULLONG_MAX - assert_equal(BigDecimal(LIMITS["LLONG_MIN"].to_s), BigDecimal(LIMITS["LLONG_MIN"]), "[GH-200]") - - minus_ullong_max = -LIMITS["ULLONG_MAX"] - assert_equal(BigDecimal(minus_ullong_max.to_s), BigDecimal(minus_ullong_max), "[GH-200]") - end - - def test_reminder_infinity_gh_187 - # https://github.com/ruby/bigdecimal/issues/187 - BigDecimal.save_exception_mode do - BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false) - BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) - bd = BigDecimal("4.2") - assert_equal(bd.remainder(BigDecimal("+Infinity")), bd) - assert_equal(bd.remainder(BigDecimal("-Infinity")), bd) - end - end - - def assert_no_memory_leak(code, *rest, **opt) - code = "8.times {20_000.times {begin #{code}; rescue NoMemoryError; end}; GC.start}" - super(["-rbigdecimal"], - "b = BigDecimal('10'); b.nil?; " \ - "GC.add_stress_to_class(BigDecimal); "\ - "#{code}", code, *rest, rss: true, limit: 1.1, **opt) - end - - if EnvUtil.gc_stress_to_class? - def test_no_memory_leak_allocate - assert_no_memory_leak("BigDecimal.allocate") - end - - def test_no_memory_leak_initialize - assert_no_memory_leak("BigDecimal()") - end - - def test_no_memory_leak_BigDecimal - assert_no_memory_leak("BigDecimal('10')") - assert_no_memory_leak("BigDecimal(b)") - end - - def test_no_memory_leak_create - assert_no_memory_leak("b + 10") - end - end -end diff --git a/test/mri/bigdecimal/test_bigdecimal_util.rb b/test/mri/bigdecimal/test_bigdecimal_util.rb deleted file mode 100644 index 2f27163ebfa..00000000000 --- a/test/mri/bigdecimal/test_bigdecimal_util.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: false -require_relative "helper" -require 'bigdecimal/util' - -class TestBigDecimalUtil < Test::Unit::TestCase - include TestBigDecimalBase - - def test_BigDecimal_to_d - x = BigDecimal(1) - assert_same(x, x.to_d) - end - - def test_Integer_to_d - assert_equal(BigDecimal(1), 1.to_d) - assert_equal(BigDecimal(2<<100), (2<<100).to_d) - - assert(1.to_d.frozen?) - end - - def test_Float_to_d_without_precision - delta = 1.0/10**(Float::DIG+1) - assert_in_delta(BigDecimal(0.5, 0), 0.5.to_d, delta) - assert_in_delta(BigDecimal(355.0/113.0, 0), (355.0/113.0).to_d, delta) - - assert_equal(9.05, 9.05.to_d.to_f) - assert_equal("9.05", 9.05.to_d.to_s('F')) - - assert_equal("65.6", 65.6.to_d.to_s("F")) - - assert_equal(Math::PI, Math::PI.to_d.to_f) - - bug9214 = '[ruby-core:58858]' - assert_equal((-0.0).to_d.sign, -1, bug9214) - - assert_raise(TypeError) { 0.3.to_d(nil) } - assert_raise(TypeError) { 0.3.to_d(false) } - - assert(1.1.to_d.frozen?) - - assert_equal(BigDecimal("999_999.9999"), 999_999.9999.to_d) - end - - def test_Float_to_d_with_precision - digits = 5 - delta = 1.0/10**(digits) - assert_in_delta(BigDecimal(0.5, 5), 0.5.to_d(digits), delta) - assert_in_delta(BigDecimal(355.0/113.0, 5), (355.0/113.0).to_d(digits), delta) - - bug9214 = '[ruby-core:58858]' - assert_equal((-0.0).to_d(digits).sign, -1, bug9214) - - assert(1.1.to_d(digits).frozen?) - end - - def test_Float_to_d_bug13331 - assert_equal(64.4.to_d, - 1.to_d * 64.4, - "[ruby-core:80234] [Bug #13331]") - - assert_equal((2*Math::PI).to_d, - 2.to_d * Math::PI, - "[ruby-core:80234] [Bug #13331]") - end - - def test_Float_to_d_issue_192 - # https://github.com/ruby/bigdecimal/issues/192 - # https://github.com/rails/rails/pull/42125 - if BASE_FIG == 9 - flo = 1_000_000_000.12345 - big = BigDecimal("0.100000000012345e10") - else # BASE_FIG == 4 - flo = 1_0000.12 - big = BigDecimal("0.1000012e5") - end - assert_equal(flo.to_d, big, "[ruby/bigdecimal#192]") - end - - def test_Rational_to_d - digits = 100 - delta = 1.0/10**(digits) - assert_in_delta(BigDecimal(1.quo(2), digits), 1.quo(2).to_d(digits), delta) - assert_in_delta(BigDecimal(355.quo(113), digits), 355.quo(113).to_d(digits), delta) - - assert(355.quo(113).to_d(digits).frozen?) - end - - def test_Rational_to_d_with_zero_precision - assert_equal(BigDecimal(355.quo(113), 0), 355.quo(113).to_d(0)) - end - - def test_Rational_to_d_with_negative_precision - assert_raise(ArgumentError) { 355.quo(113).to_d(-42) } - end - - def test_Complex_to_d - BigDecimal.save_rounding_mode do - BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN) - - assert_equal(BigDecimal("1"), Complex(1, 0).to_d) - assert_equal(BigDecimal("0.333333333333333333333"), - Complex(1.quo(3), 0).to_d(21)) - assert_equal(BigDecimal("0.1234567"), Complex(0.1234567, 0).to_d) - assert_equal(BigDecimal("0.1235"), Complex(0.1234567, 0).to_d(4)) - - assert_raise_with_message(ArgumentError, "can't omit precision for a Rational.") { Complex(1.quo(3), 0).to_d } - - assert_raise_with_message(ArgumentError, "Unable to make a BigDecimal from non-zero imaginary number") { Complex(1, 1).to_d } - end - end - - def test_String_to_d - assert_equal(BigDecimal('1'), "1__1_1".to_d) - assert_equal(BigDecimal('2.5'), "2.5".to_d) - assert_equal(BigDecimal('2.5'), "2.5 degrees".to_d) - assert_equal(BigDecimal('2.5e1'), "2.5e1 degrees".to_d) - assert_equal(BigDecimal('0'), "degrees 100.0".to_d) - assert_equal(BigDecimal('0.125'), "0.1_2_5".to_d) - assert_equal(BigDecimal('0.125'), "0.1_2_5__".to_d) - assert_equal(BigDecimal('1'), "1_.125".to_d) - assert_equal(BigDecimal('1'), "1._125".to_d) - assert_equal(BigDecimal('0.1'), "0.1__2_5".to_d) - assert_equal(BigDecimal('0.1'), "0.1_e10".to_d) - assert_equal(BigDecimal('0.1'), "0.1e_10".to_d) - assert_equal(BigDecimal('1'), "0.1e1__0".to_d) - assert_equal(BigDecimal('1.2'), "1.2.3".to_d) - assert_equal(BigDecimal('1'), "1.".to_d) - assert_equal(BigDecimal('1'), "1e".to_d) - - assert("2.5".to_d.frozen?) - end - - def test_invalid_String_to_d - assert_equal("invalid".to_d, BigDecimal('0.0')) - end - - def test_Nil_to_d - assert_equal(nil.to_d, BigDecimal('0.0')) - - assert(nil.to_d) - end -end diff --git a/test/mri/bigdecimal/test_bigmath.rb b/test/mri/bigdecimal/test_bigmath.rb deleted file mode 100644 index 5bf1fbf318a..00000000000 --- a/test/mri/bigdecimal/test_bigmath.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: false -require_relative "helper" -require "bigdecimal/math" - -class TestBigMath < Test::Unit::TestCase - include TestBigDecimalBase - include BigMath - N = 20 - PINF = BigDecimal("+Infinity") - MINF = BigDecimal("-Infinity") - NAN = BigDecimal("NaN") - - def test_const - assert_in_delta(Math::PI, PI(N)) - assert_in_delta(Math::E, E(N)) - end - - def test_sqrt - assert_in_delta(2**0.5, sqrt(BigDecimal("2"), N)) - assert_equal(10, sqrt(BigDecimal("100"), N)) - assert_equal(0.0, sqrt(BigDecimal("0"), N)) - assert_equal(0.0, sqrt(BigDecimal("-0"), N)) - assert_raise(FloatDomainError) {sqrt(BigDecimal("-1.0"), N)} - assert_raise(FloatDomainError) {sqrt(NAN, N)} - assert_raise(FloatDomainError) {sqrt(PINF, N)} - end - - def test_sin - assert_in_delta(0.0, sin(BigDecimal("0.0"), N)) - assert_in_delta(Math.sqrt(2.0) / 2, sin(PI(N) / 4, N)) - assert_in_delta(1.0, sin(PI(N) / 2, N)) - assert_in_delta(0.0, sin(PI(N) * 2, N)) - assert_in_delta(0.0, sin(PI(N), N)) - assert_in_delta(-1.0, sin(PI(N) / -2, N)) - assert_in_delta(0.0, sin(PI(N) * -2, N)) - assert_in_delta(0.0, sin(-PI(N), N)) - assert_in_delta(0.0, sin(PI(N) * 21, N)) - assert_in_delta(0.0, sin(PI(N) * 30, N)) - assert_in_delta(-1.0, sin(PI(N) * BigDecimal("301.5"), N)) - end - - def test_cos - assert_in_delta(1.0, cos(BigDecimal("0.0"), N)) - assert_in_delta(Math.sqrt(2.0) / 2, cos(PI(N) / 4, N)) - assert_in_delta(0.0, cos(PI(N) / 2, N)) - assert_in_delta(1.0, cos(PI(N) * 2, N)) - assert_in_delta(-1.0, cos(PI(N), N)) - assert_in_delta(0.0, cos(PI(N) / -2, N)) - assert_in_delta(1.0, cos(PI(N) * -2, N)) - assert_in_delta(-1.0, cos(-PI(N), N)) - assert_in_delta(-1.0, cos(PI(N) * 21, N)) - assert_in_delta(1.0, cos(PI(N) * 30, N)) - assert_in_delta(0.0, cos(PI(N) * BigDecimal("301.5"), N)) - end - - def test_atan - assert_equal(0.0, atan(BigDecimal("0.0"), N)) - assert_in_delta(Math::PI/4, atan(BigDecimal("1.0"), N)) - assert_in_delta(Math::PI/6, atan(sqrt(BigDecimal("3.0"), N) / 3, N)) - assert_in_delta(Math::PI/2, atan(PINF, N)) - assert_equal(BigDecimal("0.823840753418636291769355073102514088959345624027952954058347023122539489"), - atan(BigDecimal("1.08"), 72).round(72), '[ruby-dev:41257]') - end - - def test_log - assert_equal(0, BigMath.log(BigDecimal("1.0"), 10)) - assert_in_epsilon(Math.log(10)*1000, BigMath.log(BigDecimal("1e1000"), 10)) - assert_raise(Math::DomainError) {BigMath.log(BigDecimal("0"), 10)} - assert_raise(Math::DomainError) {BigMath.log(BigDecimal("-1"), 10)} - assert_separately(%w[-rbigdecimal], <<-SRC) - begin - x = BigMath.log(BigDecimal("1E19999999999999"), 10) - rescue FloatDomainError - else - unless x.infinite? - assert_in_epsilon(Math.log(10)*19999999999999, x) - end - end - SRC - end -end diff --git a/test/mri/bigdecimal/test_ractor.rb b/test/mri/bigdecimal/test_ractor.rb deleted file mode 100644 index 798cc494e18..00000000000 --- a/test/mri/bigdecimal/test_ractor.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -require_relative "helper" - -class TestBigDecimalRactor < Test::Unit::TestCase - include TestBigDecimalBase - - def setup - super - omit unless defined? Ractor - end - - def test_ractor_shareable - assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") - begin; - $VERBOSE = nil - require "bigdecimal" - r = Ractor.new BigDecimal(Math::PI, Float::DIG+1) do |pi| - BigDecimal('2.0')*pi - end - assert_equal(2*Math::PI, r.take) - end; - end -end diff --git a/test/mri/cgi/test_cgi_util.rb b/test/mri/cgi/test_cgi_util.rb index a3be193a134..b0612fc87d9 100644 --- a/test/mri/cgi/test_cgi_util.rb +++ b/test/mri/cgi/test_cgi_util.rb @@ -74,6 +74,10 @@ def test_cgi_escapeURIComponent assert_equal('%26%3C%3E%22%20%E3%82%86%E3%82%93%E3%82%86%E3%82%93'.ascii_only?, CGI.escapeURIComponent(@str1).ascii_only?) if defined?(::Encoding) end + def test_cgi_escape_uri_component + assert_equal('%26%3C%3E%22%20%E3%82%86%E3%82%93%E3%82%86%E3%82%93', CGI.escape_uri_component(@str1)) + end + def test_cgi_escapeURIComponent_with_unreserved_characters assert_equal("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", CGI.escapeURIComponent("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"), @@ -101,6 +105,11 @@ def test_cgi_unescapeURIComponent assert_equal("\u{30E1 30E2 30EA 691C 7D22}", CGI.unescapeURIComponent("\u{30E1 30E2 30EA}%E6%A4%9C%E7%B4%A2")) end + def test_cgi_unescape_uri_component + str = CGI.unescape_uri_component('%26%3C%3E%22%20%E3%82%86%E3%82%93%E3%82%86%E3%82%93') + assert_equal(@str1, str) + end + def test_cgi_unescapeURIComponent_preserve_encoding assert_equal(Encoding::US_ASCII, CGI.unescapeURIComponent("%C0%3C%3C".dup.force_encoding("US-ASCII")).encoding) assert_equal(Encoding::ASCII_8BIT, CGI.unescapeURIComponent("%C0%3C%3C".dup.force_encoding("ASCII-8BIT")).encoding) @@ -177,6 +186,22 @@ def test_cgi_unescapeHTML_invalid assert_equal('&<&>"&abcdefghijklmn', CGI.unescapeHTML('&<&>"&abcdefghijklmn')) end + module UnescapeHTMLTests + def test_cgi_unescapeHTML_following_known_first_letter + assert_equal('&a>&q>&l>&g>', CGI.unescapeHTML('&a>&q>&l>&g>')) + end + + def test_cgi_unescapeHTML_following_number_sign + assert_equal('&#>&#x>', CGI.unescapeHTML('&#>&#x>')) + end + + def test_cgi_unescapeHTML_following_invalid_numeric + assert_equal('�>�>', CGI.unescapeHTML('�>�>')) + end + end + + include UnescapeHTMLTests + Encoding.list.each do |enc| begin escaped = "'&"><".encode(enc) @@ -262,7 +287,7 @@ def setup remove_method :escapeHTML alias _unescapeHTML unescapeHTML remove_method :unescapeHTML - end + end if defined?(CGI::Escape) end def teardown @@ -271,9 +296,11 @@ def teardown remove_method :_escapeHTML alias unescapeHTML _unescapeHTML remove_method :_unescapeHTML - end + end if defined?(CGI::Escape) end + include CGIUtilTest::UnescapeHTMLTests + def test_cgi_escapeHTML_with_invalid_byte_sequence assert_equal("<\xA4??>", CGI.escapeHTML(%[<\xA4??>])) end diff --git a/test/mri/coverage/test_coverage.rb b/test/mri/coverage/test_coverage.rb index a2efa0d1c06..16be47b458b 100644 --- a/test/mri/coverage/test_coverage.rb +++ b/test/mri/coverage/test_coverage.rb @@ -165,14 +165,16 @@ def test_eval end def test_eval_coverage - assert_in_out_err(%w[-rcoverage], <<-"end;", ["[1, nil, 1, nil]"], []) + assert_in_out_err(%w[-rcoverage], <<-"end;", ["[1, 1, 1, nil, 0, nil]"], []) Coverage.start(eval: true, lines: true) eval(<<-RUBY, TOPLEVEL_BINDING, "test.rb") - s = String.new - begin - s << "foo - bar".freeze; end + _out = String.new + if _out.empty? + _out << 'Hello World' + else + _out << 'Goodbye World' + end RUBY p Coverage.result["test.rb"][:lines] @@ -181,6 +183,7 @@ def test_eval_coverage def test_coverage_supported assert Coverage.supported?(:lines) + assert Coverage.supported?(:oneshot_lines) assert Coverage.supported?(:branches) assert Coverage.supported?(:methods) assert Coverage.supported?(:eval) @@ -845,9 +848,10 @@ def baz EOS end - cov1 = "[0, 0, nil, nil, 0, 1, nil, nil, 0, 0, nil]" - cov2 = "[0, 0, nil, nil, 0, 1, nil, nil, 0, 1, nil]" - assert_in_out_err(%w[-rcoverage], <<-"end;", [cov1, cov2], []) + assert_separately(%w[-rcoverage], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + cov1 = [0, 0, nil, nil, 0, 1, nil, nil, 0, 0, nil] + cov2 = [0, 0, nil, nil, 0, 1, nil, nil, 0, 1, nil] Coverage.setup tmp = Dir.pwd require tmp + "/test.rb" @@ -856,15 +860,34 @@ def baz bar Coverage.suspend baz - p Coverage.peek_result[tmp + "/test.rb"] + assert_equal cov1, Coverage.peek_result[tmp + "/test.rb"] Coverage.resume baz - p Coverage.result[tmp + "/test.rb"] + assert_equal cov2, Coverage.result[tmp + "/test.rb"] end; - cov1 = "{:lines=>[0, 0, nil, nil, 0, 1, nil, nil, 0, 0, nil], :branches=>{}, :methods=>{[Object, :baz, 9, 12, 11, 15]=>0, [Object, :bar, 5, 12, 7, 15]=>1, [Object, :foo, 1, 12, 3, 15]=>0}}" - cov2 = "{:lines=>[0, 0, nil, nil, 0, 1, nil, nil, 0, 1, nil], :branches=>{}, :methods=>{[Object, :baz, 9, 12, 11, 15]=>1, [Object, :bar, 5, 12, 7, 15]=>1, [Object, :foo, 1, 12, 3, 15]=>0}}" - assert_in_out_err(%w[-rcoverage], <<-"end;", [cov1, cov2], []) + assert_separately(%w[-rcoverage], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + cov1 = { + lines: [0, 0, nil, nil, 0, 1, nil, nil, 0, 0, nil], + branches: {}, + methods: { + [Object, :baz, 9, 12, 11, 15]=>0, + [Object, :bar, 5, 12, 7, 15]=>1, + [Object, :foo, 1, 12, 3, 15]=>0, + } + } + + cov2 = { + lines: [0, 0, nil, nil, 0, 1, nil, nil, 0, 1, nil], + branches: {}, + methods: { + [Object, :baz, 9, 12, 11, 15]=>1, + [Object, :bar, 5, 12, 7, 15]=>1, + [Object, :foo, 1, 12, 3, 15]=>0, + } + } + Coverage.setup(:all) tmp = Dir.pwd require tmp + "/test.rb" @@ -873,15 +896,16 @@ def baz bar Coverage.suspend baz - p Coverage.peek_result[tmp + "/test.rb"] + assert_equal cov1, Coverage.peek_result[tmp + "/test.rb"] Coverage.resume baz - p Coverage.result[tmp + "/test.rb"] + assert_equal cov2, Coverage.result[tmp + "/test.rb"] end; - cov1 = "{:oneshot_lines=>[6]}" - cov2 = "{:oneshot_lines=>[6, 10]}" - assert_in_out_err(%w[-rcoverage], <<-"end;", [cov1, cov2], []) + assert_separately(%w[-rcoverage], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + cov1 = {:oneshot_lines=>[6]} + cov2 = {:oneshot_lines=>[6, 10]} Coverage.setup(oneshot_lines: true) tmp = Dir.pwd require tmp + "/test.rb" @@ -890,10 +914,10 @@ def baz bar Coverage.suspend baz - p Coverage.peek_result[tmp + "/test.rb"] + assert_equal cov1, Coverage.peek_result[tmp + "/test.rb"] Coverage.resume baz - p Coverage.result[tmp + "/test.rb"] + assert_equal cov2, Coverage.result[tmp + "/test.rb"] end; } } diff --git a/test/mri/csv/helper.rb b/test/mri/csv/helper.rb deleted file mode 100644 index 1f9cf969799..00000000000 --- a/test/mri/csv/helper.rb +++ /dev/null @@ -1,42 +0,0 @@ -require "tempfile" -require "test/unit" - -require "csv" - -require_relative "../lib/with_different_ofs" - -module Helper - def with_chunk_size(chunk_size) - chunk_size_keep = ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] - begin - ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] = chunk_size - yield - ensure - ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] = chunk_size_keep - end - end - - def with_verbose(verbose) - original = $VERBOSE - begin - $VERBOSE = verbose - yield - ensure - $VERBOSE = original - end - end - - def with_default_internal(encoding) - original = Encoding.default_internal - begin - with_verbose(false) do - Encoding.default_internal = encoding - end - yield - ensure - with_verbose(false) do - Encoding.default_internal = original - end - end - end -end diff --git a/test/mri/csv/interface/test_delegation.rb b/test/mri/csv/interface/test_delegation.rb deleted file mode 100644 index 349257633bd..00000000000 --- a/test/mri/csv/interface/test_delegation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVInterfaceDelegation < Test::Unit::TestCase - class TestStringIO < self - def setup - @csv = CSV.new("h1,h2") - end - - def test_flock - assert_raise(NotImplementedError) do - @csv.flock(File::LOCK_EX) - end - end - - def test_ioctl - assert_raise(NotImplementedError) do - @csv.ioctl(0) - end - end - - def test_stat - assert_raise(NotImplementedError) do - @csv.stat - end - end - - def test_to_i - assert_raise(NotImplementedError) do - @csv.to_i - end - end - - def test_binmode? - assert_equal(false, @csv.binmode?) - end - - def test_path - assert_equal(nil, @csv.path) - end - - def test_to_io - assert_instance_of(StringIO, @csv.to_io) - end - end -end diff --git a/test/mri/csv/interface/test_read.rb b/test/mri/csv/interface/test_read.rb deleted file mode 100644 index 001177036ab..00000000000 --- a/test/mri/csv/interface/test_read.rb +++ /dev/null @@ -1,381 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVInterfaceRead < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @data = "" - @data << "1\t2\t3\r\n" - @data << "4\t5\r\n" - @input = Tempfile.new(["interface-read", ".csv"], binmode: true) - @input << @data - @input.rewind - @rows = [ - ["1", "2", "3"], - ["4", "5"], - ] - end - - def teardown - @input.close(true) - super - end - - def test_foreach - rows = [] - CSV.foreach(@input.path, col_sep: "\t", row_sep: "\r\n") do |row| - rows << row - end - assert_equal(@rows, rows) - end - - if respond_to?(:ractor) - ractor - def test_foreach_in_ractor - ractor = Ractor.new(@input.path) do |path| - rows = [] - CSV.foreach(path, col_sep: "\t", row_sep: "\r\n") do |row| - rows << row - end - rows - end - rows = [ - ["1", "2", "3"], - ["4", "5"], - ] - assert_equal(rows, ractor.take) - end - end - - def test_foreach_mode - rows = [] - CSV.foreach(@input.path, "r", col_sep: "\t", row_sep: "\r\n") do |row| - rows << row - end - assert_equal(@rows, rows) - end - - def test_foreach_enumerator - rows = CSV.foreach(@input.path, col_sep: "\t", row_sep: "\r\n").to_a - assert_equal(@rows, rows) - end - - def test_closed? - csv = CSV.open(@input.path, "r+", col_sep: "\t", row_sep: "\r\n") - assert_not_predicate(csv, :closed?) - csv.close - assert_predicate(csv, :closed?) - end - - def test_open_auto_close - csv = nil - CSV.open(@input.path) do |_csv| - csv = _csv - end - assert_predicate(csv, :closed?) - end - - def test_open_closed - csv = nil - CSV.open(@input.path) do |_csv| - csv = _csv - csv.close - end - assert_predicate(csv, :closed?) - end - - def test_open_block_return_value - return_value = CSV.open(@input.path) do - "Return value." - end - assert_equal("Return value.", return_value) - end - - def test_open_encoding_valid - # U+1F600 GRINNING FACE - # U+1F601 GRINNING FACE WITH SMILING EYES - File.open(@input.path, "w") do |file| - file << "\u{1F600},\u{1F601}" - end - CSV.open(@input.path, encoding: "utf-8") do |csv| - assert_equal([["\u{1F600}", "\u{1F601}"]], - csv.to_a) - end - end - - def test_open_encoding_invalid - # U+1F600 GRINNING FACE - # U+1F601 GRINNING FACE WITH SMILING EYES - File.open(@input.path, "w") do |file| - file << "\u{1F600},\u{1F601}" - end - CSV.open(@input.path, encoding: "EUC-JP") do |csv| - error = assert_raise(CSV::MalformedCSVError) do - csv.shift - end - assert_equal("Invalid byte sequence in EUC-JP in line 1.", - error.message) - end - end - - def test_open_encoding_nonexistent - _output, error = capture_output do - CSV.open(@input.path, encoding: "nonexistent") do - end - end - assert_equal("path:0: warning: Unsupported encoding nonexistent ignored\n", - error.gsub(/\A.+:\d+: /, "path:0: ")) - end - - def test_open_encoding_utf_8_with_bom - # U+FEFF ZERO WIDTH NO-BREAK SPACE, BOM - # U+1F600 GRINNING FACE - # U+1F601 GRINNING FACE WITH SMILING EYES - File.open(@input.path, "w") do |file| - file << "\u{FEFF}\u{1F600},\u{1F601}" - end - CSV.open(@input.path, encoding: "bom|utf-8") do |csv| - assert_equal([["\u{1F600}", "\u{1F601}"]], - csv.to_a) - end - end - - def test_open_invalid_byte_sequence_in_utf_8 - CSV.open(@input.path, "w", encoding: Encoding::CP932) do |rows| - error = assert_raise(Encoding::InvalidByteSequenceError) do - rows << ["\x82\xa0"] - end - assert_equal('"\x82" on UTF-8', - error.message) - end - end - - def test_open_with_invalid_nil - CSV.open(@input.path, "w", encoding: Encoding::CP932, invalid: nil) do |rows| - error = assert_raise(Encoding::InvalidByteSequenceError) do - rows << ["\x82\xa0"] - end - assert_equal('"\x82" on UTF-8', - error.message) - end - end - - def test_open_with_invalid_replace - CSV.open(@input.path, "w", encoding: Encoding::CP932, invalid: :replace) do |rows| - rows << ["\x82\xa0".force_encoding(Encoding::UTF_8)] - end - CSV.open(@input.path, encoding: Encoding::CP932) do |csv| - assert_equal([["??"]], - csv.to_a) - end - end - - def test_open_with_invalid_replace_and_replace_string - CSV.open(@input.path, "w", encoding: Encoding::CP932, invalid: :replace, replace: "X") do |rows| - rows << ["\x82\xa0".force_encoding(Encoding::UTF_8)] - end - CSV.open(@input.path, encoding: Encoding::CP932) do |csv| - assert_equal([["XX"]], - csv.to_a) - end - end - - def test_open_with_undef_replace - # U+00B7 Middle Dot - CSV.open(@input.path, "w", encoding: Encoding::CP932, undef: :replace) do |rows| - rows << ["\u00B7"] - end - CSV.open(@input.path, encoding: Encoding::CP932) do |csv| - assert_equal([["?"]], - csv.to_a) - end - end - - def test_open_with_undef_replace_and_replace_string - # U+00B7 Middle Dot - CSV.open(@input.path, "w", encoding: Encoding::CP932, undef: :replace, replace: "X") do |rows| - rows << ["\u00B7"] - end - CSV.open(@input.path, encoding: Encoding::CP932) do |csv| - assert_equal([["X"]], - csv.to_a) - end - end - - def test_open_with_newline - CSV.open(@input.path, col_sep: "\t", universal_newline: true) do |csv| - assert_equal(@rows, csv.to_a) - end - File.binwrite(@input.path, "1,2,3\r\n" "4,5\n") - CSV.open(@input.path, newline: :universal) do |csv| - assert_equal(@rows, csv.to_a) - end - end - - def test_parse - assert_equal(@rows, - CSV.parse(@data, col_sep: "\t", row_sep: "\r\n")) - end - - def test_parse_block - rows = [] - CSV.parse(@data, col_sep: "\t", row_sep: "\r\n") do |row| - rows << row - end - assert_equal(@rows, rows) - end - - def test_parse_enumerator - rows = CSV.parse(@data, col_sep: "\t", row_sep: "\r\n").to_a - assert_equal(@rows, rows) - end - - def test_parse_headers_only - table = CSV.parse("a,b,c", headers: true) - assert_equal([ - ["a", "b", "c"], - [], - ], - [ - table.headers, - table.each.to_a, - ]) - end - - def test_parse_line - assert_equal(["1", "2", "3"], - CSV.parse_line("1;2;3", col_sep: ";")) - end - - def test_parse_line_shortcut - assert_equal(["1", "2", "3"], - "1;2;3".parse_csv(col_sep: ";")) - end - - def test_parse_line_empty - assert_equal(nil, CSV.parse_line("")) # to signal eof - end - - def test_parse_line_empty_line - assert_equal([], CSV.parse_line("\n1,2,3")) - end - - def test_read - assert_equal(@rows, - CSV.read(@input.path, col_sep: "\t", row_sep: "\r\n")) - end - - if respond_to?(:ractor) - ractor - def test_read_in_ractor - ractor = Ractor.new(@input.path) do |path| - CSV.read(path, col_sep: "\t", row_sep: "\r\n") - end - rows = [ - ["1", "2", "3"], - ["4", "5"], - ] - assert_equal(rows, ractor.take) - end - end - - def test_readlines - assert_equal(@rows, - CSV.readlines(@input.path, col_sep: "\t", row_sep: "\r\n")) - end - - def test_open_read - rows = CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - csv.read - end - assert_equal(@rows, rows) - end - - def test_open_readlines - rows = CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - csv.readlines - end - assert_equal(@rows, rows) - end - - def test_table - table = CSV.table(@input.path, col_sep: "\t", row_sep: "\r\n") - assert_equal(CSV::Table.new([ - CSV::Row.new([:"1", :"2", :"3"], [4, 5, nil]), - ]), - table) - end - - def test_shift # aliased as gets() and readline() - CSV.open(@input.path, "rb+", col_sep: "\t", row_sep: "\r\n") do |csv| - rows = [ - csv.shift, - csv.shift, - csv.shift, - ] - assert_equal(@rows + [nil], - rows) - end - end - - def test_enumerator - CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - assert_equal(@rows, csv.each.to_a) - end - end - - def test_shift_and_each - CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - rows = [] - rows << csv.shift - rows.concat(csv.each.to_a) - assert_equal(@rows, rows) - end - end - - def test_each_twice - CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - assert_equal([ - @rows, - [], - ], - [ - csv.each.to_a, - csv.each.to_a, - ]) - end - end - - def test_eof? - eofs = [] - CSV.open(@input.path, col_sep: "\t", row_sep: "\r\n") do |csv| - eofs << csv.eof? - csv.shift - eofs << csv.eof? - csv.shift - eofs << csv.eof? - end - assert_equal([false, false, true], - eofs) - end - - def test_new_nil - assert_raise_with_message ArgumentError, "Cannot parse nil as CSV" do - CSV.new(nil) - end - end - - def test_options_not_modified - options = {}.freeze - CSV.foreach(@input.path, **options) - CSV.open(@input.path, **options) {} - CSV.parse("", **options) - CSV.parse_line("", **options) - CSV.read(@input.path, **options) - CSV.readlines(@input.path, **options) - CSV.table(@input.path, **options) - end -end diff --git a/test/mri/csv/interface/test_read_write.rb b/test/mri/csv/interface/test_read_write.rb deleted file mode 100644 index c371e9c5fcf..00000000000 --- a/test/mri/csv/interface/test_read_write.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVInterfaceReadWrite < Test::Unit::TestCase - extend DifferentOFS - - def test_filter - input = <<-CSV.freeze -1;2;3 -4;5 - CSV - output = "" - CSV.filter(input, output, - in_col_sep: ";", - out_col_sep: ",", - converters: :all) do |row| - row.map! {|n| n * 2} - row << "Added\r" - end - assert_equal(<<-CSV, output) -2,4,6,"Added\r" -8,10,"Added\r" - CSV - end - - def test_filter_headers_true - input = <<-CSV.freeze -Name,Value -foo,0 -bar,1 -baz,2 - CSV - output = "" - CSV.filter(input, output, headers: true) do |row| - row[0] += "X" - row[1] = row[1].to_i + 1 - end - assert_equal(<<-CSV, output) -fooX,1 -barX,2 -bazX,3 - CSV - end - - def test_filter_headers_true_write_headers - input = <<-CSV.freeze -Name,Value -foo,0 -bar,1 -baz,2 - CSV - output = "" - CSV.filter(input, output, headers: true, out_write_headers: true) do |row| - if row.is_a?(Array) - row[0] += "X" - row[1] += "Y" - else - row[0] += "X" - row[1] = row[1].to_i + 1 - end - end - assert_equal(<<-CSV, output) -NameX,ValueY -fooX,1 -barX,2 -bazX,3 - CSV - end - - def test_filter_headers_array_write_headers - input = <<-CSV.freeze -foo,0 -bar,1 -baz,2 - CSV - output = "" - CSV.filter(input, output, - headers: ["Name", "Value"], - out_write_headers: true) do |row| - row[0] += "X" - row[1] = row[1].to_i + 1 - end - assert_equal(<<-CSV, output) -Name,Value -fooX,1 -barX,2 -bazX,3 - CSV - end - - def test_instance_same - data = "" - assert_equal(CSV.instance(data, col_sep: ";").object_id, - CSV.instance(data, col_sep: ";").object_id) - end - - def test_instance_append - output = "" - CSV.instance(output, col_sep: ";") << ["a", "b", "c"] - assert_equal(<<-CSV, output) -a;b;c - CSV - CSV.instance(output, col_sep: ";") << [1, 2, 3] - assert_equal(<<-CSV, output) -a;b;c -1;2;3 - CSV - end - - def test_instance_shortcut - assert_equal(CSV.instance, - CSV {|csv| csv}) - end - - def test_instance_shortcut_with_io - io = StringIO.new - from_instance = CSV.instance(io, col_sep: ";") { |csv| csv << ["a", "b", "c"] } - from_shortcut = CSV(io, col_sep: ";") { |csv| csv << ["e", "f", "g"] } - - assert_equal(from_instance, from_shortcut) - assert_equal(from_instance.string, "a;b;c\ne;f;g\n") - end -end diff --git a/test/mri/csv/interface/test_write.rb b/test/mri/csv/interface/test_write.rb deleted file mode 100644 index 0cd39a7663a..00000000000 --- a/test/mri/csv/interface/test_write.rb +++ /dev/null @@ -1,217 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVInterfaceWrite < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @output = Tempfile.new(["interface-write", ".csv"]) - end - - def teardown - @output.close(true) - super - end - - def test_generate_default - csv_text = CSV.generate do |csv| - csv << [1, 2, 3] << [4, nil, 5] - end - assert_equal(<<-CSV, csv_text) -1,2,3 -4,,5 - CSV - end - - if respond_to?(:ractor) - ractor - def test_generate_default_in_ractor - ractor = Ractor.new do - CSV.generate do |csv| - csv << [1, 2, 3] << [4, nil, 5] - end - end - assert_equal(<<-CSV, ractor.take) -1,2,3 -4,,5 - CSV - end - end - - def test_generate_append - csv_text = <<-CSV -1,2,3 -4,,5 - CSV - CSV.generate(csv_text) do |csv| - csv << ["last", %Q{"row"}] - end - assert_equal(<<-CSV, csv_text) -1,2,3 -4,,5 -last,"""row""" - CSV - end - - def test_generate_no_new_line - csv_text = CSV.generate("test") do |csv| - csv << ["row"] - end - assert_equal(<<-CSV, csv_text) -testrow - CSV - end - - def test_generate_line_col_sep - line = CSV.generate_line(["1", "2", "3"], col_sep: ";") - assert_equal(<<-LINE, line) -1;2;3 - LINE - end - - def test_generate_line_row_sep - line = CSV.generate_line(["1", "2"], row_sep: nil) - assert_equal(<<-LINE.chomp, line) -1,2 - LINE - end - - def test_generate_line_shortcut - line = ["1", "2", "3"].to_csv(col_sep: ";") - assert_equal(<<-LINE, line) -1;2;3 - LINE - end - - def test_generate_lines - lines = CSV.generate_lines([["foo", "bar"], [1, 2], [3, 4]]) - assert_equal(<<-LINES, lines) -foo,bar -1,2 -3,4 - LINES - end - - def test_headers_detection - headers = ["a", "b", "c"] - CSV.open(@output.path, "w", headers: true) do |csv| - csv << headers - csv << ["1", "2", "3"] - assert_equal(headers, csv.headers) - end - end - - def test_lineno - CSV.open(@output.path, "w") do |csv| - n_lines = 20 - n_lines.times do - csv << ["a", "b", "c"] - end - assert_equal(n_lines, csv.lineno) - end - end - - def test_append_row - CSV.open(@output.path, "wb") do |csv| - csv << - CSV::Row.new([], ["1", "2", "3"]) << - CSV::Row.new([], ["a", "b", "c"]) - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -1,2,3 -a,b,c - CSV - end - - - if respond_to?(:ractor) - ractor - def test_append_row_in_ractor - ractor = Ractor.new(@output.path) do |path| - CSV.open(path, "wb") do |csv| - csv << - CSV::Row.new([], ["1", "2", "3"]) << - CSV::Row.new([], ["a", "b", "c"]) - end - end - ractor.take - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -1,2,3 -a,b,c - CSV - end - end - - def test_append_hash - CSV.open(@output.path, "wb", headers: true) do |csv| - csv << [:a, :b, :c] - csv << {a: 1, b: 2, c: 3} - csv << {a: 4, b: 5, c: 6} - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -a,b,c -1,2,3 -4,5,6 - CSV - end - - def test_append_hash_headers_array - CSV.open(@output.path, "wb", headers: [:b, :a, :c]) do |csv| - csv << {a: 1, b: 2, c: 3} - csv << {a: 4, b: 5, c: 6} - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -2,1,3 -5,4,6 - CSV - end - - def test_append_hash_headers_string - CSV.open(@output.path, "wb", headers: "b|a|c", col_sep: "|") do |csv| - csv << {"a" => 1, "b" => 2, "c" => 3} - csv << {"a" => 4, "b" => 5, "c" => 6} - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -2|1|3 -5|4|6 - CSV - end - - def test_write_headers - CSV.open(@output.path, - "wb", - headers: "b|a|c", - write_headers: true, - col_sep: "|" ) do |csv| - csv << {"a" => 1, "b" => 2, "c" => 3} - csv << {"a" => 4, "b" => 5, "c" => 6} - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -b|a|c -2|1|3 -5|4|6 - CSV - end - - def test_write_headers_empty - CSV.open(@output.path, - "wb", - headers: "b|a|c", - write_headers: true, - col_sep: "|" ) do |csv| - end - assert_equal(<<-CSV, File.read(@output.path, mode: "rb")) -b|a|c - CSV - end - - def test_options_not_modified - options = {}.freeze - CSV.generate(**options) {} - CSV.generate_line([], **options) - CSV.filter("", "", **options) - CSV.instance("", **options) - end -end diff --git a/test/mri/csv/parse/test_column_separator.rb b/test/mri/csv/parse/test_column_separator.rb deleted file mode 100644 index d6eaa7b6de4..00000000000 --- a/test/mri/csv/parse/test_column_separator.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseColumnSeparator < Test::Unit::TestCase - extend DifferentOFS - - def test_comma - assert_equal([["a", "b", nil, "d"]], - CSV.parse("a,b,,d", col_sep: ",")) - end - - def test_space - assert_equal([["a", "b", nil, "d"]], - CSV.parse("a b d", col_sep: " ")) - end - - def test_tab - assert_equal([["a", "b", nil, "d"]], - CSV.parse("a\tb\t\td", col_sep: "\t")) - end - - def test_multiple_characters_include_sub_separator - assert_equal([["a b", nil, "d"]], - CSV.parse("a b d", col_sep: " ")) - end - - def test_multiple_characters_leading_empty_fields - data = <<-CSV -<=><=>A<=>B<=>C -1<=>2<=>3 - CSV - assert_equal([ - [nil, nil, "A", "B", "C"], - ["1", "2", "3"], - ], - CSV.parse(data, col_sep: "<=>")) - end -end diff --git a/test/mri/csv/parse/test_convert.rb b/test/mri/csv/parse/test_convert.rb deleted file mode 100644 index c9195c71d9b..00000000000 --- a/test/mri/csv/parse/test_convert.rb +++ /dev/null @@ -1,165 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseConvert < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @data = "Numbers,:integer,1,:float,3.015" - @parser = CSV.new(@data) - - @custom = lambda {|field| /\A:(\S.*?)\s*\Z/ =~ field ? $1.to_sym : field} - - @time = Time.utc(2018, 12, 30, 6, 41, 29) - @windows_safe_time_data = @time.strftime("%a %b %d %H:%M:%S %Y") - - @preserving_converter = lambda do |field, info| - f = field.encode(CSV::ConverterEncoding) - return f if info.quoted? - begin - Integer(f, 10) - rescue - f - end - end - - @quoted_header_converter = lambda do |field, info| - f = field.encode(CSV::ConverterEncoding) - return f if info.quoted? - f.to_sym - end - end - - def test_integer - @parser.convert(:integer) - assert_equal(["Numbers", ":integer", 1, ":float", "3.015"], - @parser.shift) - end - - def test_float - @parser.convert(:float) - assert_equal(["Numbers", ":integer", 1.0, ":float", 3.015], - @parser.shift) - end - - def test_float_integer - @parser.convert(:float) - @parser.convert(:integer) - assert_equal(["Numbers", ":integer", 1.0, ":float", 3.015], - @parser.shift) - end - - def test_integer_float - @parser.convert(:integer) - @parser.convert(:float) - assert_equal(["Numbers", ":integer", 1, ":float", 3.015], - @parser.shift) - end - - def test_numeric - @parser.convert(:numeric) - assert_equal(["Numbers", ":integer", 1, ":float", 3.015], - @parser.shift) - end - - def test_all - @data << ",#{@windows_safe_time_data}" - @parser = CSV.new(@data) - @parser.convert(:all) - assert_equal(["Numbers", ":integer", 1, ":float", 3.015, @time.to_datetime], - @parser.shift) - end - - def test_custom - @parser.convert do |field| - /\A:(\S.*?)\s*\Z/ =~ field ? $1.to_sym : field - end - assert_equal(["Numbers", :integer, "1", :float, "3.015"], - @parser.shift) - end - - def test_builtin_custom - @parser.convert(:numeric) - @parser.convert(&@custom) - assert_equal(["Numbers", :integer, 1, :float, 3.015], - @parser.shift) - end - - def test_custom_field_info_line - @parser.convert do |field, info| - assert_equal(1, info.line) - info.index == 4 ? Float(field).floor : field - end - assert_equal(["Numbers", ":integer", "1", ":float", 3], - @parser.shift) - end - - def test_custom_field_info_header - headers = ["one", "two", "three", "four", "five"] - @parser = CSV.new(@data, headers: headers) - @parser.convert do |field, info| - info.header == "three" ? Integer(field) * 100 : field - end - assert_equal(CSV::Row.new(headers, - ["Numbers", ":integer", 100, ":float", "3.015"]), - @parser.shift) - end - - def test_custom_blank_field - converter = lambda {|field| field.nil?} - row = CSV.parse_line('nil,', converters: converter) - assert_equal([false, true], row) - end - - def test_nil_value - assert_equal(["nil", "", "a"], - CSV.parse_line(',"",a', nil_value: "nil")) - end - - def test_empty_value - assert_equal([nil, "empty", "a"], - CSV.parse_line(',"",a', empty_value: "empty")) - end - - def test_quoted_parse_line - row = CSV.parse_line('1,"2",3', converters: @preserving_converter) - assert_equal([1, "2", 3], row) - end - - def test_quoted_parse - expected = [["quoted", "unquoted"], ["109", 1], ["10A", 2]] - rows = CSV.parse(<<~CSV, converters: @preserving_converter) - "quoted",unquoted - "109",1 - "10A",2 - CSV - assert_equal(expected, rows) - end - - def test_quoted_alternating_quote - row = CSV.parse_line('"1",2,"3"', converters: @preserving_converter) - assert_equal(['1', 2, '3'], row) - end - - def test_quoted_parse_headers - expected = [["quoted", :unquoted], ["109", "1"], ["10A", "2"]] - table = CSV.parse(<<~CSV, headers: true, header_converters: @quoted_header_converter) - "quoted",unquoted - "109",1 - "10A",2 - CSV - assert_equal(expected, table.to_a) - end - - def test_quoted_parse_with_string_headers - expected = [["quoted", :unquoted], %w[109 1], %w[10A 2]] - table = CSV.parse(<<~CSV, headers: '"quoted",unquoted', header_converters: @quoted_header_converter) - "109",1 - "10A",2 - CSV - assert_equal(expected, table.to_a) - end -end diff --git a/test/mri/csv/parse/test_each.rb b/test/mri/csv/parse/test_each.rb deleted file mode 100644 index ce0b71d0581..00000000000 --- a/test/mri/csv/parse/test_each.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseEach < Test::Unit::TestCase - extend DifferentOFS - - def test_twice - data = <<-CSV -Ruby,2.6.0,script - CSV - csv = CSV.new(data) - assert_equal([ - [["Ruby", "2.6.0", "script"]], - [], - ], - [ - csv.to_a, - csv.to_a, - ]) - end -end diff --git a/test/mri/csv/parse/test_general.rb b/test/mri/csv/parse/test_general.rb deleted file mode 100644 index ff32eef6d39..00000000000 --- a/test/mri/csv/parse/test_general.rb +++ /dev/null @@ -1,341 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require "timeout" - -require_relative "../helper" - -# -# Following tests are my interpretation of the -# {CSV RCF}[http://www.ietf.org/rfc/rfc4180.txt]. I only deviate from that -# document in one place (intentionally) and that is to make the default row -# separator $/. -# -class TestCSVParseGeneral < Test::Unit::TestCase - extend DifferentOFS - - BIG_DATA = "123456789\n" * 512 - - def test_mastering_regex_example - ex = %Q{Ten Thousand,10000, 2710 ,,"10,000","It's ""10 Grand"", baby",10K} - assert_equal( [ "Ten Thousand", "10000", " 2710 ", nil, "10,000", - "It's \"10 Grand\", baby", "10K" ], - CSV.parse_line(ex) ) - end - - # Old Ruby 1.8 CSV library tests. - def test_std_lib_csv - [ ["\t", ["\t"]], - ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]], - ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]], - ["\"\"\"\n\",\"\"\"\n\"", ["\"\n", "\"\n"]], - ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]], - ["\"\"", [""]], - ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]], - ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]], - ["foo,\"\r\",baz", ["foo", "\r", "baz"]], - ["foo,\"\",baz", ["foo", "", "baz"]], - ["\",\"", [","]], - ["foo", ["foo"]], - [",,", [nil, nil, nil]], - [",", [nil, nil]], - ["foo,\"\n\",baz", ["foo", "\n", "baz"]], - ["foo,,baz", ["foo", nil, "baz"]], - ["\"\"\"\r\",\"\"\"\r\"", ["\"\r", "\"\r"]], - ["\",\",\",\"", [",", ","]], - ["foo,bar,", ["foo", "bar", nil]], - [",foo,bar", [nil, "foo", "bar"]], - ["foo,bar", ["foo", "bar"]], - [";", [";"]], - ["\t,\t", ["\t", "\t"]], - ["foo,\"\r\n\r\",baz", ["foo", "\r\n\r", "baz"]], - ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]], - ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]], - [";,;", [";", ";"]] ].each do |csv_test| - assert_equal(csv_test.last, CSV.parse_line(csv_test.first)) - end - - [ ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]], - ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]], - ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]], - ["\"\"", [""]], - ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]], - ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]], - ["foo,\"\r\",baz", ["foo", "\r", "baz"]], - ["foo,\"\",baz", ["foo", "", "baz"]], - ["foo", ["foo"]], - [",,", [nil, nil, nil]], - [",", [nil, nil]], - ["foo,\"\n\",baz", ["foo", "\n", "baz"]], - ["foo,,baz", ["foo", nil, "baz"]], - ["foo,bar", ["foo", "bar"]], - ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]], - ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]] ].each do |csv_test| - assert_equal(csv_test.last, CSV.parse_line(csv_test.first)) - end - end - - # From: http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/6496 - def test_aras_edge_cases - [ [%Q{a,b}, ["a", "b"]], - [%Q{a,"""b"""}, ["a", "\"b\""]], - [%Q{a,"""b"}, ["a", "\"b"]], - [%Q{a,"b"""}, ["a", "b\""]], - [%Q{a,"\nb"""}, ["a", "\nb\""]], - [%Q{a,"""\nb"}, ["a", "\"\nb"]], - [%Q{a,"""\nb\n"""}, ["a", "\"\nb\n\""]], - [%Q{a,"""\nb\n""",\nc}, ["a", "\"\nb\n\"", nil]], - [%Q{a,,,}, ["a", nil, nil, nil]], - [%Q{,}, [nil, nil]], - [%Q{"",""}, ["", ""]], - [%Q{""""}, ["\""]], - [%Q{"""",""}, ["\"",""]], - [%Q{,""}, [nil,""]], - [%Q{,"\r"}, [nil,"\r"]], - [%Q{"\r\n,"}, ["\r\n,"]], - [%Q{"\r\n,",}, ["\r\n,", nil]] ].each do |edge_case| - assert_equal(edge_case.last, CSV.parse_line(edge_case.first)) - end - end - - def test_james_edge_cases - # A read at eof? should return nil. - assert_equal(nil, CSV.parse_line("")) - # - # With Ruby 1.8 CSV it's impossible to tell an empty line from a line - # containing a single +nil+ field. The old CSV library returns - # [nil] in these cases, but Array.new makes more sense to - # me. - # - assert_equal(Array.new, CSV.parse_line("\n1,2,3\n")) - end - - def test_rob_edge_cases - [ [%Q{"a\nb"}, ["a\nb"]], - [%Q{"\n\n\n"}, ["\n\n\n"]], - [%Q{a,"b\n\nc"}, ['a', "b\n\nc"]], - [%Q{,"\r\n"}, [nil,"\r\n"]], - [%Q{,"\r\n."}, [nil,"\r\n."]], - [%Q{"a\na","one newline"}, ["a\na", 'one newline']], - [%Q{"a\n\na","two newlines"}, ["a\n\na", 'two newlines']], - [%Q{"a\r\na","one CRLF"}, ["a\r\na", 'one CRLF']], - [%Q{"a\r\n\r\na","two CRLFs"}, ["a\r\n\r\na", 'two CRLFs']], - [%Q{with blank,"start\n\nfinish"\n}, ['with blank', "start\n\nfinish"]], - ].each do |edge_case| - assert_equal(edge_case.last, CSV.parse_line(edge_case.first)) - end - end - - def test_non_regex_edge_cases - # An early version of the non-regex parser fails this test - [ [ "foo,\"foo,bar,baz,foo\",\"foo\"", - ["foo", "foo,bar,baz,foo", "foo"] ] ].each do |edge_case| - assert_equal(edge_case.last, CSV.parse_line(edge_case.first)) - end - - assert_raise(CSV::MalformedCSVError) do - CSV.parse_line("1,\"23\"4\"5\", 6") - end - end - - def test_malformed_csv_cr_first_line - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line("1,2\r,3", row_sep: "\n") - end - assert_equal("Unquoted fields do not allow new line <\"\\r\"> in line 1.", - error.message) - end - - def test_malformed_csv_cr_middle_line - csv = <<-CSV -line,1,abc -line,2,"def\nghi" - -line,4,some\rjunk -line,5,jkl - CSV - - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse(csv) - end - assert_equal("Unquoted fields do not allow new line <\"\\r\"> in line 4.", - error.message) - end - - def test_malformed_csv_unclosed_quote - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line('1,2,"3...') - end - assert_equal("Unclosed quoted field in line 1.", - error.message) - end - - def test_malformed_csv_illegal_quote_middle_line - csv = <<-CSV -line,1,abc -line,2,"def\nghi" - -line,4,8'10" -line,5,jkl - CSV - - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse(csv) - end - assert_equal("Illegal quoting in line 4.", - error.message) - end - - def test_the_parse_fails_fast_when_it_can_for_unquoted_fields - assert_parse_errors_out('valid,fields,bad start"' + BIG_DATA) - end - - def test_the_parse_fails_fast_when_it_can_for_unescaped_quotes - assert_parse_errors_out('valid,fields,"bad start"unescaped' + BIG_DATA) - end - - def test_field_size_limit_controls_lookahead - assert_parse_errors_out( 'valid,fields,"' + BIG_DATA + '"', - field_size_limit: 2048 ) - end - - def test_field_size_limit_max_allowed - column = "abcde" - assert_equal([[column]], - CSV.parse("\"#{column}\"", - field_size_limit: column.size + 1)) - end - - def test_field_size_limit_quote_simple - column = "abcde" - assert_parse_errors_out("\"#{column}\"", - field_size_limit: column.size) - end - - def test_field_size_limit_no_quote_implicitly - column = "abcde" - assert_parse_errors_out("#{column}", - field_size_limit: column.size) - end - - def test_field_size_limit_no_quote_explicitly - column = "abcde" - assert_parse_errors_out("#{column}", - field_size_limit: column.size, - quote_char: nil) - end - - def test_field_size_limit_in_extended_column_not_exceeding - data = <<~DATA - "a","b" - " - 2 - ","" - DATA - assert_nothing_raised(CSV::MalformedCSVError) do - CSV.parse(data, field_size_limit: 4) - end - end - - def test_field_size_limit_in_extended_column_exceeding - data = <<~DATA - "a","b" - " - 2345 - ","" - DATA - assert_parse_errors_out(data, field_size_limit: 5) - end - - def test_max_field_size_controls_lookahead - assert_parse_errors_out( 'valid,fields,"' + BIG_DATA + '"', - max_field_size: 2048 ) - end - - def test_max_field_size_max_allowed - column = "abcde" - assert_equal([[column]], - CSV.parse("\"#{column}\"", - max_field_size: column.size)) - end - - def test_max_field_size_quote_simple - column = "abcde" - assert_parse_errors_out("\"#{column}\"", - max_field_size: column.size - 1) - end - - def test_max_field_size_no_quote_implicitly - column = "abcde" - assert_parse_errors_out("#{column}", - max_field_size: column.size - 1) - end - - def test_max_field_size_no_quote_explicitly - column = "abcde" - assert_parse_errors_out("#{column}", - max_field_size: column.size - 1, - quote_char: nil) - end - - def test_max_field_size_in_extended_column_not_exceeding - data = <<~DATA - "a","b" - " - 2 - ","" - DATA - assert_nothing_raised(CSV::MalformedCSVError) do - CSV.parse(data, max_field_size: 3) - end - end - - def test_max_field_size_in_extended_column_exceeding - data = <<~DATA - "a","b" - " - 2345 - ","" - DATA - assert_parse_errors_out(data, max_field_size: 4) - end - - def test_row_sep_auto_cr - assert_equal([["a"]], CSV.parse("a\r")) - end - - def test_row_sep_auto_lf - assert_equal([["a"]], CSV.parse("a\n")) - end - - def test_row_sep_auto_cr_lf - assert_equal([["a"]], CSV.parse("a\r\n")) - end - - def test_seeked_string_io - input_with_bom = StringIO.new("\ufeffあ,い,う\r\na,b,c\r\n") - input_with_bom.read(3) - assert_equal([ - ["あ", "い", "う"], - ["a", "b", "c"], - ], - CSV.new(input_with_bom).each.to_a) - end - - private - def assert_parse_errors_out(data, **options) - assert_raise(CSV::MalformedCSVError) do - timeout = 0.2 - if defined?(RubyVM::YJIT.enabled?) and RubyVM::YJIT.enabled? - timeout = 1 # for --yjit-call-threshold=1 - end - if defined?(RubyVM::MJIT.enabled?) and RubyVM::MJIT.enabled? - timeout = 5 # for --jit-wait - end - Timeout.timeout(timeout) do - CSV.parse(data, **options) - fail("Parse didn't error out") - end - end - end -end diff --git a/test/mri/csv/parse/test_header.rb b/test/mri/csv/parse/test_header.rb deleted file mode 100644 index e8c3786d686..00000000000 --- a/test/mri/csv/parse/test_header.rb +++ /dev/null @@ -1,342 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVHeaders < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @data = <<-CSV -first,second,third -A,B,C -1,2,3 - CSV - end - - def test_first_row - [:first_row, true].each do |setting| # two names for the same setting - # activate headers - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse(@data, headers: setting) - end - - # first data row - skipping headers - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{first A}, %w{second B}, %w{third C}], row.to_a) - - # second data row - row = csv[1] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{first 1}, %w{second 2}, %w{third 3}], row.to_a) - - # empty - assert_nil(csv[2]) - end - end - - def test_array_of_headers - # activate headers - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse(@data, headers: [:my, :new, :headers]) - end - - # first data row - skipping headers - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal( [[:my, "first"], [:new, "second"], [:headers, "third"]], - row.to_a ) - - # second data row - row = csv[1] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([[:my, "A"], [:new, "B"], [:headers, "C"]], row.to_a) - - # third data row - row = csv[2] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([[:my, "1"], [:new, "2"], [:headers, "3"]], row.to_a) - - # empty - assert_nil(csv[3]) - - # with return and convert - assert_nothing_raised(Exception) do - csv = CSV.parse( @data, headers: [:my, :new, :headers], - return_headers: true, - header_converters: lambda { |h| h.to_s } ) - end - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([["my", :my], ["new", :new], ["headers", :headers]], row.to_a) - assert_predicate(row, :header_row?) - assert_not_predicate(row, :field_row?) - end - - def test_csv_header_string - # activate headers - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse(@data, headers: "my,new,headers") - end - - # first data row - skipping headers - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{my first}, %w{new second}, %w{headers third}], row.to_a) - - # second data row - row = csv[1] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{my A}, %w{new B}, %w{headers C}], row.to_a) - - # third data row - row = csv[2] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{my 1}, %w{new 2}, %w{headers 3}], row.to_a) - - # empty - assert_nil(csv[3]) - - # with return and convert - assert_nothing_raised(Exception) do - csv = CSV.parse( @data, headers: "my,new,headers", - return_headers: true, - header_converters: :symbol ) - end - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([[:my, "my"], [:new, "new"], [:headers, "headers"]], row.to_a) - assert_predicate(row, :header_row?) - assert_not_predicate(row, :field_row?) - end - - def test_csv_header_string_inherits_separators - # parse with custom col_sep - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse( @data.tr(",", "|"), col_sep: "|", - headers: "my|new|headers" ) - end - - # verify headers were recognized - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{my first}, %w{new second}, %w{headers third}], row.to_a) - end - - def test_return_headers - # activate headers and request they are returned - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse(@data, headers: true, return_headers: true) - end - - # header row - row = csv[0] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal( [%w{first first}, %w{second second}, %w{third third}], - row.to_a ) - assert_predicate(row, :header_row?) - assert_not_predicate(row, :field_row?) - - # first data row - skipping headers - row = csv[1] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{first A}, %w{second B}, %w{third C}], row.to_a) - assert_not_predicate(row, :header_row?) - assert_predicate(row, :field_row?) - - # second data row - row = csv[2] - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([%w{first 1}, %w{second 2}, %w{third 3}], row.to_a) - assert_not_predicate(row, :header_row?) - assert_predicate(row, :field_row?) - - # empty - assert_nil(csv[3]) - end - - def test_converters - # create test data where headers and fields look alike - data = <<-CSV -1,2,3 -1,2,3 - CSV - - # normal converters do not affect headers - csv = CSV.parse( data, headers: true, - return_headers: true, - converters: :numeric ) - assert_equal([%w{1 1}, %w{2 2}, %w{3 3}], csv[0].to_a) - assert_equal([["1", 1], ["2", 2], ["3", 3]], csv[1].to_a) - assert_nil(csv[2]) - - # header converters do affect headers (only) - assert_nothing_raised(Exception) do - csv = CSV.parse( data, headers: true, - return_headers: true, - converters: :numeric, - header_converters: :symbol ) - end - assert_equal([[:"1", "1"], [:"2", "2"], [:"3", "3"]], csv[0].to_a) - assert_equal([[:"1", 1], [:"2", 2], [:"3", 3]], csv[1].to_a) - assert_nil(csv[2]) - end - - def test_builtin_downcase_converter - csv = CSV.parse( "One,TWO Three", headers: true, - return_headers: true, - header_converters: :downcase ) - assert_equal(%w{one two\ three}, csv.headers) - end - - def test_builtin_symbol_converter - # Note that the trailing space is intentional - csv = CSV.parse( "One,TWO Three ", headers: true, - return_headers: true, - header_converters: :symbol ) - assert_equal([:one, :two_three], csv.headers) - end - - def test_builtin_symbol_raw_converter - csv = CSV.parse( "a b,c d", headers: true, - return_headers: true, - header_converters: :symbol_raw ) - assert_equal([:"a b", :"c d"], csv.headers) - end - - def test_builtin_symbol_converter_with_punctuation - csv = CSV.parse( "One, Two & Three ($)", headers: true, - return_headers: true, - header_converters: :symbol ) - assert_equal([:one, :two_three], csv.headers) - end - - def test_builtin_converters_with_blank_header - csv = CSV.parse( "one,,three", headers: true, - return_headers: true, - header_converters: [:downcase, :symbol, :symbol_raw] ) - assert_equal([:one, nil, :three], csv.headers) - end - - def test_custom_converter - converter = lambda { |header| header.tr(" ", "_") } - csv = CSV.parse( "One,TWO Three", - headers: true, - return_headers: true, - header_converters: converter ) - assert_equal(%w{One TWO_Three}, csv.headers) - end - - def test_table_support - csv = nil - assert_nothing_raised(Exception) do - csv = CSV.parse(@data, headers: true) - end - - assert_instance_of(CSV::Table, csv) - end - - def test_skip_blanks - @data = <<-CSV - - -A,B,C - -1,2,3 - - - - CSV - - expected = [%w[1 2 3]] - CSV.parse(@data, headers: true, skip_blanks: true) do |row| - assert_equal(expected.shift, row.fields) - end - - expected = [%w[A B C], %w[1 2 3]] - CSV.parse( @data, - headers: true, - return_headers: true, - skip_blanks: true ) do |row| - assert_equal(expected.shift, row.fields) - end - end - - def test_headers_reader - # no headers - assert_nil(CSV.new(@data).headers) - - # headers - csv = CSV.new(@data, headers: true) - assert_equal(true, csv.headers) # before headers are read - csv.shift # set headers - assert_equal(%w[first second third], csv.headers) # after headers are read - end - - def test_blank_row - @data += "\n#{@data}" # add a blank row - - # ensure that everything returned is a Row object - CSV.parse(@data, headers: true) do |row| - assert_instance_of(CSV::Row, row) - end - end - - def test_nil_row_header - @data = <<-CSV -A - -1 - CSV - - csv = CSV.parse(@data, headers: true) - - # ensure nil row creates Row object with headers - row = csv[0] - assert_equal([["A"], [nil]], - [row.headers, row.fields]) - end - - def test_parse_empty - assert_equal(CSV::Table.new([]), - CSV.parse("", headers: true)) - end - - def test_parse_empty_line - assert_equal(CSV::Table.new([]), - CSV.parse("\n", headers: true)) - end - - def test_specified_empty - assert_equal(CSV::Table.new([], - headers: ["header1"]), - CSV.parse("", headers: ["header1"])) - end - - def test_specified_empty_line - assert_equal(CSV::Table.new([CSV::Row.new(["header1"], [])], - headers: ["header1"]), - CSV.parse("\n", headers: ["header1"])) - end -end diff --git a/test/mri/csv/parse/test_inputs_scanner.rb b/test/mri/csv/parse/test_inputs_scanner.rb deleted file mode 100644 index 06e1c845d54..00000000000 --- a/test/mri/csv/parse/test_inputs_scanner.rb +++ /dev/null @@ -1,63 +0,0 @@ -require_relative "../helper" - -class TestCSVParseInputsScanner < Test::Unit::TestCase - include Helper - - def test_scan_keep_over_chunks_nested_back - input = CSV::Parser::UnoptimizedStringIO.new("abcdefghijklmnl") - scanner = CSV::Parser::InputsScanner.new([input], - Encoding::UTF_8, - nil, - chunk_size: 2) - scanner.keep_start - assert_equal("abc", scanner.scan_all(/[a-c]+/)) - scanner.keep_start - assert_equal("def", scanner.scan_all(/[d-f]+/)) - scanner.keep_back - scanner.keep_back - assert_equal("abcdefg", scanner.scan_all(/[a-g]+/)) - end - - def test_scan_keep_over_chunks_nested_drop_back - input = CSV::Parser::UnoptimizedStringIO.new("abcdefghijklmnl") - scanner = CSV::Parser::InputsScanner.new([input], - Encoding::UTF_8, - nil, - chunk_size: 3) - scanner.keep_start - assert_equal("ab", scanner.scan(/../)) - scanner.keep_start - assert_equal("c", scanner.scan(/./)) - assert_equal("d", scanner.scan(/./)) - scanner.keep_drop - scanner.keep_back - assert_equal("abcdefg", scanner.scan_all(/[a-g]+/)) - end - - def test_each_line_keep_over_chunks_multibyte - input = CSV::Parser::UnoptimizedStringIO.new("ab\n\u{3000}a\n") - scanner = CSV::Parser::InputsScanner.new([input], - Encoding::UTF_8, - nil, - chunk_size: 1) - each_line = scanner.each_line("\n") - assert_equal("ab\n", each_line.next) - scanner.keep_start - assert_equal("\u{3000}a\n", each_line.next) - scanner.keep_back - assert_equal("\u{3000}a\n", scanner.scan_all(/[^,]+/)) - end - - def test_each_line_keep_over_chunks_fit_chunk_size - input = CSV::Parser::UnoptimizedStringIO.new("\na") - scanner = CSV::Parser::InputsScanner.new([input], - Encoding::UTF_8, - nil, - chunk_size: 1) - each_line = scanner.each_line("\n") - assert_equal("\n", each_line.next) - scanner.keep_start - assert_equal("a", each_line.next) - scanner.keep_back - end -end diff --git a/test/mri/csv/parse/test_invalid.rb b/test/mri/csv/parse/test_invalid.rb deleted file mode 100644 index ddb59e2b9a0..00000000000 --- a/test/mri/csv/parse/test_invalid.rb +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseInvalid < Test::Unit::TestCase - def test_no_column_mixed_new_lines - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse("\n" + - "\r") - end - assert_equal("New line must be <\"\\n\"> not <\"\\r\"> in line 2.", - error.message) - end - - def test_ignore_invalid_line - csv = CSV.new(<<-CSV, headers: true, return_headers: true) -head1,head2,head3 -aaa,bbb,ccc -ddd,ee"e.fff -ggg,hhh,iii - CSV - headers = ["head1", "head2", "head3"] - assert_equal(CSV::Row.new(headers, headers), - csv.shift) - assert_equal(CSV::Row.new(headers, ["aaa", "bbb", "ccc"]), - csv.shift) - assert_equal(false, csv.eof?) - error = assert_raise(CSV::MalformedCSVError) do - csv.shift - end - assert_equal("Illegal quoting in line 3.", - error.message) - assert_equal(false, csv.eof?) - assert_equal(CSV::Row.new(headers, ["ggg", "hhh", "iii"]), - csv.shift) - assert_equal(true, csv.eof?) - end - - def test_ignore_invalid_line_cr_lf - data = <<-CSV -"1","OK"\r -"2",""NOT" OK"\r -"3","OK"\r -CSV - csv = CSV.new(data) - - assert_equal(['1', 'OK'], csv.shift) - assert_raise(CSV::MalformedCSVError) { csv.shift } - assert_equal(['3', 'OK'], csv.shift) - end -end diff --git a/test/mri/csv/parse/test_liberal_parsing.rb b/test/mri/csv/parse/test_liberal_parsing.rb deleted file mode 100644 index 5796d10828c..00000000000 --- a/test/mri/csv/parse/test_liberal_parsing.rb +++ /dev/null @@ -1,171 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseLiberalParsing < Test::Unit::TestCase - extend DifferentOFS - - def test_middle_quote_start - input = '"Johnson, Dwayne",Dwayne "The Rock" Johnson' - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line(input) - end - assert_equal("Illegal quoting in line 1.", - error.message) - assert_equal(["Johnson, Dwayne", 'Dwayne "The Rock" Johnson'], - CSV.parse_line(input, liberal_parsing: true)) - end - - def test_middle_quote_end - input = '"quoted" field' - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line(input) - end - assert_equal("Any value after quoted field isn't allowed in line 1.", - error.message) - assert_equal(['"quoted" field'], - CSV.parse_line(input, liberal_parsing: true)) - end - - def test_endline_after_quoted_field_end - csv = CSV.new("A\r\n\"B\"\nC\r\n", liberal_parsing: true) - assert_equal(["A"], csv.gets) - error = assert_raise(CSV::MalformedCSVError) do - csv.gets - end - assert_equal('Illegal end-of-line sequence outside of a quoted field <"\n"> in line 2.', - error.message) - assert_equal(["C"], csv.gets) - end - - def test_quote_after_column_separator - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line('is,this "three," or four,fields', liberal_parsing: true) - end - assert_equal("Unclosed quoted field in line 1.", - error.message) - end - - def test_quote_before_column_separator - assert_equal(["is", 'this "three', ' or four"', "fields"], - CSV.parse_line('is,this "three, or four",fields', - liberal_parsing: true)) - end - - def test_backslash_quote - assert_equal([ - "1", - "\"Hamlet says, \\\"Seems", - "\\\" madam! Nay it is; I know not \\\"seems.\\\"\"", - ], - CSV.parse_line('1,' + - '"Hamlet says, \"Seems,' + - '\" madam! Nay it is; I know not \"seems.\""', - liberal_parsing: true)) - end - - def test_space_quote - input = <<~CSV - Los Angeles, 34°03'N, 118°15'W - New York City, 40°42'46"N, 74°00'21"W - Paris, 48°51'24"N, 2°21'03"E - CSV - assert_equal( - [ - ["Los Angeles", " 34°03'N", " 118°15'W"], - ["New York City", " 40°42'46\"N", " 74°00'21\"W"], - ["Paris", " 48°51'24\"N", " 2°21'03\"E"], - ], - CSV.parse(input, liberal_parsing: true)) - end - - def test_double_quote_outside_quote - data = %Q{a,""b""} - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse(data) - end - assert_equal("Any value after quoted field isn't allowed in line 1.", - error.message) - assert_equal([ - [["a", %Q{""b""}]], - [["a", %Q{"b"}]], - ], - [ - CSV.parse(data, liberal_parsing: true), - CSV.parse(data, - liberal_parsing: { - double_quote_outside_quote: true, - }), - ]) - end - - class TestBackslashQuote < Test::Unit::TestCase - extend ::DifferentOFS - - def test_double_quote_outside_quote - data = %Q{a,""b""} - assert_equal([ - [["a", %Q{""b""}]], - [["a", %Q{"b"}]], - ], - [ - CSV.parse(data, - liberal_parsing: { - backslash_quote: true - }), - CSV.parse(data, - liberal_parsing: { - backslash_quote: true, - double_quote_outside_quote: true - }), - ]) - end - - def test_unquoted_value - data = %q{\"\"a\"\"} - assert_equal([ - [[%q{\"\"a\"\"}]], - [[%q{""a""}]], - ], - [ - CSV.parse(data, liberal_parsing: true), - CSV.parse(data, - liberal_parsing: { - backslash_quote: true - }), - ]) - end - - def test_unquoted_value_multiple_characters_col_sep - data = %q{a<\\"b<=>x} - assert_equal([[%Q{a<"b}, "x"]], - CSV.parse(data, - col_sep: "<=>", - liberal_parsing: { - backslash_quote: true - })) - end - - def test_quoted_value - data = %q{"\"\"a\"\""} - assert_equal([ - [[%q{"\"\"a\"\""}]], - [[%q{""a""}]], - [[%q{""a""}]], - ], - [ - CSV.parse(data, liberal_parsing: true), - CSV.parse(data, - liberal_parsing: { - backslash_quote: true - }), - CSV.parse(data, - liberal_parsing: { - backslash_quote: true, - double_quote_outside_quote: true - }), - ]) - end - end -end diff --git a/test/mri/csv/parse/test_quote_char_nil.rb b/test/mri/csv/parse/test_quote_char_nil.rb deleted file mode 100644 index fc3b646759b..00000000000 --- a/test/mri/csv/parse/test_quote_char_nil.rb +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseQuoteCharNil < Test::Unit::TestCase - extend DifferentOFS - - def test_full - assert_equal(["a", "b"], CSV.parse_line(%Q{a,b}, quote_char: nil)) - end - - def test_end_with_nil - assert_equal(["a", nil, nil, nil], CSV.parse_line(%Q{a,,,}, quote_char: nil)) - end - - def test_nil_nil - assert_equal([nil, nil], CSV.parse_line(%Q{,}, quote_char: nil)) - end - - def test_unquoted_value_multiple_characters_col_sep - data = %q{ax} - assert_equal([[%Q{a", quote_char: nil)) - end - - def test_csv_header_string - data = <<~DATA - first,second,third - A,B,C - 1,2,3 - DATA - assert_equal( - CSV::Table.new([ - CSV::Row.new(["my", "new", "headers"], ["first", "second", "third"]), - CSV::Row.new(["my", "new", "headers"], ["A", "B", "C"]), - CSV::Row.new(["my", "new", "headers"], ["1", "2", "3"]) - ]), - CSV.parse(data, headers: "my,new,headers", quote_char: nil) - ) - end - - def test_comma - assert_equal([["a", "b", nil, "d"]], - CSV.parse("a,b,,d", col_sep: ",", quote_char: nil)) - end - - def test_space - assert_equal([["a", "b", nil, "d"]], - CSV.parse("a b d", col_sep: " ", quote_char: nil)) - end - - def encode_array(array, encoding) - array.collect do |element| - element ? element.encode(encoding) : element - end - end - - def test_space_no_ascii - encoding = Encoding::UTF_16LE - assert_equal([encode_array(["a", "b", nil, "d"], encoding)], - CSV.parse("a b d".encode(encoding), - col_sep: " ".encode(encoding), - quote_char: nil)) - end - - def test_multiple_space - assert_equal([["a b", nil, "d"]], - CSV.parse("a b d", col_sep: " ", quote_char: nil)) - end - - def test_multiple_characters_leading_empty_fields - data = <<-CSV -<=><=>A<=>B<=>C -1<=>2<=>3 - CSV - assert_equal([ - [nil, nil, "A", "B", "C"], - ["1", "2", "3"], - ], - CSV.parse(data, col_sep: "<=>", quote_char: nil)) - end - - def test_line - lines = [ - "abc,def\n", - ] - csv = CSV.new(lines.join(""), quote_char: nil) - lines.each do |line| - csv.shift - assert_equal(line, csv.line) - end - end -end diff --git a/test/mri/csv/parse/test_read.rb b/test/mri/csv/parse/test_read.rb deleted file mode 100644 index ba6fe985a94..00000000000 --- a/test/mri/csv/parse/test_read.rb +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseRead < Test::Unit::TestCase - extend DifferentOFS - - def test_shift - data = <<-CSV -1 -2 -3 - CSV - csv = CSV.new(data) - assert_equal([ - ["1"], - [["2"], ["3"]], - nil, - ], - [ - csv.shift, - csv.read, - csv.shift, - ]) - end -end diff --git a/test/mri/csv/parse/test_rewind.rb b/test/mri/csv/parse/test_rewind.rb deleted file mode 100644 index 0aa403b7562..00000000000 --- a/test/mri/csv/parse/test_rewind.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseRewind < Test::Unit::TestCase - extend DifferentOFS - - def parse(data, **options) - csv = CSV.new(data, **options) - records = csv.to_a - csv.rewind - [records, csv.to_a] - end - - def test_default - data = <<-CSV -Ruby,2.6.0,script - CSV - assert_equal([ - [["Ruby", "2.6.0", "script"]], - [["Ruby", "2.6.0", "script"]], - ], - parse(data)) - end - - def test_have_headers - data = <<-CSV -Language,Version,Type -Ruby,2.6.0,script - CSV - assert_equal([ - [CSV::Row.new(["Language", "Version", "Type"], - ["Ruby", "2.6.0", "script"])], - [CSV::Row.new(["Language", "Version", "Type"], - ["Ruby", "2.6.0", "script"])], - ], - parse(data, headers: true)) - end -end diff --git a/test/mri/csv/parse/test_row_separator.rb b/test/mri/csv/parse/test_row_separator.rb deleted file mode 100644 index eaf6adc9101..00000000000 --- a/test/mri/csv/parse/test_row_separator.rb +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseRowSeparator < Test::Unit::TestCase - extend DifferentOFS - include Helper - - def test_multiple_characters - with_chunk_size("1") do - assert_equal([["a"], ["b"]], - CSV.parse("a\r\nb\r\n", row_sep: "\r\n")) - end - end -end diff --git a/test/mri/csv/parse/test_skip_lines.rb b/test/mri/csv/parse/test_skip_lines.rb deleted file mode 100644 index 98d67ae51c1..00000000000 --- a/test/mri/csv/parse/test_skip_lines.rb +++ /dev/null @@ -1,118 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseSkipLines < Test::Unit::TestCase - extend DifferentOFS - include Helper - - def test_default - csv = CSV.new("a,b,c\n") - assert_nil(csv.skip_lines) - end - - def test_regexp - csv = <<-CSV -1 -#2 - #3 -4 - CSV - assert_equal([ - ["1"], - ["4"], - ], - CSV.parse(csv, :skip_lines => /\A\s*#/)) - end - - def test_regexp_quoted - csv = <<-CSV -1 -#2 -"#3" -4 - CSV - assert_equal([ - ["1"], - ["#3"], - ["4"], - ], - CSV.parse(csv, :skip_lines => /\A\s*#/)) - end - - def test_string - csv = <<-CSV -1 -.2 -3. -4 - CSV - assert_equal([ - ["1"], - ["4"], - ], - CSV.parse(csv, :skip_lines => ".")) - end - - class RegexStub - end - - def test_not_matchable - regex_stub = RegexStub.new - csv = CSV.new("1\n", :skip_lines => regex_stub) - error = assert_raise(ArgumentError) do - csv.shift - end - assert_equal(":skip_lines has to respond to #match: #{regex_stub.inspect}", - error.message) - end - - class Matchable - def initialize(pattern) - @pattern = pattern - end - - def match(line) - @pattern.match(line) - end - end - - def test_matchable - csv = <<-CSV -1 -# 2 -3 -# 4 - CSV - assert_equal([ - ["1"], - ["3"], - ], - CSV.parse(csv, :skip_lines => Matchable.new(/\A#/))) - end - - def test_multibyte_data - # U+3042 HIRAGANA LETTER A - # U+3044 HIRAGANA LETTER I - # U+3046 HIRAGANA LETTER U - value = "\u3042\u3044\u3046" - with_chunk_size("5") do - assert_equal([[value], [value]], - CSV.parse("#{value}\n#{value}\n", - :skip_lines => /\A#/)) - end - end - - def test_empty_line_and_liberal_parsing - assert_equal([["a", "b"]], - CSV.parse("a,b\n", - :liberal_parsing => true, - :skip_lines => /^$/)) - end - - def test_crlf - assert_equal([["a", "b"]], - CSV.parse("a,b\r\n,\r\n", - :skip_lines => /^,+$/)) - end -end diff --git a/test/mri/csv/parse/test_strip.rb b/test/mri/csv/parse/test_strip.rb deleted file mode 100644 index c5e35209cc1..00000000000 --- a/test/mri/csv/parse/test_strip.rb +++ /dev/null @@ -1,112 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseStrip < Test::Unit::TestCase - extend DifferentOFS - - def test_both - assert_equal(["a", "b"], - CSV.parse_line(%Q{ a , b }, strip: true)) - end - - def test_left - assert_equal(["a", "b"], - CSV.parse_line(%Q{ a, b}, strip: true)) - end - - def test_right - assert_equal(["a", "b"], - CSV.parse_line(%Q{a ,b }, strip: true)) - end - - def test_middle - assert_equal(["a b"], - CSV.parse_line(%Q{a b}, strip: true)) - end - - def test_quoted - assert_equal([" a ", " b "], - CSV.parse_line(%Q{" a "," b "}, strip: true)) - end - - def test_liberal_parsing - assert_equal([" a ", "b", " c ", " d "], - CSV.parse_line(%Q{" a ", b , " c "," d " }, - strip: true, - liberal_parsing: true)) - end - - def test_string - assert_equal(["a", " b"], - CSV.parse_line(%Q{ a , " b" }, - strip: " ")) - end - - def test_no_quote - assert_equal([" a ", " b "], - CSV.parse_line(%Q{" a ", b }, - strip: %Q{"}, - quote_char: nil)) - end - - def test_do_not_strip_cr - assert_equal([ - ["a", "b "], - ["a", "b "], - ], - CSV.parse(%Q{"a" ,"b " \r} + - %Q{"a" ,"b " \r}, - strip: true)) - end - - def test_do_not_strip_lf - assert_equal([ - ["a", "b "], - ["a", "b "], - ], - CSV.parse(%Q{"a" ,"b " \n} + - %Q{"a" ,"b " \n}, - strip: true)) - end - - def test_do_not_strip_crlf - assert_equal([ - ["a", "b "], - ["a", "b "], - ], - CSV.parse(%Q{"a" ,"b " \r\n} + - %Q{"a" ,"b " \r\n}, - strip: true)) - end - - def test_col_sep_incompatible_true - message = "The provided strip (true) and " \ - "col_sep (\\t) options are incompatible." - assert_raise_with_message(ArgumentError, message) do - CSV.parse_line(%Q{"a"\t"b"\n}, - col_sep: "\t", - strip: true) - end - end - - def test_col_sep_incompatible_string - message = "The provided strip (\\t) and " \ - "col_sep (\\t) options are incompatible." - assert_raise_with_message(ArgumentError, message) do - CSV.parse_line(%Q{"a"\t"b"\n}, - col_sep: "\t", - strip: "\t") - end - end - - def test_col_sep_compatible_string - assert_equal( - ["a", "b"], - CSV.parse_line(%Q{\va\tb\v\n}, - col_sep: "\t", - strip: "\v") - ) - end -end diff --git a/test/mri/csv/parse/test_unconverted_fields.rb b/test/mri/csv/parse/test_unconverted_fields.rb deleted file mode 100644 index 437124ebd3c..00000000000 --- a/test/mri/csv/parse/test_unconverted_fields.rb +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -class TestCSVParseUnconvertedFields < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @custom = lambda {|field| /\A:(\S.*?)\s*\Z/ =~ field ? $1.to_sym : field} - - @headers = ["first", "second", "third"] - @data = <<-CSV -first,second,third -1,2,3 - CSV - end - - - def test_custom - row = CSV.parse_line("Numbers,:integer,1,:float,3.015", - converters: [:numeric, @custom], - unconverted_fields: true) - assert_equal([ - ["Numbers", :integer, 1, :float, 3.015], - ["Numbers", ":integer", "1", ":float", "3.015"], - ], - [ - row, - row.unconverted_fields, - ]) - end - - def test_no_fields - row = CSV.parse_line("\n", - converters: [:numeric, @custom], - unconverted_fields: true) - assert_equal([ - [], - [], - ], - [ - row, - row.unconverted_fields, - ]) - end - - def test_parsed_header - row = CSV.parse_line(@data, - converters: :numeric, - unconverted_fields: true, - headers: :first_row) - assert_equal([ - CSV::Row.new(@headers, - [1, 2, 3]), - ["1", "2", "3"], - ], - [ - row, - row.unconverted_fields, - ]) - end - - def test_return_headers - row = CSV.parse_line(@data, - converters: :numeric, - unconverted_fields: true, - headers: :first_row, - return_headers: true) - assert_equal([ - CSV::Row.new(@headers, - @headers), - @headers, - ], - [ - row, - row.unconverted_fields, - ]) - end - - def test_header_converters - row = CSV.parse_line(@data, - converters: :numeric, - unconverted_fields: true, - headers: :first_row, - return_headers: true, - header_converters: :symbol) - assert_equal([ - CSV::Row.new(@headers.collect(&:to_sym), - @headers), - @headers, - ], - [ - row, - row.unconverted_fields, - ]) - end - - def test_specified_headers - row = CSV.parse_line("\n", - converters: :numeric, - unconverted_fields: true, - headers: %w{my new headers}, - return_headers: true, - header_converters: :symbol) - assert_equal([ - CSV::Row.new([:my, :new, :headers], - ["my", "new", "headers"]), - [], - ], - [ - row, - row.unconverted_fields, - ]) - end -end diff --git a/test/mri/csv/test_data_converters.rb b/test/mri/csv/test_data_converters.rb deleted file mode 100644 index c20a5d1f4ba..00000000000 --- a/test/mri/csv/test_data_converters.rb +++ /dev/null @@ -1,190 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "helper" - -class TestCSVDataConverters < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @win_safe_time_str = Time.now.strftime("%a %b %d %H:%M:%S %Y") - end - - def test_builtin_integer_converter - # does convert - [-5, 1, 10000000000].each do |n| - assert_equal(n, CSV::Converters[:integer][n.to_s]) - end - - # does not convert - (%w{junk 1.0} + [""]).each do |str| - assert_equal(str, CSV::Converters[:integer][str]) - end - end - - def test_builtin_float_converter - # does convert - [-5.1234, 0, 2.3e-11].each do |n| - assert_equal(n, CSV::Converters[:float][n.to_s]) - end - - # does not convert - (%w{junk 1..0 .015F} + [""]).each do |str| - assert_equal(str, CSV::Converters[:float][str]) - end - end - - def test_builtin_date_converter - # does convert - assert_instance_of( - Date, - CSV::Converters[:date][@win_safe_time_str.sub(/\d+:\d+:\d+ /, "")] - ) - - # does not convert - assert_instance_of(String, CSV::Converters[:date]["junk"]) - end - - def test_builtin_date_time_converter - # does convert - assert_instance_of( DateTime, - CSV::Converters[:date_time][@win_safe_time_str] ) - - # does not convert - assert_instance_of(String, CSV::Converters[:date_time]["junk"]) - end - - def test_builtin_date_time_converter_iso8601_date - iso8601_string = "2018-01-14" - datetime = DateTime.new(2018, 1, 14) - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_minute - iso8601_string = "2018-01-14T22:25" - datetime = DateTime.new(2018, 1, 14, 22, 25) - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_second - iso8601_string = "2018-01-14T22:25:19" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_under_second - iso8601_string = "2018-01-14T22:25:19.1" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1) - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_under_second_offset - iso8601_string = "2018-01-14T22:25:19.1+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_offset - iso8601_string = "2018-01-14T22:25:19+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_iso8601_utc - iso8601_string = "2018-01-14T22:25:19Z" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][iso8601_string]) - end - - def test_builtin_date_time_converter_rfc3339_minute - rfc3339_string = "2018-01-14 22:25" - datetime = DateTime.new(2018, 1, 14, 22, 25) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_second - rfc3339_string = "2018-01-14 22:25:19" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_under_second - rfc3339_string = "2018-01-14 22:25:19.1" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_under_second_offset - rfc3339_string = "2018-01-14 22:25:19.1+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_offset - rfc3339_string = "2018-01-14 22:25:19+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_utc - rfc3339_string = "2018-01-14 22:25:19Z" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_minute - rfc3339_string = "2018-01-14\t22:25" - datetime = DateTime.new(2018, 1, 14, 22, 25) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_second - rfc3339_string = "2018-01-14\t22:25:19" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_under_second - rfc3339_string = "2018-01-14\t22:25:19.1" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_under_second_offset - rfc3339_string = "2018-01-14\t22:25:19.1+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19.1, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_offset - rfc3339_string = "2018-01-14\t22:25:19+09:00" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19, "+9") - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end - - def test_builtin_date_time_converter_rfc3339_tab_utc - rfc3339_string = "2018-01-14\t22:25:19Z" - datetime = DateTime.new(2018, 1, 14, 22, 25, 19) - assert_equal(datetime, - CSV::Converters[:date_time][rfc3339_string]) - end -end diff --git a/test/mri/csv/test_encodings.rb b/test/mri/csv/test_encodings.rb deleted file mode 100644 index f08d551f69e..00000000000 --- a/test/mri/csv/test_encodings.rb +++ /dev/null @@ -1,403 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "helper" - -class TestCSVEncodings < Test::Unit::TestCase - extend DifferentOFS - include Helper - - def setup - super - require 'tempfile' - @temp_csv_file = Tempfile.new(%w"test_csv. .csv") - @temp_csv_path = @temp_csv_file.path - @temp_csv_file.close - end - - def teardown - @temp_csv_file.close! - super - end - - ######################################## - ### Hand Test Some Popular Encodings ### - ######################################## - - def test_parses_utf8_encoding - assert_parses( [ %w[ one two … ], - %w[ 1 … 3 ], - %w[ … 5 6 ] ], "UTF-8" ) - end - - def test_parses_latin1_encoding - assert_parses( [ %w[ one two Résumé ], - %w[ 1 Résumé 3 ], - %w[ Résumé 5 6 ] ], "ISO-8859-1" ) - end - - def test_parses_utf16be_encoding - assert_parses( [ %w[ one two … ], - %w[ 1 … 3 ], - %w[ … 5 6 ] ], "UTF-16BE" ) - end - - def test_parses_shift_jis_encoding - assert_parses( [ %w[ 一 二 三 ], - %w[ 四 五 六 ], - %w[ 七 八 九 ] ], "Shift_JIS" ) - end - - ########################################################### - ### Try Simple Reading for All Non-dummy Ruby Encodings ### - ########################################################### - - def test_reading_with_most_encodings - each_encoding do |encoding| - begin - assert_parses( [ %w[ abc def ], - %w[ ghi jkl ] ], encoding ) - rescue Encoding::ConverterNotFoundError - fail("Failed to support #{encoding.name}.") - end - end - end - - def test_regular_expression_escaping - each_encoding do |encoding| - begin - assert_parses( [ %w[ abc def ], - %w[ ghi jkl ] ], encoding, col_sep: "|" ) - rescue Encoding::ConverterNotFoundError - fail("Failed to properly escape #{encoding.name}.") - end - end - end - - def test_read_with_default_encoding - data = "abc" - default_external = Encoding.default_external - each_encoding do |encoding| - File.open(@temp_csv_path, "wb", encoding: encoding) {|f| f << data} - begin - no_warnings do - Encoding.default_external = encoding - end - result = CSV.read(@temp_csv_path)[0][0] - ensure - no_warnings do - Encoding.default_external = default_external - end - end - assert_equal(encoding, result.encoding) - end - end - - ####################################################################### - ### Stress Test ASCII Compatible and Non-ASCII Compatible Encodings ### - ####################################################################### - - def test_auto_line_ending_detection - # arrange data to place a \r at the end of CSV's read ahead point - encode_for_tests([["a" * 509]], row_sep: "\r\n") do |data| - assert_equal("\r\n".encode(data.encoding), CSV.new(data).row_sep) - end - end - - def test_csv_chars_are_transcoded - encode_for_tests([%w[abc def]]) do |data| - %w[col_sep row_sep quote_char].each do |csv_char| - assert_equal( "|".encode(data.encoding), - CSV.new(data, csv_char.to_sym => "|").send(csv_char) ) - end - end - end - - def test_parser_works_with_encoded_headers - encode_for_tests([%w[one two three], %w[1 2 3]]) do |data| - parsed = CSV.parse(data, headers: true) - assert_all?(parsed.headers, "Wrong data encoding.") {|h| h.encoding == data.encoding} - parsed.each do |row| - assert_all?(row.fields, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - end - - def test_built_in_converters_transcode_to_utf_8_then_convert - encode_for_tests([%w[one two three], %w[1 2 3]]) do |data| - parsed = CSV.parse(data, converters: :integer) - assert_all?(parsed[0], "Wrong data encoding.") {|f| f.encoding == data.encoding} - assert_equal([1, 2, 3], parsed[1]) - end - end - - def test_built_in_header_converters_transcode_to_utf_8_then_convert - encode_for_tests([%w[one two three], %w[1 2 3]]) do |data| - parsed = CSV.parse( data, headers: true, - header_converters: :downcase ) - assert_all?(parsed.headers, "Wrong data encoding.") {|h| h.encoding.name == "UTF-8"} - assert_all?(parsed[0].fields, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - - def test_open_allows_you_to_set_encodings - encode_for_tests([%w[abc def]]) do |data| - # read and write in encoding - File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data } - CSV.open(@temp_csv_path, "rb:#{data.encoding.name}") do |csv| - csv.each do |row| - assert_all?(row, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - - # read and write with transcoding - File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f| - f << data - end - CSV.open(@temp_csv_path, "rb:UTF-32BE:#{data.encoding.name}") do |csv| - csv.each do |row| - assert_all?(row, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - end - end - - def test_foreach_allows_you_to_set_encodings - encode_for_tests([%w[abc def]]) do |data| - # read and write in encoding - File.open(@temp_csv_path, "wb", encoding: data.encoding) { |f| f << data } - CSV.foreach(@temp_csv_path, encoding: data.encoding) do |row| - row.each {|f| assert_equal(f.encoding, data.encoding)} - end - - # read and write with transcoding - File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f| - f << data - end - CSV.foreach( @temp_csv_path, - encoding: "UTF-32BE:#{data.encoding.name}" ) do |row| - assert_all?(row, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - end - - def test_read_allows_you_to_set_encodings - encode_for_tests([%w[abc def]]) do |data| - # read and write in encoding - File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data } - rows = CSV.read(@temp_csv_path, encoding: data.encoding.name) - assert_all?(rows.flatten, "Wrong data encoding.") {|f| f.encoding == data.encoding} - - # read and write with transcoding - File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f| - f << data - end - rows = CSV.read( @temp_csv_path, - encoding: "UTF-32BE:#{data.encoding.name}" ) - assert_all?(rows.flatten, "Wrong data encoding.") {|f| f.encoding == data.encoding} - end - end - - ################################# - ### Write CSV in any Encoding ### - ################################# - - def test_can_write_csv_in_any_encoding - each_encoding do |encoding| - # test generate_line with encoding hint - begin - csv = %w[abc d|ef].map { |f| f.encode(encoding) }. - to_csv(col_sep: "|", encoding: encoding.name) - rescue Encoding::ConverterNotFoundError - next - end - assert_equal(encoding, csv.encoding) - - # test generate_line with encoding guessing from fields - csv = %w[abc d|ef].map { |f| f.encode(encoding) }.to_csv(col_sep: "|") - assert_equal(encoding, csv.encoding) - - # writing to files - data = encode_ary([%w[abc d,ef], %w[123 456 ]], encoding) - CSV.open(@temp_csv_path, "wb:#{encoding.name}") do |f| - data.each { |row| f << row } - end - assert_equal(data, CSV.read(@temp_csv_path, encoding: encoding.name)) - end - end - - def test_encoding_is_upgraded_during_writing_as_needed - data = ["foo".force_encoding("US-ASCII"), "\u3042"] - assert_equal("US-ASCII", data.first.encoding.name) - assert_equal("UTF-8", data.last.encoding.name) - assert_equal("UTF-8", data.join('').encoding.name) - assert_equal("UTF-8", data.to_csv.encoding.name) - end - - def test_encoding_is_upgraded_for_ascii_content_during_writing_as_needed - data = ["foo".force_encoding("ISO-8859-1"), "\u3042"] - assert_equal("ISO-8859-1", data.first.encoding.name) - assert_equal("UTF-8", data.last.encoding.name) - assert_equal("UTF-8", data.join('').encoding.name) - assert_equal("UTF-8", data.to_csv.encoding.name) - end - - def test_encoding_is_not_upgraded_for_non_ascii_content_during_writing_as_needed - data = ["\u00c0".encode("ISO-8859-1"), "\u3042"] - assert_equal([ - "ISO-8859-1", - "UTF-8", - ], - data.collect {|field| field.encoding.name}) - assert_raise(Encoding::CompatibilityError) do - data.to_csv - end - end - - def test_explicit_encoding - bug9766 = '[ruby-core:62113] [Bug #9766]' - s = CSV.generate(encoding: "Windows-31J") do |csv| - csv << ["foo".force_encoding("ISO-8859-1"), "\u3042"] - end - assert_equal(["foo,\u3042\n".encode(Encoding::Windows_31J), Encoding::Windows_31J], [s, s.encoding], bug9766) - end - - def test_encoding_with_default_internal - with_default_internal(Encoding::UTF_8) do - s = CSV.generate(String.new(encoding: Encoding::Big5), encoding: Encoding::Big5) do |csv| - csv << ["漢字"] - end - assert_equal(["漢字\n".encode(Encoding::Big5), Encoding::Big5], [s, s.encoding]) - end - end - - def test_row_separator_detection_with_invalid_encoding - csv = CSV.new("invalid,\xF8\r\nvalid,x\r\n".force_encoding("UTF-8"), - encoding: "UTF-8") - assert_equal("\r\n", csv.row_sep) - end - - def test_invalid_encoding_row_error - csv = CSV.new("valid,x\rinvalid,\xF8\r".force_encoding("UTF-8"), - encoding: "UTF-8", row_sep: "\r") - error = assert_raise(CSV::MalformedCSVError) do - csv.shift - csv.shift - end - assert_equal("Invalid byte sequence in UTF-8 in line 2.", - error.message) - end - - def test_string_input_transcode - # U+3042 HIRAGANA LETTER A - # U+3044 HIRAGANA LETTER I - # U+3046 HIRAGANA LETTER U - value = "\u3042\u3044\u3046" - csv = CSV.new(value, encoding: "UTF-8:EUC-JP") - assert_equal([[value.encode("EUC-JP")]], - csv.read) - end - - def test_string_input_set_encoding_string - # U+3042 HIRAGANA LETTER A - # U+3044 HIRAGANA LETTER I - # U+3046 HIRAGANA LETTER U - value = "\u3042\u3044\u3046".encode("EUC-JP") - csv = CSV.new(value.dup.force_encoding("UTF-8"), encoding: "EUC-JP") - assert_equal([[value.encode("EUC-JP")]], - csv.read) - end - - def test_string_input_set_encoding_encoding - # U+3042 HIRAGANA LETTER A - # U+3044 HIRAGANA LETTER I - # U+3046 HIRAGANA LETTER U - value = "\u3042\u3044\u3046".encode("EUC-JP") - csv = CSV.new(value.dup.force_encoding("UTF-8"), - encoding: Encoding.find("EUC-JP")) - assert_equal([[value.encode("EUC-JP")]], - csv.read) - end - - private - - def assert_parses(fields, encoding, **options) - encoding = Encoding.find(encoding) unless encoding.is_a? Encoding - orig_fields = fields - fields = encode_ary(fields, encoding) - data = ary_to_data(fields, **options) - parsed = CSV.parse(data, **options) - assert_equal(fields, parsed) - parsed.flatten.each_with_index do |field, i| - assert_equal(encoding, field.encoding, "Field[#{i + 1}] was transcoded.") - end - File.open(@temp_csv_path, "wb") {|f| f.print(data)} - CSV.open(@temp_csv_path, "rb:#{encoding}", **options) do |csv| - csv.each_with_index do |row, i| - assert_equal(fields[i], row) - end - end - begin - CSV.open(@temp_csv_path, - "rb:#{encoding}:#{__ENCODING__}", - **options) do |csv| - csv.each_with_index do |row, i| - assert_equal(orig_fields[i], row) - end - end unless encoding == __ENCODING__ - rescue Encoding::ConverterNotFoundError - end - options[:encoding] = encoding.name - CSV.open(@temp_csv_path, **options) do |csv| - csv.each_with_index do |row, i| - assert_equal(fields[i], row) - end - end - options.delete(:encoding) - options[:external_encoding] = encoding.name - options[:internal_encoding] = __ENCODING__.name - begin - CSV.open(@temp_csv_path, **options) do |csv| - csv.each_with_index do |row, i| - assert_equal(orig_fields[i], row) - end - end unless encoding == __ENCODING__ - rescue Encoding::ConverterNotFoundError - end - end - - def encode_ary(ary, encoding) - ary.map { |row| row.map { |field| field.encode(encoding) } } - end - - def ary_to_data(ary, **options) - encoding = ary.flatten.first.encoding - quote_char = (options[:quote_char] || '"').encode(encoding) - col_sep = (options[:col_sep] || ",").encode(encoding) - row_sep = (options[:row_sep] || "\n").encode(encoding) - ary.map { |row| - row.map { |field| - [quote_char, field.encode(encoding), quote_char].join('') - }.join(col_sep) + row_sep - }.join('').encode(encoding) - end - - def encode_for_tests(data, **options) - yield ary_to_data(encode_ary(data, "UTF-8"), **options) - yield ary_to_data(encode_ary(data, "UTF-16BE"), **options) - end - - def each_encoding - Encoding.list.each do |encoding| - next if encoding.dummy? # skip "dummy" encodings - yield encoding - end - end - - def no_warnings - old_verbose, $VERBOSE = $VERBOSE, nil - yield - ensure - $VERBOSE = old_verbose - end -end diff --git a/test/mri/csv/test_features.rb b/test/mri/csv/test_features.rb deleted file mode 100644 index d6eb2dc13be..00000000000 --- a/test/mri/csv/test_features.rb +++ /dev/null @@ -1,359 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -begin - require "zlib" -rescue LoadError -end - -require_relative "helper" -require "tempfile" - -class TestCSVFeatures < Test::Unit::TestCase - extend DifferentOFS - - TEST_CASES = [ [%Q{a,b}, ["a", "b"]], - [%Q{a,"""b"""}, ["a", "\"b\""]], - [%Q{a,"""b"}, ["a", "\"b"]], - [%Q{a,"b"""}, ["a", "b\""]], - [%Q{a,"\nb"""}, ["a", "\nb\""]], - [%Q{a,"""\nb"}, ["a", "\"\nb"]], - [%Q{a,"""\nb\n"""}, ["a", "\"\nb\n\""]], - [%Q{a,"""\nb\n""",\nc}, ["a", "\"\nb\n\"", nil]], - [%Q{a,,,}, ["a", nil, nil, nil]], - [%Q{,}, [nil, nil]], - [%Q{"",""}, ["", ""]], - [%Q{""""}, ["\""]], - [%Q{"""",""}, ["\"",""]], - [%Q{,""}, [nil,""]], - [%Q{,"\r"}, [nil,"\r"]], - [%Q{"\r\n,"}, ["\r\n,"]], - [%Q{"\r\n,",}, ["\r\n,", nil]] ] - - def setup - super - @sample_data = <<-CSV -line,1,abc -line,2,"def\nghi" - -line,4,jkl - CSV - @csv = CSV.new(@sample_data) - end - - def test_col_sep - [";", "\t"].each do |sep| - TEST_CASES.each do |test_case| - assert_equal( test_case.last.map { |t| t.tr(",", sep) unless t.nil? }, - CSV.parse_line( test_case.first.tr(",", sep), - col_sep: sep ) ) - end - end - assert_equal([",,,", nil], CSV.parse_line(",,,;", col_sep: ";")) - end - - def test_col_sep_nil - assert_raise_with_message(ArgumentError, - ":col_sep must be 1 or more characters: nil") do - CSV.parse(@sample_data, col_sep: nil) - end - end - - def test_col_sep_empty - assert_raise_with_message(ArgumentError, - ":col_sep must be 1 or more characters: \"\"") do - CSV.parse(@sample_data, col_sep: "") - end - end - - def test_row_sep - error = assert_raise(CSV::MalformedCSVError) do - CSV.parse_line("1,2,3\n,4,5\r\n", row_sep: "\r\n") - end - assert_equal("Unquoted fields do not allow new line <\"\\n\"> in line 1.", - error.message) - assert_equal( ["1", "2", "3\n", "4", "5"], - CSV.parse_line(%Q{1,2,"3\n",4,5\r\n}, row_sep: "\r\n")) - end - - def test_quote_char - TEST_CASES.each do |test_case| - assert_equal(test_case.last.map {|t| t.tr('"', "'") unless t.nil?}, - CSV.parse_line(test_case.first.tr('"', "'"), - quote_char: "'" )) - end - end - - def test_quote_char_special_regexp_char - TEST_CASES.each do |test_case| - assert_equal(test_case.last.map {|t| t.tr('"', "|") unless t.nil?}, - CSV.parse_line(test_case.first.tr('"', "|"), - quote_char: "|")) - end - end - - def test_quote_char_special_regexp_char_liberal_parsing - TEST_CASES.each do |test_case| - assert_equal(test_case.last.map {|t| t.tr('"', "|") unless t.nil?}, - CSV.parse_line(test_case.first.tr('"', "|"), - quote_char: "|", - liberal_parsing: true)) - end - end - - def test_csv_char_readers - %w[col_sep row_sep quote_char].each do |reader| - csv = CSV.new("abc,def", reader.to_sym => "|") - assert_equal("|", csv.send(reader)) - end - end - - def test_row_sep_auto_discovery - ["\r\n", "\n", "\r"].each do |line_end| - data = "1,2,3#{line_end}4,5#{line_end}" - discovered = CSV.new(data).row_sep - assert_equal(line_end, discovered) - end - - assert_equal("\n", CSV.new("\n\r\n\r").row_sep) - - assert_equal($/, CSV.new("").row_sep) - - assert_equal($/, CSV.new(STDERR).row_sep) - end - - def test_line - lines = [ - %Q(\u{3000}abc,def\n), - %Q(\u{3000}abc,"d\nef"\n), - %Q(\u{3000}abc,"d\r\nef"\n), - %Q(\u{3000}abc,"d\ref") - ] - csv = CSV.new(lines.join('')) - lines.each do |line| - csv.shift - assert_equal(line, csv.line) - end - end - - def test_lineno - assert_equal(5, @sample_data.lines.to_a.size) - - 4.times do |line_count| - assert_equal(line_count, @csv.lineno) - assert_not_nil(@csv.shift) - assert_equal(line_count + 1, @csv.lineno) - end - assert_nil(@csv.shift) - end - - def test_readline - test_lineno - - @csv.rewind - - test_lineno - end - - def test_unknown_options - assert_raise_with_message(ArgumentError, /unknown keyword/) { - CSV.new(@sample_data, unknown: :error) - } - assert_raise_with_message(ArgumentError, /unknown keyword/) { - CSV.new(@sample_data, universal_newline: true) - } - end - - def test_skip_blanks - assert_equal(4, @csv.to_a.size) - - @csv = CSV.new(@sample_data, skip_blanks: true) - - count = 0 - @csv.each do |row| - count += 1 - assert_equal("line", row.first) - end - assert_equal(3, count) - end - - def test_csv_behavior_readers - %w[ unconverted_fields return_headers write_headers - skip_blanks force_quotes ].each do |behavior| - assert_not_predicate(CSV.new("abc,def"), "#{behavior}?", "Behavior defaulted to on.") - csv = CSV.new("abc,def", behavior.to_sym => true) - assert_predicate(csv, "#{behavior}?", "Behavior change now registered.") - end - end - - def test_converters_reader - # no change - assert_equal( [:integer], - CSV.new("abc,def", converters: [:integer]).converters ) - - # just one - assert_equal( [:integer], - CSV.new("abc,def", converters: :integer).converters ) - - # expanded - assert_equal( [:integer, :float], - CSV.new("abc,def", converters: :numeric).converters ) - - # custom - csv = CSV.new("abc,def", converters: [:integer, lambda { }]) - assert_equal(2, csv.converters.size) - assert_equal(:integer, csv.converters.first) - assert_instance_of(Proc, csv.converters.last) - end - - def test_header_converters_reader - # no change - hc = :header_converters - assert_equal([:downcase], CSV.new("abc,def", hc => [:downcase]).send(hc)) - - # just one - assert_equal([:downcase], CSV.new("abc,def", hc => :downcase).send(hc)) - - # custom - csv = CSV.new("abc,def", hc => [:symbol, lambda { }]) - assert_equal(2, csv.send(hc).size) - assert_equal(:symbol, csv.send(hc).first) - assert_instance_of(Proc, csv.send(hc).last) - end - - # reported by Kev Jackson - def test_failing_to_escape_col_sep - assert_nothing_raised(Exception) { CSV.new(String.new, col_sep: "|") } - end - - # reported by Chris Roos - def test_failing_to_reset_headers_in_rewind - csv = CSV.new("forename,surname", headers: true, return_headers: true) - csv.each {|row| assert_predicate row, :header_row?} - csv.rewind - csv.each {|row| assert_predicate row, :header_row?} - end - - def test_gzip_reader - zipped = nil - assert_nothing_raised(NoMethodError) do - zipped = CSV.new( - Zlib::GzipReader.open( - File.join(File.dirname(__FILE__), "line_endings.gz") - ) - ) - end - assert_equal("\r\n", zipped.row_sep) - ensure - zipped.close - end if defined?(Zlib::GzipReader) - - def test_gzip_writer - Tempfile.create(%w"temp .gz") {|tempfile| - tempfile.close - file = tempfile.path - zipped = nil - assert_nothing_raised(NoMethodError) do - zipped = CSV.new(Zlib::GzipWriter.open(file)) - end - zipped << %w[one two three] - zipped << [1, 2, 3] - zipped.close - - assert_include(Zlib::GzipReader.open(file) {|f| f.read}, - $INPUT_RECORD_SEPARATOR, "@row_sep did not default") - } - end if defined?(Zlib::GzipWriter) - - def test_inspect_is_smart_about_io_types - str = CSV.new("string,data").inspect - assert_include(str, "io_type:StringIO", "IO type not detected.") - - str = CSV.new($stderr).inspect - assert_include(str, "io_type:$stderr", "IO type not detected.") - - Tempfile.create(%w"temp .csv") {|tempfile| - tempfile.close - path = tempfile.path - File.open(path, "w") { |csv| csv << "one,two,three\n1,2,3\n" } - str = CSV.open(path) { |csv| csv.inspect } - assert_include(str, "io_type:File", "IO type not detected.") - } - end - - def test_inspect_shows_key_attributes - str = @csv.inspect - %w[lineno col_sep row_sep quote_char].each do |attr_name| - assert_match(/\b#{attr_name}:[^\s>]+/, str) - end - end - - def test_inspect_shows_headers_when_available - csv = CSV.new("one,two,three\n1,2,3\n", headers: true) - assert_include(csv.inspect, "headers:true", "Header hint not shown.") - csv.shift # load headers - assert_match(/headers:\[[^\]]+\]/, csv.inspect) - end - - def test_inspect_encoding_is_ascii_compatible - csv = CSV.new("one,two,three\n1,2,3\n".encode("UTF-16BE")) - assert_send([Encoding, :compatible?, - Encoding.find("US-ASCII"), csv.inspect.encoding], - "inspect() was not ASCII compatible.") - end - - def test_version - assert_not_nil(CSV::VERSION) - assert_instance_of(String, CSV::VERSION) - assert_predicate(CSV::VERSION, :frozen?) - assert_match(/\A\d\.\d\.\d\z/, CSV::VERSION) - end - - def test_table_nil_equality - assert_nothing_raised(NoMethodError) { CSV.parse("test", headers: true) == nil } - end - - # non-seekable input stream for testing https://github.com/ruby/csv/issues/44 - class DummyIO - extend Forwardable - def_delegators :@io, :gets, :read, :pos, :eof? # no seek or rewind! - def initialize(data) - @io = StringIO.new(data) - end - end - - def test_line_separator_autodetection_for_non_seekable_input_lf - c = CSV.new(DummyIO.new("one,two,three\nfoo,bar,baz\n")) - assert_equal [["one", "two", "three"], ["foo", "bar", "baz"]], c.each.to_a - end - - def test_line_separator_autodetection_for_non_seekable_input_cr - c = CSV.new(DummyIO.new("one,two,three\rfoo,bar,baz\r")) - assert_equal [["one", "two", "three"], ["foo", "bar", "baz"]], c.each.to_a - end - - def test_line_separator_autodetection_for_non_seekable_input_cr_lf - c = CSV.new(DummyIO.new("one,two,three\r\nfoo,bar,baz\r\n")) - assert_equal [["one", "two", "three"], ["foo", "bar", "baz"]], c.each.to_a - end - - def test_line_separator_autodetection_for_non_seekable_input_1024_over_lf - table = (1..10).map { |row| (1..200).map { |col| "row#{row}col#{col}" }.to_a }.to_a - input = table.map { |line| line.join(",") }.join("\n") - c = CSV.new(DummyIO.new(input)) - assert_equal table, c.each.to_a - end - - def test_line_separator_autodetection_for_non_seekable_input_1024_over_cr_lf - table = (1..10).map { |row| (1..200).map { |col| "row#{row}col#{col}" }.to_a }.to_a - input = table.map { |line| line.join(",") }.join("\r\n") - c = CSV.new(DummyIO.new(input)) - assert_equal table, c.each.to_a - end - - def test_line_separator_autodetection_for_non_seekable_input_many_cr_only - # input with lots of CRs (to make sure no bytes are lost due to look-ahead) - c = CSV.new(DummyIO.new("foo\r" + "\r" * 9999 + "bar\r")) - assert_equal [["foo"]] + [[]] * 9999 + [["bar"]], c.each.to_a - end -end diff --git a/test/mri/csv/test_patterns.rb b/test/mri/csv/test_patterns.rb deleted file mode 100644 index 881f03a3a4a..00000000000 --- a/test/mri/csv/test_patterns.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require_relative "helper" - -class TestCSVPatternMatching < Test::Unit::TestCase - - def test_hash - case CSV::Row.new(%i{A B C}, [1, 2, 3]) - in B: b, C: c - assert_equal([2, 3], [b, c]) - end - end - - def test_hash_rest - case CSV::Row.new(%i{A B C}, [1, 2, 3]) - in B: b, **rest - assert_equal([2, { A: 1, C: 3 }], [b, rest]) - end - end - - def test_array - case CSV::Row.new(%i{A B C}, [1, 2, 3]) - in *, matched - assert_equal(3, matched) - end - end -end diff --git a/test/mri/csv/test_row.rb b/test/mri/csv/test_row.rb deleted file mode 100644 index b7179450412..00000000000 --- a/test/mri/csv/test_row.rb +++ /dev/null @@ -1,435 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "helper" - -class TestCSVRow < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @row = CSV::Row.new(%w{A B C A A}, [1, 2, 3, 4]) - end - - def test_initialize - # basic - row = CSV::Row.new(%w{A B C}, [1, 2, 3]) - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([["A", 1], ["B", 2], ["C", 3]], row.to_a) - - # missing headers - row = CSV::Row.new(%w{A}, [1, 2, 3]) - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([["A", 1], [nil, 2], [nil, 3]], row.to_a) - - # missing fields - row = CSV::Row.new(%w{A B C}, [1, 2]) - assert_not_nil(row) - assert_instance_of(CSV::Row, row) - assert_equal([["A", 1], ["B", 2], ["C", nil]], row.to_a) - end - - def test_row_type - # field rows - row = CSV::Row.new(%w{A B C}, [1, 2, 3]) # implicit - assert_not_predicate(row, :header_row?) - assert_predicate(row, :field_row?) - row = CSV::Row.new(%w{A B C}, [1, 2, 3], false) # explicit - assert_not_predicate(row, :header_row?) - assert_predicate(row, :field_row?) - - # header row - row = CSV::Row.new(%w{A B C}, [1, 2, 3], true) - assert_predicate(row, :header_row?) - assert_not_predicate(row, :field_row?) - end - - def test_headers - assert_equal(%w{A B C A A}, @row.headers) - end - - def test_field - # by name - assert_equal(2, @row.field("B")) - assert_equal(2, @row["B"]) # alias - - # by index - assert_equal(3, @row.field(2)) - - # by range - assert_equal([2,3], @row.field(1..2)) - - # missing - assert_nil(@row.field("Missing")) - assert_nil(@row.field(10)) - - # minimum index - assert_equal(1, @row.field("A")) - assert_equal(1, @row.field("A", 0)) - assert_equal(4, @row.field("A", 1)) - assert_equal(4, @row.field("A", 2)) - assert_equal(4, @row.field("A", 3)) - assert_equal(nil, @row.field("A", 4)) - assert_equal(nil, @row.field("A", 5)) - end - - def test_fetch - # only by name - assert_equal(2, @row.fetch('B')) - - # missing header raises KeyError - assert_raise KeyError do - @row.fetch('foo') - end - - # missing header yields itself to block - assert_equal 'bar', @row.fetch('foo') { |header| - header == 'foo' ? 'bar' : false } - - # missing header returns the given default value - assert_equal 'bar', @row.fetch('foo', 'bar') - - # more than one vararg raises ArgumentError - assert_raise ArgumentError do - @row.fetch('foo', 'bar', 'baz') - end - end - - def test_has_key? - assert_equal(true, @row.has_key?('B')) - assert_equal(false, @row.has_key?('foo')) - - # aliases - assert_equal(true, @row.header?('B')) - assert_equal(false, @row.header?('foo')) - - assert_equal(true, @row.include?('B')) - assert_equal(false, @row.include?('foo')) - - assert_equal(true, @row.member?('B')) - assert_equal(false, @row.member?('foo')) - - assert_equal(true, @row.key?('B')) - assert_equal(false, @row.key?('foo')) - end - - def test_set_field - # set field by name - assert_equal(100, @row["A"] = 100) - - # set field by index - assert_equal(300, @row[3] = 300) - - # set field by name and minimum index - assert_equal([:a, :b, :c], @row["A", 4] = [:a, :b, :c]) - - # verify the changes - assert_equal( [ ["A", 100], - ["B", 2], - ["C", 3], - ["A", 300], - ["A", [:a, :b, :c]] ], @row.to_a ) - - # assigning an index past the end - assert_equal("End", @row[10] = "End") - assert_equal( [ ["A", 100], - ["B", 2], - ["C", 3], - ["A", 300], - ["A", [:a, :b, :c]], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, "End"] ], @row.to_a ) - - # assigning a new field by header - assert_equal("New", @row[:new] = "New") - assert_equal( [ ["A", 100], - ["B", 2], - ["C", 3], - ["A", 300], - ["A", [:a, :b, :c]], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, nil], - [nil, "End"], - [:new, "New"] ], @row.to_a ) - end - - def test_append - # add a value - assert_equal(@row, @row << "Value") - assert_equal( [ ["A", 1], - ["B", 2], - ["C", 3], - ["A", 4], - ["A", nil], - [nil, "Value"] ], @row.to_a ) - - # add a pair - assert_equal(@row, @row << %w{Header Field}) - assert_equal( [ ["A", 1], - ["B", 2], - ["C", 3], - ["A", 4], - ["A", nil], - [nil, "Value"], - %w{Header Field} ], @row.to_a ) - - # a pair with Hash syntax - assert_equal(@row, @row << {key: :value}) - assert_equal( [ ["A", 1], - ["B", 2], - ["C", 3], - ["A", 4], - ["A", nil], - [nil, "Value"], - %w{Header Field}, - [:key, :value] ], @row.to_a ) - - # multiple fields at once - assert_equal(@row, @row.push(100, 200, [:last, 300])) - assert_equal( [ ["A", 1], - ["B", 2], - ["C", 3], - ["A", 4], - ["A", nil], - [nil, "Value"], - %w{Header Field}, - [:key, :value], - [nil, 100], - [nil, 200], - [:last, 300] ], @row.to_a ) - end - - def test_delete - # by index - assert_equal(["B", 2], @row.delete(1)) - - # by header - assert_equal(["C", 3], @row.delete("C")) - - end - - def test_delete_if - assert_equal(@row, @row.delete_if { |h, f| h == "A" and not f.nil? }) - assert_equal([["B", 2], ["C", 3], ["A", nil]], @row.to_a) - end - - def test_delete_if_without_block - enum = @row.delete_if - assert_instance_of(Enumerator, enum) - assert_equal(@row.size, enum.size) - - assert_equal(@row, enum.each { |h, f| h == "A" and not f.nil? }) - assert_equal([["B", 2], ["C", 3], ["A", nil]], @row.to_a) - end - - def test_fields - # all fields - assert_equal([1, 2, 3, 4, nil], @row.fields) - - # by header - assert_equal([1, 3], @row.fields("A", "C")) - - # by index - assert_equal([2, 3, nil], @row.fields(1, 2, 10)) - - # by both - assert_equal([2, 3, 4], @row.fields("B", "C", 3)) - - # with minimum indices - assert_equal([2, 3, 4], @row.fields("B", "C", ["A", 3])) - - # by header range - assert_equal([2, 3], @row.values_at("B".."C")) - end - - def test_index - # basic usage - assert_equal(0, @row.index("A")) - assert_equal(1, @row.index("B")) - assert_equal(2, @row.index("C")) - assert_equal(nil, @row.index("Z")) - - # with minimum index - assert_equal(0, @row.index("A")) - assert_equal(0, @row.index("A", 0)) - assert_equal(3, @row.index("A", 1)) - assert_equal(3, @row.index("A", 2)) - assert_equal(3, @row.index("A", 3)) - assert_equal(4, @row.index("A", 4)) - assert_equal(nil, @row.index("A", 5)) - end - - def test_queries - # fields - assert(@row.field?(4)) - assert(@row.field?(nil)) - assert(!@row.field?(10)) - end - - def test_each - # array style - ary = @row.to_a - @row.each do |pair| - assert_equal(ary.first.first, pair.first) - assert_equal(ary.shift.last, pair.last) - end - - # hash style - ary = @row.to_a - @row.each do |header, field| - assert_equal(ary.first.first, header) - assert_equal(ary.shift.last, field) - end - - # verify that we can chain the call - assert_equal(@row, @row.each { }) - - # without block - ary = @row.to_a - enum = @row.each - assert_instance_of(Enumerator, enum) - assert_equal(@row.size, enum.size) - enum.each do |pair| - assert_equal(ary.first.first, pair.first) - assert_equal(ary.shift.last, pair.last) - end - end - - def test_each_pair - assert_equal([ - ["A", 1], - ["B", 2], - ["C", 3], - ["A", 4], - ["A", nil], - ], - @row.each_pair.to_a) - end - - def test_enumerable - assert_equal( [["A", 1], ["A", 4], ["A", nil]], - @row.select { |pair| pair.first == "A" } ) - - assert_equal(10, @row.inject(0) { |sum, (_, n)| sum + (n || 0) }) - end - - def test_to_a - row = CSV::Row.new(%w{A B C}, [1, 2, 3]).to_a - assert_instance_of(Array, row) - row.each do |pair| - assert_instance_of(Array, pair) - assert_equal(2, pair.size) - end - assert_equal([["A", 1], ["B", 2], ["C", 3]], row) - end - - def test_to_hash - hash = @row.to_hash - assert_equal({"A" => @row["A"], "B" => @row["B"], "C" => @row["C"]}, hash) - hash.keys.each_with_index do |string_key, h| - assert_predicate(string_key, :frozen?) - assert_same(string_key, @row.headers[h]) - end - end - - def test_to_csv - # normal conversion - assert_equal("1,2,3,4,\n", @row.to_csv) - assert_equal("1,2,3,4,\n", @row.to_s) # alias - - # with options - assert_equal( "1|2|3|4|\r\n", - @row.to_csv(col_sep: "|", row_sep: "\r\n") ) - end - - def test_array_delegation - assert_not_empty(@row, "Row was empty.") - - assert_equal([@row.headers.size, @row.fields.size].max, @row.size) - end - - def test_inspect_shows_header_field_pairs - str = @row.inspect - @row.each do |header, field| - assert_include(str, "#{header.inspect}:#{field.inspect}", - "Header field pair not found.") - end - end - - def test_inspect_encoding_is_ascii_compatible - assert_send([Encoding, :compatible?, - Encoding.find("US-ASCII"), - @row.inspect.encoding], - "inspect() was not ASCII compatible.") - end - - def test_inspect_shows_symbol_headers_as_bare_attributes - str = CSV::Row.new(@row.headers.map { |h| h.to_sym }, @row.fields).inspect - @row.each do |header, field| - assert_include(str, "#{header}:#{field.inspect}", - "Header field pair not found.") - end - end - - def test_can_be_compared_with_other_classes - assert_not_nil(CSV::Row.new([ ], [ ]), "The row was nil") - end - - def test_can_be_compared_when_not_a_row - r = @row == [] - assert_equal false, r - end - - def test_dig_by_index - assert_equal(2, @row.dig(1)) - - assert_nil(@row.dig(100)) - end - - def test_dig_by_header - assert_equal(2, @row.dig("B")) - - assert_nil(@row.dig("Missing")) - end - - def test_dig_cell - row = CSV::Row.new(%w{A}, [["foo", ["bar", ["baz"]]]]) - - assert_equal("foo", row.dig(0, 0)) - assert_equal("bar", row.dig(0, 1, 0)) - - assert_equal("foo", row.dig("A", 0)) - assert_equal("bar", row.dig("A", 1, 0)) - end - - def test_dig_cell_no_dig - row = CSV::Row.new(%w{A}, ["foo"]) - - assert_raise(TypeError) do - row.dig(0, 0) - end - assert_raise(TypeError) do - row.dig("A", 0) - end - end - - def test_dup - row = CSV::Row.new(["A"], ["foo"]) - dupped_row = row.dup - dupped_row["A"] = "bar" - assert_equal(["foo", "bar"], - [row["A"], dupped_row["A"]]) - dupped_row.delete("A") - assert_equal(["foo", nil], - [row["A"], dupped_row["A"]]) - end -end diff --git a/test/mri/csv/test_table.rb b/test/mri/csv/test_table.rb deleted file mode 100644 index e8ab74044e0..00000000000 --- a/test/mri/csv/test_table.rb +++ /dev/null @@ -1,691 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "helper" - -class TestCSVTable < Test::Unit::TestCase - extend DifferentOFS - - def setup - super - @rows = [ CSV::Row.new(%w{A B C}, [1, 2, 3]), - CSV::Row.new(%w{A B C}, [4, 5, 6]), - CSV::Row.new(%w{A B C}, [7, 8, 9]) ] - @table = CSV::Table.new(@rows) - - @header_table = CSV::Table.new( - [CSV::Row.new(%w{A B C}, %w{A B C}, true)] + @rows - ) - - @header_only_table = CSV::Table.new([], headers: %w{A B C}) - end - - def test_initialize - assert_not_nil(@table) - assert_instance_of(CSV::Table, @table) - end - - def test_modes - assert_equal(:col_or_row, @table.mode) - - # non-destructive changes, intended for one shot calls - cols = @table.by_col - assert_equal(:col_or_row, @table.mode) - assert_equal(:col, cols.mode) - assert_equal(@table, cols) - - rows = @table.by_row - assert_equal(:col_or_row, @table.mode) - assert_equal(:row, rows.mode) - assert_equal(@table, rows) - - col_or_row = rows.by_col_or_row - assert_equal(:row, rows.mode) - assert_equal(:col_or_row, col_or_row.mode) - assert_equal(@table, col_or_row) - - # destructive mode changing calls - assert_equal(@table, @table.by_row!) - assert_equal(:row, @table.mode) - assert_equal(@table, @table.by_col_or_row!) - assert_equal(:col_or_row, @table.mode) - end - - def test_headers - assert_equal(@rows.first.headers, @table.headers) - end - - def test_headers_empty - t = CSV::Table.new([]) - assert_equal Array.new, t.headers - end - - def test_headers_only - assert_equal(%w[A B C], @header_only_table.headers) - end - - def test_headers_modified_by_row - table = CSV::Table.new([], headers: ["A", "B"]) - table << ["a", "b"] - table.first << {"C" => "c"} - assert_equal(["A", "B", "C"], table.headers) - end - - def test_index - ################## - ### Mixed Mode ### - ################## - # by row - @rows.each_index { |i| assert_equal(@rows[i], @table[i]) } - assert_equal(nil, @table[100]) # empty row - - # by row with Range - assert_equal([@table[1], @table[2]], @table[1..2]) - - # by col - @rows.first.headers.each do |header| - assert_equal(@rows.map { |row| row[header] }, @table[header]) - end - assert_equal([nil] * @rows.size, @table["Z"]) # empty col - - # by cell, row then col - assert_equal(2, @table[0][1]) - assert_equal(6, @table[1]["C"]) - - # by cell, col then row - assert_equal(5, @table["B"][1]) - assert_equal(9, @table["C"][2]) - - # with headers (by col) - assert_equal(["B", 2, 5, 8], @header_table["B"]) - - ################### - ### Column Mode ### - ################### - @table.by_col! - - assert_equal([2, 5, 8], @table[1]) - assert_equal([2, 5, 8], @table["B"]) - - ################ - ### Row Mode ### - ################ - @table.by_row! - - assert_equal(@rows[1], @table[1]) - assert_raise(TypeError) { @table["B"] } - - ############################ - ### One Shot Mode Change ### - ############################ - assert_equal(@rows[1], @table[1]) - assert_equal([2, 5, 8], @table.by_col[1]) - assert_equal(@rows[1], @table[1]) - end - - def test_set_row_or_column - ################## - ### Mixed Mode ### - ################## - # set row - @table[2] = [10, 11, 12] - assert_equal([%w[A B C], [1, 2, 3], [4, 5, 6], [10, 11, 12]], @table.to_a) - - @table[3] = CSV::Row.new(%w[A B C], [13, 14, 15]) - assert_equal( [%w[A B C], [1, 2, 3], [4, 5, 6], [10, 11, 12], [13, 14, 15]], - @table.to_a ) - - # set col - @table["Type"] = "data" - assert_equal( [ %w[A B C Type], - [1, 2, 3, "data"], - [4, 5, 6, "data"], - [10, 11, 12, "data"], - [13, 14, 15, "data"] ], - @table.to_a ) - - @table["Index"] = [1, 2, 3] - assert_equal( [ %w[A B C Type Index], - [1, 2, 3, "data", 1], - [4, 5, 6, "data", 2], - [10, 11, 12, "data", 3], - [13, 14, 15, "data", nil] ], - @table.to_a ) - - @table["B"] = [100, 200] - assert_equal( [ %w[A B C Type Index], - [1, 100, 3, "data", 1], - [4, 200, 6, "data", 2], - [10, nil, 12, "data", 3], - [13, nil, 15, "data", nil] ], - @table.to_a ) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -A,B,C,Type,Index -1,100,3,data,1 -4,200,6,data,2 -10,,12,data,3 -13,,15,data, - CSV - - # with headers - @header_table["Type"] = "data" - assert_equal(%w[Type data data data], @header_table["Type"]) - - ################### - ### Column Mode ### - ################### - @table.by_col! - - @table[1] = [2, 5, 11, 14] - assert_equal( [ %w[A B C Type Index], - [1, 2, 3, "data", 1], - [4, 5, 6, "data", 2], - [10, 11, 12, "data", 3], - [13, 14, 15, "data", nil] ], - @table.to_a ) - - @table["Extra"] = "new stuff" - assert_equal( [ %w[A B C Type Index Extra], - [1, 2, 3, "data", 1, "new stuff"], - [4, 5, 6, "data", 2, "new stuff"], - [10, 11, 12, "data", 3, "new stuff"], - [13, 14, 15, "data", nil, "new stuff"] ], - @table.to_a ) - - ################ - ### Row Mode ### - ################ - @table.by_row! - - @table[1] = (1..6).to_a - assert_equal( [ %w[A B C Type Index Extra], - [1, 2, 3, "data", 1, "new stuff"], - [1, 2, 3, 4, 5, 6], - [10, 11, 12, "data", 3, "new stuff"], - [13, 14, 15, "data", nil, "new stuff"] ], - @table.to_a ) - - assert_raise(TypeError) { @table["Extra"] = nil } - end - - def test_set_by_col_with_header_row - r = [ CSV::Row.new(%w{X Y Z}, [97, 98, 99], true) ] - t = CSV::Table.new(r) - t.by_col! - t['A'] = [42] - assert_equal(['A'], t['A']) - end - - def test_each - ###################### - ### Mixed/Row Mode ### - ###################### - i = 0 - @table.each do |row| - assert_equal(@rows[i], row) - i += 1 - end - - # verify that we can chain the call - assert_equal(@table, @table.each { }) - - # without block - enum = @table.each - assert_instance_of(Enumerator, enum) - assert_equal(@table.size, enum.size) - - i = 0 - enum.each do |row| - assert_equal(@rows[i], row) - i += 1 - end - - ################### - ### Column Mode ### - ################### - @table.by_col! - - headers = @table.headers - @table.each do |header, column| - assert_equal(headers.shift, header) - assert_equal(@table[header], column) - end - - # without block - enum = @table.each - assert_instance_of(Enumerator, enum) - assert_equal(@table.headers.size, enum.size) - - headers = @table.headers - enum.each do |header, column| - assert_equal(headers.shift, header) - assert_equal(@table[header], column) - end - - ############################ - ### One Shot Mode Change ### - ############################ - @table.by_col_or_row! - - @table.each { |row| assert_instance_of(CSV::Row, row) } - @table.by_col.each { |tuple| assert_instance_of(Array, tuple) } - @table.each { |row| assert_instance_of(CSV::Row, row) } - end - - def test_each_by_col_duplicated_headers - table = CSV.parse(<<-CSV, headers: true) -a,a,,,b -1,2,3,4,5 -11,12,13,14,15 - CSV - assert_equal([ - ["a", ["1", "11"]], - ["a", ["2", "12"]], - [nil, ["3", "13"]], - [nil, ["4", "14"]], - ["b", ["5", "15"]], - ], - table.by_col.each.to_a) - end - - def test_each_split - yielded_values = [] - @table.each do |column1, column2, column3| - yielded_values << [column1, column2, column3] - end - assert_equal(@rows.collect(&:to_a), - yielded_values) - end - - def test_enumerable - assert_equal( @rows.values_at(0, 2), - @table.select { |row| (row["B"] % 2).zero? } ) - - assert_equal(@rows[1], @table.find { |row| row["C"] > 5 }) - end - - def test_to_a - assert_equal([%w[A B C], [1, 2, 3], [4, 5, 6], [7, 8, 9]], @table.to_a) - - # with headers - assert_equal( [%w[A B C], [1, 2, 3], [4, 5, 6], [7, 8, 9]], - @header_table.to_a ) - end - - def test_to_csv - csv = <<-CSV -A,B,C -1,2,3 -4,5,6 -7,8,9 - CSV - - # normal conversion - assert_equal(csv, @table.to_csv) - assert_equal(csv, @table.to_s) # alias - - # with options - assert_equal( csv.gsub(",", "|").gsub("\n", "\r\n"), - @table.to_csv(col_sep: "|", row_sep: "\r\n") ) - assert_equal( csv.lines.to_a[1..-1].join(''), - @table.to_csv(:write_headers => false) ) - - # with headers - assert_equal(csv, @header_table.to_csv) - end - - def test_to_csv_limit_positive - assert_equal(<<-CSV, @table.to_csv(limit: 2)) -A,B,C -1,2,3 -4,5,6 - CSV - end - - def test_to_csv_limit_positive_over - assert_equal(<<-CSV, @table.to_csv(limit: 5)) -A,B,C -1,2,3 -4,5,6 -7,8,9 - CSV - end - - def test_to_csv_limit_zero - assert_equal(<<-CSV, @table.to_csv(limit: 0)) -A,B,C - CSV - end - - def test_to_csv_limit_negative - assert_equal(<<-CSV, @table.to_csv(limit: -2)) -A,B,C -1,2,3 -4,5,6 - CSV - end - - def test_to_csv_limit_negative_over - assert_equal(<<-CSV, @table.to_csv(limit: -5)) -A,B,C - CSV - end - - def test_append - # verify that we can chain the call - assert_equal(@table, @table << [10, 11, 12]) - - # Array append - assert_equal(CSV::Row.new(%w[A B C], [10, 11, 12]), @table[-1]) - - # Row append - assert_equal(@table, @table << CSV::Row.new(%w[A B C], [13, 14, 15])) - assert_equal(CSV::Row.new(%w[A B C], [13, 14, 15]), @table[-1]) - end - - def test_delete_mixed_one - ################## - ### Mixed Mode ### - ################## - # delete a row - assert_equal(@rows[1], @table.delete(1)) - - # delete a col - assert_equal(@rows.map { |row| row["A"] }, @table.delete("A")) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -B,C -2,3 -8,9 - CSV - end - - def test_delete_mixed_multiple - ################## - ### Mixed Mode ### - ################## - # delete row and col - second_row = @rows[1] - a_col = @rows.map { |row| row["A"] } - a_col_without_second_row = a_col[0..0] + a_col[2..-1] - assert_equal([ - second_row, - a_col_without_second_row, - ], - @table.delete(1, "A")) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -B,C -2,3 -8,9 - CSV - end - - def test_delete_column - ################### - ### Column Mode ### - ################### - @table.by_col! - - assert_equal(@rows.map { |row| row[0] }, @table.delete(0)) - assert_equal(@rows.map { |row| row["C"] }, @table.delete("C")) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -B -2 -5 -8 - CSV - end - - def test_delete_row - ################ - ### Row Mode ### - ################ - @table.by_row! - - assert_equal(@rows[1], @table.delete(1)) - assert_raise(TypeError) { @table.delete("C") } - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -A,B,C -1,2,3 -7,8,9 - CSV - end - - def test_delete_with_blank_rows - data = "col1,col2\nra1,ra2\n\nrb1,rb2" - table = CSV.parse(data, :headers => true) - assert_equal(["ra2", nil, "rb2"], table.delete("col2")) - end - - def test_delete_if_row - ###################### - ### Mixed/Row Mode ### - ###################### - # verify that we can chain the call - assert_equal(@table, @table.delete_if { |row| (row["B"] % 2).zero? }) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -A,B,C -4,5,6 - CSV - end - - def test_delete_if_row_without_block - ###################### - ### Mixed/Row Mode ### - ###################### - enum = @table.delete_if - assert_instance_of(Enumerator, enum) - assert_equal(@table.size, enum.size) - - # verify that we can chain the call - assert_equal(@table, enum.each { |row| (row["B"] % 2).zero? }) - - # verify resulting table - assert_equal(<<-CSV, @table.to_csv) -A,B,C -4,5,6 - CSV - end - - def test_delete_if_column - ################### - ### Column Mode ### - ################### - @table.by_col! - - assert_equal(@table, @table.delete_if { |h, v| h > "A" }) - assert_equal(<<-CSV, @table.to_csv) -A -1 -4 -7 - CSV - end - - def test_delete_if_column_without_block - ################### - ### Column Mode ### - ################### - @table.by_col! - - enum = @table.delete_if - assert_instance_of(Enumerator, enum) - assert_equal(@table.headers.size, enum.size) - - assert_equal(@table, enum.each { |h, v| h > "A" }) - assert_equal(<<-CSV, @table.to_csv) -A -1 -4 -7 - CSV - end - - def test_delete_headers_only - ################### - ### Column Mode ### - ################### - @header_only_table.by_col! - - # delete by index - assert_equal([], @header_only_table.delete(0)) - assert_equal(%w[B C], @header_only_table.headers) - - # delete by header - assert_equal([], @header_only_table.delete("C")) - assert_equal(%w[B], @header_only_table.headers) - end - - def test_values_at - ################## - ### Mixed Mode ### - ################## - # rows - assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2)) - assert_equal(@rows.values_at(1..2), @table.values_at(1..2)) - - # cols - assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at("A", "C")) - assert_equal([[2, 3], [5, 6], [8, 9]], @table.values_at("B".."C")) - - ################### - ### Column Mode ### - ################### - @table.by_col! - - assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at(0, 2)) - assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at("A", "C")) - - ################ - ### Row Mode ### - ################ - @table.by_row! - - assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2)) - assert_raise(TypeError) { @table.values_at("A", "C") } - - ############################ - ### One Shot Mode Change ### - ############################ - assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2)) - assert_equal([[1, 3], [4, 6], [7, 9]], @table.by_col.values_at(0, 2)) - assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2)) - end - - def test_array_delegation - assert_not_empty(@table, "Table was empty.") - - assert_equal(@rows.size, @table.size) - end - - def test_inspect_shows_current_mode - str = @table.inspect - assert_include(str, "mode:#{@table.mode}", "Mode not shown.") - - @table.by_col! - str = @table.inspect - assert_include(str, "mode:#{@table.mode}", "Mode not shown.") - end - - def test_inspect_encoding_is_ascii_compatible - assert_send([Encoding, :compatible?, - Encoding.find("US-ASCII"), - @table.inspect.encoding], - "inspect() was not ASCII compatible." ) - end - - def test_inspect_with_rows - additional_rows = [ CSV::Row.new(%w{A B C}, [101, 102, 103]), - CSV::Row.new(%w{A B C}, [104, 105, 106]), - CSV::Row.new(%w{A B C}, [107, 108, 109]) ] - table = CSV::Table.new(@rows + additional_rows) - str_table = table.inspect - - assert_equal(<<-CSV, str_table) -# -A,B,C -1,2,3 -4,5,6 -7,8,9 -101,102,103 -104,105,106 - CSV - end - - def test_dig_mixed - # by row - assert_equal(@rows[0], @table.dig(0)) - assert_nil(@table.dig(100)) # empty row - - # by col - assert_equal([2, 5, 8], @table.dig("B")) - assert_equal([nil] * @rows.size, @table.dig("Z")) # empty col - - # by row then col - assert_equal(2, @table.dig(0, 1)) - assert_equal(6, @table.dig(1, "C")) - - # by col then row - assert_equal(5, @table.dig("B", 1)) - assert_equal(9, @table.dig("C", 2)) - end - - def test_dig_by_column - @table.by_col! - - assert_equal([2, 5, 8], @table.dig(1)) - assert_equal([2, 5, 8], @table.dig("B")) - - # by col then row - assert_equal(5, @table.dig("B", 1)) - assert_equal(9, @table.dig("C", 2)) - end - - def test_dig_by_row - @table.by_row! - - assert_equal(@rows[1], @table.dig(1)) - assert_raise(TypeError) { @table.dig("B") } - - # by row then col - assert_equal(2, @table.dig(0, 1)) - assert_equal(6, @table.dig(1, "C")) - end - - def test_dig_cell - table = CSV::Table.new([CSV::Row.new(["A"], [["foo", ["bar", ["baz"]]]])]) - - # by row, col then cell - assert_equal("foo", table.dig(0, "A", 0)) - assert_equal(["baz"], table.dig(0, "A", 1, 1)) - - # by col, row then cell - assert_equal("foo", table.dig("A", 0, 0)) - assert_equal(["baz"], table.dig("A", 0, 1, 1)) - end - - def test_dig_cell_no_dig - table = CSV::Table.new([CSV::Row.new(["A"], ["foo"])]) - - # by row, col then cell - assert_raise(TypeError) do - table.dig(0, "A", 0) - end - - # by col, row then cell - assert_raise(TypeError) do - table.dig("A", 0, 0) - end - end -end diff --git a/test/mri/csv/write/test_converters.rb b/test/mri/csv/write/test_converters.rb deleted file mode 100644 index 0e0080b4c5c..00000000000 --- a/test/mri/csv/write/test_converters.rb +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -module TestCSVWriteConverters - def test_one - assert_equal(%Q[=a,=b,=c\n], - generate_line(["a", "b", "c"], - write_converters: ->(value) {"=" + value})) - end - - def test_multiple - assert_equal(%Q[=a_,=b_,=c_\n], - generate_line(["a", "b", "c"], - write_converters: [ - ->(value) {"=" + value}, - ->(value) {value + "_"}, - ])) - end - - def test_nil_value - assert_equal(%Q[a,NaN,29\n], - generate_line(["a", nil, 29], - write_nil_value: "NaN")) - end - - def test_empty_value - assert_equal(%Q[a,,29\n], - generate_line(["a", "", 29], - write_empty_value: nil)) - end -end - -class TestCSVWriteConvertersGenerateLine < Test::Unit::TestCase - include TestCSVWriteConverters - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate_line(row, **kwargs) - end -end - -class TestCSVWriteConvertersGenerate < Test::Unit::TestCase - include TestCSVWriteConverters - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate(**kwargs) do |csv| - csv << row - end - end -end diff --git a/test/mri/csv/write/test_force_quotes.rb b/test/mri/csv/write/test_force_quotes.rb deleted file mode 100644 index 622dcb021b4..00000000000 --- a/test/mri/csv/write/test_force_quotes.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: false - -require_relative "../helper" - -module TestCSVWriteForceQuotes - def test_default - assert_equal(%Q[1,2,3#{$INPUT_RECORD_SEPARATOR}], - generate_line(["1", "2", "3"])) - end - - def test_true - assert_equal(%Q["1","2","3"#{$INPUT_RECORD_SEPARATOR}], - generate_line(["1", "2", "3"], - force_quotes: true)) - end - - def test_false - assert_equal(%Q[1,2,3#{$INPUT_RECORD_SEPARATOR}], - generate_line(["1", "2", "3"], - force_quotes: false)) - end - - def test_field_name - assert_equal(%Q["1",2,"3"#{$INPUT_RECORD_SEPARATOR}], - generate_line(["1", "2", "3"], - headers: ["a", "b", "c"], - force_quotes: ["a", :c])) - end - - def test_field_name_without_headers - force_quotes = ["a", "c"] - error = assert_raise(ArgumentError) do - generate_line(["1", "2", "3"], - force_quotes: force_quotes) - end - assert_equal(":headers is required when you use field name " + - "in :force_quotes: " + - "#{force_quotes.first.inspect}: #{force_quotes.inspect}", - error.message) - end - - def test_field_index - assert_equal(%Q["1",2,"3"#{$INPUT_RECORD_SEPARATOR}], - generate_line(["1", "2", "3"], - force_quotes: [0, 2])) - end - - def test_field_unknown - force_quotes = [1.1] - error = assert_raise(ArgumentError) do - generate_line(["1", "2", "3"], - force_quotes: force_quotes) - end - assert_equal(":force_quotes element must be field index or field name: " + - "#{force_quotes.first.inspect}: #{force_quotes.inspect}", - error.message) - end -end - -class TestCSVWriteForceQuotesGenerateLine < Test::Unit::TestCase - include TestCSVWriteForceQuotes - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate_line(row, **kwargs) - end -end - -class TestCSVWriteForceQuotesGenerate < Test::Unit::TestCase - include TestCSVWriteForceQuotes - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate(**kwargs) do |csv| - csv << row - end - end -end diff --git a/test/mri/csv/write/test_general.rb b/test/mri/csv/write/test_general.rb deleted file mode 100644 index 677119e1ae4..00000000000 --- a/test/mri/csv/write/test_general.rb +++ /dev/null @@ -1,246 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -module TestCSVWriteGeneral - include Helper - - def test_tab - assert_equal("\t#{$INPUT_RECORD_SEPARATOR}", - generate_line(["\t"])) - end - - def test_quote_character - assert_equal(%Q[foo,"""",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q["], "baz"])) - end - - def test_quote_character_double - assert_equal(%Q[foo,"""""",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q[""], "baz"])) - end - - def test_quote - assert_equal(%Q[foo,"""bar""",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q["bar"], "baz"])) - end - - def test_quote_lf - assert_equal(%Q["""\n","""\n"#{$INPUT_RECORD_SEPARATOR}], - generate_line([%Q["\n], %Q["\n]])) - end - - def test_quote_cr - assert_equal(%Q["""\r","""\r"#{$INPUT_RECORD_SEPARATOR}], - generate_line([%Q["\r], %Q["\r]])) - end - - def test_quote_last - assert_equal(%Q[foo,"bar"""#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q[bar"]])) - end - - def test_quote_lf_last - assert_equal(%Q[foo,"\nbar"""#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q[\nbar"]])) - end - - def test_quote_lf_value_lf - assert_equal(%Q[foo,"""\nbar\n"""#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q["\nbar\n"]])) - end - - def test_quote_lf_value_lf_nil - assert_equal(%Q[foo,"""\nbar\n""",#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", %Q["\nbar\n"], nil])) - end - - def test_cr - assert_equal(%Q[foo,"\r",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\r", "baz"])) - end - - def test_lf - assert_equal(%Q[foo,"\n",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\n", "baz"])) - end - - def test_cr_lf - assert_equal(%Q[foo,"\r\n",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\r\n", "baz"])) - end - - def test_cr_dot_lf - assert_equal(%Q[foo,"\r.\n",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\r.\n", "baz"])) - end - - def test_cr_lf_cr - assert_equal(%Q[foo,"\r\n\r",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\r\n\r", "baz"])) - end - - def test_cr_lf_lf - assert_equal(%Q[foo,"\r\n\n",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "\r\n\n", "baz"])) - end - - def test_cr_lf_comma - assert_equal(%Q["\r\n,"#{$INPUT_RECORD_SEPARATOR}], - generate_line(["\r\n,"])) - end - - def test_cr_lf_comma_nil - assert_equal(%Q["\r\n,",#{$INPUT_RECORD_SEPARATOR}], - generate_line(["\r\n,", nil])) - end - - def test_comma - assert_equal(%Q[","#{$INPUT_RECORD_SEPARATOR}], - generate_line([","])) - end - - def test_comma_double - assert_equal(%Q[",",","#{$INPUT_RECORD_SEPARATOR}], - generate_line([",", ","])) - end - - def test_comma_and_value - assert_equal(%Q[foo,"foo,bar",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "foo,bar", "baz"])) - end - - def test_one_element - assert_equal(%Q[foo#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo"])) - end - - def test_nil_values_only - assert_equal(%Q[,,#{$INPUT_RECORD_SEPARATOR}], - generate_line([nil, nil, nil])) - end - - def test_nil_double_only - assert_equal(%Q[,#{$INPUT_RECORD_SEPARATOR}], - generate_line([nil, nil])) - end - - def test_nil_values - assert_equal(%Q[foo,,,#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", nil, nil, nil])) - end - - def test_nil_value_first - assert_equal(%Q[,foo,baz#{$INPUT_RECORD_SEPARATOR}], - generate_line([nil, "foo", "baz"])) - end - - def test_nil_value_middle - assert_equal(%Q[foo,,baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", nil, "baz"])) - end - - def test_nil_value_last - assert_equal(%Q[foo,baz,#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "baz", nil])) - end - - def test_nil_empty - assert_equal(%Q[,""#{$INPUT_RECORD_SEPARATOR}], - generate_line([nil, ""])) - end - - def test_nil_cr - assert_equal(%Q[,"\r"#{$INPUT_RECORD_SEPARATOR}], - generate_line([nil, "\r"])) - end - - def test_values - assert_equal(%Q[foo,bar#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "bar"])) - end - - def test_semi_colon - assert_equal(%Q[;#{$INPUT_RECORD_SEPARATOR}], - generate_line([";"])) - end - - def test_semi_colon_values - assert_equal(%Q[;,;#{$INPUT_RECORD_SEPARATOR}], - generate_line([";", ";"])) - end - - def test_tab_values - assert_equal(%Q[\t,\t#{$INPUT_RECORD_SEPARATOR}], - generate_line(["\t", "\t"])) - end - - def test_col_sep - assert_equal(%Q[a;b;;c#{$INPUT_RECORD_SEPARATOR}], - generate_line(["a", "b", nil, "c"], - col_sep: ";")) - assert_equal(%Q[a\tb\t\tc#{$INPUT_RECORD_SEPARATOR}], - generate_line(["a", "b", nil, "c"], - col_sep: "\t")) - end - - def test_row_sep - assert_equal(%Q[a,b,,c\r\n], - generate_line(["a", "b", nil, "c"], - row_sep: "\r\n")) - end - - def test_force_quotes - assert_equal(%Q["1","b","","already ""quoted"""#{$INPUT_RECORD_SEPARATOR}], - generate_line([1, "b", nil, %Q{already "quoted"}], - force_quotes: true)) - end - - def test_encoding_utf8 - assert_equal(%Q[あ,い,う#{$INPUT_RECORD_SEPARATOR}], - generate_line(["あ" , "い", "う"])) - end - - def test_encoding_euc_jp - row = ["あ", "い", "う"].collect {|field| field.encode("EUC-JP")} - assert_equal(%Q[あ,い,う#{$INPUT_RECORD_SEPARATOR}].encode("EUC-JP"), - generate_line(row)) - end - - def test_encoding_with_default_internal - with_default_internal(Encoding::UTF_8) do - row = ["あ", "い", "う"].collect {|field| field.encode("EUC-JP")} - assert_equal(%Q[あ,い,う#{$INPUT_RECORD_SEPARATOR}].encode("EUC-JP"), - generate_line(row, encoding: Encoding::EUC_JP)) - end - end - - def test_with_default_internal - with_default_internal(Encoding::UTF_8) do - row = ["あ", "い", "う"].collect {|field| field.encode("EUC-JP")} - assert_equal(%Q[あ,い,う#{$INPUT_RECORD_SEPARATOR}].encode("EUC-JP"), - generate_line(row)) - end - end -end - -class TestCSVWriteGeneralGenerateLine < Test::Unit::TestCase - include TestCSVWriteGeneral - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate_line(row, **kwargs) - end -end - -class TestCSVWriteGeneralGenerate < Test::Unit::TestCase - include TestCSVWriteGeneral - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate(**kwargs) do |csv| - csv << row - end - end -end diff --git a/test/mri/csv/write/test_quote_empty.rb b/test/mri/csv/write/test_quote_empty.rb deleted file mode 100644 index 70f73dad4ab..00000000000 --- a/test/mri/csv/write/test_quote_empty.rb +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# frozen_string_literal: false - -require_relative "../helper" - -module TestCSVWriteQuoteEmpty - def test_quote_empty_default - assert_equal(%Q["""",""#{$INPUT_RECORD_SEPARATOR}], - generate_line([%Q["], ""])) - end - - def test_quote_empty_false - assert_equal(%Q["""",#{$INPUT_RECORD_SEPARATOR}], - generate_line([%Q["], ""], - quote_empty: false)) - end - - def test_empty_default - assert_equal(%Q[foo,"",baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "", "baz"])) - end - - def test_empty_false - assert_equal(%Q[foo,,baz#{$INPUT_RECORD_SEPARATOR}], - generate_line(["foo", "", "baz"], - quote_empty: false)) - end - - def test_empty_only_default - assert_equal(%Q[""#{$INPUT_RECORD_SEPARATOR}], - generate_line([""])) - end - - def test_empty_only_false - assert_equal(%Q[#{$INPUT_RECORD_SEPARATOR}], - generate_line([""], - quote_empty: false)) - end - - def test_empty_double_default - assert_equal(%Q["",""#{$INPUT_RECORD_SEPARATOR}], - generate_line(["", ""])) - end - - def test_empty_double_false - assert_equal(%Q[,#{$INPUT_RECORD_SEPARATOR}], - generate_line(["", ""], - quote_empty: false)) - end -end - -class TestCSVWriteQuoteEmptyGenerateLine < Test::Unit::TestCase - include TestCSVWriteQuoteEmpty - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate_line(row, **kwargs) - end -end - -class TestCSVWriteQuoteEmptyGenerate < Test::Unit::TestCase - include TestCSVWriteQuoteEmpty - extend DifferentOFS - - def generate_line(row, **kwargs) - CSV.generate(**kwargs) do |csv| - csv << row - end - end -end diff --git a/test/mri/date/test_date_parse.rb b/test/mri/date/test_date_parse.rb index 0b4a3836309..16362e3bfff 100644 --- a/test/mri/date/test_date_parse.rb +++ b/test/mri/date/test_date_parse.rb @@ -867,9 +867,7 @@ def test__iso8601 h = Date._iso8601(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._iso8601('01-02-03T04:05:06Z'.to_sym)} - assert_equal([2001, 2, 3, 4, 5, 6, 0], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._iso8601('01-02-03T04:05:06Z'.to_sym)} end def test__rfc3339 @@ -889,9 +887,7 @@ def test__rfc3339 h = Date._rfc3339(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._rfc3339('2001-02-03T04:05:06Z'.to_sym)} - assert_equal([2001, 2, 3, 4, 5, 6, 0], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._rfc3339('2001-02-03T04:05:06Z'.to_sym)} end def test__xmlschema @@ -978,9 +974,7 @@ def test__xmlschema h = Date._xmlschema(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._xmlschema('2001-02-03'.to_sym)} - assert_equal([2001, 2, 3, nil, nil, nil, nil], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._xmlschema('2001-02-03'.to_sym)} end def test__rfc2822 @@ -1017,9 +1011,7 @@ def test__rfc2822 h = Date._rfc2822(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._rfc2822('Sat, 3 Feb 2001 04:05:06 UT'.to_sym)} - assert_equal([2001, 2, 3, 4, 5, 6, 0], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._rfc2822('Sat, 3 Feb 2001 04:05:06 UT'.to_sym)} end def test__httpdate @@ -1044,9 +1036,7 @@ def test__httpdate h = Date._httpdate(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._httpdate('Sat, 03 Feb 2001 04:05:06 GMT'.to_sym)} - assert_equal([2001, 2, 3, 4, 5, 6, 0], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._httpdate('Sat, 03 Feb 2001 04:05:06 GMT'.to_sym)} end def test__jisx0301 @@ -1127,9 +1117,7 @@ def test__jisx0301 h = Date._jisx0301(nil) assert_equal({}, h) - h = assert_deprecated_warn {Date._jisx0301('H13.02.03T04:05:06.07+0100'.to_sym)} - assert_equal([2001, 2, 3, 4, 5, 6, 3600], - h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + assert_raise(TypeError) {Date._jisx0301('H13.02.03T04:05:06.07+0100'.to_sym)} end def test_iso8601 diff --git a/test/mri/did_you_mean/core_ext/test_name_error_extension.rb b/test/mri/did_you_mean/core_ext/test_name_error_extension.rb index 1fdbd4510fb..116c7cd7b9a 100644 --- a/test/mri/did_you_mean/core_ext/test_name_error_extension.rb +++ b/test/mri/did_you_mean/core_ext/test_name_error_extension.rb @@ -49,7 +49,7 @@ def test_correctable_error_objects_are_dumpable get_message(error) - assert_equal "undefined method `sizee' for #", - Marshal.load(Marshal.dump(error)).original_message + assert_match(/^undefined method [`']sizee' for /, + Marshal.load(Marshal.dump(error)).original_message) end end diff --git a/test/mri/drb/drbtest.rb b/test/mri/drb/drbtest.rb deleted file mode 100644 index 71bc92ab701..00000000000 --- a/test/mri/drb/drbtest.rb +++ /dev/null @@ -1,396 +0,0 @@ -# frozen_string_literal: false -require 'test/unit' -require 'envutil' -require 'drb/drb' -require 'drb/extservm' -require 'timeout' - -module DRbTests - -class DRbService - @@ruby = [EnvUtil.rubybin] - @@ruby << "-d" if $DEBUG - def self.add_service_command(nm) - dir = File.dirname(File.expand_path(__FILE__)) - DRb::ExtServManager.command[nm] = @@ruby + ["#{dir}/#{nm}"] - end - - %w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eq.rb).each do |nm| - add_service_command(nm) - end - - def initialize - @manager = DRb::ExtServManager.new - start - @manager.uri = server.uri - end - - def start - @server = DRb::DRbServer.new('druby://localhost:0', manager, {}) - end - - attr_reader :manager - attr_reader :server - - def ext_service(name) - EnvUtil.timeout(100, RuntimeError) do - manager.service(name) - end - end - - def finish - server.instance_variable_get(:@grp).list.each {|th| th.join } - server.stop_service - manager.instance_variable_get(:@queue)&.push(nil) - manager.instance_variable_get(:@thread)&.join - DRb::DRbConn.stop_pool - end -end - -class Onecky - include DRbUndumped - def initialize(n) - @num = n - end - - def to_i - @num.to_i - end - - def sleep(n) - Kernel.sleep(n) - to_i - end -end - -class FailOnecky < Onecky - class OneckyError < RuntimeError; end - def to_i - raise(OneckyError, @num.to_s) - end -end - -class XArray < Array - def initialize(ary) - ary.each do |x| - self.push(x) - end - end -end - -module DRbBase - def setup - @drb_service ||= DRbService.new - end - - def setup_service(service_name) - @service_name = service_name - @ext = @drb_service.ext_service(@service_name) - @there = @ext.front - end - - def teardown - return if @omitted - @ext.stop_service if defined?(@ext) && @ext - if defined?(@service_name) && @service_name - @drb_service.manager.unregist(@service_name) - while (@there&&@there.to_s rescue nil) - # nop - end - signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM - Thread.list.each {|th| - if th.respond_to?(:pid) && th[:drb_service] == @service_name - 10.times do - begin - Process.kill signal, th.pid - break - rescue Errno::ESRCH - break - rescue Errno::EPERM # on Windows - sleep 0.1 - retry - end - end - th.join - end - } - end - @drb_service.finish - DRb::DRbConn.stop_pool - end -end - -module DRbCore - include DRbBase - - def test_00_DRbObject - ro = DRbObject.new(nil, 'druby://localhost:12345') - assert_equal('druby://localhost:12345', ro.__drburi) - assert_equal(nil, ro.__drbref) - - ro = DRbObject.new_with_uri('druby://localhost:12345') - assert_equal('druby://localhost:12345', ro.__drburi) - assert_equal(nil, ro.__drbref) - - ro = DRbObject.new_with_uri('druby://localhost:12345?foobar') - assert_equal('druby://localhost:12345', ro.__drburi) - assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref) - end - - def test_01 - assert_equal("hello", @there.hello) - onecky = Onecky.new('3') - assert_equal(6, @there.sample(onecky, 1, 2)) - ary = @there.to_a - assert_kind_of(DRb::DRbObject, ary) - - assert_respond_to(@there, [:to_a, true]) - assert_respond_to(@there, [:eval, true]) - assert_not_respond_to(@there, [:eval, false]) - assert_not_respond_to(@there, :eval) - end - - def test_01_02_loop - onecky = Onecky.new('3') - 50.times do - assert_equal(6, @there.sample(onecky, 1, 2)) - ary = @there.to_a - assert_kind_of(DRb::DRbObject, ary) - end - end - - def test_02_basic_object - obj = @there.basic_object - assert_kind_of(DRb::DRbObject, obj) - assert_equal(1, obj.foo) - assert_raise(NoMethodError){obj.prot} - assert_raise(NoMethodError){obj.priv} - end - - def test_02_unknown - obj = @there.unknown_class - assert_kind_of(DRb::DRbUnknown, obj) - assert_equal('DRbTests::Unknown2', obj.name) - - obj = @there.unknown_module - assert_kind_of(DRb::DRbUnknown, obj) - assert_equal('DRbTests::DRbEx::', obj.name) - - assert_raise(DRb::DRbUnknownError) do - @there.unknown_error - end - - onecky = FailOnecky.new('3') - - assert_raise(FailOnecky::OneckyError) do - @there.sample(onecky, 1, 2) - end - end - - def test_03 - assert_equal(8, @there.sum(1, 1, 1, 1, 1, 1, 1, 1)) - assert_raise(DRb::DRbConnError) do - @there.sum(1, 1, 1, 1, 1, 1, 1, 1, 1) - end - assert_raise(DRb::DRbConnError) do - @there.sum('1' * 4096) - end - end - - def test_04 - assert_respond_to(@there, 'sum') - assert_not_respond_to(@there, "foobar") - end - - def test_05_eq - a = @there.to_a[0] - b = @there.to_a[0] - assert_not_same(a, b) - assert_equal(a, b) - assert_equal(a, @there) - assert_equal(a.hash, b.hash) - assert_equal(a.hash, @there.hash) - assert_operator(a, :eql?, b) - assert_operator(a, :eql?, @there) - end - - def test_06_timeout - omit if RUBY_PLATFORM.include?("armv7l-linux") - omit if RUBY_PLATFORM.include?("sparc-solaris2.10") - omit if RUBY_PLATFORM.include?("freebsd") - omit if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # expecting a certain delay is difficult for --jit-wait CI - Timeout.timeout(60) do - ten = Onecky.new(10) - assert_raise(Timeout::Error) do - @there.do_timeout(ten) - end - assert_raise(Timeout::Error) do - @there.do_timeout(ten) - end - end - end - - def test_07_private_missing - e = assert_raise(NoMethodError) { - @there.method_missing(:eval, 'nil') - } - assert_match(/^private method \`eval\'/, e.message) - - e = assert_raise(NoMethodError) { - @there.call_private_method - } - assert_match(/^private method \`call_private_method\'/, e.message) - end - - def test_07_protected_missing - e = assert_raise(NoMethodError) { - @there.call_protected_method - } - assert_match(/^protected method \`call_protected_method\'/, e.message) - end - - def test_07_public_missing - e = assert_raise(NoMethodError) { - @there.method_missing(:undefined_method_test) - } - assert_match(/^undefined method \`undefined_method_test\'/, e.message) - end - - def test_07_send_missing - assert_raise(DRb::DRbConnError) do - @there.method_missing(:__send__, :to_s) - end - assert_equal(true, @there.missing) - end - - def test_08_here - ro = DRbObject.new(nil, DRb.uri) - assert_kind_of(String, ro.to_s) - - ro = DRbObject.new_with_uri(DRb.uri) - assert_kind_of(String, ro.to_s) - end - - def uri_concat_option(uri, opt) - "#{uri}?#{opt}" - end - - def test_09_option - uri = uri_concat_option(@there.__drburi, "foo") - ro = DRbObject.new_with_uri(uri) - assert_equal(ro.__drburi, @there.__drburi) - assert_equal(3, ro.size) - - uri = uri_concat_option(@there.__drburi, "") - ro = DRbObject.new_with_uri(uri) - assert_equal(ro.__drburi, @there.__drburi) - assert_equal(DRb::DRbURIOption.new(''), ro.__drbref) - - uri = uri_concat_option(@there.__drburi, "hello?world") - ro = DRbObject.new_with_uri(uri) - assert_equal(DRb::DRbURIOption.new('hello?world'), ro.__drbref) - - uri = uri_concat_option(@there.__drburi, "?hello?world") - ro = DRbObject.new_with_uri(uri) - assert_equal(DRb::DRbURIOption.new('?hello?world'), ro.__drbref) - end - - def test_10_yield - @there.simple_hash.each do |k, v| - assert_kind_of(String, k) - assert_kind_of(Symbol, v) - end - end - - def test_10_yield_undumped - @there.xarray2_hash.each do |k, v| - assert_kind_of(String, k) - assert_kind_of(DRbObject, v) - end - end - - def test_11_remote_no_method_error - assert_raise(DRb::DRbRemoteError) do - @there.remote_no_method_error - end - begin - @there.remote_no_method_error - rescue - error = $! - assert_match(/^undefined method .*\(NoMethodError\)/, error.message) - assert_equal('NoMethodError', error.reason) - end - end -end - -module DRbAry - include DRbBase - - def test_01 - assert_kind_of(DRb::DRbObject, @there) - end - - def test_02_collect - ary = @there.collect do |x| x + x end - assert_kind_of(Array, ary) - assert_equal([2, 4, 'IIIIII', 8, 'fivefive', 12], ary) - end - - def test_03_redo - ary = [] - count = 0 - @there.each do |x| - count += 1 - ary.push x - redo if count == 3 - end - assert_equal([1, 2, 'III', 'III', 4, 'five', 6], ary) - end - - # retry in block is not supported on ruby 1.9 - #def test_04_retry - # retried = false - # ary = [] - # @there.each do |x| - # ary.push x - # if x == 4 && !retried - # retried = true - # retry - # end - # end - # assert_equal([1, 2, 'III', 4, 1, 2, 'III', 4, 'five', 6], ary) - #end - - def test_05_break - ary = [] - @there.each do |x| - ary.push x - break if x == 4 - end - assert_equal([1, 2, 'III', 4], ary) - end - - def test_06_next - ary = [] - @there.each do |x| - next if String === x - ary.push x - end - assert_equal([1, 2, 4, 6], ary) - end - - class_eval <\z/, server.any_to_s(BO.new)) - server.stop_service - server.thread.join - DRb::DRbConn.stop_pool - end -end - -class TestDRbTCP < Test::Unit::TestCase - def test_immediate_close - omit 'MinGW leaks a thread in this test' if /mingw/ =~ RUBY_PLATFORM - server = DRb::DRbServer.new('druby://localhost:0') - host, port, = DRb::DRbTCPSocket.send(:parse_uri, server.uri) - socket = TCPSocket.open host, port - socket.shutdown - socket.close - client = DRb::DRbTCPSocket.new(server.uri, socket) - assert client - ensure - client&.close - socket&.close - server&.stop_service - server&.thread&.join - DRb::DRbConn.stop_pool - end -end - -class TestBug16634 < Test::Unit::TestCase - include DRbBase - - def setup - super - setup_service 'ut_drb.rb' - end - - def test_bug16634 - assert_equal(42, @there.keyword_test1(a: 42)) - assert_equal("default", @there.keyword_test2) - assert_equal(42, @there.keyword_test2(b: 42)) - assert_equal({:a=>42, :b=>42}, @there.keyword_test3(a: 42, b: 42)) - end -end - -end diff --git a/test/mri/drb/test_drbobject.rb b/test/mri/drb/test_drbobject.rb deleted file mode 100644 index 2b0e2061ee4..00000000000 --- a/test/mri/drb/test_drbobject.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'test/unit' -require 'drb' -require 'drb/timeridconv' -require 'drb/weakidconv' - -module DRbObjectTest - class Foo - def initialize - @foo = 'foo' - end - end - - def teardown - DRb.stop_service - DRb::DRbConn.stop_pool - end - - def drb_eq(obj) - proxy = DRbObject.new(obj) - assert_equal(obj, DRb.to_obj(proxy.__drbref)) - end - - def test_DRbObject_id_dereference - drb_eq(Foo.new) - drb_eq(Foo) - drb_eq(File) - drb_eq(Enumerable) - drb_eq(nil) - drb_eq(1) - drb_eq($stdout) - drb_eq([]) - end -end - -class TestDRbObject < Test::Unit::TestCase - include DRbObjectTest - - def setup - DRb.start_service - end -end - -class TestDRbObjectTimerIdConv < Test::Unit::TestCase - include DRbObjectTest - - def setup - @idconv = DRb::TimerIdConv.new - DRb.start_service(nil, nil, {:idconv => @idconv}) - end - - def teardown - super - # stop DRb::TimerIdConv::TimerHolder2#on_gc - @idconv.instance_eval do - @holder.instance_eval do - @expires = nil - end - end - GC.start - end -end - -class TestDRbObjectWeakIdConv < Test::Unit::TestCase - include DRbObjectTest - - def setup - DRb.start_service(nil, nil, {:idconv => DRb::WeakIdConv.new}) - end -end diff --git a/test/mri/drb/test_drbssl.rb b/test/mri/drb/test_drbssl.rb deleted file mode 100644 index 0c7e39ca706..00000000000 --- a/test/mri/drb/test_drbssl.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: false -require_relative 'drbtest' - -begin - require 'drb/ssl' -rescue LoadError -end - -module DRbTests - -if Object.const_defined?("OpenSSL") - - -class DRbSSLService < DRbService - %w(ut_drb_drbssl.rb ut_array_drbssl.rb).each do |nm| - add_service_command(nm) - end - - def start - config = Hash.new - - config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER - config[:SSLVerifyCallback] = lambda{ |ok,x509_store| - true - } - begin - data = open("sample.key"){|io| io.read } - config[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(data) - data = open("sample.crt"){|io| io.read } - config[:SSLCertificate] = OpenSSL::X509::Certificate.new(data) - rescue - # $stderr.puts "Switching to use self-signed certificate" - config[:SSLCertName] = - [ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ] - end - - @server = DRb::DRbServer.new('drbssl://localhost:0', manager, config) - end -end - -class TestDRbSSLCore < Test::Unit::TestCase - include DRbCore - def setup - if RUBY_PLATFORM.match?(/mswin|mingw/) - @omitted = true - omit 'This test seems to randomly hang on Windows' - end - @drb_service = DRbSSLService.new - super - setup_service 'ut_drb_drbssl.rb' - end - - def test_02_unknown - end - - def test_01_02_loop - end - - def test_05_eq - end -end - -class TestDRbSSLAry < Test::Unit::TestCase - include DRbAry - def setup - if RUBY_PLATFORM.match?(/mswin|mingw/) - @omitted = true - omit 'This test seems to randomly hang on Windows' - end - LeakChecker.skip if defined?(LeakChecker) - @drb_service = DRbSSLService.new - super - setup_service 'ut_array_drbssl.rb' - end -end - - -end - -end diff --git a/test/mri/drb/test_drbunix.rb b/test/mri/drb/test_drbunix.rb deleted file mode 100644 index 95b3c3ca91a..00000000000 --- a/test/mri/drb/test_drbunix.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: false -require_relative 'drbtest' - -begin - require 'drb/unix' -rescue LoadError -end - -module DRbTests - -if Object.const_defined?("UNIXServer") - - -class DRbUNIXService < DRbService - %w(ut_drb_drbunix.rb ut_array_drbunix.rb).each do |nm| - add_service_command(nm) - end - - def start - @server = DRb::DRbServer.new('drbunix:', manager, {}) - end -end - -class TestDRbUNIXCore < Test::Unit::TestCase - include DRbCore - def setup - @drb_service = DRbUNIXService.new - super - setup_service 'ut_drb_drbunix.rb' - end - - def test_02_unknown - end - - def test_01_02_loop - end - - def test_05_eq - end - - def test_bad_uri - assert_raise(DRb::DRbBadURI) do - DRb::DRbServer.new("badfile\n""drbunix:") - end - end -end - -class TestDRbUNIXAry < Test::Unit::TestCase - include DRbAry - def setup - @drb_service = DRbUNIXService.new - super - setup_service 'ut_array_drbunix.rb' - end -end - - -end - -end diff --git a/test/mri/drb/ut_array.rb b/test/mri/drb/ut_array.rb deleted file mode 100644 index d13dda3d8e5..00000000000 --- a/test/mri/drb/ut_array.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6]) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_array_drbssl.rb b/test/mri/drb/ut_array_drbssl.rb deleted file mode 100644 index 5938d9ff3df..00000000000 --- a/test/mri/drb/ut_array_drbssl.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' -require 'drb/ssl' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - module DRbTests - - TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_ ------BEGIN DH PARAMETERS----- -MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0 -pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG -AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC ------END DH PARAMETERS----- - _end_of_pem_ - - end - - config = Hash.new - config[:SSLTmpDhCallback] = proc { DRbTests::TEST_KEY_DH1024 } - config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER - config[:SSLVerifyCallback] = lambda{|ok,x509_store| - true - } - config[:SSLCertName] = - [ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ] - - DRb.start_service('drbssl://localhost:0', [1, 2, 'III', 4, "five", 6], config) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_array_drbunix.rb b/test/mri/drb/ut_array_drbunix.rb deleted file mode 100644 index b656cdaddd8..00000000000 --- a/test/mri/drb/ut_array_drbunix.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb.start_service('drbunix:', [1, 2, 'III', 4, "five", 6]) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_drb.rb b/test/mri/drb/ut_drb.rb deleted file mode 100644 index 7c0603b009b..00000000000 --- a/test/mri/drb/ut_drb.rb +++ /dev/null @@ -1,189 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' -require 'timeout' - -module DRbTests - -class XArray < Array - def initialize(ary) - ary.each do |x| - self.push(x) - end - end -end - -class XArray2 < XArray - include DRbUndumped -end - -class Unknown2 - def initialize - @foo = 'unknown2' - end -end - -class DRbEx - include DRbUndumped - - class FooBar - def initialize - @foo = 'bar' - end - end - - class UError < RuntimeError; end - - def initialize - @xary2_hash = nil - @hash = nil - @hello = 'hello' - end - attr_reader :hello - - def sample(a, b, c) - a.to_i + b.to_i + c.to_i - end - - def sum(*a) - s = 0 - a.each do |e| - s += e.to_i - end - s - end - - def do_timeout(n) - Timeout.timeout(0.1) do - n.sleep(2) - end - end - - def unknown_module - FooBar.new - end - - class BO < ::BasicObject - def foo; 1 end - protected def prot; 2; end - private def priv; 3; end - end - def basic_object - @basic_object = BO.new - end - - def unknown_class - Unknown2.new - end - - def unknown_error - raise UError - end - - def remote_no_method_error - invoke_no_method(self) - end - - def test_yield - yield - yield([]) - yield(*[]) - end - - def echo_yield(*arg) - yield(*arg) - nil - end - - def echo_yield_0 - yield - nil - end - - def echo_yield_1(one) - yield(one) - nil - end - - def echo_yield_2(one, two) - yield(one, two) - nil - end - - def xarray_each - xary = [XArray.new([0])] - xary.each do |x| - yield(x) - end - nil - end - - def xarray2_hash - unless @xary2_hash - @xary2_hash = { "a" => XArray2.new([0]), "b" => XArray2.new([1]) } - end - DRbObject.new(@xary2_hash) - end - - def simple_hash - unless @hash - @hash = { 'a'=>:a, 'b'=>:b } - end - DRbObject.new(@hash) - end - - def [](key) - key.to_s - end - - def to_a - [self] - end - - def method_missing(msg, *a, &b) - if msg == :missing - return true - else - super(msg, *a, &b) - end - end - - def keyword_test1(a:) - a - end - - def keyword_test2(b: "default") - b - end - - def keyword_test3(**opt) - opt - end - - private - def call_private_method - true - end - - protected - def call_protected_method - true - end -end - -end - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb::DRbServer.default_argc_limit(8) - DRb::DRbServer.default_load_limit(4096) - DRb.start_service('druby://localhost:0', DRbTests::DRbEx.new) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end diff --git a/test/mri/drb/ut_drb_drbssl.rb b/test/mri/drb/ut_drb_drbssl.rb deleted file mode 100644 index c8251716d6d..00000000000 --- a/test/mri/drb/ut_drb_drbssl.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: false -require_relative "ut_drb" -require 'drb/ssl' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - module DRbTests - - TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_ ------BEGIN DH PARAMETERS----- -MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0 -pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG -AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC ------END DH PARAMETERS----- - _end_of_pem_ - - end - - config = Hash.new - config[:SSLTmpDhCallback] = proc { DRbTests::TEST_KEY_DH1024 } - config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER - config[:SSLVerifyCallback] = lambda{|ok,x509_store| - true - } - config[:SSLCertName] = - [ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ] - - DRb::DRbServer.default_argc_limit(8) - DRb::DRbServer.default_load_limit(4096) - DRb.start_service('drbssl://localhost:0', DRbTests::DRbEx.new, config) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_drb_drbunix.rb b/test/mri/drb/ut_drb_drbunix.rb deleted file mode 100644 index ecf0920451a..00000000000 --- a/test/mri/drb/ut_drb_drbunix.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: false -require "#{File.dirname(File.expand_path(__FILE__))}/ut_drb" - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb::DRbServer.default_argc_limit(8) - DRb::DRbServer.default_load_limit(4096) - DRb.start_service('drbunix:', DRbTests::DRbEx.new) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_eq.rb b/test/mri/drb/ut_eq.rb deleted file mode 100644 index 56285a384f3..00000000000 --- a/test/mri/drb/ut_eq.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -module DRbTests - -class Foo - include DRbUndumped -end - -class Bar - include DRbUndumped - def initialize - @foo = Foo.new - end - attr_reader :foo - - def foo?(foo) - @foo == foo - end -end - -end - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb.start_service('druby://localhost:0', DRbTests::Bar.new) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_large.rb b/test/mri/drb/ut_large.rb deleted file mode 100644 index 9376ff119df..00000000000 --- a/test/mri/drb/ut_large.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' -require 'timeout' - -module DRbTests - -class DRbLarge - include DRbUndumped - - def size(ary) - ary.size - end - - def sum(ary) - ary.inject(:+) - end - - def multiply(ary) - ary.inject(:*) - end - - def avg(ary) - return if ary.empty? - if ary.any? {|n| n.is_a? String} - raise TypeError - else - sum(ary).to_f / ary.count - end - end - - def median(ary) - return if ary.empty? - if ary.any? {|n| n.is_a? String} - raise TypeError - else - avg ary.sort[((ary.length - 1) / 2)..(ary.length / 2)] - end - end - - def arg_test(*arg) - # nop - end -end - -end - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb::DRbServer.default_argc_limit(3) - DRb::DRbServer.default_load_limit(100000) - DRb.start_service('druby://localhost:0', DRbTests::DRbLarge.new) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end - diff --git a/test/mri/drb/ut_port.rb b/test/mri/drb/ut_port.rb deleted file mode 100644 index d317a307cc1..00000000000 --- a/test/mri/drb/ut_port.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb.start_service('druby://:8473', [1, 2, 'III', 4, "five", 6]) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end diff --git a/test/mri/drb/ut_safe1.rb b/test/mri/drb/ut_safe1.rb deleted file mode 100644 index 4b16fa7d6d8..00000000000 --- a/test/mri/drb/ut_safe1.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} " unless it - it - end - - DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6], - {:safe_level => 1}) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end diff --git a/test/mri/drb/ut_timerholder.rb b/test/mri/drb/ut_timerholder.rb deleted file mode 100644 index 1753b30c74a..00000000000 --- a/test/mri/drb/ut_timerholder.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: false -require 'test/unit' -require 'drb/timeridconv' - -module DRbTests - -class TimerIdConvTest < Test::Unit::TestCase - def test_usecase_01 - keeping = 0.1 - idconv = DRb::TimerIdConv.new(keeping) - - key = idconv.to_id(self) - assert_equal(key, self.__id__) - sleep(keeping) - assert_equal(idconv.to_id(false), false.__id__) - assert_equal(idconv.to_obj(key), self) - sleep(keeping) - - assert_equal(idconv.to_obj(key), self) - sleep(keeping) - - assert_equal(idconv.to_id(true), true.__id__) - sleep(keeping) - - assert_raise do - assert_equal(idconv.to_obj(key), self) - end - - assert_raise do - assert_equal(idconv.to_obj(false.__id__), false) - end - - key = idconv.to_id(self) - assert_equal(key, self.__id__) - assert_equal(idconv.to_id(true), true.__id__) - sleep(keeping) - GC.start - sleep(keeping) - GC.start - assert_raise do - assert_equal(idconv.to_obj(key), self) - end - end - - def test_usecase_02 - keeping = 0.1 - idconv = DRb::TimerIdConv.new(keeping) - - key = idconv.to_id(self) - assert_equal(key, self.__id__) - sleep(keeping) - GC.start - sleep(keeping) - GC.start - assert_raise do - assert_equal(idconv.to_obj(key), self) - end - GC.start - - key = idconv.to_id(self) - assert_equal(key, self.__id__) - sleep(keeping) - GC.start - sleep(keeping) - GC.start - assert_raise do - assert_equal(idconv.to_obj(key), self) - end - end -end - - -end - diff --git a/test/mri/error_highlight/test_error_highlight.rb b/test/mri/error_highlight/test_error_highlight.rb index 37026d05785..2095970af17 100644 --- a/test/mri/error_highlight/test_error_highlight.rb +++ b/test/mri/error_highlight/test_error_highlight.rb @@ -23,23 +23,48 @@ def teardown end end + begin + method_not_exist + rescue NameError + if $!.message.include?("`") + def preprocess(msg) + msg + end + else + def preprocess(msg) + msg.sub("`", "'") + end + end + end + if Exception.method_defined?(:detailed_message) def assert_error_message(klass, expected_msg, &blk) omit unless klass < ErrorHighlight::CoreExt err = assert_raise(klass, &blk) - assert_equal(expected_msg.chomp, err.detailed_message(highlight: false).sub(/ \((?:NoMethod|Name)Error\)/, "")) + assert_equal(preprocess(expected_msg).chomp, err.detailed_message(highlight: false).sub(/ \((?:NoMethod|Name)Error\)/, "")) end else def assert_error_message(klass, expected_msg, &blk) omit unless klass < ErrorHighlight::CoreExt err = assert_raise(klass, &blk) - assert_equal(expected_msg.chomp, err.message) + assert_equal(preprocess(expected_msg).chomp, err.message) end end + if begin; 1.time; rescue; $!.message.end_with?("an instance of Integer"); end + # new message format + NEW_MESSAGE_FORMAT = true + NIL_RECV_MESSAGE = "nil" + ONE_RECV_MESSAGE = "an instance of Integer" + else + NEW_MESSAGE_FORMAT = false + NIL_RECV_MESSAGE = "nil:NilClass" + ONE_RECV_MESSAGE = "1:Integer" + end + def test_CALL_noarg_1 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.foo + 1 ^^^^ @@ -51,7 +76,7 @@ def test_CALL_noarg_1 def test_CALL_noarg_2 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } .foo + 1 ^^^^ @@ -64,7 +89,7 @@ def test_CALL_noarg_2 def test_CALL_noarg_3 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } foo + 1 ^^^ @@ -77,7 +102,7 @@ def test_CALL_noarg_3 def test_CALL_noarg_4 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } (nil).foo + 1 ^^^^ @@ -89,7 +114,7 @@ def test_CALL_noarg_4 def test_CALL_arg_1 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.foo (42) ^^^^ @@ -101,7 +126,7 @@ def test_CALL_arg_1 def test_CALL_arg_2 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } .foo ( ^^^^ @@ -116,7 +141,7 @@ def test_CALL_arg_2 def test_CALL_arg_3 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } foo ( ^^^ @@ -131,7 +156,7 @@ def test_CALL_arg_3 def test_CALL_arg_4 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.foo(42) ^^^^ @@ -143,7 +168,7 @@ def test_CALL_arg_4 def test_CALL_arg_5 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } .foo( ^^^^ @@ -158,7 +183,7 @@ def test_CALL_arg_5 def test_CALL_arg_6 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } foo( ^^^ @@ -173,7 +198,7 @@ def test_CALL_arg_6 def test_QCALL_1 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for 1:Integer +undefined method `foo' for #{ ONE_RECV_MESSAGE } 1&.foo ^^^^^ @@ -185,7 +210,7 @@ def test_QCALL_1 def test_QCALL_2 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for 1:Integer +undefined method `foo' for #{ ONE_RECV_MESSAGE } 1&.foo(42) ^^^^^ @@ -197,7 +222,7 @@ def test_QCALL_2 def test_CALL_aref_1 assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } nil [ ] ^^^ @@ -209,7 +234,7 @@ def test_CALL_aref_1 def test_CALL_aref_2 assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } nil [0] ^^^ @@ -221,7 +246,7 @@ def test_CALL_aref_2 def test_CALL_aref_3 assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } END nil [ @@ -232,8 +257,9 @@ def test_CALL_aref_3 def test_CALL_aref_4 v = Object.new + recv = NEW_MESSAGE_FORMAT ? "an instance of Object" : v.inspect assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for #{ v.inspect } +undefined method `[]' for #{ recv } v &.[](0) ^^^^ @@ -245,7 +271,7 @@ def test_CALL_aref_4 def test_CALL_aref_5 assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } (nil)[ ] ^^^ @@ -257,7 +283,7 @@ def test_CALL_aref_5 def test_CALL_aset assert_error_message(NoMethodError, <<~END) do -undefined method `[]=' for nil:NilClass +undefined method `[]=' for #{ NIL_RECV_MESSAGE } nil.[]= ^^^^ @@ -270,7 +296,7 @@ def test_CALL_aset def test_CALL_op_asgn v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } v += 42 ^ @@ -282,7 +308,7 @@ def test_CALL_op_asgn def test_CALL_special_call_1 assert_error_message(NoMethodError, <<~END) do -undefined method `call' for nil:NilClass +undefined method `call' for #{ NIL_RECV_MESSAGE } END nil.() @@ -291,7 +317,7 @@ def test_CALL_special_call_1 def test_CALL_special_call_2 assert_error_message(NoMethodError, <<~END) do -undefined method `call' for nil:NilClass +undefined method `call' for #{ NIL_RECV_MESSAGE } END nil.(42) @@ -300,7 +326,7 @@ def test_CALL_special_call_2 def test_CALL_send assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.send(:foo, 42) ^^^^^ @@ -312,7 +338,7 @@ def test_CALL_send def test_ATTRASGN_1 assert_error_message(NoMethodError, <<~END) do -undefined method `[]=' for nil:NilClass +undefined method `[]=' for #{ NIL_RECV_MESSAGE } nil [ ] = 42 ^^^^^ @@ -324,7 +350,7 @@ def test_ATTRASGN_1 def test_ATTRASGN_2 assert_error_message(NoMethodError, <<~END) do -undefined method `[]=' for nil:NilClass +undefined method `[]=' for #{ NIL_RECV_MESSAGE } nil [0] = 42 ^^^^^ @@ -336,7 +362,7 @@ def test_ATTRASGN_2 def test_ATTRASGN_3 assert_error_message(NoMethodError, <<~END) do -undefined method `foo=' for nil:NilClass +undefined method `foo=' for #{ NIL_RECV_MESSAGE } nil.foo = 42 ^^^^^^ @@ -348,7 +374,7 @@ def test_ATTRASGN_3 def test_ATTRASGN_4 assert_error_message(NoMethodError, <<~END) do -undefined method `[]=' for nil:NilClass +undefined method `[]=' for #{ NIL_RECV_MESSAGE } (nil)[0] = 42 ^^^^^ @@ -360,7 +386,7 @@ def test_ATTRASGN_4 def test_ATTRASGN_5 assert_error_message(NoMethodError, <<~END) do -undefined method `foo=' for nil:NilClass +undefined method `foo=' for #{ NIL_RECV_MESSAGE } (nil).foo = 42 ^^^^^^ @@ -372,7 +398,7 @@ def test_ATTRASGN_5 def test_OPCALL_binary_1 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } nil + 42 ^ @@ -384,7 +410,7 @@ def test_OPCALL_binary_1 def test_OPCALL_binary_2 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } nil + # comment ^ @@ -397,7 +423,7 @@ def test_OPCALL_binary_2 def test_OPCALL_binary_3 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } (nil) + 42 ^ @@ -409,7 +435,7 @@ def test_OPCALL_binary_3 def test_OPCALL_unary_1 assert_error_message(NoMethodError, <<~END) do -undefined method `+@' for nil:NilClass +undefined method `+@' for #{ NIL_RECV_MESSAGE } + nil ^ @@ -421,7 +447,7 @@ def test_OPCALL_unary_1 def test_OPCALL_unary_2 assert_error_message(NoMethodError, <<~END) do -undefined method `+@' for nil:NilClass +undefined method `+@' for #{ NIL_RECV_MESSAGE } +(nil) ^ @@ -433,7 +459,7 @@ def test_OPCALL_unary_2 def test_FCALL_1 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.instance_eval { foo() } ^^^ @@ -445,7 +471,7 @@ def test_FCALL_1 def test_FCALL_2 assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } nil.instance_eval { foo(42) } ^^^ @@ -457,7 +483,7 @@ def test_FCALL_2 def test_VCALL_2 assert_error_message(NameError, <<~END) do -undefined local variable or method `foo' for nil:NilClass +undefined local variable or method `foo' for #{ NIL_RECV_MESSAGE } nil.instance_eval { foo } ^^^ @@ -471,7 +497,7 @@ def test_OP_ASGN1_aref_1 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } v [0] += 42 ^^^ @@ -485,7 +511,7 @@ def test_OP_ASGN1_aref_2 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } v [0] += # comment ^^^ @@ -500,7 +526,7 @@ def test_OP_ASGN1_aref_3 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } END v [ @@ -514,7 +540,7 @@ def test_OP_ASGN1_aref_4 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `[]' for nil:NilClass +undefined method `[]' for #{ NIL_RECV_MESSAGE } (v)[0] += 42 ^^^ @@ -529,7 +555,7 @@ def test_OP_ASGN1_op_1 def v.[](x); nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } v [0] += 42 ^ @@ -544,7 +570,7 @@ def test_OP_ASGN1_op_2 def v.[](x); nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } v [0 ] += # comment ^ @@ -560,7 +586,7 @@ def test_OP_ASGN1_op_3 def v.[](x); nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } END v [ @@ -575,7 +601,7 @@ def test_OP_ASGN1_op_4 def v.[](x); nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } (v)[0] += 42 ^ @@ -650,7 +676,7 @@ def test_OP_ASGN2_read_1 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } v.foo += 42 ^^^^ @@ -664,7 +690,7 @@ def test_OP_ASGN2_read_2 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } v.foo += # comment ^^^^ @@ -679,7 +705,7 @@ def test_OP_ASGN2_read_3 v = nil assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } (v).foo += 42 ^^^^ @@ -694,7 +720,7 @@ def test_OP_ASGN2_op_1 def v.foo; nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } v.foo += 42 ^ @@ -709,7 +735,7 @@ def test_OP_ASGN2_op_2 def v.foo; nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } v.foo += # comment ^ @@ -725,7 +751,7 @@ def test_OP_ASGN2_op_3 def v.foo; nil; end assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } (v).foo += 42 ^ @@ -818,6 +844,54 @@ def test_COLON2_2 end end + def test_COLON2_3 + assert_error_message(NameError, <<~END) do +uninitialized constant ErrorHighlightTest::NotDefined + + ErrorHighlightTest::NotDefined::Foo + ^^^^^^^^^^^^ + END + + ErrorHighlightTest::NotDefined::Foo + end + end + + def test_COLON2_4 + assert_error_message(NameError, <<~END) do +uninitialized constant ErrorHighlightTest::NotDefined + + ::ErrorHighlightTest::NotDefined::Foo + ^^^^^^^^^^^^ + END + + ::ErrorHighlightTest::NotDefined::Foo + end + end + + if ErrorHighlight.const_get(:Spotter).const_get(:OPT_GETCONSTANT_PATH) + def test_COLON2_5 + # Unfortunately, we cannot identify which `NotDefined` caused the NameError + assert_error_message(NameError, <<~END) do +uninitialized constant ErrorHighlightTest::NotDefined + END + + ErrorHighlightTest::NotDefined::NotDefined + end + end + else + def test_COLON2_5 + assert_error_message(NameError, <<~END) do +uninitialized constant ErrorHighlightTest::NotDefined + + ErrorHighlightTest::NotDefined::NotDefined + ^^^^^^^^^^^^ + END + + ErrorHighlightTest::NotDefined::NotDefined + end + end + end + def test_COLON3 assert_error_message(NameError, <<~END) do uninitialized constant NotDefined @@ -871,7 +945,7 @@ def test_OP_CDECL_read_3 def test_OP_CDECL_op_1 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } OP_CDECL_TEST::Nil += 1 ^ @@ -883,7 +957,7 @@ def test_OP_CDECL_op_1 def test_OP_CDECL_op_2 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } OP_CDECL_TEST::Nil += # comment ^ @@ -896,7 +970,7 @@ def test_OP_CDECL_op_2 def test_OP_CDECL_op_3 assert_error_message(NoMethodError, <<~END) do -undefined method `+' for nil:NilClass +undefined method `+' for #{ NIL_RECV_MESSAGE } Nil += 1 ^ @@ -920,8 +994,9 @@ def test_OP_CDECL_toplevel_1 end def test_OP_CDECL_toplevel_2 + recv = NEW_MESSAGE_FORMAT ? "class ErrorHighlightTest" : "ErrorHighlightTest:Class" assert_error_message(NoMethodError, <<~END) do -undefined method `+' for ErrorHighlightTest:Class +undefined method `+' for #{ recv } ::ErrorHighlightTest += 1 ^ @@ -982,7 +1057,7 @@ def test_local_variable_get def test_multibyte assert_error_message(NoMethodError, <<~END) do -undefined method `あいうえお' for nil:NilClass +undefined method `あいうえお' for #{ NIL_RECV_MESSAGE } END nil.あいうえお @@ -1154,7 +1229,7 @@ def custom_formatter.message_for(spot) original_formatter, ErrorHighlight.formatter = ErrorHighlight.formatter, custom_formatter assert_error_message(NoMethodError, <<~END) do -undefined method `time' for 1:Integer +undefined method `time' for #{ ONE_RECV_MESSAGE } {:first_lineno=>#{ __LINE__ + 3 }, :first_column=>7, :last_lineno=>#{ __LINE__ + 3 }, :last_column=>12, :snippet=>" 1.time {}\\n"} END @@ -1172,7 +1247,7 @@ def test_hard_tabs tmp.close assert_error_message(NoMethodError, <<~END.gsub("_", "\t")) do -undefined method `time' for 1:Integer +undefined method `time' for #{ ONE_RECV_MESSAGE } _ _1.time {} _ _ ^^^^^ @@ -1189,7 +1264,7 @@ def test_no_final_newline tmp.close assert_error_message(NoMethodError, <<~END) do -undefined method `time' for 1:Integer +undefined method `time' for #{ ONE_RECV_MESSAGE } 1.time {} ^^^^^ @@ -1202,7 +1277,7 @@ def test_no_final_newline def test_simulate_funcallv_from_embedded_ruby assert_error_message(NoMethodError, <<~END) do -undefined method `foo' for nil:NilClass +undefined method `foo' for #{ NIL_RECV_MESSAGE } END nil.foo + 1 @@ -1217,8 +1292,9 @@ def test_spoofed_filename tmp << "module Dummy\nend\n" tmp.close + recv = NEW_MESSAGE_FORMAT ? "an instance of String" : '"dummy":String' assert_error_message(NameError, <<~END) do - undefined local variable or method `foo' for "dummy":String + undefined local variable or method `foo' for #{ recv } END "dummy".instance_eval do diff --git a/test/mri/excludes/Psych_Unit_Tests.rb b/test/mri/excludes/Psych_Unit_Tests.rb index 67e7264e691..18cfc9a73d3 100644 --- a/test/mri/excludes/Psych_Unit_Tests.rb +++ b/test/mri/excludes/Psych_Unit_Tests.rb @@ -1 +1,2 @@ -exclude :test_time_now_cycle, "time is off by UTF diff" \ No newline at end of file +exclude :test_spec_sequence_of_sequences, "time is off by UTF diff" +exclude :test_time_now_cycle, "time is off by UTF diff" diff --git a/test/mri/excludes/TestArgf.rb b/test/mri/excludes/TestArgf.rb index af12c49fd2d..edf09646282 100644 --- a/test/mri/excludes/TestArgf.rb +++ b/test/mri/excludes/TestArgf.rb @@ -15,6 +15,7 @@ exclude :test_lineno, "needs investigation" exclude :test_lineno2, "needs investigation" exclude :test_readlines_limit_0, "HANGS" +exclude :test_read_nonblock, "HANGS" exclude :test_skip_in_each_char, "needs investigation" exclude :test_skip_in_each_codepoint, "needs investigation" exclude :test_to_io, "needs investigation" \ No newline at end of file diff --git a/test/mri/excludes/TestAutoload.rb b/test/mri/excludes/TestAutoload.rb index 47d77c65b85..81b68d69111 100644 --- a/test/mri/excludes/TestAutoload.rb +++ b/test/mri/excludes/TestAutoload.rb @@ -1,4 +1,5 @@ exclude :test_autoload_deprecate_constant, "to be fixed in #5489" +exclude :test_autoload_parallel_race, "hangs" exclude :test_autoload_so, "to be fixed in #5489" exclude :test_autoload_same_file, "to be fixed in #5489" exclude :test_bug_13526, "racey test that doesn't behave as expected with concurrent threads #5294" diff --git a/test/mri/excludes/TestDir.rb b/test/mri/excludes/TestDir.rb index 5cf911b8f98..ca30a48d4e9 100644 --- a/test/mri/excludes/TestDir.rb +++ b/test/mri/excludes/TestDir.rb @@ -3,3 +3,4 @@ exclude :test_glob_gc_for_fd, "tweaks rlimit and never restores it, depends on GC effects" exclude :test_glob_too_may_open_files, "our glob does not appear to open files, and so the expected EMFILE does not happen" exclude :test_home, "uses user.home as a fallback home path" +exclude :test_instance_chdir, "causes suite to terminate early" diff --git a/test/mri/excludes/TestRegexp.rb b/test/mri/excludes/TestRegexp.rb index 2bcf46a8986..d55680e930a 100644 --- a/test/mri/excludes/TestRegexp.rb +++ b/test/mri/excludes/TestRegexp.rb @@ -1,4 +1,5 @@ exclude :test_absent, "until fixed" +exclude :test_cache_opcodes_initialize, "hangs and may be CRuby-specific" exclude :test_dup_warn, "temporary failure due to disabling a warning jruby/joni#34" exclude :test_invalid_escape_error, "needs investigation" exclude :test_invalid_fragment, "needs investigation" diff --git a/test/mri/excludes/TestSocket_UNIXSocket.rb b/test/mri/excludes/TestSocket_UNIXSocket.rb index 8eba2e1e168..d4cc791492f 100644 --- a/test/mri/excludes/TestSocket_UNIXSocket.rb +++ b/test/mri/excludes/TestSocket_UNIXSocket.rb @@ -1,11 +1,12 @@ +exclude :test_accept_nonblock, "needs investigation" exclude :test_addr, "needs investigation" +exclude :test_cloexec, "needs investigation" exclude :test_dgram_pair, "needs investigation" +exclude :test_dgram_pair_sendrecvmsg_errno_set, "needs investigation" exclude :test_fd_passing, "close_on_exec? not implemented" exclude :test_fd_passing_race_condition, "needs investigation" exclude :test_getpeereid, "needs investigation" exclude :test_socket_pair_with_block, "needs investigation" +exclude :test_stream_pair, "hangs (tested on macos M1)" exclude :test_unix_server_socket, "needs investigation" exclude :test_unix_socket_pair_with_block, "needs investigation" -exclude :test_cloexec, "needs investigation" -exclude :test_dgram_pair_sendrecvmsg_errno_set, "needs investigation" -exclude :test_accept_nonblock, "needs investigation" diff --git a/test/mri/fiber/test_address_resolve.rb b/test/mri/fiber/test_address_resolve.rb index 12223bcc06f..09c8db6049f 100644 --- a/test/mri/fiber/test_address_resolve.rb +++ b/test/mri/fiber/test_address_resolve.rb @@ -179,7 +179,7 @@ def test_addrinfo_getaddrinfo_non_existing_domain_blocking Fiber.set_scheduler scheduler Fiber.schedule do - assert_raise(SocketError) { + assert_raise(Socket::ResolutionError) { Addrinfo.getaddrinfo("non-existing-domain.abc", nil) } end diff --git a/test/mri/fiber/test_io.rb b/test/mri/fiber/test_io.rb index de88745e579..0e3e086d5ae 100644 --- a/test/mri/fiber/test_io.rb +++ b/test/mri/fiber/test_io.rb @@ -170,6 +170,34 @@ def test_read_write_blocking assert_predicate(o, :closed?) end + def test_puts_empty + omit "UNIXSocket is not defined!" unless defined?(UNIXSocket) + + i, o = UNIXSocket.pair + i.nonblock = false + o.nonblock = false + + thread = Thread.new do + # This scheduler provides non-blocking `io_read`/`io_write`: + scheduler = IOBufferScheduler.new + Fiber.set_scheduler scheduler + + Fiber.schedule do + # This was causing a segfault on older Ruby. + o.puts "" + o.puts nil + o.close + end + end + + thread.join + + message = i.read + i.close + + assert_equal $/*2, message + end + def test_io_select omit "UNIXSocket is not defined!" unless defined?(UNIXSocket) @@ -191,4 +219,19 @@ def test_io_select assert_equal [[r], [w], []], result end end + + def test_backquote + result = nil + + thread = Thread.new do + scheduler = Scheduler.new + Fiber.set_scheduler scheduler + Fiber.schedule do + result = `#{EnvUtil.rubybin} -e "sleep 0.1;puts %[ok]"` + end + end + thread.join + + assert_equal "ok\n", result + end end diff --git a/test/mri/fiber/test_io_buffer.rb b/test/mri/fiber/test_io_buffer.rb index 48a34c31b61..a08b1ce1a9d 100644 --- a/test/mri/fiber/test_io_buffer.rb +++ b/test/mri/fiber/test_io_buffer.rb @@ -122,4 +122,78 @@ def test_write_nonblock i&.close o&.close end + + def test_io_buffer_read_write + omit "UNIXSocket is not defined!" unless defined?(UNIXSocket) + + i, o = UNIXSocket.pair + source_buffer = IO::Buffer.for("Hello World!") + destination_buffer = IO::Buffer.new(source_buffer.size) + + # Test non-scheduler code path: + source_buffer.write(o, source_buffer.size) + destination_buffer.read(i, source_buffer.size) + assert_equal source_buffer, destination_buffer + + # Test scheduler code path: + destination_buffer.clear + + thread = Thread.new do + scheduler = IOBufferScheduler.new + Fiber.set_scheduler scheduler + + Fiber.schedule do + source_buffer.write(o, source_buffer.size) + destination_buffer.read(i, source_buffer.size) + end + end + + thread.join + + assert_equal source_buffer, destination_buffer + ensure + i&.close + o&.close + end + + def nonblockable?(io) + io.nonblock{} + true + rescue + false + end + + def test_io_buffer_pread_pwrite + file = Tempfile.new("test_io_buffer_pread_pwrite") + + omit "Non-blocking file IO is not supported" unless nonblockable?(file) + + source_buffer = IO::Buffer.for("Hello World!") + destination_buffer = IO::Buffer.new(source_buffer.size) + + # Test non-scheduler code path: + source_buffer.pwrite(file, 1, source_buffer.size) + destination_buffer.pread(file, 1, source_buffer.size) + assert_equal source_buffer, destination_buffer + + # Test scheduler code path: + destination_buffer.clear + file.truncate(0) + + thread = Thread.new do + scheduler = IOBufferScheduler.new + Fiber.set_scheduler scheduler + + Fiber.schedule do + source_buffer.pwrite(file, 1, source_buffer.size) + destination_buffer.pread(file, 1, source_buffer.size) + end + end + + thread.join + + assert_equal source_buffer, destination_buffer + ensure + file&.close! + end end diff --git a/test/mri/fiber/test_process.rb b/test/mri/fiber/test_process.rb index a5990be2044..a09b070c0a6 100644 --- a/test/mri/fiber/test_process.rb +++ b/test/mri/fiber/test_process.rb @@ -3,13 +3,15 @@ require_relative 'scheduler' class TestFiberProcess < Test::Unit::TestCase + TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true" + def test_process_wait Thread.new do scheduler = Scheduler.new Fiber.set_scheduler scheduler Fiber.schedule do - pid = Process.spawn("true") + pid = Process.spawn(TRUE_CMD) Process.wait(pid) # TODO test that scheduler was invoked. @@ -25,7 +27,7 @@ def test_system Fiber.set_scheduler scheduler Fiber.schedule do - system("true") + system(TRUE_CMD) # TODO test that scheduler was invoked (currently it's not). @@ -34,6 +36,27 @@ def test_system end.join end + def test_system_faulty_process_wait + Thread.new do + scheduler = Scheduler.new + + def scheduler.process_wait(pid, flags) + Fiber.blocking{Process.wait(pid, flags)} + + # Don't return `Process::Status` instance. + return false + end + + Fiber.set_scheduler scheduler + + Fiber.schedule do + assert_raise TypeError do + system(TRUE_CMD) + end + end + end.join + end + def test_fork omit 'fork not supported' unless Process.respond_to?(:fork) Thread.new do diff --git a/test/mri/fiber/test_queue.rb b/test/mri/fiber/test_queue.rb index 10d95404923..d78b026f114 100644 --- a/test/mri/fiber/test_queue.rb +++ b/test/mri/fiber/test_queue.rb @@ -5,9 +5,10 @@ class TestFiberQueue < Test::Unit::TestCase def test_pop_with_timeout queue = Thread::Queue.new + kill = false result = :unspecified - Thread.new do + thread = Thread.new do scheduler = Scheduler.new Fiber.set_scheduler(scheduler) @@ -16,17 +17,23 @@ def test_pop_with_timeout end scheduler.run - end.join + end + until thread.join(2) + kill = true + thread.kill + end + assert_false(kill, 'Getting stuck due to a possible compiler bug.') assert_nil result end def test_pop_with_timeout_and_value queue = Thread::Queue.new queue.push(:something) + kill = false result = :unspecified - Thread.new do + thread = Thread.new do scheduler = Scheduler.new Fiber.set_scheduler(scheduler) @@ -35,8 +42,13 @@ def test_pop_with_timeout_and_value end scheduler.run - end.join + end + until thread.join(2) + kill = true + thread.kill + end + assert_false(kill, 'Getting stuck due to a possible compiler bug.') assert_equal :something, result end end diff --git a/test/mri/fiber/test_thread.rb b/test/mri/fiber/test_thread.rb index 5c25c43de29..5e3cc6d0e13 100644 --- a/test/mri/fiber/test_thread.rb +++ b/test/mri/fiber/test_thread.rb @@ -20,6 +20,28 @@ def test_thread_join assert_equal :done, thread.value end + def test_thread_join_timeout + sleeper = nil + + thread = Thread.new do + scheduler = Scheduler.new + Fiber.set_scheduler scheduler + + Fiber.schedule do + sleeper = Thread.new{sleep} + sleeper.join(0.1) + end + + scheduler.run + end + + thread.join + + assert_predicate sleeper, :alive? + ensure + sleeper&.kill&.join + end + def test_thread_join_implicit sleeping = false finished = false diff --git a/test/mri/fiddle/test_c_struct_entry.rb b/test/mri/fiddle/test_c_struct_entry.rb index 9fd16d71014..45de2efe21f 100644 --- a/test/mri/fiddle/test_c_struct_entry.rb +++ b/test/mri/fiddle/test_c_struct_entry.rb @@ -8,7 +8,7 @@ module Fiddle class TestCStructEntity < TestCase def test_class_size - types = [TYPE_DOUBLE, TYPE_CHAR] + types = [TYPE_DOUBLE, TYPE_CHAR, TYPE_DOUBLE, TYPE_BOOL] size = CStructEntity.size types @@ -20,6 +20,12 @@ def test_class_size expected = PackInfo.align expected, alignments[1] expected += PackInfo::SIZE_MAP[TYPE_CHAR] + expected = PackInfo.align expected, alignments[2] + expected += PackInfo::SIZE_MAP[TYPE_DOUBLE] + + expected = PackInfo.align expected, alignments[3] + expected += PackInfo::SIZE_MAP[TYPE_BOOL] + expected = PackInfo.align expected, alignments.max assert_equal expected, size diff --git a/test/mri/fiddle/test_closure.rb b/test/mri/fiddle/test_closure.rb index 825ea9651d2..abb6bdbd32a 100644 --- a/test/mri/fiddle/test_closure.rb +++ b/test/mri/fiddle/test_closure.rb @@ -81,6 +81,18 @@ def call(string) end end + def test_bool + closure_class = Class.new(Closure) do + def call(bool) + not bool + end + end + closure_class.create(:bool, [:bool]) do |closure| + func = Function.new(closure, [:bool], :bool) + assert_equal(false, func.call(true)) + end + end + def test_free Closure.create(:int, [:void]) do |closure| assert(!closure.freed?) diff --git a/test/mri/fiddle/test_cparser.rb b/test/mri/fiddle/test_cparser.rb index ae319197a4d..f1b67476ba8 100644 --- a/test/mri/fiddle/test_cparser.rb +++ b/test/mri/fiddle/test_cparser.rb @@ -24,14 +24,32 @@ def test_short_ctype assert_equal(TYPE_SHORT, parse_ctype('const short')) assert_equal(TYPE_SHORT, parse_ctype('short int')) assert_equal(TYPE_SHORT, parse_ctype('const short int')) + assert_equal(TYPE_SHORT, parse_ctype('int short')) + assert_equal(TYPE_SHORT, parse_ctype('const int short')) assert_equal(TYPE_SHORT, parse_ctype('signed short')) assert_equal(TYPE_SHORT, parse_ctype('const signed short')) + assert_equal(TYPE_SHORT, parse_ctype('short signed')) + assert_equal(TYPE_SHORT, parse_ctype('const short signed')) assert_equal(TYPE_SHORT, parse_ctype('signed short int')) assert_equal(TYPE_SHORT, parse_ctype('const signed short int')) + assert_equal(TYPE_SHORT, parse_ctype('signed int short')) + assert_equal(TYPE_SHORT, parse_ctype('const signed int short')) + assert_equal(TYPE_SHORT, parse_ctype('int signed short')) + assert_equal(TYPE_SHORT, parse_ctype('const int signed short')) + assert_equal(TYPE_SHORT, parse_ctype('int short signed')) + assert_equal(TYPE_SHORT, parse_ctype('const int short signed')) assert_equal(-TYPE_SHORT, parse_ctype('unsigned short')) assert_equal(-TYPE_SHORT, parse_ctype('const unsigned short')) assert_equal(-TYPE_SHORT, parse_ctype('unsigned short int')) assert_equal(-TYPE_SHORT, parse_ctype('const unsigned short int')) + assert_equal(-TYPE_SHORT, parse_ctype('unsigned int short')) + assert_equal(-TYPE_SHORT, parse_ctype('const unsigned int short')) + assert_equal(-TYPE_SHORT, parse_ctype('short int unsigned')) + assert_equal(-TYPE_SHORT, parse_ctype('const short int unsigned')) + assert_equal(-TYPE_SHORT, parse_ctype('int unsigned short')) + assert_equal(-TYPE_SHORT, parse_ctype('const int unsigned short')) + assert_equal(-TYPE_SHORT, parse_ctype('int short unsigned')) + assert_equal(-TYPE_SHORT, parse_ctype('const int short unsigned')) end def test_int_ctype @@ -50,14 +68,32 @@ def test_long_ctype assert_equal(TYPE_LONG, parse_ctype('const long')) assert_equal(TYPE_LONG, parse_ctype('long int')) assert_equal(TYPE_LONG, parse_ctype('const long int')) + assert_equal(TYPE_LONG, parse_ctype('int long')) + assert_equal(TYPE_LONG, parse_ctype('const int long')) assert_equal(TYPE_LONG, parse_ctype('signed long')) assert_equal(TYPE_LONG, parse_ctype('const signed long')) assert_equal(TYPE_LONG, parse_ctype('signed long int')) assert_equal(TYPE_LONG, parse_ctype('const signed long int')) + assert_equal(TYPE_LONG, parse_ctype('signed int long')) + assert_equal(TYPE_LONG, parse_ctype('const signed int long')) + assert_equal(TYPE_LONG, parse_ctype('long signed')) + assert_equal(TYPE_LONG, parse_ctype('const long signed')) + assert_equal(TYPE_LONG, parse_ctype('long int signed')) + assert_equal(TYPE_LONG, parse_ctype('const long int signed')) + assert_equal(TYPE_LONG, parse_ctype('int long signed')) + assert_equal(TYPE_LONG, parse_ctype('const int long signed')) assert_equal(-TYPE_LONG, parse_ctype('unsigned long')) assert_equal(-TYPE_LONG, parse_ctype('const unsigned long')) assert_equal(-TYPE_LONG, parse_ctype('unsigned long int')) assert_equal(-TYPE_LONG, parse_ctype('const unsigned long int')) + assert_equal(-TYPE_LONG, parse_ctype('long int unsigned')) + assert_equal(-TYPE_LONG, parse_ctype('const long int unsigned')) + assert_equal(-TYPE_LONG, parse_ctype('unsigned int long')) + assert_equal(-TYPE_LONG, parse_ctype('const unsigned int long')) + assert_equal(-TYPE_LONG, parse_ctype('int unsigned long')) + assert_equal(-TYPE_LONG, parse_ctype('const int unsigned long')) + assert_equal(-TYPE_LONG, parse_ctype('int long unsigned')) + assert_equal(-TYPE_LONG, parse_ctype('const int long unsigned')) end def test_size_t_ctype @@ -85,6 +121,10 @@ def test_uintptr_t_ctype assert_equal(TYPE_UINTPTR_T, parse_ctype("const uintptr_t")) end + def test_bool_ctype + assert_equal(TYPE_BOOL, parse_ctype('bool')) + end + def test_undefined_ctype assert_raise(DLError) { parse_ctype('DWORD') } end diff --git a/test/mri/fiddle/test_func.rb b/test/mri/fiddle/test_func.rb index ff52f727d0b..df79539e76c 100644 --- a/test/mri/fiddle/test_func.rb +++ b/test/mri/fiddle/test_func.rb @@ -145,5 +145,22 @@ def to_str assert_equal("string: He, const string: World, uint: 29\n", output_buffer[0, written]) end + + def test_rb_memory_view_available_p + omit "MemoryView is unavailable" unless defined? Fiddle::MemoryView + libruby = Fiddle.dlopen(nil) + case Fiddle::SIZEOF_VOIDP + when Fiddle::SIZEOF_LONG_LONG + value_type = -Fiddle::TYPE_LONG_LONG + else + value_type = -Fiddle::TYPE_LONG + end + rb_memory_view_available_p = + Function.new(libruby["rb_memory_view_available_p"], + [value_type], + :bool, + need_gvl: true) + assert_equal(false, rb_memory_view_available_p.call(Fiddle::Qnil)) + end end end if defined?(Fiddle) diff --git a/test/mri/fiddle/test_handle.rb b/test/mri/fiddle/test_handle.rb index c19bcc66233..412c10e09d4 100644 --- a/test/mri/fiddle/test_handle.rb +++ b/test/mri/fiddle/test_handle.rb @@ -183,9 +183,12 @@ def test_dlerror # it calls _nss_cache_cycle_prevention_function with dlsym(3). # So our Fiddle::Handle#sym must call dlerror(3) before call dlsym. # In general uses of dlerror(3) should call it before use it. + verbose, $VERBOSE = $VERBOSE, nil require 'socket' Socket.gethostbyname("localhost") Fiddle.dlopen("/lib/libc.so.7").sym('strcpy') + ensure + $VERBOSE = verbose end if /freebsd/=~ RUBY_PLATFORM def test_no_memory_leak diff --git a/test/mri/fiddle/test_pointer.rb b/test/mri/fiddle/test_pointer.rb index d6cba04bbe6..f2c1d285ad5 100644 --- a/test/mri/fiddle/test_pointer.rb +++ b/test/mri/fiddle/test_pointer.rb @@ -10,6 +10,22 @@ def dlwrap arg Fiddle.dlwrap arg end + def test_can_read_write_memory + # Allocate some memory + address = Fiddle.malloc(Fiddle::SIZEOF_VOIDP) + + bytes_to_write = Fiddle::SIZEOF_VOIDP.times.to_a.pack("C*") + + # Write to the memory + Fiddle::Pointer.write(address, bytes_to_write) + + # Read the bytes out again + bytes = Fiddle::Pointer.read(address, Fiddle::SIZEOF_VOIDP) + assert_equal bytes_to_write, bytes + ensure + Fiddle.free address + end + def test_cptr_to_int null = Fiddle::NULL assert_equal(null.to_i, null.to_int) diff --git a/test/mri/fileutils/test_fileutils.rb b/test/mri/fileutils/test_fileutils.rb index 3994da74339..481f913d0c4 100644 --- a/test/mri/fileutils/test_fileutils.rb +++ b/test/mri/fileutils/test_fileutils.rb @@ -1237,6 +1237,14 @@ def test_install_pathname install Pathname.new('tmp/a'), 'tmp/b' rm_f 'tmp/a'; touch 'tmp/a' install Pathname.new('tmp/a'), Pathname.new('tmp/b') + my_rm_rf 'tmp/new_dir_end_with_slash' + install Pathname.new('tmp/a'), 'tmp/new_dir_end_with_slash/' + my_rm_rf 'tmp/new_dir_end_with_slash' + my_rm_rf 'tmp/new_dir' + install Pathname.new('tmp/a'), 'tmp/new_dir/a' + my_rm_rf 'tmp/new_dir' + install Pathname.new('tmp/a'), 'tmp/new_dir/new_dir_end_with_slash/' + my_rm_rf 'tmp/new_dir' rm_f 'tmp/a' touch 'tmp/a' touch 'tmp/b' diff --git a/test/mri/io/console/test_io_console.rb b/test/mri/io/console/test_io_console.rb index 3f4b64bbcdf..40551286d03 100644 --- a/test/mri/io/console/test_io_console.rb +++ b/test/mri/io/console/test_io_console.rb @@ -36,22 +36,22 @@ def set_winsize_teardown trap(:TTOU, @old_ttou) if defined?(@old_ttou) and @old_ttou end + exceptions = %w[ENODEV ENOTTY EBADF ENXIO].map {|e| + Errno.const_get(e) if Errno.const_defined?(e) + } + exceptions.compact! + FailedPathExceptions = (exceptions unless exceptions.empty?) + def test_failed_path - exceptions = %w[ENODEV ENOTTY EBADF ENXIO].map {|e| - Errno.const_get(e) if Errno.const_defined?(e) - } - exceptions.compact! - omit if exceptions.empty? File.open(IO::NULL) do |f| - e = assert_raise(*exceptions) do + e = assert_raise(*FailedPathExceptions) do f.echo? end assert_include(e.message, IO::NULL) end - end + end if FailedPathExceptions def test_bad_keyword - omit if RUBY_ENGINE == 'jruby' assert_raise_with_message(ArgumentError, /unknown keyword:.*bad/) do File.open(IO::NULL) do |f| f.raw(bad: 0) @@ -241,7 +241,6 @@ def test_setecho2 end def test_getpass - omit unless IO.method_defined?("getpass") run_pty("p IO.console.getpass('> ')") do |r, w| assert_equal("> ", r.readpartial(10)) sleep 0.1 @@ -259,6 +258,15 @@ def test_getpass assert_equal("\r\n", r.gets) assert_equal("\"asdf\"", r.gets.chomp) end + + run_pty("$VERBOSE, $/ = nil, '.'; p IO.console.getpass('> ')") do |r, w| + assert_equal("> ", r.readpartial(10)) + sleep 0.1 + w.print "asdf\n" + sleep 0.1 + assert_equal("\r\n", r.gets) + assert_equal("\"asdf\"", r.gets.chomp) + end end def test_iflush diff --git a/test/mri/io/wait/test_io_wait.rb b/test/mri/io/wait/test_io_wait.rb index 7997a4814f0..cbc01f96224 100644 --- a/test/mri/io/wait/test_io_wait.rb +++ b/test/mri/io/wait/test_io_wait.rb @@ -36,6 +36,7 @@ def test_nread_buffered end def test_ready? + omit 'unstable on MinGW' if /mingw/ =~ RUBY_PLATFORM assert_not_predicate @r, :ready?, "shouldn't ready, but ready" @w.syswrite "." sleep 0.1 diff --git a/test/mri/irb/command/test_force_exit.rb b/test/mri/irb/command/test_force_exit.rb new file mode 100644 index 00000000000..9e86c644d6d --- /dev/null +++ b/test/mri/irb/command/test_force_exit.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: false +require 'irb' + +require_relative "../helper" + +module TestIRB + class ForceExitTest < IntegrationTestCase + def test_forced_exit_finishes_process_immediately + write_ruby <<~'ruby' + puts "First line" + puts "Second line" + binding.irb + puts "Third line" + binding.irb + puts "Fourth line" + ruby + + output = run_ruby_file do + type "123" + type "456" + type "exit!" + end + + assert_match(/First line\r\n/, output) + assert_match(/Second line\r\n/, output) + assert_match(/irb\(main\):001> 123/, output) + assert_match(/irb\(main\):002> 456/, output) + refute_match(/Third line\r\n/, output) + refute_match(/Fourth line\r\n/, output) + end + + def test_forced_exit_in_nested_sessions + write_ruby <<~'ruby' + def foo + binding.irb + end + + binding.irb + binding.irb + ruby + + output = run_ruby_file do + type "123" + type "foo" + type "exit!" + end + + assert_match(/irb\(main\):001> 123/, output) + end + + def test_forced_exit_out_of_irb_session + write_ruby <<~'ruby' + at_exit { puts 'un' + 'reachable' } + binding.irb + exit! # this will call exit! method overrided by command + ruby + output = run_ruby_file do + type "exit" + end + assert_not_include(output, 'unreachable') + end + end +end diff --git a/test/mri/irb/command/test_help.rb b/test/mri/irb/command/test_help.rb new file mode 100644 index 00000000000..c82c43a4c58 --- /dev/null +++ b/test/mri/irb/command/test_help.rb @@ -0,0 +1,66 @@ +require "tempfile" +require_relative "../helper" + +module TestIRB + class HelpTest < IntegrationTestCase + def setup + super + + write_rc <<~'RUBY' + IRB.conf[:USE_PAGER] = false + RUBY + + write_ruby <<~'RUBY' + binding.irb + RUBY + end + + def test_help + out = run_ruby_file do + type "help" + type "exit" + end + + assert_match(/List all available commands/, out) + assert_match(/Start the debugger of debug\.gem/, out) + end + + def test_command_help + out = run_ruby_file do + type "help ls" + type "exit" + end + + assert_match(/Usage: ls \[obj\]/, out) + end + + def test_command_help_not_found + out = run_ruby_file do + type "help foo" + type "exit" + end + + assert_match(/Can't find command `foo`\. Please check the command name and try again\./, out) + end + + def test_show_cmds + out = run_ruby_file do + type "help" + type "exit" + end + + assert_match(/List all available commands/, out) + assert_match(/Start the debugger of debug\.gem/, out) + end + + def test_help_lists_user_aliases + out = run_ruby_file do + type "help" + type "exit" + end + + assert_match(/\$\s+Alias for `show_source`/, out) + assert_match(/@\s+Alias for `whereami`/, out) + end + end +end diff --git a/test/mri/irb/command/test_show_source.rb b/test/mri/irb/command/test_show_source.rb new file mode 100644 index 00000000000..d014c78fc4a --- /dev/null +++ b/test/mri/irb/command/test_show_source.rb @@ -0,0 +1,397 @@ +# frozen_string_literal: false +require 'irb' + +require_relative "../helper" + +module TestIRB + class ShowSourceTest < IntegrationTestCase + def setup + super + + write_rc <<~'RUBY' + IRB.conf[:USE_PAGER] = false + RUBY + end + + def test_show_source + write_ruby <<~'RUBY' + binding.irb + RUBY + + out = run_ruby_file do + type "show_source IRB.conf" + type "exit" + end + + assert_match(%r[/irb\/init\.rb], out) + end + + def test_show_source_alias + write_ruby <<~'RUBY' + binding.irb + RUBY + + out = run_ruby_file do + type "$ IRB.conf" + type "exit" + end + + assert_match(%r[/irb\/init\.rb], out) + end + + def test_show_source_with_missing_signature + write_ruby <<~'RUBY' + binding.irb + RUBY + + out = run_ruby_file do + type "show_source foo" + type "exit" + end + + assert_match(%r[Couldn't locate a definition for foo], out) + end + + def test_show_source_with_missing_constant + write_ruby <<~'RUBY' + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Foo" + type "exit" + end + + assert_match(%r[Couldn't locate a definition for Foo], out) + end + + def test_show_source_string + write_ruby <<~'RUBY' + binding.irb + RUBY + + out = run_ruby_file do + type "show_source 'IRB.conf'" + type "exit" + end + + assert_match(%r[/irb\/init\.rb], out) + end + + def test_show_source_method_s + write_ruby <<~RUBY + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#foo -s" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+def foo\r\n end\r\n], out) + end + + def test_show_source_method_s_with_incorrect_signature + write_ruby <<~RUBY + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#fooo -s" + type "exit" + end + + assert_match(%r[Error: Couldn't locate a super definition for Bar#fooo], out) + end + + def test_show_source_private_method + write_ruby <<~RUBY + class Bar + private def foo + end + end + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#foo" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+private def foo\r\n end\r\n], out) + end + + def test_show_source_private_singleton_method + write_ruby <<~RUBY + class Bar + private def foo + end + end + binding.irb + RUBY + + out = run_ruby_file do + type "bar = Bar.new" + type "show_source bar.foo" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+private def foo\r\n end\r\n], out) + end + + def test_show_source_method_multiple_s + write_ruby <<~RUBY + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + class Bob < Bar + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bob#foo -ss" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+def foo\r\n end\r\n], out) + end + + def test_show_source_method_no_instance_method + write_ruby <<~RUBY + class Baz + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#foo -s" + type "exit" + end + + assert_match(%r[Error: Couldn't locate a super definition for Bar#foo], out) + end + + def test_show_source_method_exceeds_super_chain + write_ruby <<~RUBY + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#foo -ss" + type "exit" + end + + assert_match(%r[Error: Couldn't locate a super definition for Bar#foo], out) + end + + def test_show_source_method_accidental_characters + write_ruby <<~'RUBY' + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source Bar#foo -sddddd" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+def foo\r\n end], out) + end + + def test_show_source_receiver_super + write_ruby <<~RUBY + class Baz + def foo + end + end + + class Bar < Baz + def foo + super + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "bar = Bar.new" + type "show_source bar.foo -s" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:2\s+def foo\r\n end], out) + end + + def test_show_source_with_double_colons + write_ruby <<~RUBY + class Foo + end + + class Foo + class Bar + end + end + + binding.irb + RUBY + + out = run_ruby_file do + type "show_source ::Foo" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:1\s+class Foo\r\nend], out) + + out = run_ruby_file do + type "show_source ::Foo::Bar" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:5\s+class Bar\r\n end], out) + end + + def test_show_source_keep_script_lines + pend unless defined?(RubyVM.keep_script_lines) + + write_ruby <<~RUBY + binding.irb + RUBY + + out = run_ruby_file do + type "def foo; end" + type "show_source foo" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}\(irb\):1\s+def foo; end], out) + end + + def test_show_source_unavailable_source + write_ruby <<~RUBY + binding.irb + RUBY + + out = run_ruby_file do + type "RubyVM.keep_script_lines = false if defined?(RubyVM.keep_script_lines)" + type "def foo; end" + type "show_source foo" + type "exit" + end + assert_match(%r[#{@ruby_file.to_path}\(irb\):2\s+Source not available], out) + end + + def test_show_source_shows_binary_source + write_ruby <<~RUBY + # io-console is an indirect dependency of irb + require "io/console" + + binding.irb + RUBY + + out = run_ruby_file do + # IO::ConsoleMode is defined in io-console gem's C extension + type "show_source IO::ConsoleMode" + type "exit" + end + + # A safeguard to make sure the test subject is actually defined + refute_match(/NameError/, out) + assert_match(%r[Defined in binary file:.+io/console], out) + end + + def test_show_source_with_constant_lookup + write_ruby <<~RUBY + X = 1 + module M + Y = 1 + Z = 2 + end + class A + Z = 1 + Array = 1 + class B + include M + Object.new.instance_eval { binding.irb } + end + end + RUBY + + out = run_ruby_file do + type "show_source X" + type "show_source Y" + type "show_source Z" + type "show_source Array" + type "exit" + end + + assert_match(%r[#{@ruby_file.to_path}:1\s+X = 1], out) + assert_match(%r[#{@ruby_file.to_path}:3\s+Y = 1], out) + assert_match(%r[#{@ruby_file.to_path}:7\s+Z = 1], out) + assert_match(%r[#{@ruby_file.to_path}:8\s+Array = 1], out) + end + end +end diff --git a/test/mri/irb/helper.rb b/test/mri/irb/helper.rb index e4ce7bff089..1614b42adbc 100644 --- a/test/mri/irb/helper.rb +++ b/test/mri/irb/helper.rb @@ -1,22 +1,29 @@ require "test/unit" require "pathname" +require "rubygems" begin require_relative "../lib/helper" + require_relative "../lib/envutil" rescue LoadError # ruby/ruby defines helpers differently end +begin + require "pty" +rescue LoadError # some platforms don't support PTY +end + module IRB class InputMethod; end end module TestIRB + RUBY_3_4 = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0.dev") class TestCase < Test::Unit::TestCase class TestInputMethod < ::IRB::InputMethod attr_reader :list, :line_no def initialize(list = []) - super("test") @line_no = 0 @list = list end @@ -57,20 +64,156 @@ def restore_encodings end def without_rdoc(&block) - ::Kernel.send(:alias_method, :old_require, :require) + ::Kernel.send(:alias_method, :irb_original_require, :require) ::Kernel.define_method(:require) do |name| raise LoadError, "cannot load such file -- rdoc (test)" if name.match?("rdoc") || name.match?(/^rdoc\/.*/) - ::Kernel.send(:old_require, name) + ::Kernel.send(:irb_original_require, name) end yield ensure - begin - require_relative "../lib/envutil" - rescue LoadError # ruby/ruby defines EnvUtil differently + EnvUtil.suppress_warning { + ::Kernel.send(:alias_method, :require, :irb_original_require) + ::Kernel.undef_method :irb_original_require + } + end + end + + class IntegrationTestCase < TestCase + LIB = File.expand_path("../../lib", __dir__) + TIMEOUT_SEC = 3 + + def setup + @envs = {} + @tmpfiles = [] + + unless defined?(PTY) + omit "Integration tests require PTY." + end + + if ruby_core? + omit "This test works only under ruby/irb" + end + + write_rc <<~RUBY + IRB.conf[:USE_PAGER] = false + RUBY + end + + def teardown + @tmpfiles.each do |tmpfile| + File.unlink(tmpfile) + end + end + + def run_ruby_file(&block) + cmd = [EnvUtil.rubybin, "-I", LIB, @ruby_file.to_path] + tmp_dir = Dir.mktmpdir + + @commands = [] + lines = [] + + yield + + # Test should not depend on user's irbrc file + @envs["HOME"] ||= tmp_dir + @envs["XDG_CONFIG_HOME"] ||= tmp_dir + @envs["IRBRC"] = nil unless @envs.key?("IRBRC") + + PTY.spawn(@envs.merge("TERM" => "dumb"), *cmd) do |read, write, pid| + Timeout.timeout(TIMEOUT_SEC) do + while line = safe_gets(read) + lines << line + + # means the breakpoint is triggered + if line.match?(/binding\.irb/) + while command = @commands.shift + write.puts(command) + end + end + end + end + ensure + read.close + write.close + kill_safely(pid) end - EnvUtil.suppress_warning { ::Kernel.send(:alias_method, :require, :old_require) } + + lines.join + rescue Timeout::Error + message = <<~MSG + Test timedout. + + #{'=' * 30} OUTPUT #{'=' * 30} + #{lines.map { |l| " #{l}" }.join} + #{'=' * 27} END OF OUTPUT #{'=' * 27} + MSG + assert_block(message) { false } + ensure + FileUtils.remove_entry tmp_dir + end + + # read.gets could raise exceptions on some platforms + # https://github.com/ruby/ruby/blob/master/ext/pty/pty.c#L721-L728 + def safe_gets(read) + read.gets + rescue Errno::EIO + nil + end + + def kill_safely pid + return if wait_pid pid, TIMEOUT_SEC + + Process.kill :TERM, pid + return if wait_pid pid, 0.2 + + Process.kill :KILL, pid + Process.waitpid(pid) + rescue Errno::EPERM, Errno::ESRCH + end + + def wait_pid pid, sec + total_sec = 0.0 + wait_sec = 0.001 # 1ms + + while total_sec < sec + if Process.waitpid(pid, Process::WNOHANG) == pid + return true + end + sleep wait_sec + total_sec += wait_sec + wait_sec *= 2 + end + + false + rescue Errno::ECHILD + true + end + + def type(command) + @commands << command + end + + def write_ruby(program) + @ruby_file = Tempfile.create(%w{irb- .rb}) + @tmpfiles << @ruby_file + @ruby_file.write(program) + @ruby_file.close + end + + def write_rc(content) + # Append irbrc content if a tempfile for it already exists + if @irbrc + @irbrc = File.open(@irbrc, "a") + else + @irbrc = Tempfile.new('irbrc') + @tmpfiles << @irbrc + end + + @irbrc.write(content) + @irbrc.close + @envs['IRBRC'] = @irbrc.path end end end diff --git a/test/mri/irb/test_cmd.rb b/test/mri/irb/test_cmd.rb deleted file mode 100644 index 719a2bbf8f2..00000000000 --- a/test/mri/irb/test_cmd.rb +++ /dev/null @@ -1,692 +0,0 @@ -# frozen_string_literal: false -require "rubygems" -require "irb" -require "irb/extend-command" - -require_relative "helper" - -module TestIRB - class CommandTestCase < TestCase - def execute_lines(*lines, conf: {}, main: self, irb_path: nil) - IRB.init_config(nil) - IRB.conf[:VERBOSE] = false - IRB.conf[:PROMPT_MODE] = :SIMPLE - IRB.conf.merge!(conf) - input = TestInputMethod.new(lines) - irb = IRB::Irb.new(IRB::WorkSpace.new(main), input) - irb.context.return_format = "=> %s\n" - irb.context.irb_path = irb_path if irb_path - IRB.conf[:MAIN_CONTEXT] = irb.context - capture_output do - irb.eval_input - end - end - end - - class ExtendCommandTest < CommandTestCase - def setup - @pwd = Dir.pwd - @tmpdir = File.join(Dir.tmpdir, "test_reline_config_#{$$}") - begin - Dir.mkdir(@tmpdir) - rescue Errno::EEXIST - FileUtils.rm_rf(@tmpdir) - Dir.mkdir(@tmpdir) - end - Dir.chdir(@tmpdir) - @home_backup = ENV["HOME"] - ENV["HOME"] = @tmpdir - @xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME") - save_encodings - IRB.instance_variable_get(:@CONF).clear - @is_win = (RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/) - end - - def teardown - ENV["XDG_CONFIG_HOME"] = @xdg_config_home_backup - ENV["HOME"] = @home_backup - Dir.chdir(@pwd) - FileUtils.rm_rf(@tmpdir) - restore_encodings - end - - class InfoCommandTest < ExtendCommandTest - def setup - super - @locals_backup = ENV.delete("LANG"), ENV.delete("LC_ALL") - end - - def teardown - super - ENV["LANG"], ENV["LC_ALL"] = @locals_backup - end - - def test_irb_info_multiline - FileUtils.touch("#{@tmpdir}/.inputrc") - FileUtils.touch("#{@tmpdir}/.irbrc") - - out, err = execute_lines( - "irb_info", - conf: { USE_MULTILINE: true, USE_SINGLELINE: false } - ) - - expected = %r{ - Ruby\sversion:\s.+\n - IRB\sversion:\sirb\s.+\n - InputMethod:\sAbstract\sInputMethod\n - \.irbrc\spath:\s.+\n - RUBY_PLATFORM:\s.+\n - East\sAsian\sAmbiguous\sWidth:\s\d\n - #{@is_win ? 'Code\spage:\s\d+\n' : ''} - }x - - assert_empty err - assert_match expected, out - end - - def test_irb_info_singleline - FileUtils.touch("#{@tmpdir}/.inputrc") - FileUtils.touch("#{@tmpdir}/.irbrc") - - out, err = execute_lines( - "irb_info", - conf: { USE_MULTILINE: false, USE_SINGLELINE: true } - ) - - expected = %r{ - Ruby\sversion:\s.+\n - IRB\sversion:\sirb\s.+\n - InputMethod:\sAbstract\sInputMethod\n - \.irbrc\spath:\s.+\n - RUBY_PLATFORM:\s.+\n - East\sAsian\sAmbiguous\sWidth:\s\d\n - #{@is_win ? 'Code\spage:\s\d+\n' : ''} - }x - - assert_empty err - assert_match expected, out - end - - def test_irb_info_multiline_without_rc_files - inputrc_backup = ENV["INPUTRC"] - ENV["INPUTRC"] = "unknown_inpurc" - ext_backup = IRB::IRBRC_EXT - IRB.__send__(:remove_const, :IRBRC_EXT) - IRB.const_set(:IRBRC_EXT, "unknown_ext") - - out, err = execute_lines( - "irb_info", - conf: { USE_MULTILINE: true, USE_SINGLELINE: false } - ) - - expected = %r{ - Ruby\sversion:\s.+\n - IRB\sversion:\sirb\s.+\n - InputMethod:\sAbstract\sInputMethod\n - RUBY_PLATFORM:\s.+\n - East\sAsian\sAmbiguous\sWidth:\s\d\n - #{@is_win ? 'Code\spage:\s\d+\n' : ''} - }x - - assert_empty err - assert_match expected, out - ensure - ENV["INPUTRC"] = inputrc_backup - IRB.__send__(:remove_const, :IRBRC_EXT) - IRB.const_set(:IRBRC_EXT, ext_backup) - end - - def test_irb_info_singleline_without_rc_files - inputrc_backup = ENV["INPUTRC"] - ENV["INPUTRC"] = "unknown_inpurc" - ext_backup = IRB::IRBRC_EXT - IRB.__send__(:remove_const, :IRBRC_EXT) - IRB.const_set(:IRBRC_EXT, "unknown_ext") - - out, err = execute_lines( - "irb_info", - conf: { USE_MULTILINE: false, USE_SINGLELINE: true } - ) - - expected = %r{ - Ruby\sversion:\s.+\n - IRB\sversion:\sirb\s.+\n - InputMethod:\sAbstract\sInputMethod\n - RUBY_PLATFORM:\s.+\n - East\sAsian\sAmbiguous\sWidth:\s\d\n - #{@is_win ? 'Code\spage:\s\d+\n' : ''} - }x - - assert_empty err - assert_match expected, out - ensure - ENV["INPUTRC"] = inputrc_backup - IRB.__send__(:remove_const, :IRBRC_EXT) - IRB.const_set(:IRBRC_EXT, ext_backup) - end - - def test_irb_info_lang - FileUtils.touch("#{@tmpdir}/.inputrc") - FileUtils.touch("#{@tmpdir}/.irbrc") - ENV["LANG"] = "ja_JP.UTF-8" - ENV["LC_ALL"] = "en_US.UTF-8" - - out, err = execute_lines( - "irb_info", - conf: { USE_MULTILINE: true, USE_SINGLELINE: false } - ) - - expected = %r{ - Ruby\sversion: .+\n - IRB\sversion:\sirb .+\n - InputMethod:\sAbstract\sInputMethod\n - \.irbrc\spath: .+\n - RUBY_PLATFORM: .+\n - LANG\senv:\sja_JP\.UTF-8\n - LC_ALL\senv:\sen_US\.UTF-8\n - East\sAsian\sAmbiguous\sWidth:\s\d\n - }x - - assert_empty err - assert_match expected, out - end - end - - def test_measure - conf = { - PROMPT: { - DEFAULT: { - PROMPT_I: '> ', - PROMPT_S: '> ', - PROMPT_C: '> ', - PROMPT_N: '> ' - } - }, - PROMPT_MODE: :DEFAULT, - MEASURE: false - } - - c = Class.new(Object) - out, err = execute_lines( - "3\n", - "measure\n", - "3\n", - "measure :off\n", - "3\n", - conf: conf, - main: c - ) - - assert_empty err - assert_match(/\A=> 3\nTIME is added\.\n=> nil\nprocessing time: .+\n=> 3\n=> nil\n=> 3\n/, out) - assert_empty(c.class_variables) - end - - def test_measure_enabled_by_rc - conf = { - PROMPT: { - DEFAULT: { - PROMPT_I: '> ', - PROMPT_S: '> ', - PROMPT_C: '> ', - PROMPT_N: '> ' - } - }, - PROMPT_MODE: :DEFAULT, - MEASURE: true - } - - out, err = execute_lines( - "3\n", - "measure :off\n", - "3\n", - conf: conf, - ) - - assert_empty err - assert_match(/\Aprocessing time: .+\n=> 3\n=> nil\n=> 3\n/, out) - end - - def test_measure_enabled_by_rc_with_custom - measuring_proc = proc { |line, line_no, &block| - time = Time.now - result = block.() - puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE] - result - } - conf = { - PROMPT: { - DEFAULT: { - PROMPT_I: '> ', - PROMPT_S: '> ', - PROMPT_C: '> ', - PROMPT_N: '> ' - } - }, - PROMPT_MODE: :DEFAULT, - MEASURE: true, - MEASURE_PROC: { CUSTOM: measuring_proc } - } - - out, err = execute_lines( - "3\n", - "measure :off\n", - "3\n", - conf: conf, - ) - assert_empty err - assert_match(/\Acustom processing time: .+\n=> 3\n=> nil\n=> 3\n/, out) - end - - def test_measure_with_custom - measuring_proc = proc { |line, line_no, &block| - time = Time.now - result = block.() - puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE] - result - } - conf = { - PROMPT: { - DEFAULT: { - PROMPT_I: '> ', - PROMPT_S: '> ', - PROMPT_C: '> ', - PROMPT_N: '> ' - } - }, - PROMPT_MODE: :DEFAULT, - MEASURE: false, - MEASURE_PROC: { CUSTOM: measuring_proc } - } - out, err = execute_lines( - "3\n", - "measure\n", - "3\n", - "measure :off\n", - "3\n", - conf: conf - ) - - assert_empty err - assert_match(/\A=> 3\nCUSTOM is added\.\n=> nil\ncustom processing time: .+\n=> 3\n=> nil\n=> 3\n/, out) - end - - def test_measure_with_proc - conf = { - PROMPT: { - DEFAULT: { - PROMPT_I: '> ', - PROMPT_S: '> ', - PROMPT_C: '> ', - PROMPT_N: '> ' - } - }, - PROMPT_MODE: :DEFAULT, - MEASURE: false, - } - c = Class.new(Object) - out, err = execute_lines( - "3\n", - "measure { |context, code, line_no, &block|\n", - " result = block.()\n", - " puts 'aaa' if IRB.conf[:MEASURE]\n", - " result\n", - "}\n", - "3\n", - "measure { |context, code, line_no, &block|\n", - " result = block.()\n", - " puts 'bbb' if IRB.conf[:MEASURE]\n", - " result\n", - "}\n", - "3\n", - "measure :off\n", - "3\n", - conf: conf, - main: c - ) - - assert_empty err - assert_match(/\A=> 3\nBLOCK is added\.\n=> nil\naaa\n=> 3\nBLOCK is added.\naaa\n=> nil\nbbb\n=> 3\n=> nil\n=> 3\n/, out) - assert_empty(c.class_variables) - end - - def test_irb_source - File.write("#{@tmpdir}/a.rb", "a = 'hi'\n") - out, err = execute_lines( - "a = 'bug17564'\n", - "a\n", - "irb_source '#{@tmpdir}/a.rb'\n", - "a\n", - ) - assert_empty err - assert_pattern_list([ - /=> "bug17564"\n/, - /=> "bug17564"\n/, - / => "hi"\n/, - / => nil\n/, - /=> "hi"\n/, - ], out) - end - - def test_irb_source_without_argument - out, err = execute_lines( - "irb_source\n", - ) - assert_empty err - assert_match(/Please specify the file name./, out) - end - - def test_irb_load - File.write("#{@tmpdir}/a.rb", "a = 'hi'\n") - out, err = execute_lines( - "a = 'bug17564'\n", - "a\n", - "irb_load '#{@tmpdir}/a.rb'\n", - "a\n", - ) - assert_empty err - assert_pattern_list([ - /=> "bug17564"\n/, - /=> "bug17564"\n/, - / => "hi"\n/, - / => nil\n/, - /=> "bug17564"\n/, - ], out) - end - - def test_irb_load_without_argument - out, err = execute_lines( - "irb_load\n", - ) - - assert_empty err - assert_match(/Please specify the file name./, out) - end - - def test_ls - out, err = execute_lines( - "class P\n", - " def m() end\n", - " def m2() end\n", - "end\n", - - "class C < P\n", - " def m1() end\n", - " def m2() end\n", - "end\n", - - "module M\n", - " def m1() end\n", - " def m3() end\n", - "end\n", - - "module M2\n", - " include M\n", - " def m4() end\n", - "end\n", - - "obj = C.new\n", - "obj.instance_variable_set(:@a, 1)\n", - "obj.extend M2\n", - "def obj.m5() end\n", - "ls obj\n", - ) - - assert_empty err - assert_match(/^instance variables:\s+@a\n/m, out) - assert_match(/P#methods:\s+m\n/m, out) - assert_match(/C#methods:\s+m2\n/m, out) - assert_match(/M#methods:\s+m1\s+m3\n/m, out) - assert_match(/M2#methods:\s+m4\n/m, out) - assert_match(/C.methods:\s+m5\n/m, out) - end - - def test_ls_grep - pend if RUBY_ENGINE == 'truffleruby' - out, err = execute_lines("ls 42\n") - assert_empty err - assert_match(/times/, out) - assert_match(/polar/, out) - - [ - "ls 42, grep: /times/\n", - "ls 42 -g times\n", - "ls 42 -G times\n", - ].each do |line| - out, err = execute_lines(line) - assert_empty err - assert_match(/times/, out) - assert_not_match(/polar/, out) - end - end - - def test_ls_grep_empty - pend if RUBY_ENGINE == 'truffleruby' - out, err = execute_lines("ls\n") - assert_empty err - assert_match(/whereami/, out) - assert_match(/show_source/, out) - - [ - "ls grep: /whereami/\n", - "ls -g whereami\n", - "ls -G whereami\n", - ].each do |line| - out, err = execute_lines(line) - assert_empty err - assert_match(/whereami/, out) - assert_not_match(/show_source/, out) - end - end - - def test_ls_with_no_singleton_class - out, err = execute_lines( - "ls 42", - ) - assert_empty err - assert_match(/Comparable#methods:\s+/, out) - assert_match(/Numeric#methods:\s+/, out) - assert_match(/Integer#methods:\s+/, out) - end - - def test_show_source - out, err = execute_lines( - "show_source IRB.conf\n", - ) - assert_empty err - assert_match(%r[/irb\.rb], out) - end - - def test_show_source_method - out, err = execute_lines( - "p show_source('IRB.conf')\n", - ) - assert_empty err - assert_match(%r[/irb\.rb], out) - end - - def test_show_source_string - out, err = execute_lines( - "show_source 'IRB.conf'\n", - ) - assert_empty err - assert_match(%r[/irb\.rb], out) - end - - def test_show_source_alias - out, err = execute_lines( - "$ 'IRB.conf'\n", - conf: { COMMAND_ALIASES: { :'$' => :show_source } } - ) - assert_empty err - assert_match(%r[/irb\.rb], out) - end - - def test_show_source_end_finder - pend if RUBY_ENGINE == 'truffleruby' - eval(code = <<-EOS, binding, __FILE__, __LINE__ + 1) - def show_source_test_method - unless true - end - end unless defined?(show_source_test_method) - EOS - - out, err = execute_lines( - "show_source 'TestIRB::ExtendCommandTest#show_source_test_method'\n", - ) - - assert_empty err - assert_include(out, code) - end - - def test_whereami - out, err = execute_lines( - "whereami\n", - ) - assert_empty err - assert_match(/^From: .+ @ line \d+ :\n/, out) - end - - def test_whereami_alias - out, err = execute_lines( - "@\n", - ) - assert_empty err - assert_match(/^From: .+ @ line \d+ :\n/, out) - end - - def test_vars_with_aliases - @foo = "foo" - $bar = "bar" - out, err = execute_lines( - "@foo\n", - "$bar\n", - ) - assert_empty err - assert_match(/"foo"/, out) - assert_match(/"bar"/, out) - ensure - remove_instance_variable(:@foo) - $bar = nil - end - - def test_show_cmds - out, err = execute_lines( - "show_cmds\n" - ) - - assert_empty err - assert_match(/List all available commands and their description/, out) - assert_match(/Start the debugger of debug\.gem/, out) - end - - class ShowDocTest < CommandTestCase - def test_help_and_show_doc - ["help", "show_doc"].each do |cmd| - out, _ = execute_lines( - "#{cmd} String#gsub\n", - "\n", - ) - - # the former is what we'd get without document content installed, like on CI - # the latter is what we may get locally - possible_rdoc_output = [/Nothing known about String#gsub/, /gsub\(pattern\)/] - assert(possible_rdoc_output.any? { |output| output.match?(out) }, "Expect the `#{cmd}` command to match one of the possible outputs. Got:\n#{out}") - end - ensure - # this is the only way to reset the redefined method without coupling the test with its implementation - EnvUtil.suppress_warning { load "irb/cmd/help.rb" } - end - - def test_show_doc_without_rdoc - out, _ = without_rdoc do - execute_lines( - "show_doc String#gsub\n", - "\n", - ) - end - - # if it fails to require rdoc, it only returns the command object - assert_match(/=> IRB::ExtendCommand::Help\n/, out) - ensure - # this is the only way to reset the redefined method without coupling the test with its implementation - EnvUtil.suppress_warning { load "irb/cmd/help.rb" } - end - end - - class EditTest < CommandTestCase - def setup - @original_editor = ENV["EDITOR"] - # noop the command so nothing gets executed - ENV["EDITOR"] = ": code" - end - - def teardown - ENV["EDITOR"] = @original_editor - end - - def test_edit_without_arg - out, err = execute_lines( - "edit", - irb_path: __FILE__ - ) - - assert_empty err - assert_match("path: #{__FILE__}", out) - assert_match("command: ': code'", out) - end - - def test_edit_with_path - out, err = execute_lines( - "edit #{__FILE__}" - ) - - assert_empty err - assert_match("path: #{__FILE__}", out) - assert_match("command: ': code'", out) - end - - def test_edit_with_non_existing_path - out, err = execute_lines( - "edit test_cmd_non_existing_path.rb" - ) - - assert_empty err - assert_match(/Can not find file: test_cmd_non_existing_path\.rb/, out) - end - - def test_edit_with_constant - # const_source_location is supported after Ruby 2.7 - omit if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') || RUBY_ENGINE == 'truffleruby' - - out, err = execute_lines( - "edit IRB::Irb" - ) - - assert_empty err - assert_match(/path: .*\/lib\/irb\.rb/, out) - assert_match("command: ': code'", out) - end - - def test_edit_with_class_method - out, err = execute_lines( - "edit IRB.start" - ) - - assert_empty err - assert_match(/path: .*\/lib\/irb\.rb/, out) - assert_match("command: ': code'", out) - end - - def test_edit_with_instance_method - out, err = execute_lines( - "edit IRB::Irb#run" - ) - - assert_empty err - assert_match(/path: .*\/lib\/irb\.rb/, out) - assert_match("command: ': code'", out) - end - end - end -end diff --git a/test/mri/irb/test_color.rb b/test/mri/irb/test_color.rb index 1b27afb898d..72e036eab77 100644 --- a/test/mri/irb/test_color.rb +++ b/test/mri/irb/test_color.rb @@ -1,12 +1,11 @@ # frozen_string_literal: false require 'irb/color' -require 'rubygems' require 'stringio' require_relative "helper" module TestIRB - class TestColor < TestCase + class ColorTest < TestCase CLEAR = "\e[0m" BOLD = "\e[1m" UNDERLINE = "\e[4m" @@ -18,6 +17,20 @@ class TestColor < TestCase MAGENTA = "\e[35m" CYAN = "\e[36m" + def setup + super + if IRB.respond_to?(:conf) + @colorize, IRB.conf[:USE_COLORIZE] = IRB.conf[:USE_COLORIZE], true + end + end + + def teardown + if instance_variable_defined?(:@colorize) + IRB.conf[:USE_COLORIZE] = @colorize + end + super + end + def test_colorize text = "text" { @@ -76,6 +89,7 @@ def test_colorize_code ":class" => "#{YELLOW}:#{CLEAR}#{YELLOW}class#{CLEAR}", "[:end, 2]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}end#{CLEAR}, #{BLUE}#{BOLD}2#{CLEAR}]", "[:>, 3]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}>#{CLEAR}, #{BLUE}#{BOLD}3#{CLEAR}]", + "[:`, 4]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}`#{CLEAR}, #{BLUE}#{BOLD}4#{CLEAR}]", ":Hello ? world : nil" => "#{YELLOW}:#{CLEAR}#{YELLOW}Hello#{CLEAR} ? world : #{CYAN}#{BOLD}nil#{CLEAR}", 'raise "foo#{bar}baz"' => "raise #{RED}#{BOLD}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}bar#{RED}}#{CLEAR}#{RED}baz#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}", '["#{obj.inspect}"]' => "[#{RED}#{BOLD}\"#{CLEAR}#{RED}\#{#{CLEAR}obj.inspect#{RED}}#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}]", @@ -94,14 +108,11 @@ def test_colorize_code "< "#{RED}<= Gem::Version.new('2.7.0') - tests.merge!({ - "4.5.6" => "#{MAGENTA}#{BOLD}4.5#{CLEAR}#{RED}#{REVERSE}.6#{CLEAR}", - "\e[0m\n" => "#{RED}#{REVERSE}^[#{CLEAR}[#{BLUE}#{BOLD}0#{CLEAR}#{RED}#{REVERSE}m#{CLEAR}\n", - "< "#{RED}< "#{MAGENTA}#{BOLD}4.5#{CLEAR}#{RED}#{REVERSE}.6#{CLEAR}", + "\e[0m\n" => "#{RED}#{REVERSE}^[#{CLEAR}[#{BLUE}#{BOLD}0#{CLEAR}#{RED}#{REVERSE}m#{CLEAR}\n", + "< "#{RED}<= Gem::Version.new('3.0.0') @@ -121,18 +132,9 @@ def test_colorize_code }) end else - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') - tests.merge!({ - "[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}]^S", - "def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}) end", - }) - else - tests.merge!({ - "[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]]]^S", - "def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{CYAN}#{BOLD}true#{CLEAR}) end", - }) - end tests.merge!({ + "[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}]^S", + "def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}) end", "nil = 1" => "#{CYAN}#{BOLD}nil#{CLEAR} = #{BLUE}#{BOLD}1#{CLEAR}", "alias $x $1" => "#{GREEN}alias#{CLEAR} #{GREEN}#{BOLD}$x#{CLEAR} $1", "class bad; end" => "#{GREEN}class#{CLEAR} bad; #{GREEN}end#{CLEAR}", @@ -169,10 +171,6 @@ def test_colorize_code_with_local_variables end def test_colorize_code_complete_true - unless complete_option_supported? - pend '`complete: true` is the same as `complete: false` in Ruby 2.6-' - end - # `complete: true` behaviors. Warn end-of-file. { "'foo' + 'bar" => "#{RED}#{BOLD}'#{CLEAR}#{RED}foo#{CLEAR}#{RED}#{BOLD}'#{CLEAR} + #{RED}#{BOLD}'#{CLEAR}#{RED}#{REVERSE}bar#{CLEAR}", @@ -201,16 +199,6 @@ def test_colorize_code_complete_false assert_equal_with_term(code, code, complete: false, colorable: false) assert_equal_with_term(result, code, complete: false, tty: false, colorable: true) - - unless complete_option_supported? - assert_equal_with_term(result, code, complete: true) - - assert_equal_with_term(code, code, complete: true, tty: false) - - assert_equal_with_term(code, code, complete: true, colorable: false) - - assert_equal_with_term(result, code, complete: true, tty: false, colorable: true) - end end end @@ -236,11 +224,6 @@ def test_inspect_colorable private - # `complete: true` is the same as `complete: false` in Ruby 2.6- - def complete_option_supported? - Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') - end - def with_term(tty: true) stdout = $stdout io = StringIO.new diff --git a/test/mri/irb/test_color_printer.rb b/test/mri/irb/test_color_printer.rb index 79ab0505504..c2c624d8689 100644 --- a/test/mri/irb/test_color_printer.rb +++ b/test/mri/irb/test_color_printer.rb @@ -1,12 +1,11 @@ # frozen_string_literal: false require 'irb/color_printer' -require 'rubygems' require 'stringio' require_relative "helper" module TestIRB - class TestColorPrinter < TestCase + class ColorPrinterTest < TestCase CLEAR = "\e[0m" BOLD = "\e[1m" RED = "\e[31m" @@ -15,6 +14,10 @@ class TestColorPrinter < TestCase CYAN = "\e[36m" def setup + super + if IRB.respond_to?(:conf) + @colorize, IRB.conf[:USE_COLORIZE] = IRB.conf[:USE_COLORIZE], true + end @get_screen_size = Reline.method(:get_screen_size) Reline.instance_eval { undef :get_screen_size } def Reline.get_screen_size @@ -25,18 +28,19 @@ def Reline.get_screen_size def teardown Reline.instance_eval { undef :get_screen_size } Reline.define_singleton_method(:get_screen_size, @get_screen_size) + if instance_variable_defined?(:@colorize) + IRB.conf[:USE_COLORIZE] = @colorize + end + super end IRBTestColorPrinter = Struct.new(:a) def test_color_printer - unless ripper_lexer_scan_supported? - pend 'Ripper::Lexer#scan is supported in Ruby 2.7+' - end { 1 => "#{BLUE}#{BOLD}1#{CLEAR}\n", "a\nb" => %[#{RED}#{BOLD}"#{CLEAR}#{RED}a\\nb#{CLEAR}#{RED}#{BOLD}"#{CLEAR}\n], - IRBTestColorPrinter.new('test') => "#{GREEN}##{CLEAR}\n", + IRBTestColorPrinter.new('test') => "#{GREEN}##{CLEAR}\n", Ripper::Lexer.new('1').scan => "[#{GREEN}##{CLEAR}]\n", Class.new{define_method(:pretty_print){|q| q.text("[__FILE__, __LINE__, __ENCODING__]")}}.new => "[#{CYAN}#{BOLD}__FILE__#{CLEAR}, #{CYAN}#{BOLD}__LINE__#{CLEAR}, #{CYAN}#{BOLD}__ENCODING__#{CLEAR}]\n", }.each do |object, result| @@ -47,10 +51,6 @@ def test_color_printer private - def ripper_lexer_scan_supported? - Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') - end - def with_term stdout = $stdout io = StringIO.new diff --git a/test/mri/irb/test_command.rb b/test/mri/irb/test_command.rb new file mode 100644 index 00000000000..8e074e97f9d --- /dev/null +++ b/test/mri/irb/test_command.rb @@ -0,0 +1,953 @@ +# frozen_string_literal: false +require "irb" + +require_relative "helper" + +module TestIRB + class CommandTestCase < TestCase + def setup + @pwd = Dir.pwd + @tmpdir = File.join(Dir.tmpdir, "test_reline_config_#{$$}") + begin + Dir.mkdir(@tmpdir) + rescue Errno::EEXIST + FileUtils.rm_rf(@tmpdir) + Dir.mkdir(@tmpdir) + end + Dir.chdir(@tmpdir) + @home_backup = ENV["HOME"] + ENV["HOME"] = @tmpdir + @xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME") + save_encodings + IRB.instance_variable_get(:@CONF).clear + @is_win = (RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/) + end + + def teardown + ENV["XDG_CONFIG_HOME"] = @xdg_config_home_backup + ENV["HOME"] = @home_backup + Dir.chdir(@pwd) + FileUtils.rm_rf(@tmpdir) + restore_encodings + end + + def execute_lines(*lines, conf: {}, main: self, irb_path: nil) + capture_output do + IRB.init_config(nil) + IRB.conf[:VERBOSE] = false + IRB.conf[:PROMPT_MODE] = :SIMPLE + IRB.conf[:USE_PAGER] = false + IRB.conf.merge!(conf) + input = TestInputMethod.new(lines) + irb = IRB::Irb.new(IRB::WorkSpace.new(main), input) + irb.context.return_format = "=> %s\n" + irb.context.irb_path = irb_path if irb_path + IRB.conf[:MAIN_CONTEXT] = irb.context + irb.eval_input + end + end + end + + class FrozenObjectTest < CommandTestCase + def test_calling_command_on_a_frozen_main + main = Object.new.freeze + + out, err = execute_lines( + "irb_info", + main: main + ) + assert_empty(err) + assert_match(/RUBY_PLATFORM/, out) + end + end + + class InfoTest < CommandTestCase + def setup + super + @locals_backup = ENV.delete("LANG"), ENV.delete("LC_ALL") + end + + def teardown + super + ENV["LANG"], ENV["LC_ALL"] = @locals_backup + end + + def test_irb_info_multiline + FileUtils.touch("#{@tmpdir}/.inputrc") + FileUtils.touch("#{@tmpdir}/.irbrc") + FileUtils.touch("#{@tmpdir}/_irbrc") + + out, err = execute_lines( + "irb_info", + conf: { USE_MULTILINE: true, USE_SINGLELINE: false } + ) + + expected = %r{ + Ruby\sversion:\s.+\n + IRB\sversion:\sirb\s.+\n + InputMethod:\sAbstract\sInputMethod\n + Completion: .+\n + \.irbrc\spaths:.*\.irbrc.*_irbrc\n + RUBY_PLATFORM:\s.+\n + East\sAsian\sAmbiguous\sWidth:\s\d\n + #{@is_win ? 'Code\spage:\s\d+\n' : ''} + }x + + assert_empty err + assert_match expected, out + end + + def test_irb_info_singleline + FileUtils.touch("#{@tmpdir}/.inputrc") + FileUtils.touch("#{@tmpdir}/.irbrc") + + out, err = execute_lines( + "irb_info", + conf: { USE_MULTILINE: false, USE_SINGLELINE: true } + ) + + expected = %r{ + Ruby\sversion:\s.+\n + IRB\sversion:\sirb\s.+\n + InputMethod:\sAbstract\sInputMethod\n + Completion: .+\n + \.irbrc\spaths:\s.+\n + RUBY_PLATFORM:\s.+\n + East\sAsian\sAmbiguous\sWidth:\s\d\n + #{@is_win ? 'Code\spage:\s\d+\n' : ''} + }x + + assert_empty err + assert_match expected, out + end + + def test_irb_info_multiline_without_rc_files + inputrc_backup = ENV["INPUTRC"] + ENV["INPUTRC"] = "unknown_inpurc" + ext_backup = IRB::IRBRC_EXT + IRB.__send__(:remove_const, :IRBRC_EXT) + IRB.const_set(:IRBRC_EXT, "unknown_ext") + + out, err = execute_lines( + "irb_info", + conf: { USE_MULTILINE: true, USE_SINGLELINE: false } + ) + + expected = %r{ + Ruby\sversion:\s.+\n + IRB\sversion:\sirb\s.+\n + InputMethod:\sAbstract\sInputMethod\n + Completion: .+\n + RUBY_PLATFORM:\s.+\n + East\sAsian\sAmbiguous\sWidth:\s\d\n + #{@is_win ? 'Code\spage:\s\d+\n' : ''} + }x + + assert_empty err + assert_match expected, out + ensure + ENV["INPUTRC"] = inputrc_backup + IRB.__send__(:remove_const, :IRBRC_EXT) + IRB.const_set(:IRBRC_EXT, ext_backup) + end + + def test_irb_info_singleline_without_rc_files + inputrc_backup = ENV["INPUTRC"] + ENV["INPUTRC"] = "unknown_inpurc" + ext_backup = IRB::IRBRC_EXT + IRB.__send__(:remove_const, :IRBRC_EXT) + IRB.const_set(:IRBRC_EXT, "unknown_ext") + + out, err = execute_lines( + "irb_info", + conf: { USE_MULTILINE: false, USE_SINGLELINE: true } + ) + + expected = %r{ + Ruby\sversion:\s.+\n + IRB\sversion:\sirb\s.+\n + InputMethod:\sAbstract\sInputMethod\n + Completion: .+\n + RUBY_PLATFORM:\s.+\n + East\sAsian\sAmbiguous\sWidth:\s\d\n + #{@is_win ? 'Code\spage:\s\d+\n' : ''} + }x + + assert_empty err + assert_match expected, out + ensure + ENV["INPUTRC"] = inputrc_backup + IRB.__send__(:remove_const, :IRBRC_EXT) + IRB.const_set(:IRBRC_EXT, ext_backup) + end + + def test_irb_info_lang + FileUtils.touch("#{@tmpdir}/.inputrc") + FileUtils.touch("#{@tmpdir}/.irbrc") + ENV["LANG"] = "ja_JP.UTF-8" + ENV["LC_ALL"] = "en_US.UTF-8" + + out, err = execute_lines( + "irb_info", + conf: { USE_MULTILINE: true, USE_SINGLELINE: false } + ) + + expected = %r{ + Ruby\sversion: .+\n + IRB\sversion:\sirb .+\n + InputMethod:\sAbstract\sInputMethod\n + Completion: .+\n + \.irbrc\spaths: .+\n + RUBY_PLATFORM: .+\n + LANG\senv:\sja_JP\.UTF-8\n + LC_ALL\senv:\sen_US\.UTF-8\n + East\sAsian\sAmbiguous\sWidth:\s\d\n + }x + + assert_empty err + assert_match expected, out + end + end + + class MeasureTest < CommandTestCase + def test_measure + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: false + } + + c = Class.new(Object) + out, err = execute_lines( + "measure\n", + "3\n", + "measure :off\n", + "3\n", + "measure :on\n", + "3\n", + "measure :off\n", + "3\n", + conf: conf, + main: c + ) + + assert_empty err + assert_match(/\A(TIME is added\.\n=> nil\nprocessing time: .+\n=> 3\n=> nil\n=> 3\n){2}/, out) + assert_empty(c.class_variables) + end + + def test_measure_keeps_previous_value + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: false + } + + c = Class.new(Object) + out, err = execute_lines( + "measure\n", + "3\n", + "_\n", + conf: conf, + main: c + ) + + assert_empty err + assert_match(/\ATIME is added\.\n=> nil\nprocessing time: .+\n=> 3\nprocessing time: .+\n=> 3/, out) + assert_empty(c.class_variables) + end + + def test_measure_enabled_by_rc + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: true + } + + out, err = execute_lines( + "3\n", + "measure :off\n", + "3\n", + conf: conf, + ) + + assert_empty err + assert_match(/\Aprocessing time: .+\n=> 3\n=> nil\n=> 3\n/, out) + end + + def test_measure_enabled_by_rc_with_custom + measuring_proc = proc { |line, line_no, &block| + time = Time.now + result = block.() + puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE] + result + } + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: true, + MEASURE_PROC: { CUSTOM: measuring_proc } + } + + out, err = execute_lines( + "3\n", + "measure :off\n", + "3\n", + conf: conf, + ) + assert_empty err + assert_match(/\Acustom processing time: .+\n=> 3\n=> nil\n=> 3\n/, out) + end + + def test_measure_with_custom + measuring_proc = proc { |line, line_no, &block| + time = Time.now + result = block.() + puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE] + result + } + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: false, + MEASURE_PROC: { CUSTOM: measuring_proc } + } + out, err = execute_lines( + "3\n", + "measure\n", + "3\n", + "measure :off\n", + "3\n", + conf: conf + ) + + assert_empty err + assert_match(/\A=> 3\nCUSTOM is added\.\n=> nil\ncustom processing time: .+\n=> 3\n=> nil\n=> 3\n/, out) + end + + def test_measure_toggle + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: false, + MEASURE_PROC: { + FOO: proc { |&block| puts 'foo'; block.call }, + BAR: proc { |&block| puts 'bar'; block.call } + } + } + out, err = execute_lines( + "measure :foo", + "measure :on, :bar", + "3\n", + "measure :off, :foo\n", + "measure :off, :bar\n", + "3\n", + conf: conf + ) + + assert_empty err + assert_match(/\AFOO is added\.\n=> nil\nfoo\nBAR is added\.\n=> nil\nbar\nfoo\n=> 3\nbar\nfoo\n=> nil\nbar\n=> nil\n=> 3\n/, out) + end + + def test_measure_with_proc_warning + conf = { + PROMPT: { + DEFAULT: { + PROMPT_I: '> ', + PROMPT_S: '> ', + PROMPT_C: '> ' + } + }, + PROMPT_MODE: :DEFAULT, + MEASURE: false, + } + c = Class.new(Object) + out, err = execute_lines( + "3\n", + "measure do\n", + "end\n", + "3\n", + conf: conf, + main: c + ) + + assert_match(/to add custom measure/, err) + assert_match(/\A=> 3\n=> nil\n=> 3\n/, out) + assert_empty(c.class_variables) + end + end + + class IrbSourceTest < CommandTestCase + def test_irb_source + File.write("#{@tmpdir}/a.rb", "a = 'hi'\n") + out, err = execute_lines( + "a = 'bug17564'\n", + "a\n", + "irb_source '#{@tmpdir}/a.rb'\n", + "a\n", + ) + assert_empty err + assert_pattern_list([ + /=> "bug17564"\n/, + /=> "bug17564"\n/, + / => "hi"\n/, + / => nil\n/, + /=> "hi"\n/, + ], out) + end + + def test_irb_source_without_argument + out, err = execute_lines( + "irb_source\n", + ) + assert_empty err + assert_match(/Please specify the file name./, out) + end + end + + class IrbLoadTest < CommandTestCase + def test_irb_load + File.write("#{@tmpdir}/a.rb", "a = 'hi'\n") + out, err = execute_lines( + "a = 'bug17564'\n", + "a\n", + "irb_load '#{@tmpdir}/a.rb'\n", + "a\n", + ) + assert_empty err + assert_pattern_list([ + /=> "bug17564"\n/, + /=> "bug17564"\n/, + / => "hi"\n/, + / => nil\n/, + /=> "bug17564"\n/, + ], out) + end + + def test_irb_load_without_argument + out, err = execute_lines( + "irb_load\n", + ) + + assert_empty err + assert_match(/Please specify the file name./, out) + end + end + + class WorkspaceCommandTestCase < CommandTestCase + def setup + super + # create Foo under the test class's namespace so it doesn't pollute global namespace + self.class.class_eval <<~RUBY + class Foo; end + RUBY + end + end + + class CwwsTest < WorkspaceCommandTestCase + def test_cwws_returns_the_current_workspace_object + out, err = execute_lines( + "cwws", + "self.class" + ) + + assert_empty err + assert_include(out, self.class.name) + end + end + + class PushwsTest < WorkspaceCommandTestCase + def test_pushws_switches_to_new_workspace_and_pushes_the_current_one_to_the_stack + out, err = execute_lines( + "pushws #{self.class}::Foo.new", + "self.class", + "popws", + "self.class" + ) + assert_empty err + + assert_match(/=> #{self.class}::Foo\n/, out) + assert_match(/=> #{self.class}\n$/, out) + end + + def test_pushws_extends_the_new_workspace_with_command_bundle + out, err = execute_lines( + "pushws Object.new", + "self.singleton_class.ancestors" + ) + assert_empty err + assert_include(out, "IRB::ExtendCommandBundle") + end + + def test_pushws_prints_workspace_stack_when_no_arg_is_given + out, err = execute_lines( + "pushws", + ) + assert_empty err + assert_include(out, "[#]") + end + + def test_pushws_without_argument_swaps_the_top_two_workspaces + out, err = execute_lines( + "pushws #{self.class}::Foo.new", + "self.class", + "pushws", + "self.class" + ) + assert_empty err + assert_match(/=> #{self.class}::Foo\n/, out) + assert_match(/=> #{self.class}\n$/, out) + end + end + + class WorkspacesTest < WorkspaceCommandTestCase + def test_workspaces_returns_the_stack_of_workspaces + out, err = execute_lines( + "pushws #{self.class}::Foo.new\n", + "workspaces", + ) + + assert_empty err + assert_match(/\[#, #\]\n/, out) + end + end + + class PopwsTest < WorkspaceCommandTestCase + def test_popws_replaces_the_current_workspace_with_the_previous_one + out, err = execute_lines( + "pushws Foo.new\n", + "popws\n", + "cwws.class", + ) + assert_empty err + assert_include(out, "=> #{self.class}") + end + + def test_popws_prints_help_message_if_the_workspace_is_empty + out, err = execute_lines( + "popws\n", + ) + assert_empty err + assert_match(/\[#\]\n/, out) + end + end + + class ChwsTest < WorkspaceCommandTestCase + def test_chws_replaces_the_current_workspace + out, err = execute_lines( + "chws #{self.class}::Foo.new\n", + "cwws.class", + ) + assert_empty err + assert_include(out, "=> #{self.class}::Foo") + end + + def test_chws_does_nothing_when_receiving_no_argument + out, err = execute_lines( + "chws\n", + "cwws.class", + ) + assert_empty err + assert_include(out, "=> #{self.class}") + end + end + + class WhereamiTest < CommandTestCase + def test_whereami + out, err = execute_lines( + "whereami\n", + ) + assert_empty err + assert_match(/^From: .+ @ line \d+ :\n/, out) + end + + def test_whereami_alias + out, err = execute_lines( + "@\n", + ) + assert_empty err + assert_match(/^From: .+ @ line \d+ :\n/, out) + end + end + + class LsTest < CommandTestCase + def test_ls + out, err = execute_lines( + "class P\n", + " def m() end\n", + " def m2() end\n", + "end\n", + + "class C < P\n", + " def m1() end\n", + " def m2() end\n", + "end\n", + + "module M\n", + " def m1() end\n", + " def m3() end\n", + "end\n", + + "module M2\n", + " include M\n", + " def m4() end\n", + "end\n", + + "obj = C.new\n", + "obj.instance_variable_set(:@a, 1)\n", + "obj.extend M2\n", + "def obj.m5() end\n", + "ls obj\n", + ) + + assert_empty err + assert_match(/^instance variables:\s+@a\n/m, out) + assert_match(/P#methods:\s+m\n/m, out) + assert_match(/C#methods:\s+m2\n/m, out) + assert_match(/M#methods:\s+m1\s+m3\n/m, out) + assert_match(/M2#methods:\s+m4\n/m, out) + assert_match(/C.methods:\s+m5\n/m, out) + end + + def test_ls_class + out, err = execute_lines( + "module M1\n", + " def m2; end\n", + " def m3; end\n", + "end\n", + + "class C1\n", + " def m1; end\n", + " def m2; end\n", + "end\n", + + "class C2 < C1\n", + " include M1\n", + " def m3; end\n", + " def m4; end\n", + " def self.m3; end\n", + " def self.m5; end\n", + "end\n", + "ls C2" + ) + + assert_empty err + assert_match(/C2.methods:\s+m3\s+m5\n/, out) + assert_match(/C2#methods:\s+m3\s+m4\n.*M1#methods:\s+m2\n.*C1#methods:\s+m1\n/, out) + assert_not_match(/Module#methods/, out) + assert_not_match(/Class#methods/, out) + end + + def test_ls_module + out, err = execute_lines( + "module M1\n", + " def m1; end\n", + " def m2; end\n", + "end\n", + + "module M2\n", + " include M1\n", + " def m1; end\n", + " def m3; end\n", + " def self.m4; end\n", + "end\n", + "ls M2" + ) + + assert_empty err + assert_match(/M2\.methods:\s+m4\n/, out) + assert_match(/M2#methods:\s+m1\s+m3\n.*M1#methods:\s+m2\n/, out) + assert_not_match(/Module#methods/, out) + end + + def test_ls_instance + out, err = execute_lines( + "class Foo; def bar; end; end\n", + "ls Foo.new" + ) + + assert_empty err + assert_match(/Foo#methods:\s+bar/, out) + # don't duplicate + assert_not_match(/Foo#methods:\s+bar\n.*Foo#methods/, out) + end + + def test_ls_grep + out, err = execute_lines("ls 42\n") + assert_empty err + assert_match(/times/, out) + assert_match(/polar/, out) + + [ + "ls 42, grep: /times/\n", + "ls 42 -g times\n", + "ls 42 -G times\n", + ].each do |line| + out, err = execute_lines(line) + assert_empty err + assert_match(/times/, out) + assert_not_match(/polar/, out) + end + end + + def test_ls_grep_empty + out, err = execute_lines("ls\n") + assert_empty err + assert_match(/whereami/, out) + assert_match(/show_source/, out) + + [ + "ls grep: /whereami/\n", + "ls -g whereami\n", + "ls -G whereami\n", + ].each do |line| + out, err = execute_lines(line) + assert_empty err + assert_match(/whereami/, out) + assert_not_match(/show_source/, out) + end + end + + def test_ls_with_no_singleton_class + out, err = execute_lines( + "ls 42", + ) + assert_empty err + assert_match(/Comparable#methods:\s+/, out) + assert_match(/Numeric#methods:\s+/, out) + assert_match(/Integer#methods:\s+/, out) + end + end + + class ShowDocTest < CommandTestCase + def test_show_doc + out, err = execute_lines( + "show_doc String#gsub\n", + "\n", + ) + + # the former is what we'd get without document content installed, like on CI + # the latter is what we may get locally + possible_rdoc_output = [/Nothing known about String#gsub/, /gsub\(pattern\)/] + assert_not_include err, "[Deprecation]" + assert(possible_rdoc_output.any? { |output| output.match?(out) }, "Expect the `show_doc` command to match one of the possible outputs. Got:\n#{out}") + ensure + # this is the only way to reset the redefined method without coupling the test with its implementation + EnvUtil.suppress_warning { load "irb/command/help.rb" } + end + + def test_show_doc_without_rdoc + out, err = without_rdoc do + execute_lines( + "show_doc String#gsub\n", + "\n", + ) + end + + # if it fails to require rdoc, it only returns the command object + assert_match(/=> nil\n/, out) + assert_include(err, "Can't display document because `rdoc` is not installed.\n") + ensure + # this is the only way to reset the redefined method without coupling the test with its implementation + EnvUtil.suppress_warning { load "irb/command/help.rb" } + end + end + + class EditTest < CommandTestCase + def setup + @original_visual = ENV["VISUAL"] + @original_editor = ENV["EDITOR"] + # noop the command so nothing gets executed + ENV["VISUAL"] = ": code" + ENV["EDITOR"] = ": code2" + end + + def teardown + ENV["VISUAL"] = @original_visual + ENV["EDITOR"] = @original_editor + end + + def test_edit_without_arg + out, err = execute_lines( + "edit", + irb_path: __FILE__ + ) + + assert_empty err + assert_match("path: #{__FILE__}", out) + assert_match("command: ': code'", out) + end + + def test_edit_without_arg_and_non_existing_irb_path + out, err = execute_lines( + "edit", + irb_path: '/path/to/file.rb(irb)' + ) + + assert_empty err + assert_match(/Can not find file: \/path\/to\/file\.rb\(irb\)/, out) + end + + def test_edit_with_path + out, err = execute_lines( + "edit #{__FILE__}" + ) + + assert_empty err + assert_match("path: #{__FILE__}", out) + assert_match("command: ': code'", out) + end + + def test_edit_with_non_existing_path + out, err = execute_lines( + "edit test_cmd_non_existing_path.rb" + ) + + assert_empty err + assert_match(/Can not find file: test_cmd_non_existing_path\.rb/, out) + end + + def test_edit_with_constant + out, err = execute_lines( + "edit IRB::Irb" + ) + + assert_empty err + assert_match(/path: .*\/lib\/irb\.rb/, out) + assert_match("command: ': code'", out) + end + + def test_edit_with_class_method + out, err = execute_lines( + "edit IRB.start" + ) + + assert_empty err + assert_match(/path: .*\/lib\/irb\.rb/, out) + assert_match("command: ': code'", out) + end + + def test_edit_with_instance_method + out, err = execute_lines( + "edit IRB::Irb#run" + ) + + assert_empty err + assert_match(/path: .*\/lib\/irb\.rb/, out) + assert_match("command: ': code'", out) + end + + def test_edit_with_editor_env_var + ENV.delete("VISUAL") + + out, err = execute_lines( + "edit", + irb_path: __FILE__ + ) + + assert_empty err + assert_match("path: #{__FILE__}", out) + assert_match("command: ': code2'", out) + end + end + + class HistoryCmdTest < CommandTestCase + def teardown + TestInputMethod.send(:remove_const, "HISTORY") if defined?(TestInputMethod::HISTORY) + super + end + + def test_history + TestInputMethod.const_set("HISTORY", %w[foo bar baz]) + + out, err = without_rdoc do + execute_lines("history") + end + + assert_include(out, <<~EOF) + 2: baz + 1: bar + 0: foo + EOF + assert_empty err + end + + def test_multiline_history_with_truncation + TestInputMethod.const_set("HISTORY", ["foo", "bar", <<~INPUT]) + [].each do |x| + puts x + end + INPUT + + out, err = without_rdoc do + execute_lines("hist") + end + + assert_include(out, <<~EOF) + 2: [].each do |x| + puts x + ... + 1: bar + 0: foo + EOF + assert_empty err + end + + def test_history_grep + TestInputMethod.const_set("HISTORY", ["foo", "bar", <<~INPUT]) + [].each do |x| + puts x + end + INPUT + + out, err = without_rdoc do + execute_lines("hist -g each\n") + end + + assert_include(out, <<~EOF) + 2: [].each do |x| + puts x + ... + EOF + assert_empty err + end + + end + +end diff --git a/test/mri/irb/test_completion.rb b/test/mri/irb/test_completion.rb index 1ab7dbbb194..8194463931e 100644 --- a/test/mri/irb/test_completion.rb +++ b/test/mri/irb/test_completion.rb @@ -5,90 +5,83 @@ require_relative "helper" module TestIRB - class TestCompletion < TestCase - def setup - # make sure require completion candidates are not cached - IRB::InputCompletor.class_variable_set(:@@files_from_load_path, nil) + class CompletionTest < TestCase + def completion_candidates(target, bind) + IRB::RegexpCompletor.new.completion_candidates('', target, '', bind: bind) end - def test_nonstring_module_name - begin - require "irb/completion" - bug5938 = '[ruby-core:42244]' - bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - cmds = bundle_exec + %W[-W0 -rirb -rirb/completion -e IRB.setup(__FILE__) - -e IRB.conf[:MAIN_CONTEXT]=IRB::Irb.new.context - -e module\sFoo;def\sself.name;//;end;end - -e IRB::InputCompletor::CompletionProc.call("[1].first.") - -- -f --] - status = assert_in_out_err(cmds, "", //, [], bug5938) - assert(status.success?, bug5938) - rescue LoadError - pend "cannot load irb/completion" - end + def doc_namespace(target, bind) + IRB::RegexpCompletor.new.doc_namespace('', target, '', bind: bind) end - class TestMethodCompletion < TestCompletion + class MethodCompletionTest < CompletionTest def test_complete_string - assert_include(IRB::InputCompletor.retrieve_completion_data("'foo'.up", bind: binding), "'foo'.upcase") - assert_equal("String.upcase", IRB::InputCompletor.retrieve_completion_data("'foo'.upcase", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("'foo'.up", binding), "'foo'.upcase") + # completing 'foo bar'.up + assert_include(completion_candidates("bar'.up", binding), "bar'.upcase") + assert_equal("String.upcase", doc_namespace("'foo'.upcase", binding)) end def test_complete_regexp - assert_include(IRB::InputCompletor.retrieve_completion_data("/foo/.ma", bind: binding), "/foo/.match") - assert_equal("Regexp.match", IRB::InputCompletor.retrieve_completion_data("/foo/.match", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("/foo/.ma", binding), "/foo/.match") + # completing /foo bar/.ma + assert_include(completion_candidates("bar/.ma", binding), "bar/.match") + assert_equal("Regexp.match", doc_namespace("/foo/.match", binding)) end def test_complete_array - assert_include(IRB::InputCompletor.retrieve_completion_data("[].an", bind: binding), "[].any?") - assert_equal("Array.any?", IRB::InputCompletor.retrieve_completion_data("[].any?", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("[].an", binding), "[].any?") + assert_equal("Array.any?", doc_namespace("[].any?", binding)) end def test_complete_hash_and_proc # hash - assert_include(IRB::InputCompletor.retrieve_completion_data("{}.an", bind: binding), "{}.any?") - assert_equal(["Proc.any?", "Hash.any?"], IRB::InputCompletor.retrieve_completion_data("{}.any?", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("{}.an", binding), "{}.any?") + assert_equal(["Hash.any?", "Proc.any?"], doc_namespace("{}.any?", binding)) # proc - assert_include(IRB::InputCompletor.retrieve_completion_data("{}.bin", bind: binding), "{}.binding") - assert_equal(["Proc.binding", "Hash.binding"], IRB::InputCompletor.retrieve_completion_data("{}.binding", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("{}.bin", binding), "{}.binding") + assert_equal(["Hash.binding", "Proc.binding"], doc_namespace("{}.binding", binding)) end def test_complete_numeric - assert_include(IRB::InputCompletor.retrieve_completion_data("1.positi", bind: binding), "1.positive?") - assert_equal("Integer.positive?", IRB::InputCompletor.retrieve_completion_data("1.positive?", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("1.positi", binding), "1.positive?") + assert_equal("Integer.positive?", doc_namespace("1.positive?", binding)) - assert_include(IRB::InputCompletor.retrieve_completion_data("1r.positi", bind: binding), "1r.positive?") - assert_equal("Rational.positive?", IRB::InputCompletor.retrieve_completion_data("1r.positive?", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("1r.positi", binding), "1r.positive?") + assert_equal("Rational.positive?", doc_namespace("1r.positive?", binding)) - assert_include(IRB::InputCompletor.retrieve_completion_data("0xFFFF.positi", bind: binding), "0xFFFF.positive?") - assert_equal("Integer.positive?", IRB::InputCompletor.retrieve_completion_data("0xFFFF.positive?", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("0xFFFF.positi", binding), "0xFFFF.positive?") + assert_equal("Integer.positive?", doc_namespace("0xFFFF.positive?", binding)) - assert_empty(IRB::InputCompletor.retrieve_completion_data("1i.positi", bind: binding)) + assert_empty(completion_candidates("1i.positi", binding)) end def test_complete_symbol - assert_include(IRB::InputCompletor.retrieve_completion_data(":foo.to_p", bind: binding), ":foo.to_proc") - assert_equal("Symbol.to_proc", IRB::InputCompletor.retrieve_completion_data(":foo.to_proc", bind: binding, doc_namespace: true)) + assert_include(completion_candidates(":foo.to_p", binding), ":foo.to_proc") + assert_equal("Symbol.to_proc", doc_namespace(":foo.to_proc", binding)) end def test_complete_class - assert_include(IRB::InputCompletor.retrieve_completion_data("String.ne", bind: binding), "String.new") - assert_equal("String.new", IRB::InputCompletor.retrieve_completion_data("String.new", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("String.ne", binding), "String.new") + assert_equal("String.new", doc_namespace("String.new", binding)) end end - class TestRequireComepletion < TestCompletion + class RequireComepletionTest < CompletionTest def test_complete_require - candidates = IRB::InputCompletor::CompletionProc.("'irb", "require ", "") + candidates = IRB::RegexpCompletor.new.completion_candidates("require ", "'irb", "", bind: binding) %w['irb/init 'irb/ruby-lex].each do |word| assert_include candidates, word end # Test cache - candidates = IRB::InputCompletor::CompletionProc.("'irb", "require ", "") + candidates = IRB::RegexpCompletor.new.completion_candidates("require ", "'irb", "", bind: binding) %w['irb/init 'irb/ruby-lex].each do |word| assert_include candidates, word end + # Test string completion not disturbed by require completion + candidates = IRB::RegexpCompletor.new.completion_candidates("'string ", "'.", "", bind: binding) + assert_include candidates, "'.upcase" end def test_complete_require_with_pathname_in_load_path @@ -97,7 +90,7 @@ def test_complete_require_with_pathname_in_load_path test_path = Pathname.new(temp_dir) $LOAD_PATH << test_path - candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "") + candidates = IRB::RegexpCompletor.new.completion_candidates("require ", "'foo", "", bind: binding) assert_include candidates, "'foo" ensure $LOAD_PATH.pop if test_path @@ -111,7 +104,7 @@ def test_complete_require_with_string_convertable_in_load_path object.define_singleton_method(:to_s) { temp_dir } $LOAD_PATH << object - candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "") + candidates = IRB::RegexpCompletor.new.completion_candidates("require ", "'foo", "", bind: binding) assert_include candidates, "'foo" ensure $LOAD_PATH.pop if object @@ -124,28 +117,28 @@ def object.to_s; raise; end $LOAD_PATH << object assert_nothing_raised do - IRB::InputCompletor::CompletionProc.("'foo", "require ", "") + IRB::RegexpCompletor.new.completion_candidates("require ", "'foo", "", bind: binding) end ensure $LOAD_PATH.pop if object end def test_complete_require_library_name_first - pend 'Need to use virtual library paths' - candidates = IRB::InputCompletor::CompletionProc.("'csv", "require ", "") - assert_equal "'csv", candidates.first + # Test that library name is completed first with subdirectories + candidates = IRB::RegexpCompletor.new.completion_candidates("require ", "'irb", "", bind: binding) + assert_equal "'irb", candidates.first end def test_complete_require_relative candidates = Dir.chdir(__dir__ + "/../..") do - IRB::InputCompletor::CompletionProc.("'lib/irb", "require_relative ", "") + IRB::RegexpCompletor.new.completion_candidates("require_relative ", "'lib/irb", "", bind: binding) end %w['lib/irb/init 'lib/irb/ruby-lex].each do |word| assert_include candidates, word end # Test cache candidates = Dir.chdir(__dir__ + "/../..") do - IRB::InputCompletor::CompletionProc.("'lib/irb", "require_relative ", "") + IRB::RegexpCompletor.new.completion_candidates("require_relative ", "'lib/irb", "", bind: binding) end %w['lib/irb/init 'lib/irb/ruby-lex].each do |word| assert_include candidates, word @@ -153,7 +146,7 @@ def test_complete_require_relative end end - class TestVariableCompletion < TestCompletion + class VariableCompletionTest < CompletionTest def test_complete_variable # Bug fix issues https://github.com/ruby/irb/issues/368 # Variables other than `str_example` and `@str_example` are defined to ensure that irb completion does not cause unintended behavior @@ -174,13 +167,13 @@ def test_complete_variable local_variables.clear instance_variables.clear - assert_include(IRB::InputCompletor.retrieve_completion_data("str_examp", bind: binding), "str_example") - assert_equal("String", IRB::InputCompletor.retrieve_completion_data("str_example", bind: binding, doc_namespace: true)) - assert_equal("String.to_s", IRB::InputCompletor.retrieve_completion_data("str_example.to_s", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("str_examp", binding), "str_example") + assert_equal("String", doc_namespace("str_example", binding)) + assert_equal("String.to_s", doc_namespace("str_example.to_s", binding)) - assert_include(IRB::InputCompletor.retrieve_completion_data("@str_examp", bind: binding), "@str_example") - assert_equal("String", IRB::InputCompletor.retrieve_completion_data("@str_example", bind: binding, doc_namespace: true)) - assert_equal("String.to_s", IRB::InputCompletor.retrieve_completion_data("@str_example.to_s", bind: binding, doc_namespace: true)) + assert_include(completion_candidates("@str_examp", binding), "@str_example") + assert_equal("String", doc_namespace("@str_example", binding)) + assert_equal("String.to_s", doc_namespace("@str_example.to_s", binding)) end def test_complete_sort_variables @@ -190,12 +183,12 @@ def test_complete_sort_variables xzy_1.clear xzy2.clear - candidates = IRB::InputCompletor.retrieve_completion_data("xz", bind: binding, doc_namespace: false) + candidates = completion_candidates("xz", binding) assert_equal(%w[xzy xzy2 xzy_1], candidates) end end - class TestConstantCompletion < TestCompletion + class ConstantCompletionTest < CompletionTest class Foo B3 = 1 B1 = 1 @@ -203,134 +196,56 @@ class Foo end def test_complete_constants - assert_equal(["Foo"], IRB::InputCompletor.retrieve_completion_data("Fo", bind: binding)) - assert_equal(["Foo::B1", "Foo::B2", "Foo::B3"], IRB::InputCompletor.retrieve_completion_data("Foo::B", bind: binding)) - assert_equal(["Foo::B1.positive?"], IRB::InputCompletor.retrieve_completion_data("Foo::B1.pos", bind: binding)) + assert_equal(["Foo"], completion_candidates("Fo", binding)) + assert_equal(["Foo::B1", "Foo::B2", "Foo::B3"], completion_candidates("Foo::B", binding)) + assert_equal(["Foo::B1.positive?"], completion_candidates("Foo::B1.pos", binding)) - assert_equal(["::Forwardable"], IRB::InputCompletor.retrieve_completion_data("::Fo", bind: binding)) - assert_equal("Forwardable", IRB::InputCompletor.retrieve_completion_data("::Forwardable", bind: binding, doc_namespace: true)) + assert_equal(["::Forwardable"], completion_candidates("::Fo", binding)) + assert_equal("Forwardable", doc_namespace("::Forwardable", binding)) end end - class TestPerfectMatching < TestCompletion - def setup - # trigger PerfectMatchedProc to set up RDocRIDriver constant - IRB::InputCompletor::PerfectMatchedProc.("foo", bind: binding) - - @original_use_stdout = IRB::InputCompletor::RDocRIDriver.use_stdout - # force the driver to use stdout so it doesn't start a pager and interrupt tests - IRB::InputCompletor::RDocRIDriver.use_stdout = true - end - - def teardown - IRB::InputCompletor::RDocRIDriver.use_stdout = @original_use_stdout - end - - def test_perfectly_matched_namespace_triggers_document_display - omit unless has_rdoc_content? - - out, err = capture_output do - IRB::InputCompletor::PerfectMatchedProc.("String", bind: binding) - end - - assert_empty(err) - - assert_include(out, " S\bSt\btr\bri\bin\bng\bg") - end - - def test_perfectly_matched_multiple_namespaces_triggers_document_display - result = nil - out, err = capture_output do - result = IRB::InputCompletor::PerfectMatchedProc.("{}.nil?", bind: binding) - end - - assert_empty(err) - - # check if there're rdoc contents (e.g. CI doesn't generate them) - if has_rdoc_content? - # if there's rdoc content, we can verify by checking stdout - # rdoc generates control characters for formatting method names - assert_include(out, "P\bPr\bro\boc\bc.\b.n\bni\bil\bl?\b?") # Proc.nil? - assert_include(out, "H\bHa\bas\bsh\bh.\b.n\bni\bil\bl?\b?") # Hash.nil? - else - # this is a hacky way to verify the rdoc rendering code path because CI doesn't have rdoc content - # if there are multiple namespaces to be rendered, PerfectMatchedProc renders the result with a document - # which always returns the bytes rendered, even if it's 0 - assert_equal(0, result) - end - end - - def test_not_matched_namespace_triggers_nothing - result = nil - out, err = capture_output do - result = IRB::InputCompletor::PerfectMatchedProc.("Stri", bind: binding) - end - - assert_empty(err) - assert_empty(out) - assert_nil(result) - end - - def test_perfect_matching_stops_without_rdoc - result = nil - - out, err = capture_output do - without_rdoc do - result = IRB::InputCompletor::PerfectMatchedProc.("String", bind: binding) - end - end - - assert_empty(err) - assert_not_match(/from ruby core/, out) - assert_nil(result) - end - - def test_perfect_matching_handles_nil_namespace - out, err = capture_output do - # symbol literal has `nil` doc namespace so it's a good test subject - assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding)) - end - - assert_empty(err) - assert_empty(out) - end - - private - - def has_rdoc_content? - File.exist?(RDoc::RI::Paths::BASE) - end + def test_not_completing_empty_string + assert_equal([], completion_candidates("", binding)) + assert_equal([], completion_candidates(" ", binding)) + assert_equal([], completion_candidates("\t", binding)) + assert_equal(nil, doc_namespace("", binding)) end def test_complete_symbol - %w"UTF-16LE UTF-7".each do |enc| + symbols = %w"UTF-16LE UTF-7".map do |enc| "K".force_encoding(enc).to_sym rescue end - _ = :aiueo - assert_include(IRB::InputCompletor.retrieve_completion_data(":a", bind: binding), ":aiueo") - assert_empty(IRB::InputCompletor.retrieve_completion_data(":irb_unknown_symbol_abcdefg", bind: binding)) + symbols += [:aiueo, :"aiu eo"] + candidates = completion_candidates(":a", binding) + assert_include(candidates, ":aiueo") + assert_not_include(candidates, ":aiu eo") + assert_empty(completion_candidates(":irb_unknown_symbol_abcdefg", binding)) + # Do not complete empty symbol for performance reason + assert_empty(completion_candidates(":", binding)) end def test_complete_invalid_three_colons - assert_empty(IRB::InputCompletor.retrieve_completion_data(":::A", bind: binding)) - assert_empty(IRB::InputCompletor.retrieve_completion_data(":::", bind: binding)) + assert_empty(completion_candidates(":::A", binding)) + assert_empty(completion_candidates(":::", binding)) end def test_complete_absolute_constants_with_special_characters - assert_empty(IRB::InputCompletor.retrieve_completion_data("::A:", bind: binding)) - assert_empty(IRB::InputCompletor.retrieve_completion_data("::A.", bind: binding)) - assert_empty(IRB::InputCompletor.retrieve_completion_data("::A(", bind: binding)) - assert_empty(IRB::InputCompletor.retrieve_completion_data("::A)", bind: binding)) + assert_empty(completion_candidates("::A:", binding)) + assert_empty(completion_candidates("::A.", binding)) + assert_empty(completion_candidates("::A(", binding)) + assert_empty(completion_candidates("::A)", binding)) + assert_empty(completion_candidates("::A[", binding)) end def test_complete_reserved_words - candidates = IRB::InputCompletor.retrieve_completion_data("de", bind: binding) + candidates = completion_candidates("de", binding) %w[def defined?].each do |word| assert_include candidates, word end - candidates = IRB::InputCompletor.retrieve_completion_data("__", bind: binding) + candidates = completion_candidates("__", binding) %w[__ENCODING__ __LINE__ __FILE__].each do |word| assert_include candidates, word end @@ -351,13 +266,39 @@ def instance_variables; end } bind = obj.instance_exec { binding } - assert_include(IRB::InputCompletor.retrieve_completion_data("public_hog", bind: bind), "public_hoge") - assert_include(IRB::InputCompletor.retrieve_completion_data("public_hoge.to_s", bind: bind), "public_hoge.to_s") - assert_include(IRB::InputCompletor.retrieve_completion_data("public_hoge", bind: bind, doc_namespace: true), "public_hoge") + assert_include(completion_candidates("public_hog", bind), "public_hoge") + assert_include(doc_namespace("public_hoge", bind), "public_hoge") + + assert_include(completion_candidates("private_hog", bind), "private_hoge") + assert_include(doc_namespace("private_hoge", bind), "private_hoge") + end + end + + class DeprecatedInputCompletorTest < TestCase + def setup + save_encodings + @verbose, $VERBOSE = $VERBOSE, nil + IRB.init_config(nil) + IRB.conf[:VERBOSE] = false + IRB.conf[:MAIN_CONTEXT] = IRB::Context.new(IRB::WorkSpace.new(binding)) + end + + def teardown + restore_encodings + $VERBOSE = @verbose + end + + def test_completion_proc + assert_include(IRB::InputCompletor::CompletionProc.call('1.ab'), '1.abs') + assert_include(IRB::InputCompletor::CompletionProc.call('1.ab', '', ''), '1.abs') + end - assert_include(IRB::InputCompletor.retrieve_completion_data("private_hog", bind: bind), "private_hoge") - assert_include(IRB::InputCompletor.retrieve_completion_data("private_hoge.to_s", bind: bind), "private_hoge.to_s") - assert_include(IRB::InputCompletor.retrieve_completion_data("private_hoge", bind: bind, doc_namespace: true), "private_hoge") + def test_retrieve_completion_data + assert_include(IRB::InputCompletor.retrieve_completion_data('1.ab'), '1.abs') + assert_equal(IRB::InputCompletor.retrieve_completion_data('1.abs', doc_namespace: true), 'Integer.abs') + bind = eval('a = 1; binding') + assert_include(IRB::InputCompletor.retrieve_completion_data('a.ab', bind: bind), 'a.abs') + assert_equal(IRB::InputCompletor.retrieve_completion_data('a.abs', bind: bind, doc_namespace: true), 'Integer.abs') end end end diff --git a/test/mri/irb/test_context.rb b/test/mri/irb/test_context.rb index 4d256a73a20..5812ea041ed 100644 --- a/test/mri/irb/test_context.rb +++ b/test/mri/irb/test_context.rb @@ -1,16 +1,16 @@ # frozen_string_literal: false require 'tempfile' require 'irb' -require 'rubygems' if defined?(Gem) require_relative "helper" module TestIRB - class TestContext < TestCase + class ContextTest < TestCase def setup IRB.init_config(nil) IRB.conf[:USE_SINGLELINE] = false IRB.conf[:VERBOSE] = false + IRB.conf[:USE_PAGER] = false workspace = IRB::WorkSpace.new(Object.new) @context = IRB::Context.new(nil, workspace, TestInputMethod.new) @@ -19,11 +19,13 @@ def setup def Reline.get_screen_size [36, 80] end + save_encodings end def teardown Reline.instance_eval { undef :get_screen_size } Reline.define_singleton_method(:get_screen_size, @get_screen_size) + restore_encodings end def test_last_value @@ -35,37 +37,28 @@ def test_last_value assert_same(obj, @context.evaluate('_', 1)) end - def test_evaluate_with_exception - assert_nil(@context.evaluate("$!", 1)) - e = assert_raise_with_message(RuntimeError, 'foo') { - @context.evaluate("raise 'foo'", 1) - } - assert_equal('foo', e.message) - assert_same(e, @context.evaluate('$!', 1, exception: e)) - e = assert_raise(SyntaxError) { - @context.evaluate("1,2,3", 1, exception: e) - } - assert_match(/\A\(irb\):1:/, e.message) - assert_not_match(/rescue _\.class/, e.message) - end - def test_evaluate_with_encoding_error_without_lineno - pend if RUBY_ENGINE == 'truffleruby' + if RUBY_ENGINE == 'truffleruby' + omit "Remove me after https://github.com/ruby/prism/issues/2129 is addressed and adopted in TruffleRuby" + end + + if RUBY_VERSION >= "3.4." + omit "Now raises SyntaxError" + end + assert_raise_with_message(EncodingError, /invalid symbol/) { - @context.evaluate(%q[{"\xAE": 1}], 1) + @context.evaluate(%q[:"\xAE"], 1) # The backtrace of this invalid encoding hash doesn't contain lineno. } end - def test_evaluate_with_onigmo_warning - pend if RUBY_ENGINE == 'truffleruby' - assert_warning("(irb):1: warning: character class has duplicated range: /[aa]/\n") do - @context.evaluate('/[aa]/', 1) + def test_evaluate_still_emits_warning + assert_warning("(irb):1: warning: END in method; use at_exit\n") do + @context.evaluate(%q[def foo; END {}; end], 1) end end def test_eval_input - pend if RUBY_ENGINE == 'truffleruby' verbose, $VERBOSE = $VERBOSE, nil input = TestInputMethod.new([ "raise 'Foo'\n", @@ -78,17 +71,32 @@ def test_eval_input irb.eval_input end assert_empty err - assert_pattern_list([:*, /\(irb\):1:in `
': Foo \(RuntimeError\)\n/, - :*, /#\n/, - :*, /0$/, - :*, /0$/, - /\s*/], out) + + expected_output = + if RUBY_3_4 + [ + :*, /\(irb\):1:in '
': Foo \(RuntimeError\)\n/, + :*, /#\n/, + :*, /0$/, + :*, /0$/, + /\s*/ + ] + else + [ + :*, /\(irb\):1:in `
': Foo \(RuntimeError\)\n/, + :*, /#\n/, + :*, /0$/, + :*, /0$/, + /\s*/ + ] + end + + assert_pattern_list(expected_output, out) ensure $VERBOSE = verbose end def test_eval_input_raise2x - pend if RUBY_ENGINE == 'truffleruby' input = TestInputMethod.new([ "raise 'Foo'\n", "raise 'Bar'\n", @@ -99,11 +107,33 @@ def test_eval_input_raise2x irb.eval_input end assert_empty err - assert_pattern_list([ - :*, /\(irb\):1:in `
': Foo \(RuntimeError\)\n/, - :*, /\(irb\):2:in `
': Bar \(RuntimeError\)\n/, - :*, /#\n/, - ], out) + expected_output = + if RUBY_3_4 + [ + :*, /\(irb\):1:in '
': Foo \(RuntimeError\)\n/, + :*, /\(irb\):2:in '
': Bar \(RuntimeError\)\n/, + :*, /#\n/, + ] + else + [ + :*, /\(irb\):1:in `
': Foo \(RuntimeError\)\n/, + :*, /\(irb\):2:in `
': Bar \(RuntimeError\)\n/, + :*, /#\n/, + ] + end + assert_pattern_list(expected_output, out) + end + + def test_prompt_n_deprecation + irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), TestInputMethod.new) + + _, err = capture_output do + irb.context.prompt_n = "foo" + irb.context.prompt_n + end + + assert_include err, "IRB::Context#prompt_n is deprecated" + assert_include err, "IRB::Context#prompt_n= is deprecated" end def test_output_to_pipe @@ -129,16 +159,14 @@ def test_output_to_pipe [:marshal, "123", Marshal.dump(123)], ], failed: [ - [false, "BasicObject.new", /\(Object doesn't support #inspect\)\n(=> )?\n/], - [:p, "class Foo; undef inspect ;end; Foo.new", /\(Object doesn't support #inspect\)\n(=> )?\n/], - [true, "BasicObject.new", /\(Object doesn't support #inspect\)\n(=> )?\n/], - [:yaml, "BasicObject.new", /\(Object doesn't support #inspect\)\n(=> )?\n/], - [:marshal, "[Object.new, Class.new]", /\(Object doesn't support #inspect\)\n(=> )?\n/] + [false, "BasicObject.new", /#/, out) + ensure + $VERBOSE = verbose end - def test_assignment_expression - input = TestInputMethod.new - irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), input) - [ - "foo = bar", - "@foo = bar", - "$foo = bar", - "@@foo = bar", - "::Foo = bar", - "a::Foo = bar", - "Foo = bar", - "foo.bar = 1", - "foo[1] = bar", - "foo += bar", - "foo -= bar", - "foo ||= bar", - "foo &&= bar", - "foo, bar = 1, 2", - "foo.bar=(1)", - "foo; foo = bar", - "foo; foo = bar; ;\n ;", - "foo\nfoo = bar", - ].each do |exp| - assert( - irb.assignment_expression?(exp), - "#{exp.inspect}: should be an assignment expression" - ) - end - - [ - "foo", - "foo.bar", - "foo[0]", - "foo = bar; foo", - "foo = bar\nfoo", - ].each do |exp| - refute( - irb.assignment_expression?(exp), - "#{exp.inspect}: should not be an assignment expression" - ) + def test_object_inspection_falls_back_to_kernel_inspect_when_errored + verbose, $VERBOSE = $VERBOSE, nil + main = Object.new + main.singleton_class.module_eval <<~RUBY + class Foo + def inspect + raise "foo" + end + end + RUBY + + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new(["Foo.new"])) + out, err = capture_output do + irb.eval_input end + assert_empty err + assert_match(/An error occurred when inspecting the object: #/, out) + assert_match(/Result of Kernel#inspect: #<#::Foo:/, out) + ensure + $VERBOSE = verbose end - def test_assignment_expression_with_local_variable - input = TestInputMethod.new - irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), input) - code = "a /1;x=1#/" - refute(irb.assignment_expression?(code), "#{code}: should not be an assignment expression") - irb.context.workspace.binding.eval('a = 1') - assert(irb.assignment_expression?(code), "#{code}: should be an assignment expression") - refute(irb.assignment_expression?(""), "empty code should not be an assignment expression") + def test_object_inspection_prints_useful_info_when_kernel_inspect_also_errored + verbose, $VERBOSE = $VERBOSE, nil + main = Object.new + main.singleton_class.module_eval <<~RUBY + class Foo + def initialize + # Kernel#inspect goes through instance variables with #inspect + # So this will cause Kernel#inspect to fail + @foo = BasicObject.new + end + + def inspect + raise "foo" + end + end + RUBY + + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new(["Foo.new"])) + out, err = capture_output do + irb.eval_input + end + assert_empty err + assert_match(/An error occurred when inspecting the object: #/, out) + assert_match(/An error occurred when running Kernel#inspect: # "%03n> ", - :PROMPT_N => "%03n> ", :PROMPT_S => "%03n> ", :PROMPT_C => "%03n> " # without :RETURN @@ -492,28 +529,35 @@ def test_eval_input_with_exception irb.eval_input end assert_empty err - if RUBY_VERSION < '3.0.0' && STDOUT.tty? - expected = [ - :*, /Traceback \(most recent call last\):\n/, - :*, /\t 2: from \(irb\):1:in `
'\n/, - :*, /\t 1: from \(irb\):1:in `hoge'\n/, - :*, /\(irb\):1:in `fuga': unhandled exception\n/, - ] - else - expected = [ - :*, /\(irb\):1:in `fuga': unhandled exception\n/, - :*, /\tfrom \(irb\):1:in `hoge'\n/, - :*, /\tfrom \(irb\):1:in `
'\n/, - :* - ] - end - assert_pattern_list(expected, out) + expected_output = + if RUBY_3_4 + [ + :*, /\(irb\):1:in 'fuga': unhandled exception\n/, + :*, /\tfrom \(irb\):1:in 'hoge'\n/, + :*, /\tfrom \(irb\):1:in '
'\n/, + :* + ] + elsif RUBY_VERSION < '3.0.0' && STDOUT.tty? + [ + :*, /Traceback \(most recent call last\):\n/, + :*, /\t 2: from \(irb\):1:in `
'\n/, + :*, /\t 1: from \(irb\):1:in `hoge'\n/, + :*, /\(irb\):1:in `fuga': unhandled exception\n/, + ] + else + [ + :*, /\(irb\):1:in `fuga': unhandled exception\n/, + :*, /\tfrom \(irb\):1:in `hoge'\n/, + :*, /\tfrom \(irb\):1:in `
'\n/, + :* + ] + end + assert_pattern_list(expected_output, out) ensure $VERBOSE = verbose end def test_eval_input_with_invalid_byte_sequence_exception - pend if RUBY_ENGINE == 'truffleruby' verbose, $VERBOSE = $VERBOSE, nil input = TestInputMethod.new([ %Q{def hoge() fuga; end; def fuga() raise "A\\xF3B"; end; hoge\n}, @@ -523,22 +567,31 @@ def test_eval_input_with_invalid_byte_sequence_exception irb.eval_input end assert_empty err - if RUBY_VERSION < '3.0.0' && STDOUT.tty? - expected = [ - :*, /Traceback \(most recent call last\):\n/, - :*, /\t 2: from \(irb\):1:in `
'\n/, - :*, /\t 1: from \(irb\):1:in `hoge'\n/, - :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, - ] - else - expected = [ - :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, - :*, /\tfrom \(irb\):1:in `hoge'\n/, - :*, /\tfrom \(irb\):1:in `
'\n/, - :* - ] - end - assert_pattern_list(expected, out) + expected_output = + if RUBY_3_4 + [ + :*, /\(irb\):1:in 'fuga': A\\xF3B \(RuntimeError\)\n/, + :*, /\tfrom \(irb\):1:in 'hoge'\n/, + :*, /\tfrom \(irb\):1:in '
'\n/, + :* + ] + elsif RUBY_VERSION < '3.0.0' && STDOUT.tty? + [ + :*, /Traceback \(most recent call last\):\n/, + :*, /\t 2: from \(irb\):1:in `
'\n/, + :*, /\t 1: from \(irb\):1:in `hoge'\n/, + :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, + ] + else + [ + :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, + :*, /\tfrom \(irb\):1:in `hoge'\n/, + :*, /\tfrom \(irb\):1:in `
'\n/, + :* + ] + end + + assert_pattern_list(expected_output, out) ensure $VERBOSE = verbose end @@ -564,43 +617,43 @@ def test_eval_input_with_long_exception expected = [ :*, /Traceback \(most recent call last\):\n/, :*, /\t... \d+ levels...\n/, - :*, /\t16: from \(irb\):1:in `a4'\n/, - :*, /\t15: from \(irb\):1:in `a5'\n/, - :*, /\t14: from \(irb\):1:in `a6'\n/, - :*, /\t13: from \(irb\):1:in `a7'\n/, - :*, /\t12: from \(irb\):1:in `a8'\n/, - :*, /\t11: from \(irb\):1:in `a9'\n/, - :*, /\t10: from \(irb\):1:in `a10'\n/, - :*, /\t 9: from \(irb\):1:in `a11'\n/, - :*, /\t 8: from \(irb\):1:in `a12'\n/, - :*, /\t 7: from \(irb\):1:in `a13'\n/, - :*, /\t 6: from \(irb\):1:in `a14'\n/, - :*, /\t 5: from \(irb\):1:in `a15'\n/, - :*, /\t 4: from \(irb\):1:in `a16'\n/, - :*, /\t 3: from \(irb\):1:in `a17'\n/, - :*, /\t 2: from \(irb\):1:in `a18'\n/, - :*, /\t 1: from \(irb\):1:in `a19'\n/, - :*, /\(irb\):1:in `a20': unhandled exception\n/, + :*, /\t16: from \(irb\):1:in (`|')a4'\n/, + :*, /\t15: from \(irb\):1:in (`|')a5'\n/, + :*, /\t14: from \(irb\):1:in (`|')a6'\n/, + :*, /\t13: from \(irb\):1:in (`|')a7'\n/, + :*, /\t12: from \(irb\):1:in (`|')a8'\n/, + :*, /\t11: from \(irb\):1:in (`|')a9'\n/, + :*, /\t10: from \(irb\):1:in (`|')a10'\n/, + :*, /\t 9: from \(irb\):1:in (`|')a11'\n/, + :*, /\t 8: from \(irb\):1:in (`|')a12'\n/, + :*, /\t 7: from \(irb\):1:in (`|')a13'\n/, + :*, /\t 6: from \(irb\):1:in (`|')a14'\n/, + :*, /\t 5: from \(irb\):1:in (`|')a15'\n/, + :*, /\t 4: from \(irb\):1:in (`|')a16'\n/, + :*, /\t 3: from \(irb\):1:in (`|')a17'\n/, + :*, /\t 2: from \(irb\):1:in (`|')a18'\n/, + :*, /\t 1: from \(irb\):1:in (`|')a19'\n/, + :*, /\(irb\):1:in (`|')a20': unhandled exception\n/, ] else expected = [ - :*, /\(irb\):1:in `a20': unhandled exception\n/, - :*, /\tfrom \(irb\):1:in `a19'\n/, - :*, /\tfrom \(irb\):1:in `a18'\n/, - :*, /\tfrom \(irb\):1:in `a17'\n/, - :*, /\tfrom \(irb\):1:in `a16'\n/, - :*, /\tfrom \(irb\):1:in `a15'\n/, - :*, /\tfrom \(irb\):1:in `a14'\n/, - :*, /\tfrom \(irb\):1:in `a13'\n/, - :*, /\tfrom \(irb\):1:in `a12'\n/, - :*, /\tfrom \(irb\):1:in `a11'\n/, - :*, /\tfrom \(irb\):1:in `a10'\n/, - :*, /\tfrom \(irb\):1:in `a9'\n/, - :*, /\tfrom \(irb\):1:in `a8'\n/, - :*, /\tfrom \(irb\):1:in `a7'\n/, - :*, /\tfrom \(irb\):1:in `a6'\n/, - :*, /\tfrom \(irb\):1:in `a5'\n/, - :*, /\tfrom \(irb\):1:in `a4'\n/, + :*, /\(irb\):1:in (`|')a20': unhandled exception\n/, + :*, /\tfrom \(irb\):1:in (`|')a19'\n/, + :*, /\tfrom \(irb\):1:in (`|')a18'\n/, + :*, /\tfrom \(irb\):1:in (`|')a17'\n/, + :*, /\tfrom \(irb\):1:in (`|')a16'\n/, + :*, /\tfrom \(irb\):1:in (`|')a15'\n/, + :*, /\tfrom \(irb\):1:in (`|')a14'\n/, + :*, /\tfrom \(irb\):1:in (`|')a13'\n/, + :*, /\tfrom \(irb\):1:in (`|')a12'\n/, + :*, /\tfrom \(irb\):1:in (`|')a11'\n/, + :*, /\tfrom \(irb\):1:in (`|')a10'\n/, + :*, /\tfrom \(irb\):1:in (`|')a9'\n/, + :*, /\tfrom \(irb\):1:in (`|')a8'\n/, + :*, /\tfrom \(irb\):1:in (`|')a7'\n/, + :*, /\tfrom \(irb\):1:in (`|')a6'\n/, + :*, /\tfrom \(irb\):1:in (`|')a5'\n/, + :*, /\tfrom \(irb\):1:in (`|')a4'\n/, :*, /\t... \d+ levels...\n/, ] end @@ -609,6 +662,35 @@ def test_eval_input_with_long_exception $VERBOSE = verbose end + def test_prompt_main_escape + main = Struct.new(:to_s).new("main\a\t\r\n") + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new) + assert_equal("irb(main )>", irb.send(:format_prompt, 'irb(%m)>', nil, 1, 1)) + end + + def test_prompt_main_inspect_escape + main = Struct.new(:inspect).new("main\\n\nmain") + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new) + assert_equal("irb(main\\n main)>", irb.send(:format_prompt, 'irb(%M)>', nil, 1, 1)) + end + + def test_prompt_main_truncate + main = Struct.new(:to_s).new("a" * 100) + def main.inspect; to_s.inspect; end + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new) + assert_equal('irb(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa...)>', irb.send(:format_prompt, 'irb(%m)>', nil, 1, 1)) + assert_equal('irb("aaaaaaaaaaaaaaaaaaaaaaaaaaaa...)>', irb.send(:format_prompt, 'irb(%M)>', nil, 1, 1)) + end + + def test_prompt_main_raise + main = Object.new + def main.to_s; raise TypeError; end + def main.inspect; raise ArgumentError; end + irb = IRB::Irb.new(IRB::WorkSpace.new(main), TestInputMethod.new) + assert_equal("irb(!TypeError)>", irb.send(:format_prompt, 'irb(%m)>', nil, 1, 1)) + assert_equal("irb(!ArgumentError)>", irb.send(:format_prompt, 'irb(%M)>', nil, 1, 1)) + end + def test_lineno input = TestInputMethod.new([ "\n", @@ -630,6 +712,31 @@ def test_lineno ], out) end + def test_irb_path_setter + @context.irb_path = __FILE__ + assert_equal(__FILE__, @context.irb_path) + assert_equal("#{__FILE__}(irb)", @context.instance_variable_get(:@eval_path)) + @context.irb_path = 'file/does/not/exist' + assert_equal('file/does/not/exist', @context.irb_path) + assert_equal('file/does/not/exist', @context.instance_variable_get(:@eval_path)) + @context.irb_path = "#{__FILE__}(irb)" + assert_equal("#{__FILE__}(irb)", @context.irb_path) + assert_equal("#{__FILE__}(irb)", @context.instance_variable_get(:@eval_path)) + end + + def test_build_completor + verbose, $VERBOSE = $VERBOSE, nil + original_completor = IRB.conf[:COMPLETOR] + IRB.conf[:COMPLETOR] = :regexp + assert_equal 'IRB::RegexpCompletor', @context.send(:build_completor).class.name + IRB.conf[:COMPLETOR] = :unknown + assert_equal 'IRB::RegexpCompletor', @context.send(:build_completor).class.name + # :type is tested in test_type_completor.rb + ensure + $VERBOSE = verbose + IRB.conf[:COMPLETOR] = original_completor + end + private def without_colorize diff --git a/test/mri/irb/test_debug_cmd.rb b/test/mri/irb/test_debug_cmd.rb deleted file mode 100644 index 4d1bb6d6b99..00000000000 --- a/test/mri/irb/test_debug_cmd.rb +++ /dev/null @@ -1,303 +0,0 @@ -# frozen_string_literal: true - -begin - require "pty" -rescue LoadError - return -end - -require "tempfile" -require "tmpdir" -require "envutil" - -require_relative "helper" - -module TestIRB - LIB = File.expand_path("../../lib", __dir__) - - class DebugCommandTestCase < TestCase - IRB_AND_DEBUGGER_OPTIONS = { - "RUBY_DEBUG_NO_RELINE" => "true", "NO_COLOR" => "true", "RUBY_DEBUG_HISTORY_FILE" => '' - } - - def setup - if ruby_core? - omit "This test works only under ruby/irb" - end - - if RUBY_ENGINE == 'truffleruby' - omit "This test runs with ruby/debug, which doesn't work with truffleruby" - end - end - - def test_backtrace - write_ruby <<~'RUBY' - def foo - binding.irb - end - foo - RUBY - - output = run_ruby_file do - type "backtrace" - type "q!" - end - - assert_match(/\(rdbg:irb\) backtrace/, output) - assert_match(/Object#foo at #{@ruby_file.to_path}/, output) - end - - def test_debug - write_ruby <<~'ruby' - binding.irb - puts "hello" - ruby - - output = run_ruby_file do - type "debug" - type "next" - type "continue" - end - - assert_match(/\(rdbg\) next/, output) - assert_match(/=> 2\| puts "hello"/, output) - end - - def test_next - write_ruby <<~'ruby' - binding.irb - puts "hello" - ruby - - output = run_ruby_file do - type "next" - type "continue" - end - - assert_match(/\(rdbg:irb\) next/, output) - assert_match(/=> 2\| puts "hello"/, output) - end - - def test_break - write_ruby <<~'RUBY' - binding.irb - puts "Hello" - RUBY - - output = run_ruby_file do - type "break 2" - type "continue" - type "continue" - end - - assert_match(/\(rdbg:irb\) break/, output) - assert_match(/=> 2\| puts "Hello"/, output) - end - - def test_delete - write_ruby <<~'RUBY' - binding.irb - puts "Hello" - binding.irb - puts "World" - RUBY - - output = run_ruby_file do - type "break 4" - type "continue" - type "delete 0" - type "continue" - end - - assert_match(/\(rdbg:irb\) delete/, output) - assert_match(/deleted: #0 BP - Line/, output) - end - - def test_step - write_ruby <<~'RUBY' - def foo - puts "Hello" - end - binding.irb - foo - RUBY - - output = run_ruby_file do - type "step" - type "step" - type "continue" - end - - assert_match(/\(rdbg:irb\) step/, output) - assert_match(/=> 5\| foo/, output) - assert_match(/=> 2\| puts "Hello"/, output) - end - - def test_continue - write_ruby <<~'RUBY' - binding.irb - puts "Hello" - binding.irb - puts "World" - RUBY - - output = run_ruby_file do - type "continue" - type "continue" - end - - assert_match(/\(rdbg:irb\) continue/, output) - assert_match(/=> 3: binding.irb/, output) - end - - def test_finish - write_ruby <<~'RUBY' - def foo - binding.irb - puts "Hello" - end - foo - RUBY - - output = run_ruby_file do - type "finish" - type "continue" - end - - assert_match(/\(rdbg:irb\) finish/, output) - assert_match(/=> 4\| end/, output) - end - - def test_info - write_ruby <<~'RUBY' - def foo - a = "He" + "llo" - binding.irb - end - foo - RUBY - - output = run_ruby_file do - type "info" - type "continue" - end - - assert_match(/\(rdbg:irb\) info/, output) - assert_match(/%self = main/, output) - assert_match(/a = "Hello"/, output) - end - - def test_catch - write_ruby <<~'RUBY' - binding.irb - 1 / 0 - RUBY - - output = run_ruby_file do - type "catch ZeroDivisionError" - type "continue" - type "continue" - end - - assert_match(/\(rdbg:irb\) catch/, output) - assert_match(/Stop by #0 BP - Catch "ZeroDivisionError"/, output) - end - - private - - TIMEOUT_SEC = 3 - - def run_ruby_file(&block) - cmd = [EnvUtil.rubybin, "-I", LIB, @ruby_file.to_path] - tmp_dir = Dir.mktmpdir - rc_file = File.open(File.join(tmp_dir, ".irbrc"), "w+") - rc_file.write("IRB.conf[:USE_SINGLELINE] = true") - rc_file.close - - @commands = [] - lines = [] - - yield - - PTY.spawn(IRB_AND_DEBUGGER_OPTIONS.merge("IRBRC" => rc_file.to_path), *cmd) do |read, write, pid| - Timeout.timeout(TIMEOUT_SEC) do - while line = safe_gets(read) - lines << line - - # means the breakpoint is triggered - if line.match?(/binding\.irb/) - while command = @commands.shift - write.puts(command) - end - end - end - end - ensure - read.close - write.close - kill_safely(pid) - end - - lines.join - rescue Timeout::Error - message = <<~MSG - Test timedout. - - #{'=' * 30} OUTPUT #{'=' * 30} - #{lines.map { |l| " #{l}" }.join} - #{'=' * 27} END OF OUTPUT #{'=' * 27} - MSG - assert_block(message) { false } - ensure - File.unlink(@ruby_file) if @ruby_file - FileUtils.remove_entry tmp_dir - end - - # read.gets could raise exceptions on some platforms - # https://github.com/ruby/ruby/blob/master/ext/pty/pty.c#L729-L736 - def safe_gets(read) - read.gets - rescue Errno::EIO - nil - end - - def kill_safely pid - return if wait_pid pid, TIMEOUT_SEC - - Process.kill :TERM, pid - return if wait_pid pid, 0.2 - - Process.kill :KILL, pid - Process.waitpid(pid) - rescue Errno::EPERM, Errno::ESRCH - end - - def wait_pid pid, sec - total_sec = 0.0 - wait_sec = 0.001 # 1ms - - while total_sec < sec - if Process.waitpid(pid, Process::WNOHANG) == pid - return true - end - sleep wait_sec - total_sec += wait_sec - wait_sec *= 2 - end - - false - rescue Errno::ECHILD - true - end - - def type(command) - @commands << command - end - - def write_ruby(program) - @ruby_file = Tempfile.create(%w{irb- .rb}) - @ruby_file.write(program) - @ruby_file.close - end - end -end diff --git a/test/mri/irb/test_debugger_integration.rb b/test/mri/irb/test_debugger_integration.rb new file mode 100644 index 00000000000..839a0d43f08 --- /dev/null +++ b/test/mri/irb/test_debugger_integration.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +require "tempfile" +require "tmpdir" + +require_relative "helper" + +module TestIRB + class DebuggerIntegrationTest < IntegrationTestCase + def setup + super + + if RUBY_ENGINE == 'truffleruby' + omit "This test runs with ruby/debug, which doesn't work with truffleruby" + end + + @envs.merge!("NO_COLOR" => "true", "RUBY_DEBUG_HISTORY_FILE" => '') + end + + def test_backtrace + write_ruby <<~'RUBY' + def foo + binding.irb + end + foo + RUBY + + output = run_ruby_file do + type "backtrace" + type "exit!" + end + + assert_match(/irb\(main\):001> backtrace/, output) + assert_match(/Object#foo at #{@ruby_file.to_path}/, output) + end + + def test_debug + write_ruby <<~'ruby' + binding.irb + puts "hello" + ruby + + output = run_ruby_file do + type "debug" + type "next" + type "continue" + end + + assert_match(/irb\(main\):001> debug/, output) + assert_match(/irb:rdbg\(main\):002> next/, output) + assert_match(/=> 2\| puts "hello"/, output) + end + + def test_debug_command_only_runs_once + write_ruby <<~'ruby' + binding.irb + ruby + + output = run_ruby_file do + type "debug" + type "debug" + type "continue" + end + + assert_match(/irb\(main\):001> debug/, output) + assert_match(/irb:rdbg\(main\):002> debug/, output) + assert_match(/IRB is already running with a debug session/, output) + end + + def test_next + write_ruby <<~'ruby' + binding.irb + puts "hello" + ruby + + output = run_ruby_file do + type "next" + type "continue" + end + + assert_match(/irb\(main\):001> next/, output) + assert_match(/=> 2\| puts "hello"/, output) + end + + def test_break + write_ruby <<~'RUBY' + binding.irb + puts "Hello" + RUBY + + output = run_ruby_file do + type "break 2" + type "continue" + type "continue" + end + + assert_match(/irb\(main\):001> break/, output) + assert_match(/=> 2\| puts "Hello"/, output) + end + + def test_delete + write_ruby <<~'RUBY' + binding.irb + puts "Hello" + binding.irb + puts "World" + RUBY + + output = run_ruby_file do + type "break 4" + type "continue" + type "delete 0" + type "continue" + end + + assert_match(/irb:rdbg\(main\):003> delete/, output) + assert_match(/deleted: #0 BP - Line/, output) + end + + def test_step + write_ruby <<~'RUBY' + def foo + puts "Hello" + end + binding.irb + foo + RUBY + + output = run_ruby_file do + type "step" + type "step" + type "continue" + end + + assert_match(/irb\(main\):001> step/, output) + assert_match(/=> 5\| foo/, output) + assert_match(/=> 2\| puts "Hello"/, output) + end + + def test_long_stepping + write_ruby <<~'RUBY' + class Foo + def foo(num) + bar(num + 10) + end + + def bar(num) + num + end + end + + binding.irb + Foo.new.foo(100) + RUBY + + output = run_ruby_file do + type "step" + type "step" + type "step" + type "step" + type "num" + type "continue" + end + + assert_match(/irb\(main\):001> step/, output) + assert_match(/irb:rdbg\(main\):002> step/, output) + assert_match(/irb:rdbg\(#\):003> step/, output) + assert_match(/irb:rdbg\(#\):004> step/, output) + assert_match(/irb:rdbg\(#\):005> num/, output) + assert_match(/=> 110/, output) + end + + def test_continue + write_ruby <<~'RUBY' + binding.irb + puts "Hello" + binding.irb + puts "World" + RUBY + + output = run_ruby_file do + type "continue" + type "continue" + end + + assert_match(/irb\(main\):001> continue/, output) + assert_match(/=> 3: binding.irb/, output) + assert_match(/irb:rdbg\(main\):002> continue/, output) + end + + def test_finish + write_ruby <<~'RUBY' + def foo + binding.irb + puts "Hello" + end + foo + RUBY + + output = run_ruby_file do + type "finish" + type "continue" + end + + assert_match(/irb\(main\):001> finish/, output) + assert_match(/=> 4\| end/, output) + end + + def test_info + write_ruby <<~'RUBY' + def foo + a = "He" + "llo" + binding.irb + end + foo + RUBY + + output = run_ruby_file do + type "info" + type "continue" + end + + assert_match(/irb\(main\):001> info/, output) + assert_match(/%self = main/, output) + assert_match(/a = "Hello"/, output) + end + + def test_catch + write_ruby <<~'RUBY' + binding.irb + 1 / 0 + RUBY + + output = run_ruby_file do + type "catch ZeroDivisionError" + type "continue" + type "continue" + end + + assert_match(/irb\(main\):001> catch/, output) + assert_match(/Stop by #0 BP - Catch "ZeroDivisionError"/, output) + end + + def test_exit + write_ruby <<~'RUBY' + binding.irb + puts "hello" + RUBY + + output = run_ruby_file do + type "next" + type "exit" + end + + assert_match(/irb\(main\):001> next/, output) + end + + def test_quit + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "next" + type "quit!" + end + + assert_match(/irb\(main\):001> next/, output) + end + + def test_prompt_line_number_continues + write_ruby <<~'ruby' + binding.irb + puts "Hello" + puts "World" + ruby + + output = run_ruby_file do + type "123" + type "456" + type "next" + type "info" + type "next" + type "continue" + end + + assert_match(/irb\(main\):003> next/, output) + assert_match(/irb:rdbg\(main\):004> info/, output) + assert_match(/irb:rdbg\(main\):005> next/, output) + end + + def test_prompt_irb_name_is_kept + write_rc <<~RUBY + IRB.conf[:IRB_NAME] = "foo" + RUBY + + write_ruby <<~'ruby' + binding.irb + puts "Hello" + ruby + + output = run_ruby_file do + type "next" + type "continue" + end + + assert_match(/foo\(main\):001> next/, output) + assert_match(/foo:rdbg\(main\):002> continue/, output) + end + + def test_irb_commands_are_available_after_moving_around_with_the_debugger + write_ruby <<~'ruby' + class Foo + def bar + puts "bar" + end + end + + binding.irb + Foo.new.bar + ruby + + output = run_ruby_file do + # Due to the way IRB defines its commands, moving into the Foo instance from main is necessary for proper testing. + type "next" + type "step" + type "irb_info" + type "continue" + end + + assert_include(output, "InputMethod: RelineInputMethod") + end + + def test_help_command_is_delegated_to_the_debugger + write_ruby <<~'ruby' + binding.irb + ruby + + output = run_ruby_file do + type "debug" + type "help" + type "continue" + end + + assert_include(output, "### Frame control") + end + + def test_help_display_different_content_when_debugger_is_enabled + write_ruby <<~'ruby' + binding.irb + ruby + + output = run_ruby_file do + type "debug" + type "help" + type "continue" + end + + # IRB's commands should still be listed + assert_match(/help\s+List all available commands/, output) + # debug gem's commands should be appended at the end + assert_match(/Debugging \(from debug\.gem\)\s+### Control flow/, output) + end + + def test_input_is_evaluated_in_the_context_of_the_current_thread + write_ruby <<~'ruby' + current_thread = Thread.current + binding.irb + ruby + + output = run_ruby_file do + type "debug" + type '"Threads match: #{current_thread == Thread.current}"' + type "continue" + end + + assert_match(/irb\(main\):001> debug/, output) + assert_match(/Threads match: true/, output) + end + + def test_irb_switches_debugger_interface_if_debug_was_already_activated + write_ruby <<~'ruby' + require 'debug' + class Foo + def bar + puts "bar" + end + end + + binding.irb + Foo.new.bar + ruby + + output = run_ruby_file do + # Due to the way IRB defines its commands, moving into the Foo instance from main is necessary for proper testing. + type "next" + type "step" + type 'irb_info' + type "continue" + end + + assert_match(/irb\(main\):001> next/, output) + assert_include(output, "InputMethod: RelineInputMethod") + end + + def test_debugger_cant_be_activated_while_multi_irb_is_active + write_ruby <<~'ruby' + binding.irb + a = 1 + ruby + + output = run_ruby_file do + type "jobs" + type "next" + type "exit" + end + + assert_match(/irb\(main\):001> jobs/, output) + assert_include(output, "Can't start the debugger when IRB is running in a multi-IRB session.") + end + + def test_multi_irb_commands_are_not_available_after_activating_the_debugger + write_ruby <<~'ruby' + binding.irb + a = 1 + ruby + + output = run_ruby_file do + type "next" + type "jobs" + type "continue" + end + + assert_match(/irb\(main\):001> next/, output) + assert_include(output, "Multi-IRB commands are not available when the debugger is enabled.") + end + + def test_irb_passes_empty_input_to_debugger_to_repeat_the_last_command + write_ruby <<~'ruby' + binding.irb + puts "foo" + puts "bar" + puts "baz" + ruby + + output = run_ruby_file do + type "next" + type "" + # Test that empty input doesn't repeat expressions + type "123" + type "" + type "next" + type "" + type "" + end + + assert_include(output, "=> 2\| puts \"foo\"") + assert_include(output, "=> 3\| puts \"bar\"") + assert_include(output, "=> 4\| puts \"baz\"") + end + end +end diff --git a/test/mri/irb/test_eval_history.rb b/test/mri/irb/test_eval_history.rb new file mode 100644 index 00000000000..54913ceff55 --- /dev/null +++ b/test/mri/irb/test_eval_history.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +require "irb" + +require_relative "helper" + +module TestIRB + class EvalHistoryTest < TestCase + def setup + save_encodings + IRB.instance_variable_get(:@CONF).clear + end + + def teardown + restore_encodings + end + + def execute_lines(*lines, conf: {}, main: self, irb_path: nil) + IRB.init_config(nil) + IRB.conf[:VERBOSE] = false + IRB.conf[:PROMPT_MODE] = :SIMPLE + IRB.conf[:USE_PAGER] = false + IRB.conf.merge!(conf) + input = TestInputMethod.new(lines) + irb = IRB::Irb.new(IRB::WorkSpace.new(main), input) + irb.context.return_format = "=> %s\n" + irb.context.irb_path = irb_path if irb_path + IRB.conf[:MAIN_CONTEXT] = irb.context + capture_output do + irb.eval_input + end + end + + def test_eval_history_is_disabled_by_default + out, err = execute_lines( + "a = 1", + "__" + ) + + assert_empty(err) + assert_match(/undefined local variable or method (`|')__'/, out) + end + + def test_eval_history_can_be_retrieved_with_double_underscore + out, err = execute_lines( + "a = 1", + "__", + conf: { EVAL_HISTORY: 5 } + ) + + assert_empty(err) + assert_match("=> 1\n" + "=> 1 1\n", out) + end + + def test_eval_history_respects_given_limit + out, err = execute_lines( + "'foo'\n", + "'bar'\n", + "'baz'\n", + "'xyz'\n", + "__", + conf: { EVAL_HISTORY: 4 } + ) + + assert_empty(err) + # Because eval_history injects `__` into the history AND decide to ignore it, we only get - 1 results + assert_match("2 \"bar\"\n" + "3 \"baz\"\n" + "4 \"xyz\"\n", out) + end + end +end diff --git a/test/mri/irb/test_evaluation.rb b/test/mri/irb/test_evaluation.rb new file mode 100644 index 00000000000..adb69b20677 --- /dev/null +++ b/test/mri/irb/test_evaluation.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require "tempfile" + +require_relative "helper" + +module TestIRB + class EchoingTest < IntegrationTestCase + def test_irb_echos_by_default + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "123123" + type "exit" + end + + assert_include(output, "=> 123123") + end + + def test_irb_doesnt_echo_line_with_semicolon + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "123123;" + type "123123 ;" + type "123123; " + type <<~RUBY + if true + 123123 + end; + RUBY + type "'evaluation ends'" + type "exit" + end + + assert_include(output, "=> \"evaluation ends\"") + assert_not_include(output, "=> 123123") + end + end +end diff --git a/test/mri/irb/test_history.rb b/test/mri/irb/test_history.rb index c74a3a2cb92..ea220a2dd3e 100644 --- a/test/mri/irb/test_history.rb +++ b/test/mri/irb/test_history.rb @@ -1,22 +1,45 @@ # frozen_string_literal: false require 'irb' -require 'irb/ext/save-history' require 'readline' +require "tempfile" require_relative "helper" +return if RUBY_PLATFORM.match?(/solaris|mswin|mingw/i) + module TestIRB - class TestHistory < TestCase + class HistoryTest < TestCase def setup + @original_verbose, $VERBOSE = $VERBOSE, nil + @tmpdir = Dir.mktmpdir("test_irb_history_") + @backup_home = ENV["HOME"] + @backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME") + @backup_irbrc = ENV.delete("IRBRC") + @backup_default_external = Encoding.default_external + ENV["HOME"] = @tmpdir IRB.conf[:RC_NAME_GENERATOR] = nil end def teardown IRB.conf[:RC_NAME_GENERATOR] = nil + ENV["HOME"] = @backup_home + ENV["XDG_CONFIG_HOME"] = @backup_xdg_config_home + ENV["IRBRC"] = @backup_irbrc + Encoding.default_external = @backup_default_external + $VERBOSE = @original_verbose + FileUtils.rm_rf(@tmpdir) + end + + class TestInputMethodWithRelineHistory < TestInputMethod + # When IRB.conf[:USE_MULTILINE] is true, IRB::RelineInputMethod uses Reline::History + HISTORY = Reline::History.new(Reline.core.config) + + include IRB::HistorySavingAbility end - class TestInputMethodWithHistory < TestInputMethod - HISTORY = Array.new + class TestInputMethodWithReadlineHistory < TestInputMethod + # When IRB.conf[:USE_MULTILINE] is false, IRB::ReadlineInputMethod uses Readline::HISTORY + HISTORY = Readline::HISTORY include IRB::HistorySavingAbility end @@ -100,10 +123,70 @@ def test_history_save_minus_as_infinity INPUT end - def test_history_concurrent_use + def test_history_concurrent_use_reline omit "Skip Editline" if /EditLine/n.match(Readline::VERSION) IRB.conf[:SAVE_HISTORY] = 1 - assert_history(<<~EXPECTED_HISTORY, <<~INITIAL_HISTORY, <<~INPUT) do |history_file| + history_concurrent_use_for_input_method(TestInputMethodWithRelineHistory) + end + + def test_history_concurrent_use_readline + omit "Skip Editline" if /EditLine/n.match(Readline::VERSION) + IRB.conf[:SAVE_HISTORY] = 1 + history_concurrent_use_for_input_method(TestInputMethodWithReadlineHistory) + end + + def test_history_concurrent_use_not_present + IRB.conf[:LC_MESSAGES] = IRB::Locale.new + IRB.conf[:SAVE_HISTORY] = 1 + io = TestInputMethodWithRelineHistory.new + io.class::HISTORY.clear + io.load_history + io.class::HISTORY << 'line1' + io.class::HISTORY << 'line2' + + history_file = IRB.rc_files("_history").first + assert_not_send [File, :file?, history_file] + File.write(history_file, "line0\n") + io.save_history + assert_equal(%w"line0 line1 line2", File.read(history_file).split) + end + + def test_history_different_encodings + IRB.conf[:SAVE_HISTORY] = 2 + Encoding.default_external = Encoding::US_ASCII + locale = IRB::Locale.new("C") + assert_history(<<~EXPECTED_HISTORY.encode(Encoding::US_ASCII), <<~INITIAL_HISTORY.encode(Encoding::UTF_8), <<~INPUT, locale: locale) + ???? + exit + EXPECTED_HISTORY + 😀 + INITIAL_HISTORY + exit + INPUT + end + + def test_history_does_not_raise_when_history_file_directory_does_not_exist + backup_history_file = IRB.conf[:HISTORY_FILE] + IRB.conf[:SAVE_HISTORY] = 1 + IRB.conf[:HISTORY_FILE] = "fake/fake/fake/history_file" + io = TestInputMethodWithRelineHistory.new + + assert_warn(/history file does not exist/) do + io.save_history + end + + # assert_warn reverts $VERBOSE to EnvUtil.original_verbose, which is true in some cases + # We want to keep $VERBOSE as nil until teardown is called + # TODO: check if this is an assert_warn issue + $VERBOSE = nil + ensure + IRB.conf[:HISTORY_FILE] = backup_history_file + end + + private + + def history_concurrent_use_for_input_method(input_method) + assert_history(<<~EXPECTED_HISTORY, <<~INITIAL_HISTORY, <<~INPUT, input_method) do |history_file| exit 5 exit @@ -116,7 +199,7 @@ def test_history_concurrent_use 5 exit INPUT - assert_history(<<~EXPECTED_HISTORY2, <<~INITIAL_HISTORY2, <<~INPUT2) + assert_history(<<~EXPECTED_HISTORY2, <<~INITIAL_HISTORY2, <<~INPUT2, input_method) exit EXPECTED_HISTORY2 1 @@ -131,60 +214,31 @@ def test_history_concurrent_use end end - def test_history_concurrent_use_not_present - backup_home = ENV["HOME"] - backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME") - backup_irbrc = ENV.delete("IRBRC") - IRB.conf[:LC_MESSAGES] = IRB::Locale.new - IRB.conf[:SAVE_HISTORY] = 1 - Dir.mktmpdir("test_irb_history_") do |tmpdir| - ENV["HOME"] = tmpdir - io = TestInputMethodWithHistory.new - io.class::HISTORY.clear - io.load_history - io.class::HISTORY.concat(%w"line1 line2") - - history_file = IRB.rc_file("_history") - assert_not_send [File, :file?, history_file] - File.write(history_file, "line0\n") - io.save_history - assert_equal(%w"line0 line1 line2", File.read(history_file).split) - end - ensure - ENV["HOME"] = backup_home - ENV["XDG_CONFIG_HOME"] = backup_xdg_config_home - ENV["IRBRC"] = backup_irbrc - end - - private - - def assert_history(expected_history, initial_irb_history, input) - backup_verbose, $VERBOSE = $VERBOSE, nil - backup_home = ENV["HOME"] - backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME") - IRB.conf[:LC_MESSAGES] = IRB::Locale.new + def assert_history(expected_history, initial_irb_history, input, input_method = TestInputMethodWithRelineHistory, locale: IRB::Locale.new) + IRB.conf[:LC_MESSAGES] = locale actual_history = nil - Dir.mktmpdir("test_irb_history_") do |tmpdir| - ENV["HOME"] = tmpdir - File.open(IRB.rc_file("_history"), "w") do |f| - f.write(initial_irb_history) - end + history_file = IRB.rc_files("_history").first + ENV["HOME"] = @tmpdir + File.open(history_file, "w") do |f| + f.write(initial_irb_history) + end - io = TestInputMethodWithHistory.new + io = input_method.new + io.class::HISTORY.clear + io.load_history + if block_given? + previous_history = [] + io.class::HISTORY.each { |line| previous_history << line } + yield history_file io.class::HISTORY.clear - io.load_history - if block_given? - history = io.class::HISTORY.dup - yield IRB.rc_file("_history") - io.class::HISTORY.replace(history) - end - io.class::HISTORY.concat(input.split) - io.save_history + previous_history.each { |line| io.class::HISTORY << line } + end + input.split.each { |line| io.class::HISTORY << line } + io.save_history - io.load_history - File.open(IRB.rc_file("_history"), "r") do |f| - actual_history = f.read - end + io.load_history + File.open(history_file, "r") do |f| + actual_history = f.read end assert_equal(expected_history, actual_history, <<~MESSAGE) expected: @@ -192,10 +246,6 @@ def assert_history(expected_history, initial_irb_history, input) but actual: #{actual_history} MESSAGE - ensure - $VERBOSE = backup_verbose - ENV["HOME"] = backup_home - ENV["XDG_CONFIG_HOME"] = backup_xdg_config_home end def with_temp_stdio @@ -206,4 +256,226 @@ def with_temp_stdio end end end -end if not RUBY_PLATFORM.match?(/solaris|mswin|mingw/i) + + class IRBHistoryIntegrationTest < IntegrationTestCase + def test_history_saving_with_debug + write_history "" + + write_ruby <<~'RUBY' + def foo + end + + binding.irb + + foo + RUBY + + output = run_ruby_file do + type "'irb session'" + type "next" + type "'irb:debug session'" + type "step" + type "irb_info" + type "puts Reline::HISTORY.to_a.to_s" + type "q!" + end + + assert_include(output, "InputMethod: RelineInputMethod") + # check that in-memory history is preserved across sessions + assert_include output, %q( + ["'irb session'", "next", "'irb:debug session'", "step", "irb_info", "puts Reline::HISTORY.to_a.to_s"] + ).strip + + assert_equal <<~HISTORY, @history_file.open.read + 'irb session' + next + 'irb:debug session' + step + irb_info + puts Reline::HISTORY.to_a.to_s + q! + HISTORY + end + + def test_history_saving_with_debug_without_prior_history + tmpdir = Dir.mktmpdir("test_irb_history_") + # Intentionally not creating the file so we test the reset counter logic + history_file = File.join(tmpdir, "irb_history") + + write_rc <<~RUBY + IRB.conf[:HISTORY_FILE] = "#{history_file}" + RUBY + + write_ruby <<~'RUBY' + def foo + end + + binding.irb + + foo + RUBY + + output = run_ruby_file do + type "'irb session'" + type "next" + type "'irb:debug session'" + type "step" + type "irb_info" + type "puts Reline::HISTORY.to_a.to_s" + type "q!" + end + + assert_include(output, "InputMethod: RelineInputMethod") + # check that in-memory history is preserved across sessions + assert_include output, %q( + ["'irb session'", "next", "'irb:debug session'", "step", "irb_info", "puts Reline::HISTORY.to_a.to_s"] + ).strip + + assert_equal <<~HISTORY, File.read(history_file) + 'irb session' + next + 'irb:debug session' + step + irb_info + puts Reline::HISTORY.to_a.to_s + q! + HISTORY + ensure + FileUtils.rm_rf(tmpdir) + end + + def test_history_saving_with_nested_sessions + write_history "" + + write_ruby <<~'RUBY' + def foo + binding.irb + end + + binding.irb + RUBY + + run_ruby_file do + type "'outer session'" + type "foo" + type "'inner session'" + type "exit" + type "'outer session again'" + type "exit" + end + + assert_equal <<~HISTORY, @history_file.open.read + 'outer session' + foo + 'inner session' + exit + 'outer session again' + exit + HISTORY + end + + def test_nested_history_saving_from_inner_session_with_exit! + write_history "" + + write_ruby <<~'RUBY' + def foo + binding.irb + end + + binding.irb + RUBY + + run_ruby_file do + type "'outer session'" + type "foo" + type "'inner session'" + type "exit!" + end + + assert_equal <<~HISTORY, @history_file.open.read + 'outer session' + foo + 'inner session' + exit! + HISTORY + end + + def test_nested_history_saving_from_outer_session_with_exit! + write_history "" + + write_ruby <<~'RUBY' + def foo + binding.irb + end + + binding.irb + RUBY + + run_ruby_file do + type "'outer session'" + type "foo" + type "'inner session'" + type "exit" + type "'outer session again'" + type "exit!" + end + + assert_equal <<~HISTORY, @history_file.open.read + 'outer session' + foo + 'inner session' + exit + 'outer session again' + exit! + HISTORY + end + + def test_history_saving_with_nested_sessions_and_prior_history + write_history <<~HISTORY + old_history_1 + old_history_2 + old_history_3 + HISTORY + + write_ruby <<~'RUBY' + def foo + binding.irb + end + + binding.irb + RUBY + + run_ruby_file do + type "'outer session'" + type "foo" + type "'inner session'" + type "exit" + type "'outer session again'" + type "exit" + end + + assert_equal <<~HISTORY, @history_file.open.read + old_history_1 + old_history_2 + old_history_3 + 'outer session' + foo + 'inner session' + exit + 'outer session again' + exit + HISTORY + end + + private + + def write_history(history) + @history_file = Tempfile.new('irb_history') + @history_file.write(history) + @history_file.close + write_rc <<~RUBY + IRB.conf[:HISTORY_FILE] = "#{@history_file.path}" + RUBY + end + end +end diff --git a/test/mri/irb/test_init.rb b/test/mri/irb/test_init.rb index d9e338da8d2..fd1e06e39e9 100644 --- a/test/mri/irb/test_init.rb +++ b/test/mri/irb/test_init.rb @@ -5,13 +5,13 @@ require_relative "helper" module TestIRB - class TestInit < TestCase + class InitTest < TestCase def setup # IRBRC is for RVM... @backup_env = %w[HOME XDG_CONFIG_HOME IRBRC].each_with_object({}) do |env, hash| hash[env] = ENV.delete(env) end - ENV["HOME"] = @tmpdir = Dir.mktmpdir("test_irb_init_#{$$}") + ENV["HOME"] = @tmpdir = File.realpath(Dir.mktmpdir("test_irb_init_#{$$}")) end def teardown @@ -35,41 +35,147 @@ def test_setup_with_minimum_argv_does_not_change_dollar0 end def test_rc_file + verbose, $VERBOSE = $VERBOSE, nil tmpdir = @tmpdir Dir.chdir(tmpdir) do ENV["XDG_CONFIG_HOME"] = "#{tmpdir}/xdg" IRB.conf[:RC_NAME_GENERATOR] = nil - assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) + assert_equal(tmpdir+"/.irbrc", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) assert_file.not_exist?(tmpdir+"/xdg") IRB.conf[:RC_NAME_GENERATOR] = nil - FileUtils.touch(tmpdir+"/.irb#{IRB::IRBRC_EXT}") - assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) + FileUtils.touch(tmpdir+"/.irbrc") + assert_equal(tmpdir+"/.irbrc", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) assert_file.not_exist?(tmpdir+"/xdg") end + ensure + $VERBOSE = verbose end def test_rc_file_in_subdir + verbose, $VERBOSE = $VERBOSE, nil tmpdir = @tmpdir Dir.chdir(tmpdir) do FileUtils.mkdir_p("#{tmpdir}/mydir") Dir.chdir("#{tmpdir}/mydir") do IRB.conf[:RC_NAME_GENERATOR] = nil - assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) + assert_equal(tmpdir+"/.irbrc", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) IRB.conf[:RC_NAME_GENERATOR] = nil - FileUtils.touch(tmpdir+"/.irb#{IRB::IRBRC_EXT}") - assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) + FileUtils.touch(tmpdir+"/.irbrc") + assert_equal(tmpdir+"/.irbrc", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) end end + ensure + $VERBOSE = verbose + end + + def test_rc_files + tmpdir = @tmpdir + Dir.chdir(tmpdir) do + ENV["XDG_CONFIG_HOME"] = "#{tmpdir}/xdg" + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, tmpdir+"/.irbrc" + assert_includes IRB.rc_files("_history"), tmpdir+"/.irb_history" + assert_file.not_exist?(tmpdir+"/xdg") + IRB.conf[:RC_NAME_GENERATOR] = nil + FileUtils.touch(tmpdir+"/.irbrc") + assert_includes IRB.rc_files, tmpdir+"/.irbrc" + assert_includes IRB.rc_files("_history"), tmpdir+"/.irb_history" + assert_file.not_exist?(tmpdir+"/xdg") + end + end + + def test_rc_files_in_subdir + tmpdir = @tmpdir + Dir.chdir(tmpdir) do + FileUtils.mkdir_p("#{tmpdir}/mydir") + Dir.chdir("#{tmpdir}/mydir") do + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, tmpdir+"/.irbrc" + assert_includes IRB.rc_files("_history"), tmpdir+"/.irb_history" + IRB.conf[:RC_NAME_GENERATOR] = nil + FileUtils.touch(tmpdir+"/.irbrc") + assert_includes IRB.rc_files, tmpdir+"/.irbrc" + assert_includes IRB.rc_files("_history"), tmpdir+"/.irb_history" + end + end end - def test_recovery_sigint + def test_rc_files_has_file_from_xdg_env + tmpdir = @tmpdir + ENV["XDG_CONFIG_HOME"] = "#{tmpdir}/xdg" + xdg_config = ENV["XDG_CONFIG_HOME"]+"/irb/irbrc" + + FileUtils.mkdir_p(xdg_config) + + Dir.chdir(tmpdir) do + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, xdg_config + end + ensure + ENV["XDG_CONFIG_HOME"] = nil + end + + def test_rc_files_has_file_from_irbrc_env + tmpdir = @tmpdir + ENV["IRBRC"] = "#{tmpdir}/irb" + + FileUtils.mkdir_p(ENV["IRBRC"]) + + Dir.chdir(tmpdir) do + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, ENV["IRBRC"] + end + ensure + ENV["IRBRC"] = nil + end + + def test_rc_files_has_file_from_home_env + tmpdir = @tmpdir + ENV["HOME"] = "#{tmpdir}/home" + + FileUtils.mkdir_p(ENV["HOME"]) + + Dir.chdir(tmpdir) do + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, ENV["HOME"]+"/.irbrc" + assert_includes IRB.rc_files, ENV["HOME"]+"/.config/irb/irbrc" + end + ensure + ENV["HOME"] = nil + end + + def test_rc_files_contains_non_env_files + tmpdir = @tmpdir + FileUtils.mkdir_p("#{tmpdir}/.irbrc") + FileUtils.mkdir_p("#{tmpdir}/_irbrc") + FileUtils.mkdir_p("#{tmpdir}/irb.rc") + FileUtils.mkdir_p("#{tmpdir}/$irbrc") + + Dir.chdir(tmpdir) do + IRB.conf[:RC_NAME_GENERATOR] = nil + assert_includes IRB.rc_files, tmpdir+"/.irbrc" + assert_includes IRB.rc_files, tmpdir+"/_irbrc" + assert_includes IRB.rc_files, tmpdir+"/irb.rc" + assert_includes IRB.rc_files, tmpdir+"/$irbrc" + end + end + + def test_sigint_restore_default pend "This test gets stuck on Solaris for unknown reason; contribution is welcome" if RUBY_PLATFORM =~ /solaris/ bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - status = assert_in_out_err(bundle_exec + %w[-W0 -rirb -e binding.irb;loop{Process.kill("SIGINT",$$)} -- -f --], "exit\n", //, //) + # IRB should restore SIGINT handler + status = assert_in_out_err(bundle_exec + %w[-W0 -rirb -e Signal.trap("SIGINT","DEFAULT");binding.irb;loop{Process.kill("SIGINT",$$)} -- -f --], "exit\n", //, //) + Process.kill("SIGKILL", status.pid) if !status.exited? && !status.stopped? && !status.signaled? + end + + def test_sigint_restore_block + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + # IRB should restore SIGINT handler + status = assert_in_out_err(bundle_exec + %w[-W0 -rirb -e x=false;Signal.trap("SIGINT"){x=true};binding.irb;loop{Process.kill("SIGINT",$$);if(x);break;end} -- -f --], "exit\n", //, //) Process.kill("SIGKILL", status.pid) if !status.exited? && !status.stopped? && !status.signaled? end @@ -120,6 +226,50 @@ def test_use_autocomplete_environment_variable IRB.conf[:USE_AUTOCOMPLETE] = orig_use_autocomplete_conf end + def test_completor_environment_variable + orig_use_autocomplete_env = ENV['IRB_COMPLETOR'] + orig_use_autocomplete_conf = IRB.conf[:COMPLETOR] + + ENV['IRB_COMPLETOR'] = nil + IRB.setup(__FILE__) + assert_equal(:regexp, IRB.conf[:COMPLETOR]) + + ENV['IRB_COMPLETOR'] = 'regexp' + IRB.setup(__FILE__) + assert_equal(:regexp, IRB.conf[:COMPLETOR]) + + ENV['IRB_COMPLETOR'] = 'type' + IRB.setup(__FILE__) + assert_equal(:type, IRB.conf[:COMPLETOR]) + + ENV['IRB_COMPLETOR'] = 'regexp' + IRB.setup(__FILE__, argv: ['--type-completor']) + assert_equal :type, IRB.conf[:COMPLETOR] + + ENV['IRB_COMPLETOR'] = 'type' + IRB.setup(__FILE__, argv: ['--regexp-completor']) + assert_equal :regexp, IRB.conf[:COMPLETOR] + ensure + ENV['IRB_COMPLETOR'] = orig_use_autocomplete_env + IRB.conf[:COMPLETOR] = orig_use_autocomplete_conf + end + + def test_completor_setup_with_argv + orig_completor_conf = IRB.conf[:COMPLETOR] + + # Default is :regexp + IRB.setup(__FILE__, argv: []) + assert_equal :regexp, IRB.conf[:COMPLETOR] + + IRB.setup(__FILE__, argv: ['--type-completor']) + assert_equal :type, IRB.conf[:COMPLETOR] + + IRB.setup(__FILE__, argv: ['--regexp-completor']) + assert_equal :regexp, IRB.conf[:COMPLETOR] + ensure + IRB.conf[:COMPLETOR] = orig_completor_conf + end + def test_noscript argv = %w[--noscript -- -f] IRB.setup(eval("__FILE__"), argv: argv) @@ -164,6 +314,12 @@ def test_dash assert_equal(['-f'], argv) end + def test_option_tracer + argv = %w[--tracer] + IRB.setup(eval("__FILE__"), argv: argv) + assert_equal(true, IRB.conf[:USE_TRACER]) + end + private def with_argv(argv) @@ -174,4 +330,44 @@ def with_argv(argv) ARGV.replace(orig) end end + + class InitIntegrationTest < IntegrationTestCase + def test_load_error_in_rc_file_is_warned + write_rc <<~'IRBRC' + require "file_that_does_not_exist" + IRBRC + + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "'foobar'" + type "exit" + end + + # IRB session should still be started + assert_includes output, "foobar" + assert_includes output, 'cannot load such file -- file_that_does_not_exist (LoadError)' + end + + def test_normal_errors_in_rc_file_is_warned + write_rc <<~'IRBRC' + raise "I'm an error" + IRBRC + + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "'foobar'" + type "exit" + end + + # IRB session should still be started + assert_includes output, "foobar" + assert_includes output, 'I\'m an error (RuntimeError)' + end + end end diff --git a/test/mri/irb/test_input_method.rb b/test/mri/irb/test_input_method.rb index fdfb5663905..7644d3176aa 100644 --- a/test/mri/irb/test_input_method.rb +++ b/test/mri/irb/test_input_method.rb @@ -1,11 +1,11 @@ # frozen_string_literal: false require "irb" - +require "rdoc" require_relative "helper" module TestIRB - class TestRelineInputMethod < TestCase + class InputMethodTest < TestCase def setup @conf_backup = IRB.conf.dup IRB.conf[:LC_MESSAGES] = IRB::Locale.new @@ -15,16 +15,22 @@ def setup def teardown IRB.conf.replace(@conf_backup) restore_encodings + # Reset Reline configuration overridden by RelineInputMethod. + Reline.instance_variable_set(:@core, nil) end + end + class RelineInputMethodTest < InputMethodTest def test_initialization - IRB::RelineInputMethod.new + Reline.completion_proc = nil + Reline.dig_perfect_match_proc = nil + IRB::RelineInputMethod.new(IRB::RegexpCompletor.new) assert_nil Reline.completion_append_character assert_equal '', Reline.completer_quote_characters - assert_equal IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS, Reline.basic_word_break_characters - assert_equal IRB::InputCompletor::CompletionProc, Reline.completion_proc - assert_equal IRB::InputCompletor::PerfectMatchedProc, Reline.dig_perfect_match_proc + assert_equal IRB::InputMethod::BASIC_WORD_BREAK_CHARACTERS, Reline.basic_word_break_characters + assert_not_nil Reline.completion_proc + assert_not_nil Reline.dig_perfect_match_proc end def test_initialization_without_use_autocomplete @@ -34,7 +40,7 @@ def test_initialization_without_use_autocomplete IRB.conf[:USE_AUTOCOMPLETE] = false - IRB::RelineInputMethod.new + IRB::RelineInputMethod.new(IRB::RegexpCompletor.new) refute Reline.autocompletion assert_equal empty_proc, Reline.dialog_proc(:show_doc).dialog_proc @@ -49,10 +55,10 @@ def test_initialization_with_use_autocomplete IRB.conf[:USE_AUTOCOMPLETE] = true - IRB::RelineInputMethod.new + IRB::RelineInputMethod.new(IRB::RegexpCompletor.new) assert Reline.autocompletion - assert_equal IRB::RelineInputMethod::SHOW_DOC_DIALOG, Reline.dialog_proc(:show_doc).dialog_proc + assert_not_equal empty_proc, Reline.dialog_proc(:show_doc).dialog_proc ensure Reline.add_dialog_proc(:show_doc, original_show_doc_proc, Reline::DEFAULT_DIALOG_CONTEXT) end @@ -65,7 +71,7 @@ def test_initialization_with_use_autocomplete_but_without_rdoc IRB.conf[:USE_AUTOCOMPLETE] = true without_rdoc do - IRB::RelineInputMethod.new + IRB::RelineInputMethod.new(IRB::RegexpCompletor.new) end assert Reline.autocompletion @@ -75,5 +81,92 @@ def test_initialization_with_use_autocomplete_but_without_rdoc Reline.add_dialog_proc(:show_doc, original_show_doc_proc, Reline::DEFAULT_DIALOG_CONTEXT) end end -end + class DisplayDocumentTest < InputMethodTest + def setup + super + @driver = RDoc::RI::Driver.new(use_stdout: true) + end + + def display_document(target, bind) + input_method = IRB::RelineInputMethod.new(IRB::RegexpCompletor.new) + input_method.instance_variable_set(:@completion_params, ['', target, '', bind]) + input_method.display_document(target, driver: @driver) + end + + def test_perfectly_matched_namespace_triggers_document_display + omit unless has_rdoc_content? + + out, err = capture_output do + display_document("String", binding) + end + + assert_empty(err) + + assert_include(out, " S\bSt\btr\bri\bin\bng\bg") + end + + def test_perfectly_matched_multiple_namespaces_triggers_document_display + result = nil + out, err = capture_output do + result = display_document("{}.nil?", binding) + end + + assert_empty(err) + + # check if there're rdoc contents (e.g. CI doesn't generate them) + if has_rdoc_content? + # if there's rdoc content, we can verify by checking stdout + # rdoc generates control characters for formatting method names + assert_include(out, "P\bPr\bro\boc\bc.\b.n\bni\bil\bl?\b?") # Proc.nil? + assert_include(out, "H\bHa\bas\bsh\bh.\b.n\bni\bil\bl?\b?") # Hash.nil? + else + # this is a hacky way to verify the rdoc rendering code path because CI doesn't have rdoc content + # if there are multiple namespaces to be rendered, PerfectMatchedProc renders the result with a document + # which always returns the bytes rendered, even if it's 0 + assert_equal(0, result) + end + end + + def test_not_matched_namespace_triggers_nothing + result = nil + out, err = capture_output do + result = display_document("Stri", binding) + end + + assert_empty(err) + assert_empty(out) + assert_nil(result) + end + + def test_perfect_matching_stops_without_rdoc + result = nil + + out, err = capture_output do + without_rdoc do + result = display_document("String", binding) + end + end + + assert_empty(err) + assert_not_match(/from ruby core/, out) + assert_nil(result) + end + + def test_perfect_matching_handles_nil_namespace + out, err = capture_output do + # symbol literal has `nil` doc namespace so it's a good test subject + assert_nil(display_document(":aiueo", binding)) + end + + assert_empty(err) + assert_empty(out) + end + + private + + def has_rdoc_content? + File.exist?(RDoc::RI::Paths::BASE) + end + end +end diff --git a/test/mri/irb/test_irb.rb b/test/mri/irb/test_irb.rb new file mode 100644 index 00000000000..8c4fb5ddee3 --- /dev/null +++ b/test/mri/irb/test_irb.rb @@ -0,0 +1,759 @@ +# frozen_string_literal: true +require "irb" + +require_relative "helper" + +module TestIRB + class InputTest < IntegrationTestCase + def test_symbol_aliases_are_handled_correctly + write_ruby <<~'RUBY' + class Foo + end + binding.irb + RUBY + + output = run_ruby_file do + type "$ Foo" + type "exit!" + end + + assert_include output, "From: #{@ruby_file.path}:1" + end + + def test_symbol_aliases_are_handled_correctly_with_singleline_mode + write_rc <<~RUBY + IRB.conf[:USE_SINGLELINE] = true + RUBY + + write_ruby <<~'RUBY' + class Foo + end + binding.irb + RUBY + + output = run_ruby_file do + type "irb_info" + type "$ Foo" + type "exit!" + end + + # Make sure it's tested in singleline mode + assert_include output, "InputMethod: ReadlineInputMethod" + assert_include output, "From: #{@ruby_file.path}:1" + end + + def test_symbol_aliases_dont_affect_ruby_syntax + write_ruby <<~'RUBY' + $foo = "It's a foo" + @bar = "It's a bar" + binding.irb + RUBY + + output = run_ruby_file do + type "$foo" + type "@bar" + type "exit!" + end + + assert_include output, "=> \"It's a foo\"" + assert_include output, "=> \"It's a bar\"" + end + + def test_empty_input_echoing_behaviour + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "" + type " " + type "exit" + end + + # Input cramped together due to how Reline's Reline::GeneralIO works + assert_include( + output, + "irb(main):001> irb(main):002> irb(main):002> irb(main):002> => nil\r\n" + ) + end + end + + class IrbIOConfigurationTest < TestCase + Row = Struct.new(:content, :current_line_spaces, :new_line_spaces, :indent_level) + + class MockIO_AutoIndent + attr_reader :calculated_indent + + def initialize(*params) + @params = params + end + + def auto_indent(&block) + @calculated_indent = block.call(*@params) + end + end + + class MockIO_DynamicPrompt + attr_reader :prompt_list + + def initialize(params, &assertion) + @params = params + end + + def dynamic_prompt(&block) + @prompt_list = block.call(@params) + end + end + + def setup + save_encodings + @irb = build_irb + end + + def teardown + restore_encodings + end + + class AutoIndentationTest < IrbIOConfigurationTest + def test_auto_indent + input_with_correct_indents = [ + [%q(def each_top_level_statement), 0, 2], + [%q( initialize_input), 2, 2], + [%q( catch(:TERM_INPUT) do), 2, 4], + [%q( loop do), 4, 6], + [%q( begin), 6, 8], + [%q( prompt), 8, 8], + [%q( unless l = lex), 8, 10], + [%q( throw :TERM_INPUT if @line == ''), 10, 10], + [%q( else), 8, 10], + [%q( @line_no += l.count("\n")), 10, 10], + [%q( next if l == "\n"), 10, 10], + [%q( @line.concat l), 10, 10], + [%q( if @code_block_open or @ltype or @continue or @indent > 0), 10, 12], + [%q( next), 12, 12], + [%q( end), 10, 10], + [%q( end), 8, 8], + [%q( if @line != "\n"), 8, 10], + [%q( @line.force_encoding(@io.encoding)), 10, 10], + [%q( yield @line, @exp_line_no), 10, 10], + [%q( end), 8, 8], + [%q( break if @io.eof?), 8, 8], + [%q( @line = ''), 8, 8], + [%q( @exp_line_no = @line_no), 8, 8], + [%q( ), nil, 8], + [%q( @indent = 0), 8, 8], + [%q( rescue TerminateLineInput), 6, 8], + [%q( initialize_input), 8, 8], + [%q( prompt), 8, 8], + [%q( end), 6, 6], + [%q( end), 4, 4], + [%q( end), 2, 2], + [%q(end), 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents) + end + + def test_braces_on_their_own_line + input_with_correct_indents = [ + [%q(if true), 0, 2], + [%q( [), 2, 4], + [%q( ]), 2, 2], + [%q(end), 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents) + end + + def test_multiple_braces_in_a_line + input_with_correct_indents = [ + [%q([[[), 0, 6], + [%q( ]), 4, 4], + [%q( ]), 2, 2], + [%q(]), 0, 0], + [%q([< e), 4, 6], + [%q( raise e rescue 8), 6, 6], + [%q( end), 4, 4], + [%q( rescue), 2, 4], + [%q( raise rescue 11), 4, 4], + [%q( end), 2, 2], + [%q(rescue => e), 0, 2], + [%q( raise e rescue 14), 2, 2], + [%q(end), 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents) + end + + def test_oneliner_method_definition + input_with_correct_indents = [ + [%q(class A), 0, 2], + [%q( def foo0), 2, 4], + [%q( 3), 4, 4], + [%q( end), 2, 2], + [%q( def foo1()), 2, 4], + [%q( 3), 4, 4], + [%q( end), 2, 2], + [%q( def foo2(a, b)), 2, 4], + [%q( a + b), 4, 4], + [%q( end), 2, 2], + [%q( def foo3 a, b), 2, 4], + [%q( a + b), 4, 4], + [%q( end), 2, 2], + [%q( def bar0() = 3), 2, 2], + [%q( def bar1(a) = a), 2, 2], + [%q( def bar2(a, b) = a + b), 2, 2], + [%q( def bar3() = :s), 2, 2], + [%q( def bar4() = Time.now), 2, 2], + [%q(end), 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents) + end + + def test_tlambda + input_with_correct_indents = [ + [%q(if true), 0, 2, 1], + [%q( -> {), 2, 4, 2], + [%q( }), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_corresponding_syntax_to_keyword_do_in_class + input_with_correct_indents = [ + [%q(class C), 0, 2, 1], + [%q( while method_name do), 2, 4, 2], + [%q( 3), 4, 4, 2], + [%q( end), 2, 2, 1], + [%q( foo do), 2, 4, 2], + [%q( 3), 4, 4, 2], + [%q( end), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_corresponding_syntax_to_keyword_do + input_with_correct_indents = [ + [%q(while i > 0), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while true), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while ->{i > 0}.call), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while ->{true}.call), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while i > 0 do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while true do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while ->{i > 0}.call do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(while ->{true}.call do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(foo do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(foo true do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(foo ->{true} do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + [%q(foo ->{i > 0} do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_corresponding_syntax_to_keyword_for + input_with_correct_indents = [ + [%q(for i in [1]), 0, 2, 1], + [%q( puts i), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_corresponding_syntax_to_keyword_for_with_do + input_with_correct_indents = [ + [%q(for i in [1] do), 0, 2, 1], + [%q( puts i), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_typing_incomplete_include_interpreted_as_keyword_in + input_with_correct_indents = [ + [%q(module E), 0, 2, 1], + [%q(end), 0, 0, 0], + [%q(class A), 0, 2, 1], + [%q( in), 2, 2, 1] # scenario typing `include E` + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + + end + + def test_bracket_corresponding_to_times + input_with_correct_indents = [ + [%q(3.times { |i|), 0, 2, 1], + [%q( puts i), 2, 2, 1], + [%q(}), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_do_corresponding_to_times + input_with_correct_indents = [ + [%q(3.times do |i|), 0, 2, 1], + [%q( puts i), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_bracket_corresponding_to_loop + input_with_correct_indents = [ + ['loop {', 0, 2, 1], + [' 3', 2, 2, 1], + ['}', 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_do_corresponding_to_loop + input_with_correct_indents = [ + [%q(loop do), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_embdoc_indent + input_with_correct_indents = [ + [%q(=begin), 0, 0, 0], + [%q(a), 0, 0, 0], + [%q( b), 1, 1, 0], + [%q(=end), 0, 0, 0], + [%q(if 1), 0, 2, 1], + [%q( 2), 2, 2, 1], + [%q(=begin), 0, 0, 0], + [%q(a), 0, 0, 0], + [%q( b), 1, 1, 0], + [%q(=end), 0, 2, 1], + [%q( 3), 2, 2, 1], + [%q(end), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_heredoc_with_indent + if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') + pend 'This test needs Ripper::Lexer#scan to take broken tokens' + end + input_with_correct_indents = [ + [%q(<<~Q+<<~R), 0, 2, 1], + [%q(a), 2, 2, 1], + [%q(a), 2, 2, 1], + [%q( b), 2, 2, 1], + [%q( b), 2, 2, 1], + [%q( Q), 0, 2, 1], + [%q( c), 4, 4, 1], + [%q( c), 4, 4, 1], + [%q( R), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_oneliner_def_in_multiple_lines + input_with_correct_indents = [ + [%q(def a()=[), 0, 2, 1], + [%q( 1,), 2, 2, 1], + [%q(].), 0, 0, 0], + [%q(to_s), 0, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_broken_heredoc + input_with_correct_indents = [ + [%q(def foo), 0, 2, 1], + [%q( <<~Q), 2, 4, 2], + [%q( Qend), 4, 4, 2], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_pasted_code_keep_base_indent_spaces + input_with_correct_indents = [ + [%q( def foo), 0, 6, 1], + [%q( if bar), 6, 10, 2], + [%q( [1), 10, 12, 3], + [%q( ]+[["a), 10, 14, 4], + [%q(b" + `c), 0, 14, 4], + [%q(d` + /e), 0, 14, 4], + [%q(f/ + :"g), 0, 14, 4], + [%q(h".tap do), 0, 16, 5], + [%q( 1), 16, 16, 5], + [%q( end), 14, 14, 4], + [%q( ]), 12, 12, 3], + [%q( ]), 10, 10, 2], + [%q( end), 8, 6, 1], + [%q( end), 4, 0, 0], + ] + + assert_rows_with_correct_indents(input_with_correct_indents, assert_indent_level: true) + end + + def test_pasted_code_keep_base_indent_spaces_with_heredoc + input_with_correct_indents = [ + [%q( def foo), 0, 6, 1], + [%q( if bar), 6, 10, 2], + [%q( [1), 10, 12, 3], + [%q( ]+[["a), 10, 14, 4], + [%q(b" + <<~A + <<-B + < #{lines.last} + ``` + + All lines: + + ``` + #{lines.join("\n")} + ``` + MSG + assert_equal(row.current_line_spaces, actual_current_line_spaces, error_message) + + error_message = <<~MSG + Incorrect spaces calculation for line after the current line: + + ``` + #{lines.last} + > + ``` + + All lines: + + ``` + #{lines.join("\n")} + ``` + MSG + actual_next_line_spaces = calculate_indenting(lines, true) + assert_equal(row.new_line_spaces, actual_next_line_spaces, error_message) + end + + def assert_rows_with_correct_indents(rows_with_spaces, assert_indent_level: false) + lines = [] + rows_with_spaces.map do |row| + row = Row.new(*row) + lines << row.content + assert_row_indenting(lines, row) + + if assert_indent_level + assert_indent_level(lines, row.indent_level) + end + end + end + + def assert_indent_level(lines, expected) + code = lines.map { |l| "#{l}\n" }.join # code should end with "\n" + _tokens, opens, _ = @irb.scanner.check_code_state(code, local_variables: []) + indent_level = @irb.scanner.calc_indent_level(opens) + error_message = "Calculated the wrong number of indent level for:\n #{lines.join("\n")}" + assert_equal(expected, indent_level, error_message) + end + + def calculate_indenting(lines, add_new_line) + lines = lines + [""] if add_new_line + last_line_index = lines.length - 1 + byte_pointer = lines.last.length + + mock_io = MockIO_AutoIndent.new(lines, last_line_index, byte_pointer, add_new_line) + @irb.context.auto_indent_mode = true + @irb.context.io = mock_io + @irb.configure_io + + mock_io.calculated_indent + end + end + + class DynamicPromptTest < IrbIOConfigurationTest + def test_endless_range_at_end_of_line + input_with_prompt = [ + ['001:0: :> ', %q(a = 3..)], + ['002:0: :> ', %q()], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_heredoc_with_embexpr + input_with_prompt = [ + ['001:0:":* ', %q(< ', %q(])], + ['012:0: :> ', %q()], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_heredoc_prompt_with_quotes + input_with_prompt = [ + ["001:1:':* ", %q(<<~'A')], + ["002:1:':* ", %q(#{foobar})], + ["003:0: :> ", %q(A)], + ["004:1:`:* ", %q(<<~`A`)], + ["005:1:`:* ", %q(whoami)], + ["006:0: :> ", %q(A)], + ['007:1:":* ', %q(<<~"A")], + ['008:1:":* ', %q(foobar)], + ['009:0: :> ', %q(A)], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_backtick_method + input_with_prompt = [ + ['001:0: :> ', %q(self.`(arg))], + ['002:0: :> ', %q()], + ['003:0: :> ', %q(def `(); end)], + ['004:0: :> ', %q()], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_dynamic_prompt + input_with_prompt = [ + ['001:1: :* ', %q(def hoge)], + ['002:1: :* ', %q( 3)], + ['003:0: :> ', %q(end)], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_dynamic_prompt_with_double_newline_breaking_code + input_with_prompt = [ + ['001:1: :* ', %q(if true)], + ['002:2: :* ', %q(%)], + ['003:1: :* ', %q(;end)], + ['004:1: :* ', %q(;hello)], + ['005:0: :> ', %q(end)], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_dynamic_prompt_with_multiline_literal + input_with_prompt = [ + ['001:1: :* ', %q(if true)], + ['002:2:]:* ', %q( %w[)], + ['003:2:]:* ', %q( a)], + ['004:1: :* ', %q( ])], + ['005:1: :* ', %q( b)], + ['006:2:]:* ', %q( %w[)], + ['007:2:]:* ', %q( c)], + ['008:1: :* ', %q( ])], + ['009:0: :> ', %q(end)], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def test_dynamic_prompt_with_blank_line + input_with_prompt = [ + ['001:1:]:* ', %q(%w[)], + ['002:1:]:* ', %q()], + ['003:0: :> ', %q(])], + ] + + assert_dynamic_prompt(input_with_prompt) + end + + def assert_dynamic_prompt(input_with_prompt) + expected_prompt_list, lines = input_with_prompt.transpose + def @irb.generate_prompt(opens, continue, line_offset) + ltype = @scanner.ltype_from_open_tokens(opens) + indent = @scanner.calc_indent_level(opens) + continue = opens.any? || continue + line_no = @line_no + line_offset + '%03d:%01d:%1s:%s ' % [line_no, indent, ltype, continue ? '*' : '>'] + end + io = MockIO_DynamicPrompt.new(lines) + @irb.context.io = io + @irb.configure_io + + error_message = <<~EOM + Expected dynamic prompt: + #{expected_prompt_list.join("\n")} + + Actual dynamic prompt: + #{io.prompt_list.join("\n")} + EOM + assert_equal(expected_prompt_list, io.prompt_list, error_message) + end + end + + private + + def build_binding + Object.new.instance_eval { binding } + end + + def build_irb + IRB.init_config(nil) + workspace = IRB::WorkSpace.new(build_binding) + + IRB.conf[:VERBOSE] = false + IRB::Irb.new(workspace, TestInputMethod.new) + end + end +end diff --git a/test/mri/irb/test_locale.rb b/test/mri/irb/test_locale.rb new file mode 100644 index 00000000000..930a38834c1 --- /dev/null +++ b/test/mri/irb/test_locale.rb @@ -0,0 +1,118 @@ +require "irb" +require "stringio" + +require_relative "helper" + +module TestIRB + class LocaleTestCase < TestCase + def test_initialize_with_en + locale = IRB::Locale.new("en_US.UTF-8") + + assert_equal("en", locale.lang) + assert_equal("US", locale.territory) + assert_equal("UTF-8", locale.encoding.name) + assert_equal(nil, locale.modifier) + end + + def test_initialize_with_ja + locale = IRB::Locale.new("ja_JP.UTF-8") + + assert_equal("ja", locale.lang) + assert_equal("JP", locale.territory) + assert_equal("UTF-8", locale.encoding.name) + assert_equal(nil, locale.modifier) + end + + def test_initialize_with_legacy_ja_encoding_ujis + original_stderr = $stderr + $stderr = StringIO.new + + locale = IRB::Locale.new("ja_JP.ujis") + + assert_equal("ja", locale.lang) + assert_equal("JP", locale.territory) + assert_equal(Encoding::EUC_JP, locale.encoding) + assert_equal(nil, locale.modifier) + + assert_include $stderr.string, "ja_JP.ujis is obsolete. use ja_JP.EUC-JP" + ensure + $stderr = original_stderr + end + + def test_initialize_with_legacy_ja_encoding_euc + original_stderr = $stderr + $stderr = StringIO.new + + locale = IRB::Locale.new("ja_JP.euc") + + assert_equal("ja", locale.lang) + assert_equal("JP", locale.territory) + assert_equal(Encoding::EUC_JP, locale.encoding) + assert_equal(nil, locale.modifier) + + assert_include $stderr.string, "ja_JP.euc is obsolete. use ja_JP.EUC-JP" + ensure + $stderr = original_stderr + end + + %w(IRB_LANG LC_MESSAGES LC_ALL LANG).each do |env_var| + define_method "test_initialize_with_#{env_var.downcase}" do + original_values = { + "IRB_LANG" => ENV["IRB_LANG"], + "LC_MESSAGES" => ENV["LC_MESSAGES"], + "LC_ALL" => ENV["LC_ALL"], + "LANG" => ENV["LANG"], + } + + ENV["IRB_LANG"] = ENV["LC_MESSAGES"] = ENV["LC_ALL"] = ENV["LANG"] = nil + ENV[env_var] = "zh_TW.UTF-8" + + locale = IRB::Locale.new + + assert_equal("zh", locale.lang) + assert_equal("TW", locale.territory) + assert_equal("UTF-8", locale.encoding.name) + assert_equal(nil, locale.modifier) + ensure + original_values.each do |key, value| + ENV[key] = value + end + end + end + + def test_load + # reset Locale's internal cache + IRB::Locale.class_variable_set(:@@loaded, []) + # Because error.rb files define the same class, loading them causes method redefinition warnings. + original_verbose = $VERBOSE + $VERBOSE = nil + + jp_local = IRB::Locale.new("ja_JP.UTF-8") + jp_local.load("irb/error.rb") + msg = IRB::CantReturnToNormalMode.new.message + assert_equal("Normalモードに戻れません.", msg) + + # reset Locale's internal cache + IRB::Locale.class_variable_set(:@@loaded, []) + + en_local = IRB::Locale.new("en_US.UTF-8") + en_local.load("irb/error.rb") + msg = IRB::CantReturnToNormalMode.new.message + assert_equal("Can't return to normal mode.", msg) + ensure + # before turning warnings back on, load the error.rb file again to avoid warnings in other tests + IRB::Locale.new.load("irb/error.rb") + $VERBOSE = original_verbose + end + + def test_find + jp_local = IRB::Locale.new("ja_JP.UTF-8") + path = jp_local.find("irb/error.rb") + assert_include(path, "/lib/irb/lc/ja/error.rb") + + en_local = IRB::Locale.new("en_US.UTF-8") + path = en_local.find("irb/error.rb") + assert_include(path, "/lib/irb/lc/error.rb") + end + end +end diff --git a/test/mri/irb/test_nesting_parser.rb b/test/mri/irb/test_nesting_parser.rb new file mode 100644 index 00000000000..2482d400818 --- /dev/null +++ b/test/mri/irb/test_nesting_parser.rb @@ -0,0 +1,341 @@ +# frozen_string_literal: false +require 'irb' + +require_relative "helper" + +module TestIRB + class NestingParserTest < TestCase + def setup + save_encodings + end + + def teardown + restore_encodings + end + + def parse_by_line(code) + IRB::NestingParser.parse_by_line(IRB::RubyLex.ripper_lex_without_warning(code)) + end + + def test_open_tokens + code = <<~'EOS' + class A + def f + if true + tap do + { + x: " + #{p(1, 2, 3 + EOS + opens = IRB::NestingParser.open_tokens(IRB::RubyLex.ripper_lex_without_warning(code)) + assert_equal(%w[class def if do { " #{ (], opens.map(&:tok)) + end + + def test_parse_by_line + code = <<~EOS + (((((1+2 + ).to_s())).tap do ((( + EOS + _tokens, prev_opens, next_opens, min_depth = parse_by_line(code).last + assert_equal(%w[( ( ( ( (], prev_opens.map(&:tok)) + assert_equal(%w[( ( do ( ( (], next_opens.map(&:tok)) + assert_equal(2, min_depth) + end + + def test_ruby_syntax + code = <<~'EOS' + class A + 1 if 2 + 1 while 2 + 1 until 2 + 1 unless 2 + 1 rescue 2 + begin; rescue; ensure; end + tap do; rescue; ensure; end + class B; end + module C; end + def f; end + def `; end + def f() = 1 + %(); %w[]; %q(); %r{}; %i[] + "#{1}"; ''; /#{1}/; `#{1}` + :sym; :"sym"; :+; :`; :if + [1, 2, 3] + { x: 1, y: 2 } + (a, (*b, c), d), e = 1, 2, 3 + ->(a){}; ->(a) do end + -> a = -> b = :do do end do end + if 1; elsif 2; else; end + unless 1; end + while 1; end + until 1; end + for i in j; end + case 1; when 2; end + puts(1, 2, 3) + loop{|i|} + loop do |i| end + end + EOS + line_results = parse_by_line(code) + assert_equal(code.lines.size, line_results.size) + class_open, *inner_line_results, class_close = line_results + assert_equal(['class'], class_open[2].map(&:tok)) + inner_line_results.each {|result| assert_equal(['class'], result[2].map(&:tok)) } + assert_equal([], class_close[2].map(&:tok)) + end + + def test_multiline_string + code = <<~EOS + " + aaa + bbb + " + < do end do + here + end + EOS + line_results = parse_by_line(code).select { |tokens,| tokens.map(&:last).include?('here') } + assert_equal(7, line_results.size) + line_results.each do |_tokens, _prev_opens, next_opens, _min_depth| + assert_equal(['for'], next_opens.map(&:tok)) + end + end + + def test_while_until + base_code = <<~'EOS' + while_or_until true + here + end + while_or_until a < c + here + end + while_or_until true do + here + end + while_or_until + # comment + (a + b) < + # comment + c do + here + end + while_or_until :\ + do do + here + end + while_or_until def do; end == :do do + here + end + while_or_until -> do end do + here + end + EOS + %w[while until].each do |keyword| + code = base_code.gsub('while_or_until', keyword) + line_results = parse_by_line(code).select { |tokens,| tokens.map(&:last).include?('here') } + assert_equal(7, line_results.size) + line_results.each do |_tokens, _prev_opens, next_opens, _min_depth| + assert_equal([keyword], next_opens.map(&:tok) ) + end + end + end + + def test_undef_alias + codes = [ + 'undef foo', + 'alias foo bar', + 'undef !', + 'alias + -', + 'alias $a $b', + 'undef do', + 'alias do do', + 'undef :do', + 'alias :do :do', + 'undef :"#{alias do do}"', + 'alias :"#{undef do}" do', + 'alias do :"#{undef do}"' + ] + code_with_comment = <<~EOS + undef # + # + do # + alias # + # + do # + # + do # + EOS + code_with_heredoc = <<~EOS + <<~A; alias + A + :"#{<<~A}" + A + do + EOS + [*codes, code_with_comment, code_with_heredoc].each do |code| + opens = IRB::NestingParser.open_tokens(IRB::RubyLex.ripper_lex_without_warning('(' + code + "\nif")) + assert_equal(%w[( if], opens.map(&:tok)) + end + end + + def test_case_in + if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') + pend 'This test requires ruby version that supports case-in syntax' + end + code = <<~EOS + case 1 + in 1 + here + in + 2 + here + end + EOS + line_results = parse_by_line(code).select { |tokens,| tokens.map(&:last).include?('here') } + assert_equal(2, line_results.size) + line_results.each do |_tokens, _prev_opens, next_opens, _min_depth| + assert_equal(['in'], next_opens.map(&:tok)) + end + end + end +end diff --git a/test/mri/irb/test_option.rb b/test/mri/irb/test_option.rb index e334cee6dd3..fec31f384f9 100644 --- a/test/mri/irb/test_option.rb +++ b/test/mri/irb/test_option.rb @@ -2,7 +2,7 @@ require_relative "helper" module TestIRB - class TestOption < TestCase + class OptionTest < TestCase def test_end_of_option bug4117 = '[ruby-core:33574]' bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] diff --git a/test/mri/irb/test_raise_exception.rb b/test/mri/irb/test_raise_exception.rb new file mode 100644 index 00000000000..44a5ae87e18 --- /dev/null +++ b/test/mri/irb/test_raise_exception.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: false +require "tmpdir" + +require_relative "helper" + +module TestIRB + class RaiseExceptionTest < TestCase + def test_raise_exception_with_nil_backtrace + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /#/, []) + raise Exception.new("foo").tap {|e| def e.backtrace; nil; end } +IRB + end + + def test_raise_exception_with_message_exception + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + expected = /#\nbacktraces are hidden because bar was raised when processing them/ + assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, expected, []) + e = Exception.new("foo") + def e.message; raise 'bar'; end + raise e +IRB + end + + def test_raise_exception_with_message_inspect_exception + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + expected = /Uninspectable exception occurred/ + assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, expected, []) + e = Exception.new("foo") + def e.message; raise; end + def e.inspect; raise; end + raise e +IRB + end + + def test_raise_exception_with_invalid_byte_sequence + pend if RUBY_ENGINE == 'truffleruby' || /mswin|mingw/ =~ RUBY_PLATFORM + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<~IRB, /A\\xF3B \(StandardError\)/, []) + raise StandardError, "A\\xf3B" + IRB + end + + def test_raise_exception_with_different_encoding_containing_invalid_byte_sequence + backup_home = ENV["HOME"] + Dir.mktmpdir("test_irb_raise_no_backtrace_exception_#{$$}") do |tmpdir| + ENV["HOME"] = tmpdir + + bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] + File.open("#{tmpdir}/euc.rb", 'w') do |f| + f.write(<<~EOF) + # encoding: euc-jp + + def raise_euc_with_invalid_byte_sequence + raise "\xA4\xA2\\xFF" + end + EOF + end + env = {} + %w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.UTF-8" } + # TruffleRuby warns when the locale does not exist + env['TRUFFLERUBYOPT'] = "#{ENV['TRUFFLERUBYOPT']} --log.level=SEVERE" if RUBY_ENGINE == 'truffleruby' + args = [env] + bundle_exec + %W[-rirb -C #{tmpdir} -W0 -e IRB.start(__FILE__) -- -f --] + error = /raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/ + assert_in_out_err(args, <<~IRB, error, [], encoding: "UTF-8") + require_relative 'euc' + raise_euc_with_invalid_byte_sequence + IRB + end + ensure + ENV["HOME"] = backup_home + end + end +end diff --git a/test/mri/irb/test_raise_no_backtrace_exception.rb b/test/mri/irb/test_raise_no_backtrace_exception.rb deleted file mode 100644 index 9565419cdd0..00000000000 --- a/test/mri/irb/test_raise_no_backtrace_exception.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: false -require "tmpdir" - -require_relative "helper" - -module TestIRB - class TestRaiseNoBacktraceException < TestCase - def test_raise_exception - bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /Exception: foo/, []) - e = Exception.new("foo") - puts e.inspect - def e.backtrace; nil; end - raise e -IRB - end - - def test_raise_exception_with_invalid_byte_sequence - pend if RUBY_ENGINE == 'truffleruby' || /mswin|mingw/ =~ RUBY_PLATFORM - bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<~IRB, /A\\xF3B \(StandardError\)/, []) - raise StandardError, "A\\xf3B" - IRB - end - - def test_raise_exception_with_different_encoding_containing_invalid_byte_sequence - backup_home = ENV["HOME"] - Dir.mktmpdir("test_irb_raise_no_backtrace_exception_#{$$}") do |tmpdir| - ENV["HOME"] = tmpdir - - bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - File.open("#{tmpdir}/euc.rb", 'w') do |f| - f.write(<<~EOF) - # encoding: euc-jp - - def raise_euc_with_invalid_byte_sequence - raise "\xA4\xA2\\xFF" - end - EOF - end - env = {} - %w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.UTF-8" } - # TruffleRuby warns when the locale does not exist - env['TRUFFLERUBYOPT'] = "#{ENV['TRUFFLERUBYOPT']} --log.level=SEVERE" if RUBY_ENGINE == 'truffleruby' - args = [env] + bundle_exec + %W[-rirb -C #{tmpdir} -W0 -e IRB.start(__FILE__) -- -f --] - error = /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/ - assert_in_out_err(args, <<~IRB, error, [], encoding: "UTF-8") - require_relative 'euc' - raise_euc_with_invalid_byte_sequence - IRB - end - ensure - ENV["HOME"] = backup_home - end - end -end diff --git a/test/mri/irb/test_ruby_lex.rb b/test/mri/irb/test_ruby_lex.rb index fa68a4632cb..4e406a8ce08 100644 --- a/test/mri/irb/test_ruby_lex.rb +++ b/test/mri/irb/test_ruby_lex.rb @@ -1,26 +1,10 @@ -$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'irb' -require 'rubygems' -require 'ostruct' +# frozen_string_literal: true +require "irb" require_relative "helper" module TestIRB - class TestRubyLex < TestCase - Row = Struct.new(:content, :current_line_spaces, :new_line_spaces, :nesting_level) - - class MockIO_AutoIndent - def initialize(params, &assertion) - @params = params - @assertion = assertion - end - - def auto_indent(&block) - result = block.call(*@params) - @assertion.call(result) - end - end - + class RubyLexTest < TestCase def setup save_encodings end @@ -29,638 +13,77 @@ def teardown restore_encodings end - def assert_indenting(lines, correct_space_count, add_new_line) - lines = lines + [""] if add_new_line - last_line_index = lines.length - 1 - byte_pointer = lines.last.length - - context = build_context - context.auto_indent_mode = true - ruby_lex = RubyLex.new() - io = MockIO_AutoIndent.new([lines, last_line_index, byte_pointer, add_new_line]) do |auto_indent| - error_message = "Calculated the wrong number of spaces for:\n #{lines.join("\n")}" - assert_equal(correct_space_count, auto_indent, error_message) - end - ruby_lex.set_input(io, context: context) - ruby_lex.set_auto_indent(context) - end - - def assert_nesting_level(lines, expected, local_variables: []) - ruby_lex = ruby_lex_for_lines(lines, local_variables: local_variables) - error_message = "Calculated the wrong number of nesting level for:\n #{lines.join("\n")}" - assert_equal(expected, ruby_lex.instance_variable_get(:@indent), error_message) - end - - def assert_code_block_open(lines, expected, local_variables: []) - ruby_lex = ruby_lex_for_lines(lines, local_variables: local_variables) - error_message = "Wrong result of code_block_open for:\n #{lines.join("\n")}" - assert_equal(expected, ruby_lex.instance_variable_get(:@code_block_open), error_message) - end - - def ruby_lex_for_lines(lines, local_variables: []) - ruby_lex = RubyLex.new() - - context = build_context(local_variables) - io = proc{ lines.join("\n") } - ruby_lex.set_input(io, io, context: context) - ruby_lex.lex(context) - ruby_lex - end - - def test_auto_indent - input_with_correct_indents = [ - Row.new(%q(def each_top_level_statement), nil, 2), - Row.new(%q( initialize_input), nil, 2), - Row.new(%q( catch(:TERM_INPUT) do), nil, 4), - Row.new(%q( loop do), nil, 6), - Row.new(%q( begin), nil, 8), - Row.new(%q( prompt), nil, 8), - Row.new(%q( unless l = lex), nil, 10), - Row.new(%q( throw :TERM_INPUT if @line == ''), nil, 10), - Row.new(%q( else), 8, 10), - Row.new(%q( @line_no += l.count("\n")), nil, 10), - Row.new(%q( next if l == "\n"), nil, 10), - Row.new(%q( @line.concat l), nil, 10), - Row.new(%q( if @code_block_open or @ltype or @continue or @indent > 0), nil, 12), - Row.new(%q( next), nil, 12), - Row.new(%q( end), 10, 10), - Row.new(%q( end), 8, 8), - Row.new(%q( if @line != "\n"), nil, 10), - Row.new(%q( @line.force_encoding(@io.encoding)), nil, 10), - Row.new(%q( yield @line, @exp_line_no), nil, 10), - Row.new(%q( end), 8, 8), - Row.new(%q( break if @io.eof?), nil, 8), - Row.new(%q( @line = ''), nil, 8), - Row.new(%q( @exp_line_no = @line_no), nil, 8), - Row.new(%q( ), nil, 8), - Row.new(%q( @indent = 0), nil, 8), - Row.new(%q( rescue TerminateLineInput), 6, 8), - Row.new(%q( initialize_input), nil, 8), - Row.new(%q( prompt), nil, 8), - Row.new(%q( end), 6, 6), - Row.new(%q( end), 4, 4), - Row.new(%q( end), 2, 2), - Row.new(%q(end), 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_braces_on_their_own_line - input_with_correct_indents = [ - Row.new(%q(if true), nil, 2), - Row.new(%q( [), nil, 4), - Row.new(%q( ]), 2, 2), - Row.new(%q(end), 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_multiple_braces_in_a_line - input_with_correct_indents = [ - Row.new(%q([[[), nil, 6), - Row.new(%q( ]), 4, 4), - Row.new(%q( ]), 2, 2), - Row.new(%q(]), 0, 0), - Row.new(%q([< ', %q(a = 3..)), - PromptRow.new('002:0: :* ', %q()), - ] - - lines = input_with_prompt.map(&:content) - expected_prompt_list = input_with_prompt.map(&:prompt) - assert_dynamic_prompt(lines, expected_prompt_list) - end - - def test_heredoc_with_embexpr - input_with_prompt = [ - PromptRow.new('001:0:":* ', %q(< ', %q(])), - PromptRow.new('012:0: :* ', %q()), - ] - - lines = input_with_prompt.map(&:content) - expected_prompt_list = input_with_prompt.map(&:prompt) - assert_dynamic_prompt(lines, expected_prompt_list) - end - - def test_backtick_method - input_with_prompt = [ - PromptRow.new('001:0: :> ', %q(self.`(arg))), - PromptRow.new('002:0: :* ', %q()), - PromptRow.new('003:0: :> ', %q(def `(); end)), - PromptRow.new('004:0: :* ', %q()), - ] - - lines = input_with_prompt.map(&:content) - expected_prompt_list = input_with_prompt.map(&:prompt) - assert_dynamic_prompt(lines, expected_prompt_list) - end - - def test_incomplete_coding_magic_comment - input_with_correct_indents = [ - Row.new(%q(#coding:u), nil, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_incomplete_encoding_magic_comment - input_with_correct_indents = [ - Row.new(%q(#encoding:u), nil, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_incomplete_emacs_coding_magic_comment - input_with_correct_indents = [ - Row.new(%q(# -*- coding: u), nil, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_incomplete_vim_coding_magic_comment - input_with_correct_indents = [ - Row.new(%q(# vim:set fileencoding=u), nil, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_mixed_rescue - input_with_correct_indents = [ - Row.new(%q(def m), nil, 2), - Row.new(%q( begin), nil, 4), - Row.new(%q( begin), nil, 6), - Row.new(%q( x = a rescue 4), nil, 6), - Row.new(%q( y = [(a rescue 5)]), nil, 6), - Row.new(%q( [x, y]), nil, 6), - Row.new(%q( rescue => e), 4, 6), - Row.new(%q( raise e rescue 8), nil, 6), - Row.new(%q( end), 4, 4), - Row.new(%q( rescue), 2, 4), - Row.new(%q( raise rescue 11), nil, 4), - Row.new(%q( end), 2, 2), - Row.new(%q(rescue => e), 0, 2), - Row.new(%q( raise e rescue 14), nil, 2), - Row.new(%q(end), 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_oneliner_method_definition - input_with_correct_indents = [ - Row.new(%q(class A), nil, 2), - Row.new(%q( def foo0), nil, 4), - Row.new(%q( 3), nil, 4), - Row.new(%q( end), 2, 2), - Row.new(%q( def foo1()), nil, 4), - Row.new(%q( 3), nil, 4), - Row.new(%q( end), 2, 2), - Row.new(%q( def foo2(a, b)), nil, 4), - Row.new(%q( a + b), nil, 4), - Row.new(%q( end), 2, 2), - Row.new(%q( def foo3 a, b), nil, 4), - Row.new(%q( a + b), nil, 4), - Row.new(%q( end), 2, 2), - Row.new(%q( def bar0() = 3), nil, 2), - Row.new(%q( def bar1(a) = a), nil, 2), - Row.new(%q( def bar2(a, b) = a + b), nil, 2), - Row.new(%q( def bar3() = :s), nil, 2), - Row.new(%q( def bar4() = Time.now), nil, 2), - Row.new(%q(end), 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - end - end - - def test_tlambda - input_with_correct_indents = [ - Row.new(%q(if true), nil, 2, 1), - Row.new(%q( -> {), nil, 4, 2), - Row.new(%q( }), 2, 2, 1), - Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_corresponding_syntax_to_keyword_do_in_class - input_with_correct_indents = [ - Row.new(%q(class C), nil, 2, 1), - Row.new(%q( while method_name do), nil, 4, 2), - Row.new(%q( 3), nil, 4, 2), - Row.new(%q( end), 2, 2, 1), - Row.new(%q( foo do), nil, 4, 2), - Row.new(%q( 3), nil, 4, 2), - Row.new(%q( end), 2, 2, 1), - Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_corresponding_syntax_to_keyword_do - input_with_correct_indents = [ - Row.new(%q(while i > 0), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while true), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while ->{i > 0}.call), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while ->{true}.call), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while i > 0 do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while true do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while ->{i > 0}.call do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(while ->{true}.call do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(foo do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(foo true do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(foo ->{true} do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(foo ->{i > 0} do), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_corresponding_syntax_to_keyword_for - input_with_correct_indents = [ - Row.new(%q(for i in [1]), nil, 2, 1), - Row.new(%q( puts i), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_corresponding_syntax_to_keyword_for_with_do - input_with_correct_indents = [ - Row.new(%q(for i in [1] do), nil, 2, 1), - Row.new(%q( puts i), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_corresponding_syntax_to_keyword_in - input_with_correct_indents = [ - Row.new(%q(module E), nil, 2, 1), - Row.new(%q(end), 0, 0, 0), - Row.new(%q(class A), nil, 2, 1), - Row.new(%q( in), nil, 4, 1) - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_bracket_corresponding_to_times - input_with_correct_indents = [ - Row.new(%q(3.times { |i|), nil, 2, 1), - Row.new(%q( puts i), nil, 2, 1), - Row.new(%q(}), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_do_corresponding_to_times - input_with_correct_indents = [ - Row.new(%q(3.times do |i|), nil, 2, 1), - #Row.new(%q( puts i), nil, 2, 1), - #Row.new(%q(end), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) - end - end - - def test_bracket_corresponding_to_loop - input_with_correct_indents = [ - Row.new(%q(loop {), nil, 2, 1), - Row.new(%q( 3), nil, 2, 1), - Row.new(%q(}), 0, 0, 0), - ] - - lines = [] - input_with_correct_indents.each do |row| - lines << row.content - assert_indenting(lines, row.current_line_spaces, false) - assert_indenting(lines, row.new_line_spaces, true) - assert_nesting_level(lines, row.nesting_level) + def test_interpolate_token_with_heredoc_and_unclosed_embexpr + code = <<~'EOC' + ①+<'] - end - context = build_context - ruby_lex.set_input(io, context: context) + def test_should_continue + assert_should_continue(['a'], false) + assert_should_continue(['/a/'], false) + assert_should_continue(['a;'], false) + assert_should_continue(['< ', %q(end)), - ] + def test_code_block_open_with_should_continue + # syntax ok + assert_code_block_open(['a'], false) # continue: false + assert_code_block_open(['a\\'], true) # continue: true - lines = input_with_prompt.map(&:content) - expected_prompt_list = input_with_prompt.map(&:prompt) - assert_dynamic_prompt(lines, expected_prompt_list) - end + # recoverable syntax error code is not terminated + assert_code_block_open(['a+'], true) - def test_dyanmic_prompt_with_blank_line - input_with_prompt = [ - PromptRow.new('001:0:]:* ', %q(%w[)), - PromptRow.new('002:0:]:* ', %q()), - PromptRow.new('003:0: :> ', %q(])), - ] + # unrecoverable syntax error code is terminated + assert_code_block_open(['.; a+'], false) - lines = input_with_prompt.map(&:content) - expected_prompt_list = input_with_prompt.map(&:prompt) - assert_dynamic_prompt(lines, expected_prompt_list) + # other syntax error that failed to determine if it is recoverable or not + assert_code_block_open(['@; a'], false) + assert_code_block_open(['@; a+'], true) + assert_code_block_open(['@; (a'], true) end def test_broken_percent_literal - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') - pend 'This test needs Ripper::Lexer#scan to take broken tokens' - end - - tokens = RubyLex.ripper_lex_without_warning('%wwww') + tokens = IRB::RubyLex.ripper_lex_without_warning('%wwww') pos_to_index = {} tokens.each_with_index { |t, i| assert_nil(pos_to_index[t.pos], "There is already another token in the position of #{t.inspect}.") @@ -669,11 +92,7 @@ def test_broken_percent_literal end def test_broken_percent_literal_in_method - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') - pend 'This test needs Ripper::Lexer#scan to take broken tokens' - end - - tokens = RubyLex.ripper_lex_without_warning(<<~EOC.chomp) + tokens = IRB::RubyLex.ripper_lex_without_warning(<<~EOC.chomp) def foo %wwww end @@ -686,12 +105,8 @@ def foo end def test_unterminated_code - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0') - pend 'This test needs Ripper::Lexer#scan to take broken tokens' - end - ['do', '< "true") + end + + def example_ruby_file + <<~'RUBY' + class Foo + def self.foo + 100 + end + end + + def bar(obj) + obj.foo + end + + binding.irb + RUBY + end + + def test_use_tracer_enabled_when_gem_is_unavailable + write_rc <<~RUBY + # Simulate the absence of the tracer gem + ::Kernel.send(:alias_method, :irb_original_require, :require) + + ::Kernel.define_method(:require) do |name| + raise LoadError, "cannot load such file -- tracer (test)" if name.match?("tracer") + ::Kernel.send(:irb_original_require, name) + end + + IRB.conf[:USE_TRACER] = true + RUBY + + write_ruby example_ruby_file + + output = run_ruby_file do + type "bar(Foo)" + type "exit" + end + + assert_include(output, "Tracer extension of IRB is enabled but tracer gem wasn't found.") + end + + def test_use_tracer_enabled_when_gem_is_available + write_rc <<~RUBY + IRB.conf[:USE_TRACER] = true + RUBY + + write_ruby example_ruby_file + + output = run_ruby_file do + type "bar(Foo)" + type "exit" + end + + assert_include(output, "Object#bar at") + assert_include(output, "Foo.foo at") + assert_include(output, "Foo.foo #=> 100") + assert_include(output, "Object#bar #=> 100") + + # Test that the tracer output does not include IRB's own files + assert_not_include(output, "irb/workspace.rb") + end + + def test_use_tracer_is_disabled_by_default + write_ruby example_ruby_file + + output = run_ruby_file do + type "bar(Foo)" + type "exit" + end + + assert_not_include(output, "#depth:") + assert_not_include(output, "Foo.foo") + end + + end +end diff --git a/test/mri/irb/test_type_completor.rb b/test/mri/irb/test_type_completor.rb new file mode 100644 index 00000000000..cf4fc12c9f4 --- /dev/null +++ b/test/mri/irb/test_type_completor.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Run test only when Ruby >= 3.0 and repl_type_completor is available +return unless RUBY_VERSION >= '3.0.0' +return if RUBY_ENGINE == 'truffleruby' # needs endless method definition +begin + require 'repl_type_completor' +rescue LoadError + return +end + +require 'irb/completion' +require 'tempfile' +require_relative './helper' + +module TestIRB + class TypeCompletorTest < TestCase + DummyContext = Struct.new(:irb_path) + + def setup + ReplTypeCompletor.load_rbs unless ReplTypeCompletor.rbs_loaded? + context = DummyContext.new('(irb)') + @completor = IRB::TypeCompletor.new(context) + end + + def empty_binding + binding + end + + def assert_completion(preposing, target, binding: empty_binding, include: nil, exclude: nil) + raise ArgumentError if include.nil? && exclude.nil? + candidates = @completor.completion_candidates(preposing, target, '', bind: binding) + assert ([*include] - candidates).empty?, "Expected #{candidates} to include #{include}" if include + assert (candidates & [*exclude]).empty?, "Expected #{candidates} not to include #{exclude}" if exclude + end + + def assert_doc_namespace(preposing, target, namespace, binding: empty_binding) + @completor.completion_candidates(preposing, target, '', bind: binding) + assert_equal namespace, @completor.doc_namespace(preposing, target, '', bind: binding) + end + + def test_type_completion + bind = eval('num = 1; binding') + assert_completion('num.times.map(&:', 'ab', binding: bind, include: 'abs') + assert_doc_namespace('num.chr.', 'upcase', 'String#upcase', binding: bind) + end + + def test_inspect + assert_match(/\AReplTypeCompletor.*\z/, @completor.inspect) + end + + def test_empty_completion + candidates = @completor.completion_candidates('(', ')', '', bind: binding) + assert_equal [], candidates + assert_doc_namespace('(', ')', nil) + end + end + + class TypeCompletorIntegrationTest < IntegrationTestCase + def test_type_completor + write_rc <<~RUBY + IRB.conf[:COMPLETOR] = :type + RUBY + + write_ruby <<~'RUBY' + binding.irb + RUBY + + output = run_ruby_file do + type "irb_info" + type "sleep 0.01 until ReplTypeCompletor.rbs_loaded?" + type "completor = IRB.CurrentContext.io.instance_variable_get(:@completor);" + type "n = 10" + type "puts completor.completion_candidates 'a = n.abs;', 'a.b', '', bind: binding" + type "puts completor.doc_namespace 'a = n.chr;', 'a.encoding', '', bind: binding" + type "exit!" + end + assert_match(/Completion: Autocomplete, ReplTypeCompletor/, output) + assert_match(/a\.bit_length/, output) + assert_match(/String#encoding/, output) + end + end +end diff --git a/test/mri/irb/test_workspace.rb b/test/mri/irb/test_workspace.rb index 9b10c27b89d..199ce95a37b 100644 --- a/test/mri/irb/test_workspace.rb +++ b/test/mri/irb/test_workspace.rb @@ -1,6 +1,5 @@ # frozen_string_literal: false require 'tempfile' -require 'rubygems' require 'irb' require 'irb/workspace' require 'irb/color' @@ -8,7 +7,7 @@ require_relative "helper" module TestIRB - class TestWorkSpace < TestCase + class WorkSpaceTest < TestCase def test_code_around_binding IRB.conf[:USE_COLORIZE] = false Tempfile.create('irb') do |f| @@ -83,7 +82,6 @@ def test_code_around_binding_on_irb def test_toplevel_binding_local_variables - pend if RUBY_ENGINE == 'truffleruby' bug17623 = '[ruby-core:102468]' bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] top_srcdir = "#{__dir__}/../.." @@ -92,7 +90,7 @@ def test_toplevel_binding_local_variables irb_path = "#{top_srcdir}/#{dir}/irb" File.exist?(irb_path) end or omit 'irb command not found' - assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623) + assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY, '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623) version = 'xyz' # typical rubygems loading file load('#{irb_path}') RUBY diff --git a/test/mri/irb/yamatanooroti/test_rendering.rb b/test/mri/irb/yamatanooroti/test_rendering.rb index 9e099488692..a0477ee4827 100644 --- a/test/mri/irb/yamatanooroti/test_rendering.rb +++ b/test/mri/irb/yamatanooroti/test_rendering.rb @@ -2,248 +2,506 @@ begin require 'yamatanooroti' +rescue LoadError, NameError + # On Ruby repository, this test suite doesn't run because Ruby repo doesn't + # have the yamatanooroti gem. + return +end - class IRB::TestRendering < Yamatanooroti::TestCase - def setup - @pwd = Dir.pwd - suffix = '%010d' % Random.rand(0..65535) - @tmpdir = File.join(File.expand_path(Dir.tmpdir), "test_irb_#{$$}_#{suffix}") - begin - Dir.mkdir(@tmpdir) - rescue Errno::EEXIST - FileUtils.rm_rf(@tmpdir) - Dir.mkdir(@tmpdir) - end - @irbrc_backup = ENV['IRBRC'] - @irbrc_file = ENV['IRBRC'] = File.join(@tmpdir, 'temporaty_irbrc') - File.unlink(@irbrc_file) if File.exist?(@irbrc_file) - end - - def teardown +class IRB::RenderingTest < Yamatanooroti::TestCase + def setup + @original_term = ENV['TERM'] + ENV['TERM'] = "xterm-256color" + @pwd = Dir.pwd + suffix = '%010d' % Random.rand(0..65535) + @tmpdir = File.join(File.expand_path(Dir.tmpdir), "test_irb_#{$$}_#{suffix}") + begin + Dir.mkdir(@tmpdir) + rescue Errno::EEXIST FileUtils.rm_rf(@tmpdir) - ENV['IRBRC'] = @irbrc_backup - ENV.delete('RELINE_TEST_PROMPT') if ENV['RELINE_TEST_PROMPT'] + Dir.mkdir(@tmpdir) end + @irbrc_backup = ENV['IRBRC'] + @irbrc_file = ENV['IRBRC'] = File.join(@tmpdir, 'temporaty_irbrc') + File.unlink(@irbrc_file) if File.exist?(@irbrc_file) + end - def test_launch - write_irbrc <<~'LINES' - puts 'start IRB' - LINES - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write(<<~EOC) - 'Hello, World!' - EOC - close - assert_screen(<<~EOC) - start IRB - irb(main):001:0> 'Hello, World!' - => "Hello, World!" - irb(main):002:0> - EOC - end + def teardown + FileUtils.rm_rf(@tmpdir) + ENV['IRBRC'] = @irbrc_backup + ENV['TERM'] = @original_term + end - def test_multiline_paste - write_irbrc <<~'LINES' - puts 'start IRB' - LINES - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write(<<~EOC) - class A - def inspect; '#'; end - def a; self; end - def b; true; end - end - - a = A.new - - a - .a - .b - EOC - close - assert_screen(<<~EOC) - start IRB - irb(main):001:1* class A - irb(main):002:1* def inspect; '#'; end - irb(main):003:1* def a; self; end - irb(main):004:1* def b; true; end - irb(main):005:0> end - => :b - irb(main):006:0> - irb(main):007:0> a = A.new - => # - irb(main):008:0> - irb(main):009:0> a - irb(main):010:0> .a - irb(main):011:0> .b - => true - irb(main):012:0> - EOC - end + def test_launch + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write(<<~EOC) + 'Hello, World!' + EOC + close + assert_screen(<<~EOC) + start IRB + irb(main):001> 'Hello, World!' + => "Hello, World!" + irb(main):002> + EOC + end - def test_evaluate_each_toplevel_statement_by_multiline_paste - write_irbrc <<~'LINES' - puts 'start IRB' - LINES - start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write(<<~EOC) - class A - def inspect; '#'; end - def b; self; end - def c; true; end - end - - a = A.new - - a - .b - # aaa - .c - - (a) - &.b() - - - class A def b; self; end; def c; true; end; end; - a = A.new - a - .b - # aaa - .c - (a) - &.b() - EOC - close + def test_configuration_file_is_skipped_with_dash_f + write_irbrc <<~'LINES' + puts '.irbrc file should be ignored when -f is used' + LINES + start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb -f}, startup_message: '') + write(<<~EOC) + 'Hello, World!' + EOC + close + assert_screen(<<~EOC) + irb(main):001> 'Hello, World!' + => "Hello, World!" + irb(main):002> + EOC + end + + def test_configuration_file_is_skipped_with_dash_f_for_nested_sessions + write_irbrc <<~'LINES' + puts '.irbrc file should be ignored when -f is used' + LINES + start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb -f}, startup_message: '') + write(<<~EOC) + 'Hello, World!' + binding.irb + exit! + EOC + close + assert_screen(<<~EOC) + irb(main):001> 'Hello, World!' + => "Hello, World!" + irb(main):002> binding.irb + irb(main):003> exit! + irb(main):001> + EOC + end + + def test_nomultiline + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb --nomultiline}, startup_message: 'start IRB') + write(<<~EOC) + if true + if false + a = "hello + world" + puts a + end + end + EOC + close + assert_screen(<<~EOC) + start IRB + irb(main):001> if true + irb(main):002* if false + irb(main):003* a = "hello + irb(main):004" world" + irb(main):005* puts a + irb(main):006* end + irb(main):007* end + => nil + irb(main):008> + EOC + end + + def test_multiline_paste + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write(<<~EOC) + class A + def inspect; '#'; end + def a; self; end + def b; true; end + end + + a = A.new + + a + .a + .b + EOC + close + assert_screen(<<~EOC) + start IRB + irb(main):001* class A + irb(main):002* def inspect; '#'; end + irb(main):003* def a; self; end + irb(main):004* def b; true; end + irb(main):005> end + => :b + irb(main):006> + irb(main):007> a = A.new + => # + irb(main):008> + irb(main):009> a + irb(main):010> .a + irb(main):011> .b + => true + irb(main):012> + EOC + end + + def test_evaluate_each_toplevel_statement_by_multiline_paste + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write(<<~EOC) + class A + def inspect; '#'; end + def b; self; end + def c; true; end + end + + a = A.new + + a + .b + # aaa + .c + + (a) + &.b() + + + class A def b; self; end; def c; true; end; end; + a = A.new + a + .b + # aaa + .c + (a) + &.b() + EOC + close + assert_screen(<<~EOC) + start IRB + irb(main):001* class A + irb(main):002* def inspect; '#'; end + irb(main):003* def b; self; end + irb(main):004* def c; true; end + irb(main):005> end + => :c + irb(main):006> + irb(main):007> a = A.new + => # + irb(main):008> + irb(main):009> a + irb(main):010> .b + irb(main):011> # aaa + irb(main):012> .c + => true + irb(main):013> + irb(main):014> (a) + irb(main):015> &.b() + => # + irb(main):016> + irb(main):017> + irb(main):018> class A def b; self; end; def c; true; end; end; + irb(main):019> a = A.new + => # + irb(main):020> a + irb(main):021> .b + irb(main):022> # aaa + irb(main):023> .c + => true + irb(main):024> (a) + irb(main):025> &.b() + => # + irb(main):026> + EOC + end + + def test_symbol_with_backtick + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write(<<~EOC) + :` + EOC + close + assert_screen(<<~EOC) + start IRB + irb(main):001> :` + => :` + irb(main):002> + EOC + end + + def test_autocomplete_with_multiple_doc_namespaces + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(3, 50, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("{}.__id_") + write("\C-i") + close + screen = result.join("\n").sub(/\n*\z/, "\n") + # This assertion passes whether showdoc dialog completed or not. + assert_match(/start\ IRB\nirb\(main\):001> {}\.__id__\n }\.__id__(?:Press )?/, screen) + end + + def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right + rdoc_dir = File.join(@tmpdir, 'rdoc') + system("bundle exec rdoc -r -o #{rdoc_dir}") + write_irbrc <<~LINES + IRB.conf[:EXTRA_DOC_DIRS] = ['#{rdoc_dir}'] + IRB.conf[:PROMPT][:MY_PROMPT] = { + :PROMPT_I => "%03n> ", + :PROMPT_S => "%03n> ", + :PROMPT_C => "%03n> " + } + IRB.conf[:PROMPT_MODE] = :MY_PROMPT + puts 'start IRB' + LINES + start_terminal(4, 19, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("IR") + write("\C-i") + close + + # This is because on macOS we display different shortcut for displaying the full doc + # 'O' is for 'Option' and 'A' is for 'Alt' + if RUBY_PLATFORM =~ /darwin/ assert_screen(<<~EOC) start IRB - irb(main):001:1* class A - irb(main):002:1* def inspect; '#'; end - irb(main):003:1* def b; self; end - irb(main):004:1* def c; true; end - irb(main):005:0> end - => :c - irb(main):006:0> - irb(main):007:0> a = A.new - => # - irb(main):008:0> - irb(main):009:0> a - irb(main):010:0> .b - irb(main):011:0> # aaa - irb(main):012:0> .c - => true - irb(main):013:0> - irb(main):014:0> (a) - irb(main):015:0> &.b() - => # - irb(main):016:0> - irb(main):017:0> - irb(main):018:0> class A def b; self; end; def c; true; end; end; - => :c - irb(main):019:0> a = A.new - => # - irb(main):020:0> a - irb(main):021:0> .b - irb(main):022:0> # aaa - irb(main):023:0> .c - => true - irb(main):024:0> (a) - irb(main):025:0> &.b() - => # - irb(main):026:0> - EOC - end - - def test_symbol_with_backtick - write_irbrc <<~'LINES' - puts 'start IRB' - LINES - start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write(<<~EOC) - :` + 001> IRB + IRBPress Opti + IRB EOC - close + else assert_screen(<<~EOC) start IRB - irb(main):001:0> :` - => :` - irb(main):002:0> + 001> IRB + IRBPress Alt+ + IRB EOC end + end - def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right - pend "Needs a dummy document to show doc" - write_irbrc <<~'LINES' - IRB.conf[:PROMPT][:MY_PROMPT] = { - :PROMPT_I => "%03n> ", - :PROMPT_N => "%03n> ", - :PROMPT_S => "%03n> ", - :PROMPT_C => "%03n> " - } - IRB.conf[:PROMPT_MODE] = :MY_PROMPT - puts 'start IRB' - LINES - start_terminal(4, 19, %W{ruby -I/home/aycabta/ruby/reline/lib -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write("Str\C-i") - close - assert_screen(<<~EOC) - 001> String - StringPress A - StructString - of byte - EOC - end + def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left + rdoc_dir = File.join(@tmpdir, 'rdoc') + system("bundle exec rdoc -r -o #{rdoc_dir}") + write_irbrc <<~LINES + IRB.conf[:EXTRA_DOC_DIRS] = ['#{rdoc_dir}'] + IRB.conf[:PROMPT][:MY_PROMPT] = { + :PROMPT_I => "%03n> ", + :PROMPT_S => "%03n> ", + :PROMPT_C => "%03n> " + } + IRB.conf[:PROMPT_MODE] = :MY_PROMPT + puts 'start IRB' + LINES + start_terminal(4, 12, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("IR") + write("\C-i") + close + assert_screen(<<~EOC) + start IRB + 001> IRB + PressIRB + IRB + EOC + end - def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left - pend "Needs a dummy document to show doc" - write_irbrc <<~'LINES' - IRB.conf[:PROMPT][:MY_PROMPT] = { - :PROMPT_I => "%03n> ", - :PROMPT_N => "%03n> ", - :PROMPT_S => "%03n> ", - :PROMPT_C => "%03n> " - } - IRB.conf[:PROMPT_MODE] = :MY_PROMPT - puts 'start IRB' - LINES - start_terminal(4, 12, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - write("Str\C-i") - close - assert_screen(<<~EOC) - 001> String - PressString - StrinStruct - of by - EOC - end + def test_assignment_expression_truncate + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + # Assignment expression code that turns into non-assignment expression after evaluation + code = "a /'/i if false; a=1; x=1000.times.to_a#'.size" + write(code + "\n") + close + assert_screen(<<~EOC) + start IRB + irb(main):001> #{code} + => + [0, + ... + irb(main):002> + EOC + end - def test_assignment_expression_truncate - write_irbrc <<~'LINES' - puts 'start IRB' - LINES - start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - # Assignment expression code that turns into non-assignment expression after evaluation - code = "a /'/i if false; a=1; x=1000.times.to_a#'.size" - write(code + "\n") - close - assert_screen(<<~EOC) - start IRB - irb(main):001:0> #{code} - => - [0, - ... - irb(main):002:0> - EOC - end + def test_ctrl_c_is_handled + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + # Assignment expression code that turns into non-assignment expression after evaluation + write("\C-c") + close + assert_screen(<<~EOC) + start IRB + irb(main):001> + ^C + irb(main):001> + EOC + end - private + def test_show_cmds_with_pager_can_quit_with_ctrl_c + write_irbrc <<~'LINES' + puts 'start IRB' + LINES + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("help\n") + write("G") # move to the end of the screen + write("\C-c") # quit pager + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close - def write_irbrc(content) - File.open(@irbrc_file, 'w') do |f| - f.write content - end + screen = result.join("\n").sub(/\n*\z/, "\n") + # IRB::Abort should be rescued + assert_not_match(/IRB::Abort/, screen) + # IRB should resume + assert_match(/foobar/, screen) + end + + def test_pager_page_content_pages_output_when_it_does_not_fit_in_the_screen_because_of_total_length + write_irbrc <<~'LINES' + puts 'start IRB' + require "irb/pager" + LINES + start_terminal(10, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("IRB::Pager.page_content('a' * (80 * 8))\n") + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + assert_match(/a{80}/, screen) + # because pager is invoked, foobar will not be evaluated + assert_not_match(/foobar/, screen) + end + + def test_pager_page_content_pages_output_when_it_does_not_fit_in_the_screen_because_of_screen_height + write_irbrc <<~'LINES' + puts 'start IRB' + require "irb/pager" + LINES + start_terminal(10, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("IRB::Pager.page_content('a\n' * 8)\n") + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + assert_match(/(a\n){8}/, screen) + # because pager is invoked, foobar will not be evaluated + assert_not_match(/foobar/, screen) + end + + def test_pager_page_content_doesnt_page_output_when_it_fits_in_the_screen + write_irbrc <<~'LINES' + puts 'start IRB' + require "irb/pager" + LINES + start_terminal(10, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("IRB::Pager.page_content('a' * (80 * 7))\n") + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + assert_match(/a{80}/, screen) + # because pager is not invoked, foobar will be evaluated + assert_match(/foobar/, screen) + end + + def test_long_evaluation_output_is_paged + write_irbrc <<~'LINES' + puts 'start IRB' + require "irb/pager" + LINES + start_terminal(10, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("'a' * 80 * 11\n") + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + assert_match(/(a{80}\n){8}/, screen) + # because pager is invoked, foobar will not be evaluated + assert_not_match(/foobar/, screen) + end + + def test_long_evaluation_output_is_preserved_after_paging + write_irbrc <<~'LINES' + puts 'start IRB' + require "irb/pager" + LINES + start_terminal(10, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + write("'a' * 80 * 11\n") + write("q") # quit pager + write("'foo' + 'bar'\n") # eval something to make sure IRB resumes + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + # confirm pager has exited + assert_match(/foobar/, screen) + # confirm output is preserved + assert_match(/(a{80}\n){6}/, screen) + end + + def test_debug_integration_hints_debugger_commands + write_irbrc <<~'LINES' + IRB.conf[:USE_COLORIZE] = false + LINES + script = Tempfile.create(["debug", ".rb"]) + script.write <<~RUBY + puts 'start IRB' + binding.irb + RUBY + script.close + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{script.to_path}}, startup_message: 'start IRB') + write("debug\n") + write("pp 1\n") + write("pp 1") + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + # submitted input shouldn't contain hint + assert_include(screen, "irb:rdbg(main):002> pp 1\n") + # unsubmitted input should contain hint + assert_include(screen, "irb:rdbg(main):003> pp 1 # debug command\n") + ensure + File.unlink(script) if script + end + + def test_debug_integration_doesnt_hint_non_debugger_commands + write_irbrc <<~'LINES' + IRB.conf[:USE_COLORIZE] = false + LINES + script = Tempfile.create(["debug", ".rb"]) + script.write <<~RUBY + puts 'start IRB' + binding.irb + RUBY + script.close + start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{script.to_path}}, startup_message: 'start IRB') + write("debug\n") + write("foo") + close + + screen = result.join("\n").sub(/\n*\z/, "\n") + assert_include(screen, "irb:rdbg(main):002> foo\n") + ensure + File.unlink(script) if script + end + + private + + def write_irbrc(content) + File.open(@irbrc_file, 'w') do |f| + f.write content end end -rescue LoadError, NameError - # On Ruby repository, this test suit doesn't run because Ruby repo doesn't - # have the yamatanooroti gem. end diff --git a/test/mri/json/json_addition_test.rb b/test/mri/json/json_addition_test.rb index 614c7355679..3a7a58176a0 100644 --- a/test/mri/json/json_addition_test.rb +++ b/test/mri/json/json_addition_test.rb @@ -1,5 +1,5 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' require 'json/add/core' require 'json/add/complex' require 'json/add/rational' @@ -183,14 +183,14 @@ def test_rational_complex def test_bigdecimal assert_equal BigDecimal('3.141', 23), JSON(JSON(BigDecimal('3.141', 23)), :create_additions => true) assert_equal BigDecimal('3.141', 666), JSON(JSON(BigDecimal('3.141', 666)), :create_additions => true) - end + end if defined?(::BigDecimal) def test_ostruct o = OpenStruct.new # XXX this won't work; o.foo = { :bar => true } o.foo = { 'bar' => true } assert_equal o, parse(JSON(o), :create_additions => true) - end + end if defined?(::OpenStruct) def test_set s = Set.new([:a, :b, :c, :a]) diff --git a/test/mri/json/json_common_interface_test.rb b/test/mri/json/json_common_interface_test.rb index 9148b78c8ba..c16f6ceaaf9 100644 --- a/test/mri/json/json_common_interface_test.rb +++ b/test/mri/json/json_common_interface_test.rb @@ -1,5 +1,5 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' require 'stringio' require 'tempfile' @@ -99,18 +99,26 @@ def test_load_null def test_dump too_deep = '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]' - assert_equal too_deep, dump(eval(too_deep)) - assert_kind_of String, Marshal.dump(eval(too_deep)) - assert_raise(ArgumentError) { dump(eval(too_deep), 100) } - assert_raise(ArgumentError) { Marshal.dump(eval(too_deep), 100) } - assert_equal too_deep, dump(eval(too_deep), 101) - assert_kind_of String, Marshal.dump(eval(too_deep), 101) - output = StringIO.new - dump(eval(too_deep), output) - assert_equal too_deep, output.string - output = StringIO.new - dump(eval(too_deep), output, 101) - assert_equal too_deep, output.string + obj = eval(too_deep) + assert_equal too_deep, dump(obj) + assert_kind_of String, Marshal.dump(obj) + assert_raise(ArgumentError) { dump(obj, 100) } + assert_raise(ArgumentError) { Marshal.dump(obj, 100) } + assert_equal too_deep, dump(obj, 101) + assert_kind_of String, Marshal.dump(obj, 101) + + assert_equal too_deep, JSON.dump(obj, StringIO.new, 101, strict: false).string + assert_equal too_deep, dump(obj, StringIO.new, 101, strict: false).string + assert_raise(JSON::GeneratorError) { JSON.dump(Object.new, StringIO.new, 101, strict: true).string } + assert_raise(JSON::GeneratorError) { dump(Object.new, StringIO.new, 101, strict: true).string } + + assert_equal too_deep, dump(obj, nil, nil, strict: false) + assert_equal too_deep, dump(obj, nil, 101, strict: false) + assert_equal too_deep, dump(obj, StringIO.new, nil, strict: false).string + assert_equal too_deep, dump(obj, nil, strict: false) + assert_equal too_deep, dump(obj, 101, strict: false) + assert_equal too_deep, dump(obj, StringIO.new, strict: false).string + assert_equal too_deep, dump(obj, strict: false) end def test_dump_should_modify_defaults diff --git a/test/mri/json/json_encoding_test.rb b/test/mri/json/json_encoding_test.rb index cc7b71553a3..be87f3c3d60 100644 --- a/test/mri/json/json_encoding_test.rb +++ b/test/mri/json/json_encoding_test.rb @@ -1,6 +1,5 @@ -# encoding: utf-8 -#frozen_string_literal: false -require 'test_helper' +# frozen_string_literal: false +require_relative 'test_helper' class JSONEncodingTest < Test::Unit::TestCase include JSON @@ -86,9 +85,7 @@ def test_unicode def test_chars (0..0x7f).each do |i| json = '["\u%04x"]' % i - if RUBY_VERSION >= "1.9." - i = i.chr - end + i = i.chr assert_equal i, parse(json).first[0] if i == ?\b generated = generate(["" << i]) diff --git a/test/mri/json/json_ext_parser_test.rb b/test/mri/json/json_ext_parser_test.rb index c5a030ea8a7..f49f88b5966 100644 --- a/test/mri/json/json_ext_parser_test.rb +++ b/test/mri/json/json_ext_parser_test.rb @@ -1,8 +1,10 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' class JSONExtParserTest < Test::Unit::TestCase if defined?(JSON::Ext::Parser) + include JSON + def test_allocate parser = JSON::Ext::Parser.new("{}") assert_raise(TypeError, '[ruby-core:35079]') do @@ -11,5 +13,22 @@ def test_allocate parser = JSON::Ext::Parser.allocate assert_raise(TypeError, '[ruby-core:35079]') { parser.source } end + + def test_error_messages + ex = assert_raise(ParserError) { parse('Infinity') } + assert_equal "unexpected token at 'Infinity'", ex.message + + unless RUBY_PLATFORM =~ /java/ + ex = assert_raise(ParserError) { parse('-Infinity') } + assert_equal "unexpected token at '-Infinity'", ex.message + end + + ex = assert_raise(ParserError) { parse('NaN') } + assert_equal "unexpected token at 'NaN'", ex.message + end + + def parse(json) + JSON::Ext::Parser.new(json).parse + end end end diff --git a/test/mri/json/json_fixtures_test.rb b/test/mri/json/json_fixtures_test.rb index 845abb48673..acc87499654 100644 --- a/test/mri/json/json_fixtures_test.rb +++ b/test/mri/json/json_fixtures_test.rb @@ -1,5 +1,5 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' class JSONFixturesTest < Test::Unit::TestCase def setup diff --git a/test/mri/json/json_generator_test.rb b/test/mri/json/json_generator_test.rb old mode 100644 new mode 100755 index f31b6b290e5..526bb8c1feb --- a/test/mri/json/json_generator_test.rb +++ b/test/mri/json/json_generator_test.rb @@ -1,8 +1,7 @@ #!/usr/bin/env ruby -# encoding: utf-8 # frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' class JSONGeneratorTest < Test::Unit::TestCase include JSON @@ -62,6 +61,14 @@ def test_generate assert_equal '666', generate(666) end + def test_dump_unenclosed_hash + assert_equal '{"a":1,"b":2}', dump(a: 1, b: 2) + end + + def test_dump_strict + assert_equal '{}', dump({}, strict: true) + end + def test_generate_pretty json = pretty_generate({}) assert_equal(<<'EOT'.chomp, json) @@ -149,7 +156,8 @@ def test_pretty_state :ascii_only => false, :buffer_initial_length => 1024, :depth => 0, - :escape_slash => false, + :script_safe => false, + :strict => false, :indent => " ", :max_nesting => 100, :object_nl => "\n", @@ -166,7 +174,8 @@ def test_safe_state :ascii_only => false, :buffer_initial_length => 1024, :depth => 0, - :escape_slash => false, + :script_safe => false, + :strict => false, :indent => "", :max_nesting => 100, :object_nl => "", @@ -183,7 +192,8 @@ def test_fast_state :ascii_only => false, :buffer_initial_length => 1024, :depth => 0, - :escape_slash => false, + :script_safe => false, + :strict => false, :indent => "", :max_nesting => 0, :object_nl => "", @@ -233,7 +243,7 @@ def test_buffer_initial_length def test_gc if respond_to?(:assert_in_out_err) && !(RUBY_PLATFORM =~ /java/) - assert_in_out_err(%w[-rjson --disable-gems], <<-EOS, [], []) + assert_in_out_err(%w[-rjson], <<-EOS, [], []) bignum_too_long_to_embed_as_string = 1234567890123456789012345 expect = bignum_too_long_to_embed_as_string.to_s GC.stress = true @@ -336,7 +346,13 @@ def test_hash_likeness_set_string def test_json_generate assert_raise JSON::GeneratorError do - assert_equal true, generate(["\xea"]) + generate(["\xea"]) + end + end + + def test_json_generate_unsupported_types + assert_raise JSON::GeneratorError do + generate(Object.new, strict: true) end end @@ -370,6 +386,18 @@ def test_backslash # data = [ '/' ] json = '["\/"]' + assert_equal json, generate(data, :script_safe => true) + # + data = [ "\u2028\u2029" ] + json = '["\u2028\u2029"]' + assert_equal json, generate(data, :script_safe => true) + # + data = [ "ABC \u2028 DEF \u2029 GHI" ] + json = '["ABC \u2028 DEF \u2029 GHI"]' + assert_equal json, generate(data, :script_safe => true) + # + data = [ "/\u2028\u2029" ] + json = '["\/\u2028\u2029"]' assert_equal json, generate(data, :escape_slash => true) # data = ['"'] @@ -391,6 +419,31 @@ def to_s; self; end end end + if defined?(JSON::Ext::Generator) and RUBY_PLATFORM != "java" + def test_string_ext_included_calls_super + included = false + + Module.send(:alias_method, :included_orig, :included) + Module.send(:remove_method, :included) + Module.send(:define_method, :included) do |base| + included_orig(base) + included = true + end + + Class.new(String) do + include JSON::Ext::Generator::GeneratorMethods::String + end + + assert included + ensure + if Module.private_method_defined?(:included_orig) + Module.send(:remove_method, :included) if Module.method_defined?(:included) + Module.send(:alias_method, :included, :included_orig) + Module.send(:remove_method, :included_orig) + end + end + end + if defined?(Encoding) def test_nonutf8_encoding assert_equal("\"5\u{b0}\"", "5\xb0".force_encoding("iso-8859-1").to_json) diff --git a/test/mri/json/json_generic_object_test.rb b/test/mri/json/json_generic_object_test.rb index 82742dcd638..d6d7e308166 100644 --- a/test/mri/json/json_generic_object_test.rb +++ b/test/mri/json/json_generic_object_test.rb @@ -1,5 +1,5 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' class JSONGenericObjectTest < Test::Unit::TestCase include JSON @@ -79,4 +79,4 @@ def switch_json_creatable ensure JSON::GenericObject.json_creatable = false end -end +end if defined?(JSON::GenericObject) diff --git a/test/mri/json/json_parser_test.rb b/test/mri/json/json_parser_test.rb index 146ff7c0477..49c7c8565db 100644 --- a/test/mri/json/json_parser_test.rb +++ b/test/mri/json/json_parser_test.rb @@ -1,10 +1,16 @@ # encoding: utf-8 # frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' require 'stringio' require 'tempfile' -require 'ostruct' -require 'bigdecimal' +begin + require 'ostruct' +rescue LoadError +end +begin + require 'bigdecimal' +rescue LoadError +end class JSONParserTest < Test::Unit::TestCase include JSON @@ -21,6 +27,9 @@ def test_argument_encoding end if defined?(Encoding::UTF_16) def test_error_message_encoding + # https://github.com/flori/json/actions/runs/6478148162/job/17589572890 + pend if RUBY_ENGINE == 'truffleruby' + bug10705 = '[ruby-core:67386] [Bug #10705]' json = ".\"\xE2\x88\x9A\"".force_encoding(Encoding::UTF_8) e = assert_raise(JSON::ParserError) { @@ -113,7 +122,7 @@ def test_parse_numbers def test_parse_bigdecimals assert_equal(BigDecimal, JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"].class) assert_equal(BigDecimal("0.901234567890123456789E1"),JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"] ) - end + end if defined?(::BigDecimal) def test_parse_string_mixed_unicode assert_equal(["éé"], JSON.parse("[\"\\u00e9é\"]")) @@ -406,21 +415,6 @@ def self.json_create(o) end end - class SubOpenStruct < OpenStruct - def [](k) - __send__(k) - end - - def []=(k, v) - @item_set = true - __send__("#{k}=", v) - end - - def item_set? - @item_set - end - end - def test_parse_object_custom_hash_derived_class res = parse('{"foo":"bar"}', :object_class => SubHash) assert_equal({"foo" => "bar"}, res) @@ -428,24 +422,41 @@ def test_parse_object_custom_hash_derived_class assert res.item_set? end - def test_parse_object_custom_non_hash_derived_class - res = parse('{"foo":"bar"}', :object_class => SubOpenStruct) - assert_equal "bar", res.foo - assert_equal(SubOpenStruct, res.class) - assert res.item_set? - end + if defined?(::OpenStruct) + class SubOpenStruct < OpenStruct + def [](k) + __send__(k) + end - def test_parse_generic_object - res = parse( - '{"foo":"bar", "baz":{}}', - :object_class => JSON::GenericObject - ) - assert_equal(JSON::GenericObject, res.class) - assert_equal "bar", res.foo - assert_equal "bar", res["foo"] - assert_equal "bar", res[:foo] - assert_equal "bar", res.to_hash[:foo] - assert_equal(JSON::GenericObject, res.baz.class) + def []=(k, v) + @item_set = true + __send__("#{k}=", v) + end + + def item_set? + @item_set + end + end + + def test_parse_object_custom_non_hash_derived_class + res = parse('{"foo":"bar"}', :object_class => SubOpenStruct) + assert_equal "bar", res.foo + assert_equal(SubOpenStruct, res.class) + assert res.item_set? + end + + def test_parse_generic_object + res = parse( + '{"foo":"bar", "baz":{}}', + :object_class => JSON::GenericObject + ) + assert_equal(JSON::GenericObject, res.class) + assert_equal "bar", res.foo + assert_equal "bar", res["foo"] + assert_equal "bar", res[:foo] + assert_equal "bar", res.to_hash[:foo] + assert_equal(JSON::GenericObject, res.baz.class) + end end def test_generate_core_subclasses_with_new_to_json diff --git a/test/mri/json/json_string_matching_test.rb b/test/mri/json/json_string_matching_test.rb index 5d55dc31b0c..b9cf904aaaf 100644 --- a/test/mri/json/json_string_matching_test.rb +++ b/test/mri/json/json_string_matching_test.rb @@ -1,5 +1,5 @@ #frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' require 'time' class JSONStringMatchingTest < Test::Unit::TestCase diff --git a/test/mri/json/ractor_test.rb b/test/mri/json/ractor_test.rb index 71105e55ecd..ba9bf7a7f6d 100644 --- a/test/mri/json/ractor_test.rb +++ b/test/mri/json/ractor_test.rb @@ -1,7 +1,11 @@ -# encoding: utf-8 # frozen_string_literal: false -require 'test_helper' +require_relative 'test_helper' + +begin + require_relative './lib/helper' +rescue LoadError +end class JSONInRactorTest < Test::Unit::TestCase def test_generate diff --git a/test/mri/lib/!Nothing_to_test.rb b/test/mri/lib/!Nothing_to_test.rb new file mode 100644 index 00000000000..c1f4c439d32 --- /dev/null +++ b/test/mri/lib/!Nothing_to_test.rb @@ -0,0 +1,5 @@ +### Empty test file for chkbuild ### + +# If chkbuild fails with `test-all`, each child file/directory is +# executed individually, but test-unit fails if there are no test +# files in the specified directory. diff --git a/test/mri/lib/jit_support.rb b/test/mri/lib/jit_support.rb index 812c13b9251..cf3baaaeb75 100644 --- a/test/mri/lib/jit_support.rb +++ b/test/mri/lib/jit_support.rb @@ -1,72 +1,7 @@ require 'rbconfig' module JITSupport - JIT_TIMEOUT = 600 # 10min for each... - JIT_SUCCESS_PREFIX = 'JIT success' - JIT_RECOMPILE_PREFIX = 'JIT recompile' - JIT_COMPACTION_PREFIX = 'JIT compaction \(\d+\.\dms\)' - UNSUPPORTED_COMPILERS = [ - %r[\A.*/bin/intel64/icc\b], - %r[\A/opt/developerstudio\d+\.\d+/bin/cc\z], - ] - UNSUPPORTED_ARCHITECTURES = [ - 's390x', - 'sparc', - ] - # debian-riscv64: "gcc: internal compiler error: Segmentation fault signal terminated program cc1" https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20200420T083601Z.fail.html.gz - # freebsd12: cc1 internal failure https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20200306T103003Z.fail.html.gz - # rhel8: one or more PCH files were found, but they were invalid https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20200306T153003Z.fail.html.gz - # centos8: ditto https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos8/ruby-master/log/20200512T003004Z.fail.html.gz - PENDING_RUBYCI_NICKNAMES = %w[ - debian-riscv64 - freebsd12 - rhel8 - centos8 - ] - module_function - # Run Ruby script with --mjit-wait (Synchronous JIT compilation). - # Returns [stdout, stderr] - def eval_with_jit(env = nil, script, **opts) - stdout, stderr = nil, nil - # retry 3 times while cc1 error happens. - 3.times do |i| - stdout, stderr, status = eval_with_jit_without_retry(env, script, **opts) - assert_equal(true, status.success?, "Failed to run script with JIT:\n#{code_block(script)}\nstdout:\n#{code_block(stdout)}\nstderr:\n#{code_block(stderr)}") - break unless retried_stderr?(stderr) - end - [stdout, stderr] - end - - def eval_with_jit_without_retry(env = nil, script, verbose: 0, call_threshold: 5, save_temps: false, max_cache: 1000, wait: true, timeout: JIT_TIMEOUT) - args = [ - '--disable-gems', "--mjit-verbose=#{verbose}", - "--mjit-call-threshold=#{call_threshold}", "--mjit-max-cache=#{max_cache}", - ] - args << '--disable-yjit' - args << '--mjit-wait' if wait - args << '--mjit-save-temps' if save_temps - args << '--mjit-debug' if defined?(@mjit_debug) && @mjit_debug - args << '-e' << script - base_env = { 'MJIT_SEARCH_BUILD_DIR' => 'true' } # workaround to skip requiring `make install` for `make test-all` - if preloadenv = RbConfig::CONFIG['PRELOADENV'] and !preloadenv.empty? - so = "mjit_build_dir.#{RbConfig::CONFIG['SOEXT']}" - base_env[preloadenv] = File.realpath(so) rescue nil - end - args.unshift(env ? base_env.merge!(env) : base_env) - EnvUtil.invoke_ruby(args, - '', true, true, timeout: timeout, - ) - end - - # For MJIT - def supported? - return @supported if defined?(@supported) - @supported = RbConfig::CONFIG["MJIT_SUPPORT"] != 'no' && - UNSUPPORTED_COMPILERS.all? { |regexp| !regexp.match?(RbConfig::CONFIG['MJIT_CC']) } && - !PENDING_RUBYCI_NICKNAMES.include?(ENV['RUBYCI_NICKNAME']) && - !UNSUPPORTED_ARCHITECTURES.include?(RUBY_PLATFORM.split('-', 2).first) - end def yjit_supported? return @yjit_supported if defined?(@yjit_supported) @@ -74,25 +9,25 @@ def yjit_supported? @yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT']) end - def remove_mjit_logs(stderr) - if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # utility for -DFORCE_MJIT_ENABLE - stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '') - else - stderr - end + def yjit_enabled? + defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled? + end + + def yjit_force_enabled? + "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/) end - def code_block(code) - %Q["""\n#{code}\n"""\n\n] + def rjit_supported? + return @rjit_supported if defined?(@rjit_supported) + # nil in mswin + @rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT']) end - # We're retrying cc1 not found error on gcc, which should be solved in the future but ignored for now. - def retried_stderr?(stderr) - RbConfig::CONFIG['CC'].start_with?('gcc') && - stderr.include?("error trying to exec 'cc1': execvp: No such file or directory") + def rjit_enabled? + defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? end - def mjit_force_enabled? - "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?MJIT_FORCE_ENABLE\b/) + def rjit_force_enabled? + "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/) end end diff --git a/test/mri/logger/test_severity.rb b/test/mri/logger/test_severity.rb index dad63472a6f..e1069c8262a 100644 --- a/test/mri/logger/test_severity.rb +++ b/test/mri/logger/test_severity.rb @@ -3,6 +3,8 @@ require 'logger' class TestLoggerSeverity < Test::Unit::TestCase + include Logger::Severity + def test_enum logger_levels = Logger.constants levels = ["WARN", "UNKNOWN", "INFO", "FATAL", "DEBUG", "ERROR"] @@ -23,4 +25,34 @@ def test_level_assignment assert(logger.level) == Logger::Severity.const_get(level) end end + + def test_thread_local_level + logger = Logger.new(nil) + logger.level = INFO # default level + other = Logger.new(nil) + other.level = ERROR # default level + + assert_equal(other.level, ERROR) + logger.with_level(:WARN) do + assert_equal(other.level, ERROR) + assert_equal(logger.level, WARN) + + logger.with_level(DEBUG) do # verify reentrancy + assert_equal(logger.level, DEBUG) + + Thread.new do + assert_equal(logger.level, INFO) + logger.with_level(:WARN) do + assert_equal(other.level, ERROR) + assert_equal(logger.level, WARN) + end + assert_equal(logger.level, INFO) + end.join + + assert_equal(logger.level, DEBUG) + end + assert_equal(logger.level, WARN) + end + assert_equal(logger.level, INFO) + end end diff --git a/test/mri/mkmf/base.rb b/test/mri/mkmf/base.rb index ec42bca100b..7df07c16a6d 100644 --- a/test/mri/mkmf/base.rb +++ b/test/mri/mkmf/base.rb @@ -147,7 +147,10 @@ def config_value(name) include Base - def assert_separately(args, src, *rest, **options) - super(args + ["-r#{__FILE__}"], "extend TestMkmf::Base; setup\nEND{teardown}\n#{src}", *rest, **options) + def assert_separately(args, extra_args, src, *rest, **options) + super(args + ["-r#{__FILE__}"] + %w[- --] + extra_args, + "extend TestMkmf::Base; setup\nEND{teardown}\n#{src}", + *rest, + **options) end end diff --git a/test/mri/mkmf/test_config.rb b/test/mri/mkmf/test_config.rb index 93ebe3a4ea2..7211c61d53e 100644 --- a/test/mri/mkmf/test_config.rb +++ b/test/mri/mkmf/test_config.rb @@ -1,15 +1,30 @@ # frozen_string_literal: false -$extmk = true +require_relative 'base' -require 'test/unit' -require 'mkmf' - -class TestMkmfConfig < Test::Unit::TestCase +class TestMkmfConfig < TestMkmf def test_dir_config bug8074 = '[Bug #8074]' lib = RbConfig.expand(RbConfig::MAKEFILE_CONFIG["libdir"], "exec_prefix"=>"/test/foo") - assert_separately %w[-rmkmf - -- --with-foo-dir=/test/foo], %{ + assert_separately([], %w[--with-foo-dir=/test/foo], <<-"end;") assert_equal(%w[/test/foo/include #{lib}], dir_config("foo"), #{bug8074.dump}) - } + end; + end + + def test_with_config_with_arg_and_value + assert_separately([], %w[--with-foo=bar], <<-'end;') + assert_equal("bar", with_config("foo")) + end; + end + + def test_with_config_with_arg_and_no_value + assert_separately([], %w[--with-foo], <<-'end;') + assert_equal(true, with_config("foo")) + end; + end + + def test_with_config_without_arg + assert_separately([], %w[--without-foo], <<-'end;') + assert_equal(false, with_config("foo")) + end; end end diff --git a/test/mri/mkmf/test_configuration.rb b/test/mri/mkmf/test_configuration.rb new file mode 100644 index 00000000000..0261f78a01e --- /dev/null +++ b/test/mri/mkmf/test_configuration.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: false +require_relative 'base' + +class TestMkmfConfiguration < TestMkmf + def test_verbose_with_rbconfig_verbose_disabled + makefile = mkmf do + self.class::CONFIG['MKMF_VERBOSE'] = "0" + init_mkmf(self.class::CONFIG) + configuration '.' + end + verbose = makefile.grep(/^V =/).first[/^V = (.)$/, 1] + + assert_equal "0", verbose + end + + def test_verbose_with_rbconfig_verbose_enabled + makefile = mkmf do + self.class::CONFIG['MKMF_VERBOSE'] = "1" + init_mkmf(self.class::CONFIG) + configuration '.' + end + verbose = makefile.grep(/^V =/).first[/^V = (.)$/, 1] + + assert_equal "1", verbose + end + + def test_verbose_with_arg + assert_separately([], %w[--with-verbose], <<-'end;') + makefile = mkmf do + self.class::CONFIG['MKMF_VERBOSE'] = "0" + init_mkmf(self.class::CONFIG) + configuration '.' + end + verbose = makefile.grep(/^V =/).first[/^V = (.)$/, 1] + + assert_equal "1", verbose + end; + end +end diff --git a/test/mri/mkmf/test_flags.rb b/test/mri/mkmf/test_flags.rb index aedf06b6103..6fde46adecb 100644 --- a/test/mri/mkmf/test_flags.rb +++ b/test/mri/mkmf/test_flags.rb @@ -33,21 +33,21 @@ def test_valid_warnflags end def test_try_ldflag_invalid_opt - assert_separately([], <<-'end;') #do + assert_separately([], [], <<-'end;') #do assert(!try_ldflags("nosuch.c"), TestMkmf::MKMFLOG) assert(have_devel?, TestMkmf::MKMFLOG) end; end def test_try_cflag_invalid_opt - assert_separately([], <<-'end;', timeout: 30) #do + assert_separately([], [], <<-'end;', timeout: 30) #do assert(!try_cflags("nosuch.c"), TestMkmf::MKMFLOG) assert(have_devel?, TestMkmf::MKMFLOG) end; end def test_try_cppflag_invalid_opt - assert_separately([], <<-'end;') #do + assert_separately([], [], <<-'end;') #do assert(!try_cppflags("nosuch.c"), TestMkmf::MKMFLOG) assert(have_devel?, TestMkmf::MKMFLOG) end; diff --git a/test/mri/monitor/test_monitor.rb b/test/mri/monitor/test_monitor.rb index 8ff6d006df7..4c55afca6c8 100644 --- a/test/mri/monitor/test_monitor.rb +++ b/test/mri/monitor/test_monitor.rb @@ -300,6 +300,8 @@ def test_timedwait result4 = cond.wait assert_equal(true, result4) assert_equal("bar", c) + ensure + queue3.enq(nil) end end assert_join_threads([th, th2]) diff --git a/test/mri/net/http/test_http.rb b/test/mri/net/http/test_http.rb index 0508645ac55..f0f1bc2d8f5 100644 --- a/test/mri/net/http/test_http.rb +++ b/test/mri/net/http/test_http.rb @@ -126,10 +126,10 @@ def test_proxy_address def test_proxy_address_no_proxy TestNetHTTPUtils.clean_http_proxy_env do - http = Net::HTTP.new 'hostname.example', nil, 'proxy.example', nil, nil, nil, 'example' + http = Net::HTTP.new 'hostname.example', nil, 'proxy.com', nil, nil, nil, 'example' assert_nil http.proxy_address - http = Net::HTTP.new '10.224.1.1', nil, 'proxy.example', nil, nil, nil, 'example,10.224.0.0/22' + http = Net::HTTP.new '10.224.1.1', nil, 'proxy.com', nil, nil, nil, 'example,10.224.0.0/22' assert_nil http.proxy_address end end @@ -1234,6 +1234,16 @@ def test_http_retry_failed } end + def test_http_retry_failed_with_block + start {|http| + http.max_retries = 10 + called = 0 + assert_raise(Errno::ECONNRESET){ http.get('/'){called += 1; raise Errno::ECONNRESET} } + assert_equal 1, called + } + @log_tester = nil + end + def test_keep_alive_server_close def @server.run(sock) sock.close diff --git a/test/mri/net/http/test_httpresponse.rb b/test/mri/net/http/test_httpresponse.rb index 394b4c5bfa1..01281063cda 100644 --- a/test/mri/net/http/test_httpresponse.rb +++ b/test/mri/net/http/test_httpresponse.rb @@ -312,8 +312,8 @@ def test_read_body_block end def test_read_body_block_mod - # http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3019353 - if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? + # http://ci.rvm.jp/results/trunk-rjit-wait@silicon-docker/3019353 + if defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? omit 'too unstable with --jit-wait, and extending read_timeout did not help it' end IO.pipe do |r, w| @@ -589,6 +589,41 @@ def test_read_body_string assert_equal 'hello', body end + def test_read_body_receiving_no_body + io = dummy_io(< 1) + assert_includes output.grep(/"imemo_type":"callinfo"/).join("\n"), '"mid":"baz"' + end + end + def test_dump_string_coderange assert_includes ObjectSpace.dump("TEST STRING"), '"coderange":"7bit"' - unknown = "TEST STRING".dup.force_encoding(Encoding::BINARY) + unknown = "TEST STRING".dup.force_encoding(Encoding::UTF_16BE) 2.times do # ensure that dumping the string doesn't mutate it assert_includes ObjectSpace.dump(unknown), '"coderange":"unknown"' end @@ -580,15 +648,32 @@ def assert_test_string_entry_correct_in_dump_all(output) # This test makes assertions on the assignment to `str`, so we look for # the second appearance of /TEST STRING/ in the output test_string_in_dump_all = output.grep(/TEST2/) - assert_equal(2, test_string_in_dump_all.size, "number of strings") - entry_hash = JSON.parse(test_string_in_dump_all[1]) + begin + assert_equal(2, test_string_in_dump_all.size, "number of strings") + rescue Test::Unit::AssertionFailedError => e + STDERR.puts e.inspect + STDERR.puts test_string_in_dump_all + if test_string_in_dump_all.size == 3 + STDERR.puts "This test is skipped because it seems hard to fix." + else + raise + end + end + + strs = test_string_in_dump_all.reject do |s| + s.include?("fstring") + end + + assert_equal(1, strs.length) + + entry_hash = JSON.parse(strs[0]) assert_equal(5, entry_hash["bytesize"], "bytesize is wrong") assert_equal("TEST2", entry_hash["value"], "value is wrong") assert_equal("UTF-8", entry_hash["encoding"], "encoding is wrong") assert_equal("-", entry_hash["file"], "file is wrong") - assert_equal(4, entry_hash["line"], "line is wrong") + assert_equal(5, entry_hash["line"], "line is wrong") assert_equal("dump_my_heap_please", entry_hash["method"], "method is wrong") assert_not_nil(entry_hash["generation"]) end @@ -597,6 +682,7 @@ def test_dump_all opts = %w[--disable-gem --disable=frozen-string-literal -robjspace] assert_in_out_err(opts, "#{<<-"begin;"}#{<<-'end;'}") do |output, error| + # frozen_string_literal: false begin; def dump_my_heap_please ObjectSpace.trace_object_allocations_start @@ -613,6 +699,7 @@ def dump_my_heap_please assert_in_out_err(%w[-robjspace], "#{<<-"begin;"}#{<<-'end;'}") do |(output), (error)| begin; + # frozen_string_literal: false def dump_my_heap_please ObjectSpace.trace_object_allocations_start GC.start @@ -743,6 +830,7 @@ def test_anonymous_class_name def test_objspace_trace assert_in_out_err(%w[-robjspace/trace], "#{<<-"begin;"}\n#{<<-'end;'}") do |out, err| begin; + # frozen_string_literal: false a = "foo" b = "b" + "a" + "r" c = 42 @@ -750,8 +838,8 @@ def test_objspace_trace end; assert_equal ["objspace/trace is enabled"], err assert_equal 3, out.size - assert_equal '"foo" @ -:2', out[0] - assert_equal '"bar" @ -:3', out[1] + assert_equal '"foo" @ -:3', out[0] + assert_equal '"bar" @ -:4', out[1] assert_equal '42', out[2] end end diff --git a/test/mri/objspace/test_ractor.rb b/test/mri/objspace/test_ractor.rb new file mode 100644 index 00000000000..b7008ea7314 --- /dev/null +++ b/test/mri/objspace/test_ractor.rb @@ -0,0 +1,17 @@ +require "test/unit" + +class TestObjSpaceRactor < Test::Unit::TestCase + def test_tracing_does_not_crash + assert_ractor(<<~RUBY, require: 'objspace') + ObjectSpace.trace_object_allocations do + r = Ractor.new do + obj = 'a' * 1024 + Ractor.yield obj + end + + r.take + r.take + end + RUBY + end +end diff --git a/test/mri/open-uri/test_open-uri.rb b/test/mri/open-uri/test_open-uri.rb index fdd1969666f..30e3b5c9c1e 100644 --- a/test/mri/open-uri/test_open-uri.rb +++ b/test/mri/open-uri/test_open-uri.rb @@ -172,6 +172,19 @@ def test_invalid_option assert_raise(ArgumentError) { URI.open("http://127.0.0.1/", :invalid_option=>true) {} } end + def test_pass_keywords + begin + f = URI.open(File::NULL, mode: 0666) + assert_kind_of File, f + ensure + f&.close + end + + o = Object.new + def o.open(foo: ) foo end + assert_equal 1, URI.open(o, foo: 1) + end + def test_mode with_http {|srv, dr, url| srv.mount_proc("/mode", lambda { |req, res| res.body = "mode" } ) @@ -545,6 +558,25 @@ def test_redirect_auth_failure_r1 } end + def test_max_redirects_success + with_http {|srv, dr, url| + srv.mount_proc("/r1/") {|req, res| res.status = 301; res["location"] = "#{url}/r2"; res.body = "r1" } + srv.mount_proc("/r2/") {|req, res| res.status = 301; res["location"] = "#{url}/r3"; res.body = "r2" } + srv.mount_proc("/r3/") {|req, res| res.body = "r3" } + URI.open("#{url}/r1/", max_redirects: 2) { |f| assert_equal("r3", f.read) } + } + end + + def test_max_redirects_too_many + with_http {|srv, dr, url| + srv.mount_proc("/r1/") {|req, res| res.status = 301; res["location"] = "#{url}/r2"; res.body = "r1" } + srv.mount_proc("/r2/") {|req, res| res.status = 301; res["location"] = "#{url}/r3"; res.body = "r2" } + srv.mount_proc("/r3/") {|req, res| res.body = "r3" } + exc = assert_raise(OpenURI::TooManyRedirects) { URI.open("#{url}/r1/", max_redirects: 1) {} } + assert_equal("Too many redirects", exc.message) + } + end + def test_userinfo assert_raise(ArgumentError) { URI.open("http://user:pass@127.0.0.1/") {} } end diff --git a/test/mri/openssl/fixtures/pkey/dh1024.pem b/test/mri/openssl/fixtures/pkey/dh1024.pem deleted file mode 100644 index f99c757f21a..00000000000 --- a/test/mri/openssl/fixtures/pkey/dh1024.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN DH PARAMETERS----- -MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0 -pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG -AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC ------END DH PARAMETERS----- diff --git a/test/mri/openssl/fixtures/pkey/dh2048_ffdhe2048.pem b/test/mri/openssl/fixtures/pkey/dh2048_ffdhe2048.pem new file mode 100644 index 00000000000..9b182b7201f --- /dev/null +++ b/test/mri/openssl/fixtures/pkey/dh2048_ffdhe2048.pem @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz ++8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a +87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 +YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi +7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD +ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== +-----END DH PARAMETERS----- diff --git a/test/mri/openssl/test_asn1.rb b/test/mri/openssl/test_asn1.rb index 6eb45094a2e..7b1722e5dfe 100644 --- a/test/mri/openssl/test_asn1.rb +++ b/test/mri/openssl/test_asn1.rb @@ -406,10 +406,6 @@ def test_utctime rescue OpenSSL::ASN1::ASN1Error pend "No negative time_t support?" end - # Seconds is omitted. LibreSSL 3.6.0 requires it - return if libressl? - decode_test B(%w{ 17 0B }) + "1609082343Z".b, - OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0)) # not implemented # decode_test B(%w{ 17 11 }) + "500908234339+0930".b, # OpenSSL::ASN1::UTCTime.new(Time.new(1950, 9, 8, 23, 43, 39, "+09:30")) @@ -428,10 +424,6 @@ def test_generalizedtime OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 29)) encode_decode_test B(%w{ 18 0F }) + "99990908234339Z".b, OpenSSL::ASN1::GeneralizedTime.new(Time.utc(9999, 9, 8, 23, 43, 39)) - # LibreSSL 3.6.0 requires the seconds element - return if libressl? - decode_test B(%w{ 18 0D }) + "201612081934Z".b, - OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 0)) # not implemented # decode_test B(%w{ 18 13 }) + "20161208193439+0930".b, # OpenSSL::ASN1::GeneralizedTime.new(Time.new(2016, 12, 8, 19, 34, 39, "+09:30")) diff --git a/test/mri/openssl/test_bn.rb b/test/mri/openssl/test_bn.rb index 77af14091e3..ea88ff06ce3 100644 --- a/test/mri/openssl/test_bn.rb +++ b/test/mri/openssl/test_bn.rb @@ -175,7 +175,9 @@ def test_mod_sqr end def test_mod_sqrt - assert_equal(3, 4.to_bn.mod_sqrt(5)) + assert_equal(4, 4.to_bn.mod_sqrt(5).mod_sqr(5)) + # One of 189484 or 326277 is returned as a square root of 2 (mod 515761). + assert_equal(2, 2.to_bn.mod_sqrt(515761).mod_sqr(515761)) assert_equal(0, 5.to_bn.mod_sqrt(5)) assert_raise(OpenSSL::BNError) { 3.to_bn.mod_sqrt(5) } end diff --git a/test/mri/openssl/test_cipher.rb b/test/mri/openssl/test_cipher.rb index 1c8610b2a9b..8faa5706487 100644 --- a/test/mri/openssl/test_cipher.rb +++ b/test/mri/openssl/test_cipher.rb @@ -205,7 +205,7 @@ def test_aes_ccm assert_raise(OpenSSL::Cipher::CipherError) { cipher.update(ct2) } end if has_cipher?("aes-128-ccm") && OpenSSL::Cipher.new("aes-128-ccm").authenticated? && - OpenSSL::OPENSSL_VERSION_NUMBER >= 0x1010103f # version >= 1.1.1c + openssl?(1, 1, 1, 0x03, 0xf) # version >= 1.1.1c def test_aes_gcm # GCM spec Appendix B Test Case 4 diff --git a/test/mri/openssl/test_config.rb b/test/mri/openssl/test_config.rb index 24a215a4867..6dbb9c61388 100644 --- a/test/mri/openssl/test_config.rb +++ b/test/mri/openssl/test_config.rb @@ -91,22 +91,19 @@ def test_s_parse_format assert_equal('123baz456bar798', c['dollar']['qux']) assert_equal('123baz456bar798.123baz456bar798', c['dollar']['quxx']) - excn = assert_raise(OpenSSL::ConfigError) do + assert_raise_with_message(OpenSSL::ConfigError, /error in line 1: variable has no value/) do OpenSSL::Config.parse("foo = $bar") end - assert_equal("error in line 1: variable has no value", excn.message) - excn = assert_raise(OpenSSL::ConfigError) do + assert_raise_with_message(OpenSSL::ConfigError, /error in line 1: no close brace/) do OpenSSL::Config.parse("foo = $(bar") end - assert_equal("error in line 1: no close brace", excn.message) - excn = assert_raise(OpenSSL::ConfigError) do + assert_raise_with_message(OpenSSL::ConfigError, /error in line 1: missing equal sign/) do OpenSSL::Config.parse("f o =b ar # no space in key") end - assert_equal("error in line 1: missing equal sign", excn.message) - excn = assert_raise(OpenSSL::ConfigError) do + assert_raise_with_message(OpenSSL::ConfigError, /error in line 7: missing close square bracket/) do OpenSSL::Config.parse(<<__EOC__) # comment 1 # comments @@ -117,7 +114,6 @@ def test_s_parse_format [third # section not terminated __EOC__ end - assert_equal("error in line 7: missing close square bracket", excn.message) end def test_s_parse_include diff --git a/test/mri/openssl/test_digest.rb b/test/mri/openssl/test_digest.rb index 84c128c12ff..b0b5b9bed1e 100644 --- a/test/mri/openssl/test_digest.rb +++ b/test/mri/openssl/test_digest.rb @@ -67,7 +67,7 @@ def test_digest_by_oid_and_name end def encode16(str) - str.unpack("H*").first + str.unpack1("H*") end def test_sha2 diff --git a/test/mri/openssl/test_engine.rb b/test/mri/openssl/test_engine.rb index 1ede6ed086d..b6025f915b1 100644 --- a/test/mri/openssl/test_engine.rb +++ b/test/mri/openssl/test_engine.rb @@ -26,7 +26,7 @@ def test_openssl_engine_by_id_string with_openssl <<-'end;' orig = OpenSSL::Engine.engines pend "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" } - engine = get_engine + engine = OpenSSL::Engine.by_id("openssl") assert_not_nil(engine) assert_equal(1, OpenSSL::Engine.engines.size - orig.size) end; @@ -34,7 +34,7 @@ def test_openssl_engine_by_id_string def test_openssl_engine_id_name_inspect with_openssl <<-'end;' - engine = get_engine + engine = OpenSSL::Engine.by_id("openssl") assert_equal("openssl", engine.id) assert_not_nil(engine.name) assert_not_nil(engine.inspect) @@ -43,7 +43,7 @@ def test_openssl_engine_id_name_inspect def test_openssl_engine_digest_sha1 with_openssl <<-'end;' - engine = get_engine + engine = OpenSSL::Engine.by_id("openssl") digest = engine.digest("SHA1") assert_not_nil(digest) data = "test" @@ -59,12 +59,21 @@ def test_openssl_engine_cipher_rc4 end with_openssl(<<-'end;', ignore_stderr: true) - engine = get_engine + engine = OpenSSL::Engine.by_id("openssl") algo = "RC4" data = "a" * 1000 key = OpenSSL::Random.random_bytes(16) - encrypted = crypt_data(data, key, :encrypt) { engine.cipher(algo) } - decrypted = crypt_data(encrypted, key, :decrypt) { OpenSSL::Cipher.new(algo) } + + cipher = engine.cipher(algo) + cipher.encrypt + cipher.key = key + encrypted = cipher.update(data) + cipher.final + + cipher = OpenSSL::Cipher.new(algo) + cipher.decrypt + cipher.key = key + decrypted = cipher.update(encrypted) + cipher.final + assert_equal(data, decrypted) end; end @@ -73,25 +82,10 @@ def test_openssl_engine_cipher_rc4 # this is required because OpenSSL::Engine methods change global state def with_openssl(code, **opts) - assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;", **opts) - require #{__FILE__.dump} - include OpenSSL::TestEngine::Utils + assert_separately(["-ropenssl"], <<~"end;", **opts) #{code} end; end - - module Utils - def get_engine - OpenSSL::Engine.by_id("openssl") - end - - def crypt_data(data, key, mode) - cipher = yield - cipher.send mode - cipher.key = key - cipher.update(data) + cipher.final - end - end end end diff --git a/test/mri/openssl/test_fips.rb b/test/mri/openssl/test_fips.rb index 8cd474f9a32..4a3dd43a418 100644 --- a/test/mri/openssl/test_fips.rb +++ b/test/mri/openssl/test_fips.rb @@ -4,22 +4,46 @@ if defined?(OpenSSL) class OpenSSL::TestFIPS < OpenSSL::TestCase + def test_fips_mode_get_is_true_on_fips_mode_enabled + unless ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"] + omit "Only for FIPS mode environment" + end + + assert_separately(["-ropenssl"], <<~"end;") + assert OpenSSL.fips_mode == true, ".fips_mode should return true on FIPS mode enabled" + end; + end + + def test_fips_mode_get_is_false_on_fips_mode_disabled + if ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"] + omit "Only for non-FIPS mode environment" + end + + assert_separately(["-ropenssl"], <<~"end;") + message = ".fips_mode should return false on FIPS mode disabled. " \ + "If you run the test on FIPS mode, please set " \ + "TEST_RUBY_OPENSSL_FIPS_ENABLED=true" + assert OpenSSL.fips_mode == false, message + end; + end + def test_fips_mode_is_reentrant - OpenSSL.fips_mode = false - OpenSSL.fips_mode = false + assert_separately(["-ropenssl"], <<~"end;") + OpenSSL.fips_mode = false + OpenSSL.fips_mode = false + end; end - def test_fips_mode_get - return unless OpenSSL::OPENSSL_FIPS - assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;") - require #{__FILE__.dump} + def test_fips_mode_get_with_fips_mode_set + omit('OpenSSL is not FIPS-capable') unless OpenSSL::OPENSSL_FIPS + assert_separately(["-ropenssl"], <<~"end;") begin OpenSSL.fips_mode = true - assert OpenSSL.fips_mode == true, ".fips_mode returns true when .fips_mode=true" + assert OpenSSL.fips_mode == true, ".fips_mode should return true when .fips_mode=true" OpenSSL.fips_mode = false - assert OpenSSL.fips_mode == false, ".fips_mode returns false when .fips_mode=false" + assert OpenSSL.fips_mode == false, ".fips_mode should return false when .fips_mode=false" rescue OpenSSL::OpenSSLError pend "Could not set FIPS mode (OpenSSL::OpenSSLError: \#$!); skipping" end diff --git a/test/mri/openssl/test_ns_spki.rb b/test/mri/openssl/test_ns_spki.rb index 383931b98b0..d76fc9e5cfb 100644 --- a/test/mri/openssl/test_ns_spki.rb +++ b/test/mri/openssl/test_ns_spki.rb @@ -38,13 +38,13 @@ def test_build_data def test_decode_data spki = OpenSSL::Netscape::SPKI.new(@b64) assert_equal(@b64, spki.to_pem) - assert_equal(@b64.unpack("m").first, spki.to_der) + assert_equal(@b64.unpack1("m"), spki.to_der) assert_equal("MozillaIsMyFriend", spki.challenge) assert_equal(OpenSSL::PKey::RSA, spki.public_key.class) - spki = OpenSSL::Netscape::SPKI.new(@b64.unpack("m").first) + spki = OpenSSL::Netscape::SPKI.new(@b64.unpack1("m")) assert_equal(@b64, spki.to_pem) - assert_equal(@b64.unpack("m").first, spki.to_der) + assert_equal(@b64.unpack1("m"), spki.to_der) assert_equal("MozillaIsMyFriend", spki.challenge) assert_equal(OpenSSL::PKey::RSA, spki.public_key.class) end diff --git a/test/mri/openssl/test_ocsp.rb b/test/mri/openssl/test_ocsp.rb index 85f133752cb..cf96fc22e51 100644 --- a/test/mri/openssl/test_ocsp.rb +++ b/test/mri/openssl/test_ocsp.rb @@ -228,7 +228,7 @@ def test_basic_response_response_operations assert_equal OpenSSL::OCSP::V_CERTSTATUS_REVOKED, single.cert_status assert_equal OpenSSL::OCSP::REVOKED_STATUS_UNSPECIFIED, single.revocation_reason assert_equal now - 400, single.revocation_time - assert_in_delta (now - 301), single.this_update, 1 + assert_in_delta (now - 300), single.this_update, 1 assert_equal nil, single.next_update assert_equal [], single.extensions diff --git a/test/mri/openssl/test_ossl.rb b/test/mri/openssl/test_ossl.rb index e1d86bd40b9..979669a0039 100644 --- a/test/mri/openssl/test_ossl.rb +++ b/test/mri/openssl/test_ossl.rb @@ -60,6 +60,19 @@ def test_memcmp_timing assert_operator(a_b_time, :<, a_c_time * 10, "fixed_length_secure_compare timing test failed") assert_operator(a_c_time, :<, a_b_time * 10, "fixed_length_secure_compare timing test failed") end + + def test_error_data + # X509V3_EXT_nconf_nid() called from OpenSSL::X509::ExtensionFactory#create_ext is a function + # that uses ERR_raise_data() to append additional information about the error. + # + # The generated message should look like: + # "subjectAltName = IP:not.a.valid.ip.address: bad ip address (value=not.a.valid.ip.address)" + # "subjectAltName = IP:not.a.valid.ip.address: error in extension (name=subjectAltName, value=IP:not.a.valid.ip.address)" + ef = OpenSSL::X509::ExtensionFactory.new + assert_raise_with_message(OpenSSL::X509::ExtensionError, /value=(IP:)?not.a.valid.ip.address\)/) { + ef.create_ext("subjectAltName", "IP:not.a.valid.ip.address") + } + end end end diff --git a/test/mri/openssl/test_pair.rb b/test/mri/openssl/test_pair.rb index 14786100df5..b616883925b 100644 --- a/test/mri/openssl/test_pair.rb +++ b/test/mri/openssl/test_pair.rb @@ -115,6 +115,17 @@ def test_gets } end + def test_gets_chomp + ssl_pair {|s1, s2| + s1 << "line1\r\nline2\r\nline3\r\n" + s1.close + + assert_equal("line1", s2.gets("\r\n", chomp: true)) + assert_equal("line2\r\n", s2.gets("\r\n", chomp: false)) + assert_equal("line3", s2.gets(chomp: true)) + } + end + def test_gets_eof_limit ssl_pair {|s1, s2| s1.write("hello") diff --git a/test/mri/openssl/test_pkcs12.rb b/test/mri/openssl/test_pkcs12.rb index ec676743bcb..e6b91b52afb 100644 --- a/test/mri/openssl/test_pkcs12.rb +++ b/test/mri/openssl/test_pkcs12.rb @@ -181,7 +181,7 @@ def test_create_with_mac_itr def test_new_with_no_keys # generated with: # openssl pkcs12 -certpbe PBE-SHA1-3DES -in <@mycert> -nokeys -export - str = <<~EOF.unpack("m").first + str = <<~EOF.unpack1("m") MIIGJAIBAzCCBeoGCSqGSIb3DQEHAaCCBdsEggXXMIIF0zCCBc8GCSqGSIb3 DQEHBqCCBcAwggW8AgEAMIIFtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMw DgQIjv5c3OHvnBgCAggAgIIFiMJa8Z/w7errRvCQPXh9dGQz3eJaFq3S2gXD @@ -230,7 +230,7 @@ def test_new_with_no_keys def test_new_with_no_certs # generated with: # openssl pkcs12 -inkey fixtures/openssl/pkey/rsa-1.pem -nocerts -export - str = <<~EOF.unpack("m").first + str = <<~EOF.unpack1("m") MIIJ7wIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCCZoGCSqGSIb3 DQEHAaCCCYsEggmHMIIJgzCCCX8GCyqGSIb3DQEMCgECoIIJbjCCCWowHAYK KoZIhvcNAQwBAzAOBAjX5nN8jyRKwQICCAAEgglIBIRLHfiY1mNHpl3FdX6+ diff --git a/test/mri/openssl/test_pkey.rb b/test/mri/openssl/test_pkey.rb index 1219f3f1d7b..aee0546f63f 100644 --- a/test/mri/openssl/test_pkey.rb +++ b/test/mri/openssl/test_pkey.rb @@ -40,6 +40,11 @@ def test_s_generate_parameters } # Parameter generation callback is called + if openssl?(3, 0, 0, 0) && !openssl?(3, 0, 0, 6) + # Errors in BN_GENCB were not properly handled. This special pend is to + # suppress failures on Ubuntu 22.04, which uses OpenSSL 3.0.2. + pend "unstable test on OpenSSL 3.0.[0-5]" + end cb_called = [] assert_raise(RuntimeError) { OpenSSL::PKey.generate_parameters("DSA") { |*args| @@ -47,11 +52,6 @@ def test_s_generate_parameters raise "exit!" if cb_called.size == 3 } } - if !cb_called && openssl?(3, 0, 0) && !openssl?(3, 0, 6) - # Errors in BN_GENCB were not properly handled. This special pend is to - # suppress failures on Ubuntu 22.04, which uses OpenSSL 3.0.2. - pend "unstable test on OpenSSL 3.0.[0-5]" - end assert_not_empty cb_called end @@ -82,6 +82,9 @@ def test_hmac_sign_verify end def test_ed25519 + # Ed25519 is not FIPS-approved. + omit_on_fips + # Test vector from RFC 8032 Section 7.1 TEST 2 priv_pem = <<~EOF -----BEGIN PRIVATE KEY----- @@ -96,9 +99,11 @@ def test_ed25519 begin priv = OpenSSL::PKey.read(priv_pem) pub = OpenSSL::PKey.read(pub_pem) - rescue OpenSSL::PKey::PKeyError + rescue OpenSSL::PKey::PKeyError => e # OpenSSL < 1.1.1 - pend "Ed25519 is not implemented" + pend "Ed25519 is not implemented" unless openssl?(1, 1, 1) + + raise e end assert_instance_of OpenSSL::PKey::PKey, priv assert_instance_of OpenSSL::PKey::PKey, pub @@ -106,6 +111,19 @@ def test_ed25519 assert_equal pub_pem, priv.public_to_pem assert_equal pub_pem, pub.public_to_pem + begin + assert_equal "4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb", + priv.raw_private_key.unpack1("H*") + assert_equal OpenSSL::PKey.new_raw_private_key("ED25519", priv.raw_private_key).private_to_pem, + priv.private_to_pem + assert_equal "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c", + priv.raw_public_key.unpack1("H*") + assert_equal OpenSSL::PKey.new_raw_public_key("ED25519", priv.raw_public_key).public_to_pem, + pub.public_to_pem + rescue NoMethodError + pend "running OpenSSL version does not have raw public key support" + end + sig = [<<~EOF.gsub(/[^0-9a-f]/, "")].pack("H*") 92a009a9f0d4cab8720e820b5f642540 a2b27b5416503f8fb3762223ebdb69da @@ -126,6 +144,32 @@ def test_ed25519 assert_raise(OpenSSL::PKey::PKeyError) { priv.derive(pub) } end + def test_ed25519_not_approved_on_fips + omit_on_non_fips + # Ed25519 is technically allowed in the OpenSSL 3.0 code as a kind of bug. + # So, we need to omit OpenSSL 3.0. + # + # See OpenSSL providers/fips/fipsprov.c PROV_NAMES_ED25519 entries with + # FIPS_DEFAULT_PROPERTIES on openssl-3.0 branch and + # FIPS_UNAPPROVED_PROPERTIES on openssl-3.1 branch. + # + # See also + # https://github.com/openssl/openssl/issues/20758#issuecomment-1639658102 + # for details. + unless openssl?(3, 1, 0, 0) + omit 'Ed25519 is allowed in the OpenSSL 3.0 FIPS code as a kind of bug' + end + + priv_pem = <<~EOF + -----BEGIN PRIVATE KEY----- + MC4CAQAwBQYDK2VwBCIEIEzNCJso/5banbbDRuwRTg9bijGfNaumJNqM9u1PuKb7 + -----END PRIVATE KEY----- + EOF + assert_raise(OpenSSL::PKey::PKeyError) do + OpenSSL::PKey.read(priv_pem) + end + end + def test_x25519 # Test vector from RFC 7748 Section 6.1 alice_pem = <<~EOF @@ -150,6 +194,32 @@ def test_x25519 assert_equal alice_pem, alice.private_to_pem assert_equal bob_pem, bob.public_to_pem assert_equal [shared_secret].pack("H*"), alice.derive(bob) + begin + alice_private = OpenSSL::PKey.new_raw_private_key("X25519", alice.raw_private_key) + bob_public = OpenSSL::PKey.new_raw_public_key("X25519", bob.raw_public_key) + alice_private_raw = alice.raw_private_key.unpack1("H*") + bob_public_raw = bob.raw_public_key.unpack1("H*") + rescue NoMethodError + # OpenSSL < 1.1.1 + pend "running OpenSSL version does not have raw public key support" + end + assert_equal alice_private.private_to_pem, + alice.private_to_pem + assert_equal bob_public.public_to_pem, + bob.public_to_pem + assert_equal "77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a", + alice_private_raw + assert_equal "de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f", + bob_public_raw + end + + def raw_initialize + pend "Ed25519 is not implemented" unless openssl?(1, 1, 1) # >= v1.1.1 + + assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_private_key("foo123", "xxx") } + assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_private_key("ED25519", "xxx") } + assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_public_key("foo123", "xxx") } + assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_public_key("ED25519", "xxx") } end def test_compare? diff --git a/test/mri/openssl/test_pkey_dh.rb b/test/mri/openssl/test_pkey_dh.rb index 161af1897bd..d32ffaf6b11 100644 --- a/test/mri/openssl/test_pkey_dh.rb +++ b/test/mri/openssl/test_pkey_dh.rb @@ -18,15 +18,26 @@ def test_new_generate assert_key(dh) end if ENV["OSSL_TEST_ALL"] - def test_new_break + def test_new_break_on_non_fips + omit_on_fips + assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break }) assert_raise(RuntimeError) do OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise } end end + def test_new_break_on_fips + omit_on_non_fips + + # The block argument is not executed in FIPS case. + # See https://github.com/ruby/openssl/issues/692 for details. + assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break }) + assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }) + end + def test_derive_key - params = Fixtures.pkey("dh1024") + params = Fixtures.pkey("dh2048_ffdhe2048") dh1 = OpenSSL::PKey.generate_key(params) dh2 = OpenSSL::PKey.generate_key(params) dh1_pub = OpenSSL::PKey.read(dh1.public_to_der) @@ -44,34 +55,38 @@ def test_derive_key end def test_DHparams - dh1024 = Fixtures.pkey("dh1024") - dh1024params = dh1024.public_key + dh = Fixtures.pkey("dh2048_ffdhe2048") + dh_params = dh.public_key asn1 = OpenSSL::ASN1::Sequence([ - OpenSSL::ASN1::Integer(dh1024.p), - OpenSSL::ASN1::Integer(dh1024.g) + OpenSSL::ASN1::Integer(dh.p), + OpenSSL::ASN1::Integer(dh.g) ]) key = OpenSSL::PKey::DH.new(asn1.to_der) - assert_same_dh dh1024params, key + assert_same_dh dh_params, key pem = <<~EOF -----BEGIN DH PARAMETERS----- - MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0 - pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG - AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC + MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz + +8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a + 87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 + YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi + 7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD + ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== -----END DH PARAMETERS----- EOF + key = OpenSSL::PKey::DH.new(pem) - assert_same_dh dh1024params, key + assert_same_dh dh_params, key key = OpenSSL::PKey.read(pem) - assert_same_dh dh1024params, key + assert_same_dh dh_params, key - assert_equal asn1.to_der, dh1024.to_der - assert_equal pem, dh1024.export + assert_equal asn1.to_der, dh.to_der + assert_equal pem, dh.export end def test_public_key - dh = Fixtures.pkey("dh1024") + dh = Fixtures.pkey("dh2048_ffdhe2048") public_key = dh.public_key assert_no_key(public_key) #implies public_key.public? is false! assert_equal(dh.to_der, public_key.to_der) @@ -80,7 +95,8 @@ def test_public_key def test_generate_key # Deprecated in v3.0.0; incompatible with OpenSSL 3.0 - dh = Fixtures.pkey("dh1024").public_key # creates a copy with params only + # Creates a copy with params only + dh = Fixtures.pkey("dh2048_ffdhe2048").public_key assert_no_key(dh) dh.generate_key! assert_key(dh) @@ -91,7 +107,15 @@ def test_generate_key end if !openssl?(3, 0, 0) def test_params_ok? - dh0 = Fixtures.pkey("dh1024") + # Skip the tests in old OpenSSL version 1.1.1c or early versions before + # applying the following commits in OpenSSL 1.1.1d to make `DH_check` + # function pass the RFC 7919 FFDHE group texts. + # https://github.com/openssl/openssl/pull/9435 + unless openssl?(1, 1, 1, 4) + pend 'DH check for RFC 7919 FFDHE group texts is not implemented' + end + + dh0 = Fixtures.pkey("dh2048_ffdhe2048") dh1 = OpenSSL::PKey::DH.new(OpenSSL::ASN1::Sequence([ OpenSSL::ASN1::Integer(dh0.p), @@ -108,7 +132,7 @@ def test_params_ok? def test_dup # Parameters only - dh1 = Fixtures.pkey("dh1024") + dh1 = Fixtures.pkey("dh2048_ffdhe2048") dh2 = dh1.dup assert_equal dh1.to_der, dh2.to_der assert_not_equal nil, dh1.p @@ -125,7 +149,7 @@ def test_dup end # With a key pair - dh3 = OpenSSL::PKey.generate_key(Fixtures.pkey("dh1024")) + dh3 = OpenSSL::PKey.generate_key(Fixtures.pkey("dh2048_ffdhe2048")) dh4 = dh3.dup assert_equal dh3.to_der, dh4.to_der assert_equal dh1.to_der, dh4.to_der # encodes parameters only @@ -136,7 +160,7 @@ def test_dup end def test_marshal - dh = Fixtures.pkey("dh1024") + dh = Fixtures.pkey("dh2048_ffdhe2048") deserialized = Marshal.load(Marshal.dump(dh)) assert_equal dh.to_der, deserialized.to_der diff --git a/test/mri/openssl/test_pkey_dsa.rb b/test/mri/openssl/test_pkey_dsa.rb index d1059093c50..3f64a80e324 100644 --- a/test/mri/openssl/test_pkey_dsa.rb +++ b/test/mri/openssl/test_pkey_dsa.rb @@ -58,7 +58,7 @@ def test_sign_verify signature = dsa512.sign("SHA256", data) assert_equal true, dsa512.verify("SHA256", signature, data) - signature0 = (<<~'end;').unpack("m")[0] + signature0 = (<<~'end;').unpack1("m") MCwCFH5h40plgU5Fh0Z4wvEEpz0eE9SnAhRPbkRB8ggsN/vsSEYMXvJwjGg/ 6g== end; diff --git a/test/mri/openssl/test_pkey_ec.rb b/test/mri/openssl/test_pkey_ec.rb index e5fef940a6c..2cb8e287ab7 100644 --- a/test/mri/openssl/test_pkey_ec.rb +++ b/test/mri/openssl/test_pkey_ec.rb @@ -5,20 +5,6 @@ class OpenSSL::TestEC < OpenSSL::PKeyTestCase def test_ec_key - builtin_curves = OpenSSL::PKey::EC.builtin_curves - assert_not_empty builtin_curves - - builtin_curves.each do |curve_name, comment| - # Oakley curves and X25519 are not suitable for signing and causes - # FIPS-selftest failure on some environment, so skip for now. - next if ["Oakley", "X25519"].any? { |n| curve_name.start_with?(n) } - - key = OpenSSL::PKey::EC.generate(curve_name) - assert_predicate key, :private? - assert_predicate key, :public? - assert_nothing_raised { key.check_key } - end - key1 = OpenSSL::PKey::EC.generate("prime256v1") # PKey is immutable in OpenSSL >= 3.0; constructing an empty EC object is @@ -49,6 +35,17 @@ def test_ec_key end end + def test_builtin_curves + builtin_curves = OpenSSL::PKey::EC.builtin_curves + assert_not_empty builtin_curves + assert_equal 2, builtin_curves[0].size + assert_kind_of String, builtin_curves[0][0] + assert_kind_of String, builtin_curves[0][1] + + builtin_curve_names = builtin_curves.map { |name, comment| name } + assert_include builtin_curve_names, "prime256v1" + end + def test_generate assert_raise(OpenSSL::PKey::ECError) { OpenSSL::PKey::EC.generate("non-existent") } g = OpenSSL::PKey::EC::Group.new("prime256v1") @@ -110,7 +107,7 @@ def test_sign_verify signature = p256.sign("SHA256", data) assert_equal true, p256.verify("SHA256", signature, data) - signature0 = (<<~'end;').unpack("m")[0] + signature0 = (<<~'end;').unpack1("m") MEQCIEOTY/hD7eI8a0qlzxkIt8LLZ8uwiaSfVbjX2dPAvN11AiAQdCYx56Fq QdBp1B4sxJoA8jvODMMklMyBKVmudboA6A== end; @@ -232,6 +229,8 @@ def test_ECPrivateKey_with_parameters end def test_ECPrivateKey_encrypted + omit_on_fips + p256 = Fixtures.pkey("p256") # key = abcdef pem = <<~EOF diff --git a/test/mri/openssl/test_pkey_rsa.rb b/test/mri/openssl/test_pkey_rsa.rb index b0ae5784b3a..61c55c60b25 100644 --- a/test/mri/openssl/test_pkey_rsa.rb +++ b/test/mri/openssl/test_pkey_rsa.rb @@ -83,7 +83,7 @@ def test_sign_verify signature = rsa1024.sign("SHA256", data) assert_equal true, rsa1024.verify("SHA256", signature, data) - signature0 = (<<~'end;').unpack("m")[0] + signature0 = (<<~'end;').unpack1("m") oLCgbprPvfhM4pjFQiDTFeWI9Sk+Og7Nh9TmIZ/xSxf2CGXQrptlwo7NQ28+ WA6YQo8jPH4hSuyWIM4Gz4qRYiYRkl5TDMUYob94zm8Si1HxEiS9354tzvqS zS8MLW2BtNPuTubMxTItHGTnOzo9sUg0LAHVFt8kHG2NfKAw/gQ= diff --git a/test/mri/openssl/test_provider.rb b/test/mri/openssl/test_provider.rb new file mode 100644 index 00000000000..b0ffae9ce72 --- /dev/null +++ b/test/mri/openssl/test_provider.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +require_relative 'utils' +if defined?(OpenSSL) && defined?(OpenSSL::Provider) && !OpenSSL.fips_mode + +class OpenSSL::TestProvider < OpenSSL::TestCase + def test_openssl_provider_name_inspect + with_openssl <<-'end;' + provider = OpenSSL::Provider.load("default") + assert_equal("default", provider.name) + assert_not_nil(provider.inspect) + end; + end + + def test_openssl_provider_names + with_openssl <<-'end;' + base_provider = OpenSSL::Provider.load("base") + assert_equal(2, OpenSSL::Provider.provider_names.size) + assert_includes(OpenSSL::Provider.provider_names, "base") + + assert_equal(true, base_provider.unload) + assert_equal(1, OpenSSL::Provider.provider_names.size) + assert_not_includes(OpenSSL::Provider.provider_names, "base") + end; + end + + def test_unloaded_openssl_provider + with_openssl <<-'end;' + default_provider = OpenSSL::Provider.load("default") + assert_equal(true, default_provider.unload) + assert_raise(OpenSSL::Provider::ProviderError) { default_provider.name } + assert_raise(OpenSSL::Provider::ProviderError) { default_provider.unload } + end; + end + + def test_openssl_legacy_provider + with_openssl(<<-'end;') + begin + OpenSSL::Provider.load("legacy") + rescue OpenSSL::Provider::ProviderError + omit "Only for OpenSSL with legacy provider" + end + + algo = "RC4" + data = "a" * 1000 + key = OpenSSL::Random.random_bytes(16) + + # default provider does not support RC4 + cipher = OpenSSL::Cipher.new(algo) + cipher.encrypt + cipher.key = key + encrypted = cipher.update(data) + cipher.final + + other_cipher = OpenSSL::Cipher.new(algo) + other_cipher.decrypt + other_cipher.key = key + decrypted = other_cipher.update(encrypted) + other_cipher.final + + assert_equal(data, decrypted) + end; + end + + private + + # this is required because OpenSSL::Provider methods change global state + def with_openssl(code, **opts) + assert_separately(["-ropenssl"], <<~"end;", **opts) + #{code} + end; + end +end + +end diff --git a/test/mri/openssl/test_ssl.rb b/test/mri/openssl/test_ssl.rb index c80168f2ff6..dcb7757add0 100644 --- a/test/mri/openssl/test_ssl.rb +++ b/test/mri/openssl/test_ssl.rb @@ -193,6 +193,24 @@ def test_sysread_and_syswrite } end + def test_read_with_timeout + omit "does not support timeout" unless IO.method_defined?(:timeout) + + start_server do |port| + server_connect(port) do |ssl| + str = +("x" * 100 + "\n") + ssl.syswrite(str) + assert_equal(str, ssl.sysread(str.bytesize)) + + ssl.timeout = 1 + assert_raise(IO::TimeoutError) {ssl.read(1)} + + ssl.syswrite(str) + assert_equal(str, ssl.sysread(str.bytesize)) + end + end + end + def test_getbyte start_server { |port| server_connect(port) { |ssl| @@ -481,6 +499,40 @@ def test_exception_in_verify_callback_is_ignored } end + def test_ca_file + start_server(ignore_listener_error: true) { |port| + # X509_STORE is shared; setting ca_file to SSLContext affects store + store = OpenSSL::X509::Store.new + assert_equal false, store.verify(@svr_cert) + + ctx = Tempfile.create("ca_cert.pem") { |f| + f.puts(@ca_cert.to_pem) + f.close + + ctx = OpenSSL::SSL::SSLContext.new + ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER + ctx.cert_store = store + ctx.ca_file = f.path + ctx.setup + ctx + } + assert_nothing_raised { + server_connect(port, ctx) { |ssl| ssl.puts("abc"); ssl.gets } + } + assert_equal true, store.verify(@svr_cert) + } + end + + def test_ca_file_not_found + path = Tempfile.create("ca_cert.pem") { |f| f.path } + ctx = OpenSSL::SSL::SSLContext.new + ctx.ca_file = path + # OpenSSL >= 1.1.0: /no certificate or crl found/ + assert_raise(OpenSSL::SSL::SSLError) { + ctx.setup + } + end + def test_finished_messages server_finished = nil server_peer_finished = nil diff --git a/test/mri/openssl/test_ssl_session.rb b/test/mri/openssl/test_ssl_session.rb index b243201e18b..89cf672a7bc 100644 --- a/test/mri/openssl/test_ssl_session.rb +++ b/test/mri/openssl/test_ssl_session.rb @@ -22,7 +22,7 @@ def test_session assert_match(/\A-----BEGIN SSL SESSION PARAMETERS-----/, pem) assert_match(/-----END SSL SESSION PARAMETERS-----\Z/, pem) pem.gsub!(/-----(BEGIN|END) SSL SESSION PARAMETERS-----/, '').gsub!(/[\r\n]+/m, '') - assert_equal(session.to_der, pem.unpack('m*')[0]) + assert_equal(session.to_der, pem.unpack1('m')) assert_not_nil(session.to_text) } end diff --git a/test/mri/openssl/test_x509ext.rb b/test/mri/openssl/test_x509ext.rb index 7ad010d1ed2..59a41ed7369 100644 --- a/test/mri/openssl/test_x509ext.rb +++ b/test/mri/openssl/test_x509ext.rb @@ -50,24 +50,41 @@ def test_create_by_factory cdp = ef.create_extension("crlDistributionPoints", "@crlDistPts") assert_equal(false, cdp.critical?) assert_equal("crlDistributionPoints", cdp.oid) - assert_match(%{URI:http://www\.example\.com/crl}, cdp.value) - assert_match( - %r{URI:ldap://ldap\.example\.com/cn=ca\?certificateRevocationList;binary}, - cdp.value) + assert_include(cdp.value, "URI:http://www.example.com/crl") + assert_include(cdp.value, + "URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary") cdp = ef.create_extension("crlDistributionPoints", "critical, @crlDistPts") assert_equal(true, cdp.critical?) assert_equal("crlDistributionPoints", cdp.oid) - assert_match(%{URI:http://www.example.com/crl}, cdp.value) - assert_match( - %r{URI:ldap://ldap.example.com/cn=ca\?certificateRevocationList;binary}, - cdp.value) + assert_include(cdp.value, "URI:http://www.example.com/crl") + assert_include(cdp.value, + "URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary") cp = ef.create_extension("certificatePolicies", "@certPolicies") assert_equal(false, cp.critical?) assert_equal("certificatePolicies", cp.oid) - assert_match(%r{2.23.140.1.2.1}, cp.value) - assert_match(%r{http://cps.example.com}, cp.value) + assert_include(cp.value, "2.23.140.1.2.1") + assert_include(cp.value, "http://cps.example.com") + end + + def test_factory_create_extension_sn_ln + ef = OpenSSL::X509::ExtensionFactory.new + bc_sn = ef.create_extension("basicConstraints", "critical, CA:TRUE, pathlen:2") + bc_ln = ef.create_extension("X509v3 Basic Constraints", "critical, CA:TRUE, pathlen:2") + assert_equal(@basic_constraints.to_der, bc_sn.to_der) + assert_equal(@basic_constraints.to_der, bc_ln.to_der) + end + + def test_factory_create_extension_oid + ef = OpenSSL::X509::ExtensionFactory.new + ef.config = OpenSSL::Config.parse(<<~_end_of_cnf_) + [basic_constraints] + cA = BOOLEAN:TRUE + pathLenConstraint = INTEGER:2 + _end_of_cnf_ + bc_oid = ef.create_extension("2.5.29.19", "ASN1:SEQUENCE:basic_constraints", true) + assert_equal(@basic_constraints.to_der, bc_oid.to_der) end def test_dup diff --git a/test/mri/openssl/utils.rb b/test/mri/openssl/utils.rb index 4ebcb9837bc..f6c84eef67c 100644 --- a/test/mri/openssl/utils.rb +++ b/test/mri/openssl/utils.rb @@ -1,38 +1,13 @@ # frozen_string_literal: true begin require "openssl" - - # Disable FIPS mode for tests for installations - # where FIPS mode would be enabled by default. - # Has no effect on all other installations. - OpenSSL.fips_mode=false rescue LoadError end -# Compile OpenSSL with crypto-mdebug and run this test suite with OSSL_MDEBUG=1 -# environment variable to enable memory leak check. -if ENV["OSSL_MDEBUG"] == "1" - if OpenSSL.respond_to?(:print_mem_leaks) - OpenSSL.mem_check_start - - END { - GC.start - case OpenSSL.print_mem_leaks - when nil - warn "mdebug: check what is printed" - when true - raise "mdebug: memory leaks detected" - end - } - else - warn "OSSL_MDEBUG=1 is specified but OpenSSL is not built with crypto-mdebug" - end -end - require "test/unit" +require "core_assertions" require "tempfile" require "socket" -require "envutil" if defined?(OpenSSL) @@ -131,11 +106,12 @@ def get_subject_key_id(cert, hex: true) end end - def openssl?(major = nil, minor = nil, fix = nil, patch = 0) + def openssl?(major = nil, minor = nil, fix = nil, patch = 0, status = 0) return false if OpenSSL::OPENSSL_VERSION.include?("LibreSSL") return true unless major OpenSSL::OPENSSL_VERSION_NUMBER >= - major * 0x10000000 + minor * 0x100000 + fix * 0x1000 + patch * 0x10 + major * 0x10000000 + minor * 0x100000 + fix * 0x1000 + patch * 0x10 + + status * 0x1 end def libressl?(major = nil, minor = nil, fix = nil) @@ -148,6 +124,7 @@ def libressl?(major = nil, minor = nil, fix = nil) class OpenSSL::TestCase < Test::Unit::TestCase include OpenSSL::TestUtils extend OpenSSL::TestUtils + include Test::Unit::CoreAssertions def setup if ENV["OSSL_GC_STRESS"] == "1" @@ -162,6 +139,30 @@ def teardown # OpenSSL error stack must be empty assert_equal([], OpenSSL.errors) end + + # Omit the tests in FIPS. + # + # For example, the password based encryption used in the PEM format uses MD5 + # for deriving the encryption key from the password, and MD5 is not + # FIPS-approved. + # + # See https://github.com/openssl/openssl/discussions/21830#discussioncomment-6865636 + # for details. + def omit_on_fips + return unless OpenSSL.fips_mode + + omit <<~MESSAGE + Only for OpenSSL non-FIPS with the following possible reasons: + * A testing logic is non-FIPS specific. + * An encryption used in the test is not FIPS-approved. + MESSAGE + end + + def omit_on_non_fips + return if OpenSSL.fips_mode + + omit "Only for OpenSSL FIPS" + end end class OpenSSL::SSLTestCase < OpenSSL::TestCase diff --git a/test/mri/optparse/test_acceptable.rb b/test/mri/optparse/test_acceptable.rb index 12f5322726b..c7ea2152fc0 100644 --- a/test/mri/optparse/test_acceptable.rb +++ b/test/mri/optparse/test_acceptable.rb @@ -8,6 +8,7 @@ def setup @opt.def_option("--integer VAL", Integer) { |v| @integer = v } @opt.def_option("--float VAL", Float) { |v| @float = v } @opt.def_option("--numeric VAL", Numeric) { |v| @numeric = v } + @opt.def_option("--array VAL", Array) { |v| @array = v } @opt.def_option("--decimal-integer VAL", OptionParser::DecimalInteger) { |i| @decimal_integer = i } @@ -195,4 +196,8 @@ def test_decimal_numeric end end + def test_array + assert_equal(%w"", no_error {@opt.parse!(%w"--array a,b,c")}) + assert_equal(%w"a b c", @array) + end end diff --git a/test/mri/optparse/test_getopts.rb b/test/mri/optparse/test_getopts.rb index 7d9160f7afd..4a0ae284e7d 100644 --- a/test/mri/optparse/test_getopts.rb +++ b/test/mri/optparse/test_getopts.rb @@ -11,23 +11,39 @@ def test_short_noarg o = @opt.getopts(%w[-a], "ab") assert_equal(true, o['a']) assert_equal(false, o['b']) + + o = @opt.getopts(%w[-a], "ab", symbolize_names: true) + assert_equal(true, o[:a]) + assert_equal(false, o[:b]) end def test_short_arg o = @opt.getopts(%w[-a1], "a:b:") assert_equal("1", o['a']) assert_equal(nil, o['b']) + + o = @opt.getopts(%w[-a1], "a:b:", symbolize_names: true) + assert_equal("1", o[:a]) + assert_equal(nil, o[:b]) end def test_long_noarg o = @opt.getopts(%w[--foo], "", "foo", "bar") assert_equal(true, o['foo']) assert_equal(false, o['bar']) + + o = @opt.getopts(%w[--foo], "", "foo", "bar", symbolize_names: true) + assert_equal(true, o[:foo]) + assert_equal(false, o[:bar]) end def test_long_arg o = @opt.getopts(%w[--bar ZOT], "", "foo:FOO", "bar:BAR") assert_equal("FOO", o['foo']) assert_equal("ZOT", o['bar']) + + o = @opt.getopts(%w[--bar ZOT], "", "foo:FOO", "bar:BAR", symbolize_names: true) + assert_equal("FOO", o[:foo]) + assert_equal("ZOT", o[:bar]) end end diff --git a/test/mri/optparse/test_optarg.rb b/test/mri/optparse/test_optarg.rb index 81127a8a375..f94460527fd 100644 --- a/test/mri/optparse/test_optarg.rb +++ b/test/mri/optparse/test_optarg.rb @@ -9,6 +9,8 @@ def setup @opt.def_option("--regexp[=REGEXP]", Regexp) {|x| @reopt = x} @opt.def_option "--with_underscore[=VAL]" do |x| @flag = x end @opt.def_option "--with-hyphen[=VAL]" do |x| @flag = x end + @opt.def_option("--fallback[=VAL]") do |x = "fallback"| @flag = x end + @opt.def_option("--lambda[=VAL]", &->(x) {@flag = x}) @reopt = nil end @@ -57,4 +59,18 @@ def test_hyphenize assert_equal(%w"", no_error {@opt.parse!(%w"--with_hyphen=foo4")}) assert_equal("foo4", @flag) end + + def test_default_argument + assert_equal(%w"", no_error {@opt.parse!(%w"--fallback=val1")}) + assert_equal("val1", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--fallback")}) + assert_equal("fallback", @flag) + end + + def test_lambda + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda=lambda1")}) + assert_equal("lambda1", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda")}) + assert_equal(nil, @flag) + end end diff --git a/test/mri/optparse/test_optparse.rb b/test/mri/optparse/test_optparse.rb index bfa705ad03a..8d09e0f28b1 100644 --- a/test/mri/optparse/test_optparse.rb +++ b/test/mri/optparse/test_optparse.rb @@ -73,10 +73,17 @@ def test_into @opt.def_option "-p", "--port=PORT", "port", Integer @opt.def_option "-v", "--verbose" do @verbose = true end @opt.def_option "-q", "--quiet" do @quiet = true end + @opt.def_option "-o", "--option [OPT]" do |opt| @option = opt end result = {} @opt.parse %w(--host localhost --port 8000 -v), into: result assert_equal({host: "localhost", port: 8000, verbose: true}, result) assert_equal(true, @verbose) + result = {} + @opt.parse %w(--option -q), into: result + assert_equal({quiet: true, option: nil}, result) + result = {} + @opt.parse %w(--option OPTION -v), into: result + assert_equal({verbose: true, option: "OPTION"}, result) end def test_require_exact @@ -88,9 +95,9 @@ def test_require_exact end @opt.require_exact = true - %w(--zrs -F -Ffoo).each do |arg| + [%w(--zrs foo), %w(--zrs=foo), %w(-F foo), %w(-Ffoo)].each do |args| result = {} - @opt.parse([arg, 'foo'], into: result) + @opt.parse(args, into: result) assert_equal({zrs: 'foo'}, result) end @@ -99,6 +106,43 @@ def test_require_exact assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-zrs foo))} assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-zr foo))} assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-z foo))} + + @opt.def_option('-f', '--[no-]foo', 'foo') {|arg| @foo = arg} + @opt.parse(%w[-f]) + assert_equal(true, @foo) + @opt.parse(%w[--foo]) + assert_equal(true, @foo) + @opt.parse(%w[--no-foo]) + assert_equal(false, @foo) + end + + def test_exact_option + @opt.def_option('-F', '--zrs=IRS', 'zrs') + %w(--zrs --zr --z -zfoo -z -F -Ffoo).each do |arg| + result = {} + @opt.parse([arg, 'foo'], into: result) + assert_equal({zrs: 'foo'}, result) + end + + [%w(--zrs foo), %w(--zrs=foo), %w(-F foo), %w(-Ffoo)].each do |args| + result = {} + @opt.parse(args, into: result, exact: true) + assert_equal({zrs: 'foo'}, result) + end + + assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(--zr foo), exact: true)} + assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(--z foo), exact: true)} + assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-zrs foo), exact: true)} + assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-zr foo), exact: true)} + assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-z foo), exact: true)} + + @opt.def_option('-f', '--[no-]foo', 'foo') {|arg| @foo = arg} + @opt.parse(%w[-f], exact: true) + assert_equal(true, @foo) + @opt.parse(%w[--foo], exact: true) + assert_equal(true, @foo) + @opt.parse(%w[--no-foo], exact: true) + assert_equal(false, @foo) end def test_raise_unknown @@ -120,4 +164,44 @@ def test_nonopt_pattern e = assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(-t))} assert_equal(["-t"], e.args) end + + def test_help_pager + require 'tmpdir' + Dir.mktmpdir do |dir| + File.open(File.join(dir, "options.rb"), "w") do |f| + f.puts "#{<<~"begin;"}\n#{<<~'end;'}" + begin; + stdout = STDOUT.dup + def stdout.tty?; true; end + Object.__send__(:remove_const, :STDOUT) + STDOUT = stdout + ARGV.options do |opt| + end; + 100.times {|i| f.puts " opt.on('--opt-#{i}') {}"} + f.puts "#{<<~"begin;"}\n#{<<~'end;'}" + begin; + opt.parse! + end + end; + end + + optparse = $".find {|path| path.end_with?("/optparse.rb")} + args = ["-r#{optparse}", "options.rb", "--help"] + cmd = File.join(dir, "pager.cmd") + if RbConfig::CONFIG["EXECUTABLE_EXTS"]&.include?(".cmd") + command = "@echo off" + else # if File.executable?("/bin/sh") + # TruffleRuby just calls `posix_spawnp` and no fallback to `/bin/sh`. + command = "#!/bin/sh\n" + end + + [ + [{"RUBY_PAGER"=>cmd, "PAGER"=>"echo ng"}, "Executing RUBY_PAGER"], + [{"RUBY_PAGER"=>nil, "PAGER"=>cmd}, "Executing PAGER"], + ].each do |env, expected| + File.write(cmd, "#{command}\n" "echo #{expected}\n", perm: 0o700) + assert_in_out_err([env, *args], "", [expected], chdir: dir) + end + end + end end diff --git a/test/mri/optparse/test_placearg.rb b/test/mri/optparse/test_placearg.rb index ed0e4d3e6c6..a8a11e676b8 100644 --- a/test/mri/optparse/test_placearg.rb +++ b/test/mri/optparse/test_placearg.rb @@ -13,6 +13,8 @@ def setup @reopt = nil @opt.def_option "--with_underscore=VAL" do |x| @flag = x end @opt.def_option "--with-hyphen=VAL" do |x| @flag = x end + @opt.def_option("--fallback [VAL]") do |x = "fallback"| @flag = x end + @opt.def_option("--lambda [VAL]", &->(x) {@flag = x}) end def test_short @@ -73,4 +75,22 @@ def test_conv assert_equal(%w"te.rb", no_error('[ruby-dev:38333]') {@opt.parse!(%w"-T1 te.rb")}) assert_equal(1, @topt) end + + def test_default_argument + assert_equal(%w"", no_error {@opt.parse!(%w"--fallback=val1")}) + assert_equal("val1", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--fallback val2")}) + assert_equal("val2", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--fallback")}) + assert_equal("fallback", @flag) + end + + def test_lambda + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda=lambda1")}) + assert_equal("lambda1", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda lambda2")}) + assert_equal("lambda2", @flag) + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda")}) + assert_equal(nil, @flag) + end end diff --git a/test/mri/optparse/test_reqarg.rb b/test/mri/optparse/test_reqarg.rb index d5686d13aa8..31d4fef417f 100644 --- a/test/mri/optparse/test_reqarg.rb +++ b/test/mri/optparse/test_reqarg.rb @@ -6,6 +6,7 @@ def setup super @opt.def_option "--with_underscore=VAL" do |x| @flag = x end @opt.def_option "--with-hyphen=VAL" do |x| @flag = x end + @opt.def_option("--lambda=VAL", &->(x) {@flag = x}) end class Def1 < TestOptionParser @@ -81,6 +82,11 @@ def test_hyphenize assert_equal("foo4", @flag) end + def test_lambda + assert_equal(%w"", no_error {@opt.parse!(%w"--lambda=lambda1")}) + assert_equal("lambda1", @flag) + end + class TestOptionParser::WithPattern < TestOptionParser def test_pattern pat = num = nil diff --git a/test/mri/ostruct/test_ostruct.rb b/test/mri/ostruct/test_ostruct.rb index 256db7a0c71..19bb6061457 100644 --- a/test/mri/ostruct/test_ostruct.rb +++ b/test/mri/ostruct/test_ostruct.rb @@ -412,4 +412,23 @@ def test_class assert_equal('my-class', os.class) assert_equal(OpenStruct, os.class!) end + + has_performance_warnings = begin + Warning[:performance] + true + rescue NoMethodError, ArgumentError + false + end + + if has_performance_warnings + def test_performance_warning + assert_in_out_err( + %w(-Ilib -rostruct -w -W:performance -e) + ['OpenStruct.new(a: 1)'], + "", + [], + ["-e:1: warning: OpenStruct use is discouraged for performance reasons"], + success: true, + ) + end + end end diff --git a/test/mri/prism/attribute_write_test.rb b/test/mri/prism/attribute_write_test.rb new file mode 100644 index 00000000000..bd83d72da35 --- /dev/null +++ b/test/mri/prism/attribute_write_test.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class AttributeWriteTest < TestCase + module Target + def self.value + 2 + end + + def self.value=(value) + 2 + end + + def self.[]=(index, value) + 2 + end + end + + def test_named_call_with_operator + assert_attribute_write("Target.value = 1") + end + + def test_named_call_without_operator + assert_attribute_write("Target.value=(1)") + end + + def test_indexed_call_with_operator + assert_attribute_write("Target[0] = 1") + end + + def test_indexed_call_without_operator + refute_attribute_write("Target.[]=(0, 1)") + end + + def test_comparison_operators + refute_attribute_write("Target.value == 1") + refute_attribute_write("Target.value === 1") + end + + private + + def parse(source) + Prism.parse(source).value.statements.body.first + end + + def assert_attribute_write(source) + call = parse(source) + assert(call.attribute_write?) + assert_equal(1, eval(source)) + end + + def refute_attribute_write(source) + call = parse(source) + refute(call.attribute_write?) + refute_equal(1, eval(source)) + end + end +end diff --git a/test/mri/prism/bom_test.rb b/test/mri/prism/bom_test.rb new file mode 100644 index 00000000000..1525caf458d --- /dev/null +++ b/test/mri/prism/bom_test.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Don't bother checking this on these engines, this is such a specific Ripper +# test. +return if RUBY_ENGINE == "jruby" || RUBY_ENGINE == "truffleruby" + +require_relative "test_helper" + +module Prism + class BOMTest < TestCase + def test_ident + assert_bom("foo") + end + + def test_back_reference + assert_bom("$+") + end + + def test_instance_variable + assert_bom("@foo") + end + + def test_class_variable + assert_bom("@@foo") + end + + def test_global_variable + assert_bom("$foo") + end + + def test_numbered_reference + assert_bom("$1") + end + + def test_percents + assert_bom("%i[]") + assert_bom("%r[]") + assert_bom("%s[]") + assert_bom("%q{}") + assert_bom("%w[]") + assert_bom("%x[]") + assert_bom("%I[]") + assert_bom("%W[]") + assert_bom("%Q{}") + end + + def test_string + assert_bom("\"\"") + assert_bom("''") + end + + private + + def assert_bom(source) + bommed = "\xEF\xBB\xBF#{source}" + assert_equal Prism.lex_ripper(bommed), Prism.lex_compat(bommed).value + end + end +end diff --git a/test/mri/prism/command_line_test.rb b/test/mri/prism/command_line_test.rb new file mode 100644 index 00000000000..57ab0dee45e --- /dev/null +++ b/test/mri/prism/command_line_test.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class CommandLineTest < TestCase + def test_command_line_p + program = Prism.parse("1", command_line: "p").value + statements = program.statements.body + + assert_equal 2, statements.length + assert_kind_of CallNode, statements.last + assert_equal :print, statements.last.name + end + + def test_command_line_n + program = Prism.parse("1", command_line: "n").value + statements = program.statements.body + + assert_equal 1, statements.length + assert_kind_of WhileNode, statements.first + + predicate = statements.first.predicate + assert_kind_of CallNode, predicate + assert_equal :gets, predicate.name + + arguments = predicate.arguments.arguments + assert_equal 1, arguments.length + assert_equal :$/, arguments.first.name + end + + def test_command_line_a + program = Prism.parse("1", command_line: "na").value + statements = program.statements.body + + assert_equal 1, statements.length + assert_kind_of WhileNode, statements.first + + statement = statements.first.statements.body.first + assert_kind_of GlobalVariableWriteNode, statement + assert_equal :$F, statement.name + end + + def test_command_line_l + program = Prism.parse("1", command_line: "nl").value + statements = program.statements.body + + assert_equal 1, statements.length + assert_kind_of WhileNode, statements.first + + predicate = statements.first.predicate + assert_kind_of CallNode, predicate + assert_equal :gets, predicate.name + + arguments = predicate.arguments.arguments + assert_equal 2, arguments.length + assert_equal :$/, arguments.first.name + assert_equal "chomp", arguments.last.elements.first.key.unescaped + end + + def test_command_line_e + result = Prism.parse("1 if 2..3") + assert_equal 2, result.warnings.length + + result = Prism.parse("1 if 2..3", command_line: "e") + assert_equal 0, result.warnings.length + end + end +end diff --git a/test/mri/prism/comments_test.rb b/test/mri/prism/comments_test.rb new file mode 100644 index 00000000000..b99c00268c3 --- /dev/null +++ b/test/mri/prism/comments_test.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class CommentsTest < TestCase + def test_comment_inline + source = "# comment" + assert_equal [0], Debug.newlines(source) + + assert_comment( + source, + InlineComment, + start_offset: 0, + end_offset: 9, + start_line: 1, + end_line: 1, + start_column: 0, + end_column: 9 + ) + end + + def test_comment_inline_def + source = <<~RUBY + def foo + # a comment + end + RUBY + + assert_comment( + source, + InlineComment, + start_offset: 10, + end_offset: 21, + start_line: 2, + end_line: 2, + start_column: 2, + end_column: 13 + ) + end + + def test___END__ + result = Prism.parse(<<~RUBY) + __END__ + comment + RUBY + + data_loc = result.data_loc + assert_equal 0, data_loc.start_offset + assert_equal 16, data_loc.end_offset + end + + def test___END__crlf + result = Prism.parse("__END__\r\ncomment\r\n") + + data_loc = result.data_loc + assert_equal 0, data_loc.start_offset + assert_equal 18, data_loc.end_offset + end + + def test_comment_embedded_document + source = <<~RUBY + =begin + comment + =end + RUBY + + assert_comment( + source, + EmbDocComment, + start_offset: 0, + end_offset: 20, + start_line: 1, + end_line: 4, + start_column: 0, + end_column: 0 + ) + end + + def test_comment_embedded_document_with_content_on_same_line + source = <<~RUBY + =begin other stuff + =end + RUBY + + assert_comment( + source, + EmbDocComment, + start_offset: 0, + end_offset: 24, + start_line: 1, + end_line: 3, + start_column: 0, + end_column: 0 + ) + end + + def test_attaching_comments + source = <<~RUBY + # Foo class + class Foo + # bar method + def bar + # baz invocation + baz + end # bar end + end # Foo end + RUBY + + result = Prism.parse(source) + result.attach_comments! + tree = result.value + class_node = tree.statements.body.first + method_node = class_node.body.body.first + call_node = method_node.body.body.first + + assert_equal("# Foo class\n# Foo end", class_node.location.comments.map { |c| c.location.slice }.join("\n")) + assert_equal("# bar method\n# bar end", method_node.location.comments.map { |c| c.location.slice }.join("\n")) + assert_equal("# baz invocation", call_node.location.comments.map { |c| c.location.slice }.join("\n")) + end + + private + + def assert_comment(source, type, start_offset:, end_offset:, start_line:, end_line:, start_column:, end_column:) + result = Prism.parse(source) + assert result.errors.empty?, result.errors.map(&:message).join("\n") + assert_kind_of type, result.comments.first + + location = result.comments.first.location + assert_equal start_offset, location.start_offset, -> { "Expected start_offset to be #{start_offset}" } + assert_equal end_offset, location.end_offset, -> { "Expected end_offset to be #{end_offset}" } + assert_equal start_line, location.start_line, -> { "Expected start_line to be #{start_line}" } + assert_equal end_line, location.end_line, -> { "Expected end_line to be #{end_line}" } + assert_equal start_column, location.start_column, -> { "Expected start_column to be #{start_column}" } + assert_equal end_column, location.end_column, -> { "Expected end_column to be #{end_column}" } + end + end +end diff --git a/test/mri/prism/compiler_test.rb b/test/mri/prism/compiler_test.rb new file mode 100644 index 00000000000..9a326eb8d61 --- /dev/null +++ b/test/mri/prism/compiler_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# typed: ignore + +require_relative "test_helper" + +module Prism + class CompilerTest < TestCase + class SExpressions < Prism::Compiler + def visit_arguments_node(node) + [:arguments, super] + end + + def visit_call_node(node) + [:call, super] + end + + def visit_integer_node(node) + [:integer] + end + + def visit_program_node(node) + [:program, super] + end + end + + def test_compiler + expected = [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] + assert_equal expected, Prism.parse("1 + 2").value.accept(SExpressions.new) + end + end +end diff --git a/test/mri/prism/constant_path_node_test.rb b/test/mri/prism/constant_path_node_test.rb new file mode 100644 index 00000000000..dffb55c0ffe --- /dev/null +++ b/test/mri/prism/constant_path_node_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class ConstantPathNodeTest < TestCase + def test_full_name_for_constant_path + source = <<~RUBY + Foo:: # comment + Bar::Baz:: + Qux + RUBY + + constant_path = Prism.parse(source).value.statements.body.first + assert_equal("Foo::Bar::Baz::Qux", constant_path.full_name) + end + + def test_full_name_for_constant_path_with_self + source = <<~RUBY + self:: # comment + Bar::Baz:: + Qux + RUBY + + constant_path = Prism.parse(source).value.statements.body.first + assert_raise(ConstantPathNode::DynamicPartsInConstantPathError) do + constant_path.full_name + end + end + + def test_full_name_for_constant_path_with_variable + source = <<~RUBY + foo:: # comment + Bar::Baz:: + Qux + RUBY + + constant_path = Prism.parse(source).value.statements.body.first + + assert_raise(ConstantPathNode::DynamicPartsInConstantPathError) do + constant_path.full_name + end + end + + def test_full_name_for_constant_path_target + source = <<~RUBY + Foo:: # comment + Bar::Baz:: + Qux, Something = [1, 2] + RUBY + + node = Prism.parse(source).value.statements.body.first + assert_equal("Foo::Bar::Baz::Qux", node.lefts.first.full_name) + end + + def test_full_name_for_constant_path_with_stovetop_start + source = <<~RUBY + ::Foo:: # comment + Bar::Baz:: + Qux, Something = [1, 2] + RUBY + + node = Prism.parse(source).value.statements.body.first + assert_equal("::Foo::Bar::Baz::Qux", node.lefts.first.full_name) + end + + def test_full_name_for_constant_path_target_with_non_constant_parent + source = <<~RUBY + self::Foo, Bar = [1, 2] + RUBY + + constant_target = Prism.parse(source).value.statements.body.first + dynamic, static = constant_target.lefts + + assert_raise(ConstantPathNode::DynamicPartsInConstantPathError) do + dynamic.full_name + end + + assert_equal("Bar", static.full_name) + end + + def test_full_name_for_constant_read_node + source = <<~RUBY + Bar + RUBY + + constant = Prism.parse(source).value.statements.body.first + assert_equal("Bar", constant.full_name) + end + end +end diff --git a/test/mri/prism/desugar_compiler_test.rb b/test/mri/prism/desugar_compiler_test.rb new file mode 100644 index 00000000000..1a1d580d2dc --- /dev/null +++ b/test/mri/prism/desugar_compiler_test.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class DesugarCompilerTest < TestCase + def test_and_write + assert_desugars("(AndNode (ClassVariableReadNode) (ClassVariableWriteNode (CallNode)))", "@@foo &&= bar") + assert_not_desugared("Foo::Bar &&= baz", "Desugaring would execute Foo twice or need temporary variables") + assert_desugars("(AndNode (ConstantReadNode) (ConstantWriteNode (CallNode)))", "Foo &&= bar") + assert_desugars("(AndNode (GlobalVariableReadNode) (GlobalVariableWriteNode (CallNode)))", "$foo &&= bar") + assert_desugars("(AndNode (InstanceVariableReadNode) (InstanceVariableWriteNode (CallNode)))", "@foo &&= bar") + assert_desugars("(AndNode (LocalVariableReadNode) (LocalVariableWriteNode (CallNode)))", "foo &&= bar") + assert_desugars("(AndNode (LocalVariableReadNode) (LocalVariableWriteNode (CallNode)))", "foo = 1; foo &&= bar") + end + + def test_or_write + assert_desugars("(IfNode (DefinedNode (ClassVariableReadNode)) (StatementsNode (ClassVariableReadNode)) (ElseNode (StatementsNode (ClassVariableWriteNode (CallNode)))))", "@@foo ||= bar") + assert_not_desugared("Foo::Bar ||= baz", "Desugaring would execute Foo twice or need temporary variables") + assert_desugars("(IfNode (DefinedNode (ConstantReadNode)) (StatementsNode (ConstantReadNode)) (ElseNode (StatementsNode (ConstantWriteNode (CallNode)))))", "Foo ||= bar") + assert_desugars("(IfNode (DefinedNode (GlobalVariableReadNode)) (StatementsNode (GlobalVariableReadNode)) (ElseNode (StatementsNode (GlobalVariableWriteNode (CallNode)))))", "$foo ||= bar") + assert_desugars("(OrNode (InstanceVariableReadNode) (InstanceVariableWriteNode (CallNode)))", "@foo ||= bar") + assert_desugars("(OrNode (LocalVariableReadNode) (LocalVariableWriteNode (CallNode)))", "foo ||= bar") + assert_desugars("(OrNode (LocalVariableReadNode) (LocalVariableWriteNode (CallNode)))", "foo = 1; foo ||= bar") + end + + def test_operator_write + assert_desugars("(ClassVariableWriteNode (CallNode (ClassVariableReadNode) (ArgumentsNode (CallNode))))", "@@foo += bar") + assert_not_desugared("Foo::Bar += baz", "Desugaring would execute Foo twice or need temporary variables") + assert_desugars("(ConstantWriteNode (CallNode (ConstantReadNode) (ArgumentsNode (CallNode))))", "Foo += bar") + assert_desugars("(GlobalVariableWriteNode (CallNode (GlobalVariableReadNode) (ArgumentsNode (CallNode))))", "$foo += bar") + assert_desugars("(InstanceVariableWriteNode (CallNode (InstanceVariableReadNode) (ArgumentsNode (CallNode))))", "@foo += bar") + assert_desugars("(LocalVariableWriteNode (CallNode (LocalVariableReadNode) (ArgumentsNode (CallNode))))", "foo += bar") + assert_desugars("(LocalVariableWriteNode (CallNode (LocalVariableReadNode) (ArgumentsNode (CallNode))))", "foo = 1; foo += bar") + end + + private + + def ast_inspect(node) + parts = [node.class.name.split("::").last] + + node.deconstruct_keys(nil).each do |_, value| + case value + when Node + parts << ast_inspect(value) + when Array + parts.concat(value.map { |element| ast_inspect(element) }) + end + end + + "(#{parts.join(" ")})" + end + + # Ensure every node is only present once in the AST. + # If the same node is present twice it would most likely indicate it is executed twice, which is invalid semantically. + # This also acts as a sanity check that Node#child_nodes returns only nodes or nil (which caught a couple bugs). + def ensure_every_node_once_in_ast(node, all_nodes = {}.compare_by_identity) + if all_nodes.include?(node) + raise "#{node.inspect} is present multiple times in the desugared AST and likely executed multiple times" + else + all_nodes[node] = true + end + node.child_nodes.each do |child| + ensure_every_node_once_in_ast(child, all_nodes) unless child.nil? + end + end + + def assert_desugars(expected, source) + ast = Prism.parse(source).value.accept(DesugarCompiler.new) + assert_equal expected, ast_inspect(ast.statements.body.last) + + ensure_every_node_once_in_ast(ast) + end + + def assert_not_desugared(source, reason) + ast = Prism.parse(source).value + assert_equal_nodes(ast, ast.accept(DesugarCompiler.new)) + end + end +end diff --git a/test/mri/prism/dispatcher_test.rb b/test/mri/prism/dispatcher_test.rb new file mode 100644 index 00000000000..0d8a6d35e90 --- /dev/null +++ b/test/mri/prism/dispatcher_test.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class DispatcherTest < TestCase + class TestListener + attr_reader :events_received + + def initialize + @events_received = [] + end + + def on_call_node_enter(node) + events_received << :on_call_node_enter + end + + def on_call_node_leave(node) + events_received << :on_call_node_leave + end + + def on_integer_node_enter(node) + events_received << :on_integer_node_enter + end + end + + def test_dispatching_events + listener = TestListener.new + dispatcher = Dispatcher.new + dispatcher.register(listener, :on_call_node_enter, :on_call_node_leave, :on_integer_node_enter) + + root = Prism.parse(<<~RUBY).value + def foo + something(1, 2, 3) + end + RUBY + + dispatcher.dispatch(root) + assert_equal([:on_call_node_enter, :on_integer_node_enter, :on_integer_node_enter, :on_integer_node_enter, :on_call_node_leave], listener.events_received) + + listener.events_received.clear + dispatcher.dispatch_once(root.statements.body.first.body.body.first) + assert_equal([:on_call_node_enter, :on_call_node_leave], listener.events_received) + end + end +end diff --git a/test/mri/prism/encoding_test.rb b/test/mri/prism/encoding_test.rb new file mode 100644 index 00000000000..c23bb8c294b --- /dev/null +++ b/test/mri/prism/encoding_test.rb @@ -0,0 +1,572 @@ +# frozen_string_literal: true + +return if RUBY_ENGINE != "ruby" + +require_relative "test_helper" + +module Prism + class EncodingTest < TestCase + codepoints_1byte = 0...0x100 + encodings = { + Encoding::ASCII_8BIT => codepoints_1byte, + Encoding::US_ASCII => codepoints_1byte, + Encoding::Windows_1253 => codepoints_1byte + } + + # By default we don't test every codepoint in these encodings because it + # takes a very long time. + if ENV["PRISM_TEST_ALL_ENCODINGS"] + codepoints_2bytes = 0...0x10000 + codepoints_unicode = (0...0x110000) + + codepoints_eucjp = [ + *(0...0x10000), + *(0...0x10000).map { |bytes| bytes | 0x8F0000 } + ] + + codepoints_emacs_mule = [ + *(0...0x80), + *((0x81...0x90).flat_map { |byte1| (0x90...0x100).map { |byte2| byte1 << 8 | byte2 } }), + *((0x90...0x9C).flat_map { |byte1| (0xA0...0x100).flat_map { |byte2| (0xA0...0x100).flat_map { |byte3| byte1 << 16 | byte2 << 8 | byte3 } } }), + *((0xF0...0xF5).flat_map { |byte2| (0xA0...0x100).flat_map { |byte3| (0xA0...0x100).flat_map { |byte4| 0x9C << 24 | byte3 << 16 | byte3 << 8 | byte4 } } }), + ] + + codepoints_gb18030 = [ + *(0...0x80), + *((0x81..0xFE).flat_map { |byte1| (0x40...0x100).map { |byte2| byte1 << 8 | byte2 } }), + *((0x81..0xFE).flat_map { |byte1| (0x30...0x40).flat_map { |byte2| (0x81..0xFE).flat_map { |byte3| (0x2F...0x41).map { |byte4| byte1 << 24 | byte2 << 16 | byte3 << 8 | byte4 } } } }), + ] + + codepoints_euc_tw = [ + *(0..0x7F), + *(0xA1..0xFF).flat_map { |byte1| (0xA1..0xFF).map { |byte2| (byte1 << 8) | byte2 } }, + *(0xA1..0xB0).flat_map { |byte2| (0xA1..0xFF).flat_map { |byte3| (0xA1..0xFF).flat_map { |byte4| 0x8E << 24 | byte2 << 16 | byte3 << 8 | byte4 } } } + ] + + encodings.merge!( + Encoding::CP850 => codepoints_1byte, + Encoding::CP852 => codepoints_1byte, + Encoding::CP855 => codepoints_1byte, + Encoding::GB1988 => codepoints_1byte, + Encoding::IBM437 => codepoints_1byte, + Encoding::IBM720 => codepoints_1byte, + Encoding::IBM737 => codepoints_1byte, + Encoding::IBM775 => codepoints_1byte, + Encoding::IBM852 => codepoints_1byte, + Encoding::IBM855 => codepoints_1byte, + Encoding::IBM857 => codepoints_1byte, + Encoding::IBM860 => codepoints_1byte, + Encoding::IBM861 => codepoints_1byte, + Encoding::IBM862 => codepoints_1byte, + Encoding::IBM863 => codepoints_1byte, + Encoding::IBM864 => codepoints_1byte, + Encoding::IBM865 => codepoints_1byte, + Encoding::IBM866 => codepoints_1byte, + Encoding::IBM869 => codepoints_1byte, + Encoding::ISO_8859_1 => codepoints_1byte, + Encoding::ISO_8859_2 => codepoints_1byte, + Encoding::ISO_8859_3 => codepoints_1byte, + Encoding::ISO_8859_4 => codepoints_1byte, + Encoding::ISO_8859_5 => codepoints_1byte, + Encoding::ISO_8859_6 => codepoints_1byte, + Encoding::ISO_8859_7 => codepoints_1byte, + Encoding::ISO_8859_8 => codepoints_1byte, + Encoding::ISO_8859_9 => codepoints_1byte, + Encoding::ISO_8859_10 => codepoints_1byte, + Encoding::ISO_8859_11 => codepoints_1byte, + Encoding::ISO_8859_13 => codepoints_1byte, + Encoding::ISO_8859_14 => codepoints_1byte, + Encoding::ISO_8859_15 => codepoints_1byte, + Encoding::ISO_8859_16 => codepoints_1byte, + Encoding::KOI8_R => codepoints_1byte, + Encoding::KOI8_U => codepoints_1byte, + Encoding::MACCENTEURO => codepoints_1byte, + Encoding::MACCROATIAN => codepoints_1byte, + Encoding::MACCYRILLIC => codepoints_1byte, + Encoding::MACGREEK => codepoints_1byte, + Encoding::MACICELAND => codepoints_1byte, + Encoding::MACROMAN => codepoints_1byte, + Encoding::MACROMANIA => codepoints_1byte, + Encoding::MACTHAI => codepoints_1byte, + Encoding::MACTURKISH => codepoints_1byte, + Encoding::MACUKRAINE => codepoints_1byte, + Encoding::TIS_620 => codepoints_1byte, + Encoding::Windows_1250 => codepoints_1byte, + Encoding::Windows_1251 => codepoints_1byte, + Encoding::Windows_1252 => codepoints_1byte, + Encoding::Windows_1254 => codepoints_1byte, + Encoding::Windows_1255 => codepoints_1byte, + Encoding::Windows_1256 => codepoints_1byte, + Encoding::Windows_1257 => codepoints_1byte, + Encoding::Windows_1258 => codepoints_1byte, + Encoding::Windows_874 => codepoints_1byte, + Encoding::Big5 => codepoints_2bytes, + Encoding::Big5_HKSCS => codepoints_2bytes, + Encoding::Big5_UAO => codepoints_2bytes, + Encoding::CP949 => codepoints_2bytes, + Encoding::CP950 => codepoints_2bytes, + Encoding::CP951 => codepoints_2bytes, + Encoding::EUC_KR => codepoints_2bytes, + Encoding::GBK => codepoints_2bytes, + Encoding::GB12345 => codepoints_2bytes, + Encoding::GB2312 => codepoints_2bytes, + Encoding::MACJAPANESE => codepoints_2bytes, + Encoding::Shift_JIS => codepoints_2bytes, + Encoding::SJIS_DoCoMo => codepoints_2bytes, + Encoding::SJIS_KDDI => codepoints_2bytes, + Encoding::SJIS_SoftBank => codepoints_2bytes, + Encoding::Windows_31J => codepoints_2bytes, + Encoding::UTF_8 => codepoints_unicode, + Encoding::UTF8_MAC => codepoints_unicode, + Encoding::UTF8_DoCoMo => codepoints_unicode, + Encoding::UTF8_KDDI => codepoints_unicode, + Encoding::UTF8_SoftBank => codepoints_unicode, + Encoding::CESU_8 => codepoints_unicode, + Encoding::CP51932 => codepoints_eucjp, + Encoding::EUC_JP => codepoints_eucjp, + Encoding::EUCJP_MS => codepoints_eucjp, + Encoding::EUC_JIS_2004 => codepoints_eucjp, + Encoding::EMACS_MULE => codepoints_emacs_mule, + Encoding::STATELESS_ISO_2022_JP => codepoints_emacs_mule, + Encoding::STATELESS_ISO_2022_JP_KDDI => codepoints_emacs_mule, + Encoding::GB18030 => codepoints_gb18030, + Encoding::EUC_TW => codepoints_euc_tw + ) + end + + # These test that we're correctly parsing codepoints for each alias of each + # encoding that prism supports. + encodings.each do |encoding, range| + (encoding.names - %w[external internal filesystem locale]).each do |name| + define_method(:"test_encoding_#{name}") do + assert_encoding(encoding, name, range) + end + end + end + + # These test that we're correctly setting the flags on strings for each + # encoding that prism supports. + escapes = ["\\x00", "\\x7F", "\\x80", "\\xFF", "\\u{00}", "\\u{7F}", "\\u{80}", "\\M-\\C-?"] + escapes = escapes.concat(escapes.product(escapes).map(&:join)) + symbols = [:a, :ą, :+] + regexps = [/a/, /ą/, //] + + encodings.each_key do |encoding| + define_method(:"test_encoding_flags_#{encoding.name}") do + assert_encoding_flags(encoding, escapes) + end + + define_method(:"test_symbol_encoding_flags_#{encoding.name}") do + assert_symbol_encoding_flags(encoding, symbols) + end + + define_method(:"test_symbol_character_escape_encoding_flags_#{encoding.name}") do + assert_symbol_character_escape_encoding_flags(encoding, escapes) + end + + define_method(:"test_regular_expression_encoding_flags_#{encoding.name}") do + assert_regular_expression_encoding_flags(encoding, regexps.map(&:inspect)) + end + + define_method(:"test_regular_expression_escape_encoding_flags_#{encoding.name}") do + assert_regular_expression_encoding_flags(encoding, escapes.map { |e| "/#{e}/" }) + end + end + + encoding_modifiers = { ascii_8bit: "n", utf_8: "u", euc_jp: "e", windows_31j: "s" } + regexp_sources = ["abc", "garçon", "\\x80", "gar\\xC3\\xA7on", "gar\\u{E7}on", "abc\\u{FFFFFF}", "\\x80\\u{80}" ] + + encoding_modifiers.each_value do |modifier| + encodings.each_key do |encoding| + define_method(:"test_regular_expression_encoding_modifiers_/#{modifier}_#{encoding.name}") do + assert_regular_expression_encoding_flags( + encoding, + regexp_sources.product(encoding_modifiers.values).map { |r, modifier| "/#{r}/#{modifier}" } + ) + end + end + end + + def test_coding + result = Prism.parse("# coding: utf-8\n'string'") + actual = result.value.statements.body.first.unescaped.encoding + assert_equal Encoding.find("utf-8"), actual + end + + def test_coding_with_whitespace + result = Prism.parse("# coding \t \r \v : \t \v \r ascii-8bit \n'string'") + actual = result.value.statements.body.first.unescaped.encoding + assert_equal Encoding.find("ascii-8bit"), actual + end + + def test_emacs_style + result = Prism.parse("# -*- coding: utf-8 -*-\n'string'") + actual = result.value.statements.body.first.unescaped.encoding + assert_equal Encoding.find("utf-8"), actual + end + + # This test may be a little confusing. Basically when we use our strpbrk, it + # takes into account the encoding of the file. + def test_strpbrk_multibyte + result = Prism.parse(<<~RUBY) + # encoding: Shift_JIS + %w[\x81\x5c] + RUBY + + assert(result.errors.empty?) + assert_equal( + (+"\x81\x5c").force_encoding(Encoding::Shift_JIS), + result.value.statements.body.first.elements.first.unescaped + ) + end + + def test_utf_8_variations + %w[ + utf-8-unix + utf-8-dos + utf-8-mac + utf-8-* + ].each do |encoding| + result = Prism.parse("# coding: #{encoding}\n'string'") + actual = result.value.statements.body.first.unescaped.encoding + assert_equal Encoding.find("utf-8"), actual + end + end + + def test_first_lexed_token + encoding = Prism.lex("# encoding: ascii-8bit").value[0][0].value.encoding + assert_equal Encoding.find("ascii-8bit"), encoding + end + + def test_slice_encoding + slice = Prism.parse("# encoding: Shift_JIS\nア").value.slice + assert_equal (+"ア").force_encoding(Encoding::SHIFT_JIS), slice + assert_equal Encoding::SHIFT_JIS, slice.encoding + end + + def test_multibyte_escapes + [ + ["'", "'"], + ["\"", "\""], + ["`", "`"], + ["/", "/"], + ["<<'HERE'\n", "\nHERE"], + ["<<-HERE\n", "\nHERE"] + ].each do |opening, closing| + assert Prism.parse_success?("# encoding: shift_jis\n'\\\x82\xA0'\n") + end + end + + private + + class ConstantContext < BasicObject + def self.const_missing(const) + const + end + end + + def constant_context + ConstantContext.new + end + + class IdentifierContext < BasicObject + def method_missing(name, *) + name + end + end + + def identifier_context + IdentifierContext.new + end + + def assert_encoding_constant(name, character) + source = "# encoding: #{name}\n#{character}" + expected = constant_context.instance_eval(source) + + result = Prism.parse(source) + assert result.success? + + actual = result.value.statements.body.last + assert_kind_of ConstantReadNode, actual + assert_equal expected, actual.name + end + + def assert_encoding_identifier(name, character) + source = "# encoding: #{name}\n#{character}" + expected = identifier_context.instance_eval(source) + + result = Prism.parse(source) + assert result.success? + + actual = result.value.statements.body.last + assert_kind_of CallNode, actual + assert_equal expected, actual.name + end + + # Check that we can properly parse every codepoint in the given encoding. + def assert_encoding(encoding, name, range) + # I'm not entirely sure, but I believe these codepoints are incorrect in + # their parsing in CRuby. They all report as matching `[[:lower:]]` but + # then they are parsed as constants. This is because CRuby determines if + # an identifier is a constant or not by case folding it down to lowercase + # and checking if there is a difference. And even though they report + # themselves as lowercase, their case fold is different. I have reported + # this bug upstream. + case encoding + when Encoding::UTF_8, Encoding::UTF_8_MAC, Encoding::UTF8_DoCoMo, Encoding::UTF8_KDDI, Encoding::UTF8_SoftBank, Encoding::CESU_8 + range = range.to_a - [ + 0x01c5, 0x01c8, 0x01cb, 0x01f2, 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, + 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f, 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, + 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f, 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, + 0x1fac, 0x1fad, 0x1fae, 0x1faf, 0x1fbc, 0x1fcc, 0x1ffc, + ] + when Encoding::Windows_1253 + range = range.to_a - [0xb5] + end + + range.each do |codepoint| + character = codepoint.chr(encoding) + + if character.match?(/[[:alpha:]]/) + if character.match?(/[[:upper:]]/) + assert_encoding_constant(name, character) + else + assert_encoding_identifier(name, character) + end + elsif character.match?(/[[:alnum:]]/) + assert_encoding_identifier(name, "_#{character}") + else + next if ["/", "{"].include?(character) + + source = "# encoding: #{name}\n/(?##{character})/\n" + assert Prism.parse(source).success? + end + rescue RangeError + source = "# encoding: #{name}\n\\x#{codepoint.to_s(16)}" + refute Prism.parse(source).success? + end + end + + def assert_encoding_flags(encoding, escapes) + escapes.each do |escaped| + source = "# encoding: #{encoding.name}\n\"#{escaped}\"" + + expected = + begin + eval(source).encoding + rescue SyntaxError => error + if error.message.include?("UTF-8 mixed within") + error.message[/: (.+?)\n/, 1] + else + raise + end + end + + actual = + Prism.parse(source).then do |result| + if result.success? + string = result.value.statements.body.first + + if string.forced_utf8_encoding? + Encoding::UTF_8 + elsif string.forced_binary_encoding? + Encoding::ASCII_8BIT + else + encoding + end + else + error = result.errors.first + + if error.message.include?("mixed") + error.message + else + raise error.message + end + end + end + + assert_equal expected, actual + end + end + + # Test Symbol literals without any interpolation or escape sequences. + def assert_symbol_encoding_flags(encoding, symbols) + symbols.each do |symbol| + source = "# encoding: #{encoding.name}\n#{symbol.inspect}" + + expected = + begin + eval(source).encoding + rescue SyntaxError => error + unless error.message.include?("invalid multibyte char") + raise + end + end + + actual = + Prism.parse(source).then do |result| + if result.success? + symbol = result.value.statements.body.first + + if symbol.forced_utf8_encoding? + Encoding::UTF_8 + elsif symbol.forced_binary_encoding? + Encoding::ASCII_8BIT + elsif symbol.forced_us_ascii_encoding? + Encoding::US_ASCII + else + encoding + end + else + error = result.errors.last + + unless error.message.include?("invalid symbol") + raise error.message + end + end + end + + assert_equal expected, actual + end + end + + def assert_symbol_character_escape_encoding_flags(encoding, escapes) + escapes.each do |escaped| + source = "# encoding: #{encoding.name}\n:\"#{escaped}\"" + + expected = + begin + eval(source).encoding + rescue SyntaxError => error + if error.message.include?("UTF-8 mixed within") + error.message[/: (.+?)\n/, 1] + else + raise + end + end + + actual = + Prism.parse(source).then do |result| + if result.success? + symbol = result.value.statements.body.first + + if symbol.forced_utf8_encoding? + Encoding::UTF_8 + elsif symbol.forced_binary_encoding? + Encoding::ASCII_8BIT + elsif symbol.forced_us_ascii_encoding? + Encoding::US_ASCII + else + encoding + end + else + error = result.errors.first + + if error.message.include?("mixed") + error.message + else + raise error.message + end + end + end + + assert_equal expected, actual + end + end + + def assert_regular_expression_encoding_flags(encoding, regexps) + regexps.each do |regexp| + regexp_modifier_used = regexp.end_with?("/u") || regexp.end_with?("/e") || regexp.end_with?("/s") || regexp.end_with?("/n") + source = "# encoding: #{encoding.name}\n#{regexp}" + + encoding_errors = ["invalid multibyte char", "escaped non ASCII character in UTF-8 regexp", "differs from source encoding"] + skipped_errors = ["invalid multibyte escape", "incompatible character encoding", "UTF-8 character in non UTF-8 regexp", "invalid Unicode range", "invalid Unicode list"] + + # TODO (nirvdrum 21-Feb-2024): Prism currently does not handle Regexp validation unless modifiers are used. So, skip processing those errors for now: https://github.com/ruby/prism/issues/2104 + unless regexp_modifier_used + skipped_errors += encoding_errors + encoding_errors.clear + end + + expected = + begin + eval(source).encoding + rescue SyntaxError => error + if encoding_errors.find { |e| error.message.include?(e) } + error.message.split("\n").map { |m| m[/: (.+?)$/, 1] } + elsif skipped_errors.find { |e| error.message.include?(e) } + next + else + raise + end + end + + actual = + Prism.parse(source).then do |result| + if result.success? + regexp = result.value.statements.body.first + + actual_encoding = if regexp.forced_utf8_encoding? + Encoding::UTF_8 + elsif regexp.forced_binary_encoding? + Encoding::ASCII_8BIT + elsif regexp.forced_us_ascii_encoding? + Encoding::US_ASCII + elsif regexp.ascii_8bit? + Encoding::ASCII_8BIT + elsif regexp.utf_8? + Encoding::UTF_8 + elsif regexp.euc_jp? + Encoding::EUC_JP + elsif regexp.windows_31j? + Encoding::Windows_31J + else + encoding + end + + if regexp.utf_8? && actual_encoding != Encoding::UTF_8 + raise "expected regexp encoding to be UTF-8 due to '/u' modifier, but got #{actual_encoding.name}" + elsif regexp.ascii_8bit? && (actual_encoding != Encoding::ASCII_8BIT && actual_encoding != Encoding::US_ASCII) + raise "expected regexp encoding to be ASCII-8BIT or US-ASCII due to '/n' modifier, but got #{actual_encoding.name}" + elsif regexp.euc_jp? && actual_encoding != Encoding::EUC_JP + raise "expected regexp encoding to be EUC-JP due to '/e' modifier, but got #{actual_encoding.name}" + elsif regexp.windows_31j? && actual_encoding != Encoding::Windows_31J + raise "expected regexp encoding to be Windows-31J due to '/s' modifier, but got #{actual_encoding.name}" + end + + if regexp.utf_8? && regexp.forced_utf8_encoding? + raise "the forced_utf8 flag should not be set when the UTF-8 modifier (/u) is used" + elsif regexp.ascii_8bit? && regexp.forced_binary_encoding? + raise "the forced_ascii_8bit flag should not be set when the UTF-8 modifier (/u) is used" + end + + actual_encoding + else + errors = result.errors.map(&:message) + + if errors.last&.include?("UTF-8 mixed within") + nil + else + errors + end + end + end + + # TODO (nirvdrum 22-Feb-2024): Remove this workaround once Prism better maps CRuby's error messages. + # This class of error message is tricky. The part not being compared is a representation of the regexp. + # Depending on the source encoding and any encoding modifiers being used, CRuby alters how the regexp is represented. + # Sometimes it's an MBC string. Other times it uses hexadecimal character escapes. And in other cases it uses + # the long-form Unicode escape sequences. This short-circuit checks that the error message is mostly correct. + if expected.is_a?(Array) && actual.is_a?(Array) + if expected.last.start_with?("/.../n has a non escaped non ASCII character in non ASCII-8BIT script:") && + actual.last.start_with?("/.../n has a non escaped non ASCII character in non ASCII-8BIT script:") + expected.last.clear + actual.last.clear + end + end + + assert_equal expected, actual + end + end + end +end diff --git a/test/mri/prism/errors_test.rb b/test/mri/prism/errors_test.rb new file mode 100644 index 00000000000..ccf7485c7bd --- /dev/null +++ b/test/mri/prism/errors_test.rb @@ -0,0 +1,2174 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class ErrorsTest < TestCase + include DSL + + def test_constant_path_with_invalid_token_after + assert_error_messages "A::$b", [ + "expected a constant after the `::` operator", + "unexpected global variable, expecting end-of-input" + ] + end + + def test_module_name_recoverable + expected = ModuleNode( + [], + Location(), + ConstantReadNode(:Parent), + StatementsNode( + [ModuleNode([], Location(), MissingNode(), nil, Location(), :"")] + ), + Location(), + :Parent + ) + + assert_errors expected, "module Parent module end", [ + ["expected a constant name after `module`", 14..20], + ["unexpected 'end', assuming it is closing the parent module definition", 21..24] + ] + end + + def test_for_loops_index_missing + expected = ForNode( + MissingNode(), + expression("1..10"), + StatementsNode([expression("i")]), + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "for in 1..10\ni\nend", [ + ["expected an index after `for`", 0..3] + ] + end + + def test_for_loops_only_end + expected = ForNode( + MissingNode(), + MissingNode(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "for end", [ + ["expected an index after `for`", 0..3], + ["expected an `in` after the index in a `for` statement", 3..3], + ["expected a collection after the `in` in a `for` statement", 3..3] + ] + end + + def test_pre_execution_missing_brace + expected = PreExecutionNode( + StatementsNode([expression("1")]), + Location(), + Location(), + Location() + ) + + assert_errors expected, "BEGIN 1 }", [ + ["expected a `{` after `BEGIN`", 5..5] + ] + end + + def test_pre_execution_context + expected = PreExecutionNode( + StatementsNode([ + CallNode( + 0, + expression("1"), + nil, + :+, + Location(), + nil, + ArgumentsNode(0, [MissingNode()]), + nil, + nil + ) + ]), + Location(), + Location(), + Location() + ) + + assert_errors expected, "BEGIN { 1 + }", [ + ["expected an expression after the operator", 10..11], + ["unexpected '}', assuming it is closing the parent 'BEGIN' block", 12..13] + ] + end + + def test_unterminated_embdoc + assert_errors expression("1"), "1\n=begin\n", [ + ["could not find a terminator for the embedded document", 2..9] + ] + end + + def test_unterminated_i_list + assert_errors expression("%i["), "%i[", [ + ["expected a closing delimiter for the `%i` list", 0..3] + ] + end + + def test_unterminated_w_list + assert_errors expression("%w["), "%w[", [ + ["expected a closing delimiter for the `%w` list", 0..3] + ] + end + + def test_unterminated_W_list + assert_errors expression("%W["), "%W[", [ + ["expected a closing delimiter for the `%W` list", 0..3] + ] + end + + def test_unterminated_regular_expression + assert_errors expression("/hello"), "/hello", [ + ["expected a closing delimiter for the regular expression", 0..1] + ] + end + + def test_unterminated_regular_expression_with_heredoc + source = "<<-END + /b\nEND\n" + + assert_errors expression(source), source, [ + ["expected a closing delimiter for the regular expression", 9..10] + ] + end + + def test_unterminated_xstring + assert_errors expression("`hello"), "`hello", [ + ["expected a closing delimiter for the `%x` or backtick string", 0..1] + ] + end + + def test_unterminated_interpolated_string + expr = expression('"hello') + assert_errors expr, '"hello', [ + ["unterminated string meets end of file", 6..6] + ] + assert_equal expr.unescaped, "hello" + assert_equal expr.closing, "" + end + + def test_unterminated_string + expr = expression("'hello") + assert_errors expr, "'hello", [ + ["unterminated string meets end of file", 0..1] + ] + assert_equal expr.unescaped, "hello" + assert_equal expr.closing, "" + end + + def test_unterminated_empty_string + expr = expression('"') + assert_errors expr, '"', [ + ["unterminated string meets end of file", 1..1] + ] + assert_equal expr.unescaped, "" + assert_equal expr.closing, "" + end + + def test_incomplete_instance_var_string + assert_errors expression('%@#@@#'), '%@#@@#', [ + ["'@#' is not allowed as an instance variable name", 4..5], + ["unexpected instance variable, expecting end-of-input", 4..5] + ] + end + + def test_unterminated_s_symbol + assert_errors expression("%s[abc"), "%s[abc", [ + ["expected a closing delimiter for the dynamic symbol", 0..3] + ] + end + + def test_unterminated_parenthesized_expression + assert_errors expression('(1 + 2'), '(1 + 2', [ + ["unexpected end of file, expecting end-of-input", 6..6], + ["unexpected end of file, assuming it is closing the parent top level context", 6..6], + ["expected a matching `)`", 6..6] + ] + end + + def test_missing_terminator_in_parentheses + assert_error_messages "(0 0)", [ + "unexpected integer, expecting end-of-input" + ] + end + + def test_unterminated_argument_expression + assert_errors expression('a %'), 'a %', [ + ["invalid `%` token", 2..3], + ["expected an expression after the operator", 2..3], + ["unexpected end of file, assuming it is closing the parent top level context", 3..3] + ] + end + + def test_unterminated_interpolated_symbol + assert_error_messages ":\"#", [ + "expected a closing delimiter for the interpolated symbol" + ] + end + + def test_cr_without_lf_in_percent_expression + assert_errors expression("%\r"), "%\r", [ + ["invalid `%` token", 0..2], + ] + end + + def test_1_2_3 + assert_errors expression("(1, 2, 3)"), "(1, 2, 3)", [ + ["unexpected ',', expecting end-of-input", 2..3], + ["unexpected ',', ignoring it", 2..3], + ["expected a matching `)`", 2..2], + ["unexpected ',', expecting end-of-input", 2..3], + ["unexpected ',', ignoring it", 2..3], + ["unexpected ',', expecting end-of-input", 5..6], + ["unexpected ',', ignoring it", 5..6], + ["unexpected ')', expecting end-of-input", 8..9], + ["unexpected ')', ignoring it", 8..9] + ] + end + + def test_return_1_2_3 + assert_error_messages "return(1, 2, 3)", [ + "unexpected ',', expecting end-of-input", + "unexpected ',', ignoring it", + "expected a matching `)`", + "unexpected ')', expecting end-of-input", + "unexpected ')', ignoring it" + ] + end + + def test_return_1 + assert_errors expression("return 1,;"), "return 1,;", [ + ["expected an argument", 8..9] + ] + end + + def test_next_1_2_3 + assert_errors expression("next(1, 2, 3)"), "next(1, 2, 3)", [ + ["unexpected ',', expecting end-of-input", 6..7], + ["unexpected ',', ignoring it", 6..7], + ["expected a matching `)`", 6..6], + ["unexpected ')', expecting end-of-input", 12..13], + ["unexpected ')', ignoring it", 12..13] + ] + end + + def test_next_1 + assert_errors expression("next 1,;"), "next 1,;", [ + ["expected an argument", 6..7] + ] + end + + def test_break_1_2_3 + assert_errors expression("break(1, 2, 3)"), "break(1, 2, 3)", [ + ["unexpected ',', expecting end-of-input", 7..8], + ["unexpected ',', ignoring it", 7..8], + ["expected a matching `)`", 7..7], + ["unexpected ')', expecting end-of-input", 13..14], + ["unexpected ')', ignoring it", 13..14] + ] + end + + def test_break_1 + assert_errors expression("break 1,;"), "break 1,;", [ + ["expected an argument", 7..8] + ] + end + + def test_argument_forwarding_when_parent_is_not_forwarding + assert_errors expression('def a(x, y, z); b(...); end'), 'def a(x, y, z); b(...); end', [ + ["unexpected `...` when the parent method is not forwarding", 18..21] + ] + end + + def test_argument_forwarding_only_effects_its_own_internals + assert_errors expression('def a(...); b(...); end; def c(x, y, z); b(...); end'), + 'def a(...); b(...); end; def c(x, y, z); b(...); end', [ + ["unexpected `...` when the parent method is not forwarding", 43..46] + ] + end + + def test_top_level_constant_with_downcased_identifier + assert_error_messages "::foo", [ + "expected a constant after the `::` operator", + "unexpected local variable or method, expecting end-of-input" + ] + end + + def test_top_level_constant_starting_with_downcased_identifier + assert_error_messages "::foo::A", [ + "expected a constant after the `::` operator", + "unexpected local variable or method, expecting end-of-input" + ] + end + + def test_aliasing_global_variable_with_non_global_variable + assert_errors expression("alias $a b"), "alias $a b", [ + ["invalid argument being passed to `alias`; expected a bare word, symbol, constant, or global variable", 9..10] + ] + end + + def test_aliasing_non_global_variable_with_global_variable + assert_errors expression("alias a $b"), "alias a $b", [ + ["invalid argument being passed to `alias`; expected a bare word, symbol, constant, or global variable", 8..10] + ] + end + + def test_aliasing_global_variable_with_global_number_variable + assert_errors expression("alias $a $1"), "alias $a $1", [ + ["invalid argument being passed to `alias`; expected a bare word, symbol, constant, or global variable", 9..11] + ] + end + + def test_def_with_expression_receiver_and_no_identifier + assert_errors expression("def (a); end"), "def (a); end", [ + ["expected a `.` or `::` after the receiver in a method definition", 7..7], + ["expected a method name", 7..7] + ] + end + + def test_def_with_multiple_statements_receiver + assert_errors expression("def (\na\nb\n).c; end"), "def (\na\nb\n).c; end", [ + ["expected a matching `)`", 8..8], + ["expected a `.` or `::` after the receiver in a method definition", 8..8], + ["expected a delimiter to close the parameters", 9..9], + ["unexpected ')', ignoring it", 10..11], + ["unexpected '.', ignoring it", 11..12] + ] + end + + def test_def_with_empty_expression_receiver + assert_errors expression("def ().a; end"), "def ().a; end", [ + ["expected a receiver for the method definition", 4..5] + ] + end + + def test_block_beginning_with_brace_and_ending_with_end + assert_error_messages "x.each { x end", [ + "unexpected 'end', expecting end-of-input", + "unexpected 'end', ignoring it", + "unexpected end of file, assuming it is closing the parent top level context", + "expected a block beginning with `{` to end with `}`" + ] + end + + def test_double_splat_followed_by_splat_argument + expected = CallNode( + CallNodeFlags::IGNORE_VISIBILITY, + nil, + nil, + :a, + Location(), + Location(), + ArgumentsNode(1, [ + KeywordHashNode(0, [AssocSplatNode(expression("kwargs"), Location())]), + SplatNode(Location(), expression("args")) + ]), + Location(), + nil + ) + + assert_errors expected, "a(**kwargs, *args)", [ + ["unexpected `*` splat argument after a `**` keyword splat argument", 12..17] + ] + end + + def test_arguments_after_block + expected = CallNode( + CallNodeFlags::IGNORE_VISIBILITY, + nil, + nil, + :a, + Location(), + Location(), + ArgumentsNode(0, [expression("foo")]), + Location(), + BlockArgumentNode(expression("block"), Location()) + ) + + assert_errors expected, "a(&block, foo)", [ + ["unexpected argument after a block argument", 10..13] + ] + end + + def test_arguments_binding_power_for_and + assert_error_messages "foo(*bar and baz)", [ + "expected a `)` to close the arguments", + "unexpected ')', expecting end-of-input", + "unexpected ')', ignoring it" + ] + end + + def test_splat_argument_after_keyword_argument + expected = CallNode( + CallNodeFlags::IGNORE_VISIBILITY, + nil, + nil, + :a, + Location(), + Location(), + ArgumentsNode(0, [ + KeywordHashNode(1, [ + AssocNode( + SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, nil, Location(), Location(), "foo"), + expression("bar"), + nil + ) + ]), + SplatNode(Location(), expression("args")) + ]), + Location(), + nil + ) + + assert_errors expected, "a(foo: bar, *args)", [ + ["unexpected `*` splat argument after a `**` keyword splat argument", 12..17] + ] + end + + def test_module_definition_in_method_body + expected = DefNode( + :foo, + Location(), + nil, + nil, + StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), :A)]), + [], + Location(), + nil, + nil, + nil, + nil, + Location() + ) + + assert_errors expected, "def foo;module A;end;end", [ + ["unexpected module definition in a method definition", 8..14] + ] + end + + def test_module_definition_in_method_body_within_block + expected = DefNode( + :foo, + Location(), + nil, + nil, + StatementsNode( + [CallNode( + CallNodeFlags::IGNORE_VISIBILITY, + nil, + nil, + :bar, + Location(), + nil, + nil, + nil, + BlockNode( + [], + nil, + StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), :Foo)]), + Location(), + Location() + ) + )] + ), + [], + Location(), + nil, + nil, + nil, + nil, + Location() + ) + + assert_errors expected, <<~RUBY, [["unexpected module definition in a method definition", 21..27]] + def foo + bar do + module Foo;end + end + end + RUBY + end + + def test_module_definition_in_method_defs + source = <<~RUBY + def foo(bar = module A;end);end + def foo;rescue;module A;end;end + def foo;ensure;module A;end;end + RUBY + message = "unexpected module definition in a method definition" + assert_errors expression(source), source, [ + [message, 14..20], + [message, 47..53], + [message, 79..85], + ] + end + + def test_class_definition_in_method_body + expected = DefNode( + :foo, + Location(), + nil, + nil, + StatementsNode( + [ClassNode( + [], + Location(), + ConstantReadNode(:A), + nil, + nil, + nil, + Location(), + :A + )] + ), + [], + Location(), + nil, + nil, + nil, + nil, + Location() + ) + + assert_errors expected, "def foo;class A;end;end", [ + ["unexpected class definition in a method definition", 8..13] + ] + end + + def test_class_definition_in_method_defs + source = <<~RUBY + def foo(bar = class A;end);end + def foo;rescue;class A;end;end + def foo;ensure;class A;end;end + RUBY + message = "unexpected class definition in a method definition" + assert_errors expression(source), source, [ + [message, 14..19], + [message, 46..51], + [message, 77..82], + ] + end + + def test_bad_arguments + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([ + RequiredParameterNode(0, :A), + RequiredParameterNode(0, :@a), + RequiredParameterNode(0, :$A), + RequiredParameterNode(0, :@@a), + ], [], nil, [], [], nil, nil), + nil, + [:A, :@a, :$A, :@@a], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(A, @a, $A, @@a);end", [ + ["invalid formal argument; formal argument cannot be a constant", 8..9], + ["invalid formal argument; formal argument cannot be an instance variable", 11..13], + ["invalid formal argument; formal argument cannot be a global variable", 15..17], + ["invalid formal argument; formal argument cannot be a class variable", 19..22], + ] + end + + if RUBY_VERSION >= "3.0" + def test_cannot_assign_to_a_reserved_numbered_parameter + expected = BeginNode( + Location(), + StatementsNode([ + LocalVariableWriteNode(:_1, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_2, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_3, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_4, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_5, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_6, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_7, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_8, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_9, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()), + LocalVariableWriteNode(:_10, 0, Location(), SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), Location()) + ]), + nil, + nil, + nil, + Location() + ) + source = <<~RUBY + begin + _1=:a;_2=:a;_3=:a;_4=:a;_5=:a + _6=:a;_7=:a;_8=:a;_9=:a;_10=:a + end + RUBY + assert_errors expected, source, [ + ["_1 is reserved for numbered parameters", 8..10], + ["_2 is reserved for numbered parameters", 14..16], + ["_3 is reserved for numbered parameters", 20..22], + ["_4 is reserved for numbered parameters", 26..28], + ["_5 is reserved for numbered parameters", 32..34], + ["_6 is reserved for numbered parameters", 40..42], + ["_7 is reserved for numbered parameters", 46..48], + ["_8 is reserved for numbered parameters", 52..54], + ["_9 is reserved for numbered parameters", 58..60], + ] + end + end + + def test_do_not_allow_trailing_commas_in_method_parameters + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [RequiredParameterNode(0, :a), RequiredParameterNode(0, :b), RequiredParameterNode(0, :c)], + [], + nil, + [], + [], + nil, + nil + ), + nil, + [:a, :b, :c], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a,b,c,);end", [ + ["unexpected `,` in parameters", 13..14] + ] + end + + def test_do_not_allow_trailing_commas_in_lambda_parameters + expected = LambdaNode( + [:a, :b], + Location(), + Location(), + Location(), + BlockParametersNode( + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], nil, nil), + [], + Location(), + Location() + ), + nil + ) + assert_errors expected, "-> (a, b, ) {}", [ + ["unexpected `,` in parameters", 8..9] + ] + end + + def test_do_not_allow_multiple_codepoints_in_a_single_character_literal + expected = StringNode(StringFlags::FORCED_UTF8_ENCODING, Location(), Location(), nil, "\u0001\u0002") + + assert_errors expected, '?\u{0001 0002}', [ + ["invalid Unicode escape sequence; multiple codepoints are not allowed in a character literal", 9..12] + ] + end + + def test_invalid_hex_escape + assert_errors expression('"\\xx"'), '"\\xx"', [ + ["invalid hexadecimal escape sequence", 1..3], + ] + end + + def test_do_not_allow_more_than_6_hexadecimal_digits_in_u_Unicode_character_notation + expected = StringNode(0, Location(), Location(), Location(), "\u0001") + + assert_errors expected, '"\u{0000001}"', [ + ["invalid Unicode escape sequence; maximum length is 6 digits", 4..11], + ] + end + + def test_do_not_allow_characters_other_than_0_9_a_f_and_A_F_in_u_Unicode_character_notation + expected = StringNode(0, Location(), Location(), Location(), "\u0000z}") + + assert_errors expected, '"\u{000z}"', [ + ["invalid Unicode escape sequence", 7..7], + ] + end + + def test_unterminated_unicode_brackets_should_be_a_syntax_error + assert_errors expression('?\\u{3'), '?\\u{3', [ + ["invalid Unicode escape sequence; needs closing `}`", 1..5], + ] + end + + def test_method_parameters_after_block + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [], + nil, + BlockParameterNode(0, :block, Location(), Location()) + ), + nil, + [:block, :a], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + assert_errors expected, "def foo(&block, a)\nend", [ + ["unexpected parameter order", 16..17] + ] + end + + def test_method_with_arguments_after_anonymous_block + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([], [], nil, [RequiredParameterNode(0, :a)], [], nil, BlockParameterNode(0, nil, nil, Location())), + nil, + [:a], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(&, a)\nend", [ + ["unexpected parameter order", 11..12] + ] + end + + def test_method_parameters_after_arguments_forwarding + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [], + ForwardingParameterNode(), + nil + ), + nil, + [:a], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + assert_errors expected, "def foo(..., a)\nend", [ + ["unexpected parameter order", 13..14] + ] + end + + def test_keywords_parameters_before_required_parameters + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + nil, + nil + ), + nil, + [:b, :a], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + assert_errors expected, "def foo(b:, a)\nend", [ + ["unexpected parameter order", 12..13] + ] + end + + def test_rest_keywords_parameters_before_required_parameters + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :rest, Location(), Location()), + nil + ), + nil, + [:rest, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(**rest, b:)\nend", [ + ["unexpected parameter order", 16..18] + ] + end + + def test_double_arguments_forwarding + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([], [], nil, [], [], ForwardingParameterNode(), nil), + nil, + [], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(..., ...)\nend", [ + ["unexpected parameter order", 13..16] + ] + end + + def test_multiple_error_in_parameters_order + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), + nil + ), + nil, + [:args, :a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(**args, a, b:)\nend", [ + ["unexpected parameter order", 16..17], + ["unexpected parameter order", 19..21] + ] + end + + def test_switching_to_optional_arguments_twice + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), + nil + ), + nil, + [:args, :a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location(), + ) + + assert_errors expected, "def foo(**args, a, b:)\nend", [ + ["unexpected parameter order", 16..17], + ["unexpected parameter order", 19..21] + ] + end + + def test_switching_to_named_arguments_twice + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [], + [], + nil, + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), + nil + ), + nil, + [:args, :a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location(), + ) + + assert_errors expected, "def foo(**args, a, b:)\nend", [ + ["unexpected parameter order", 16..17], + ["unexpected parameter order", 19..21] + ] + end + + def test_returning_to_optional_parameters_multiple_times + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode( + [RequiredParameterNode(0, :a)], + [ + OptionalParameterNode(0, :b, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL, 1)), + OptionalParameterNode(0, :d, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL, 2)) + ], + nil, + [RequiredParameterNode(0, :c), RequiredParameterNode(0, :e)], + [], + nil, + nil + ), + nil, + [:a, :b, :c, :d, :e], + Location(), + nil, + Location(), + Location(), + nil, + Location(), + ) + + assert_errors expected, "def foo(a, b = 1, c, d = 2, e)\nend", [ + ["unexpected parameter order", 23..24] + ] + end + + def test_case_without_when_clauses_errors_on_else_clause + expected = CaseMatchNode( + SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), + [], + ElseNode(Location(), nil, Location()), + Location(), + Location() + ) + + assert_errors expected, "case :a\nelse\nend", [ + ["expected a `when` or `in` clause after `case`", 0..4] + ] + end + + def test_case_without_clauses + expected = CaseNode( + SymbolNode(SymbolFlags::FORCED_US_ASCII_ENCODING, Location(), Location(), nil, "a"), + [], + nil, + Location(), + Location() + ) + + assert_errors expected, "case :a\nend", [ + ["expected a `when` or `in` clause after `case`", 0..4] + ] + end + + def test_setter_method_cannot_be_defined_in_an_endless_method_definition + expected = DefNode( + :a=, + Location(), + nil, + nil, + StatementsNode([IntegerNode(IntegerBaseFlags::DECIMAL, 42)]), + [], + Location(), + nil, + Location(), + Location(), + Location(), + nil + ) + + assert_errors expected, "def a=() = 42", [ + ["invalid method name; a setter method cannot be defined in an endless method definition", 4..6] + ] + end + + def test_do_not_allow_forward_arguments_in_lambda_literals + expected = LambdaNode( + [], + Location(), + Location(), + Location(), + BlockParametersNode(ParametersNode([], [], nil, [], [], ForwardingParameterNode(), nil), [], Location(), Location()), + nil + ) + + assert_errors expected, "->(...) {}", [ + ["unexpected `...` when the parent method is not forwarding", 3..6] + ] + end + + def test_do_not_allow_forward_arguments_in_blocks + expected = CallNode( + CallNodeFlags::IGNORE_VISIBILITY, + nil, + nil, + :a, + Location(), + nil, + nil, + nil, + BlockNode( + [], + BlockParametersNode(ParametersNode([], [], nil, [], [], ForwardingParameterNode(), nil), [], Location(), Location()), + nil, + Location(), + Location() + ) + ) + + assert_errors expected, "a {|...|}", [ + ["unexpected `...` when the parent method is not forwarding", 4..7] + ] + end + + def test_dont_allow_return_inside_class_body + expected = ClassNode( + [], + Location(), + ConstantReadNode(:A), + nil, + nil, + StatementsNode([ReturnNode(Location(), nil)]), + Location(), + :A + ) + + assert_errors expected, "class A; return; end", [ + ["invalid `return` in a class or module body", 15..16] + ] + end + + def test_dont_allow_return_inside_module_body + expected = ModuleNode( + [], + Location(), + ConstantReadNode(:A), + StatementsNode([ReturnNode(Location(), nil)]), + Location(), + :A + ) + + assert_errors expected, "module A; return; end", [ + ["invalid `return` in a class or module body", 16..17] + ] + end + + def test_dont_allow_setting_to_back_and_nth_reference + expected = BeginNode( + Location(), + StatementsNode([ + GlobalVariableWriteNode(:$+, Location(), NilNode(), Location()), + GlobalVariableWriteNode(:$1466, Location(), NilNode(), Location()) + ]), + nil, + nil, + nil, + Location() + ) + + assert_errors expected, "begin\n$+ = nil\n$1466 = nil\nend", [ + ["Can't set variable $+", 6..8], + ["Can't set variable $1466", 15..20] + ] + end + + def test_duplicated_parameter_names + # For some reason, Ripper reports no error for Ruby 3.0 when you have + # duplicated parameter names for positional parameters. + unless RUBY_VERSION < "3.1.0" + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b), RequiredParameterNode(ParameterFlags::REPEATED_PARAMETER, :a)], [], nil, [], [], nil, nil), + nil, + [:a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a,b,a);end", [ + ["repeated parameter name", 12..13] + ] + end + + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], RestParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location()), [], [], nil, nil), + nil, + [:a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a,b,*a);end", [ + ["repeated parameter name", 13..14] + ] + + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], KeywordRestParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location()), nil), + nil, + [:a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a,b,**a);end", [ + ["repeated parameter name", 14..15] + ] + + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], nil, BlockParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location())), + nil, + [:a, :b], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a,b,&a);end", [ + ["repeated parameter name", 13..14] + ] + + expected = DefNode( + :foo, + Location(), + nil, + ParametersNode([], [OptionalParameterNode(0, :a, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL, 1))], RestParameterNode(0, :c, Location(), Location()), [RequiredParameterNode(0, :b)], [], nil, nil), + nil, + [:a, :b, :c], + Location(), + nil, + Location(), + Location(), + nil, + Location() + ) + + assert_errors expected, "def foo(a = 1,b,*c);end", [["unexpected parameter `*`", 16..17]] + end + + def test_content_after_unterminated_heredoc + receiver = StringNode(0, Location(), Location(), Location(), "") + expected = CallNode(0, receiver, Location(), :foo, Location(), nil, nil, nil, nil) + + assert_errors expected, "<<~FOO.foo\n", [ + ["could not find a terminator for the heredoc", 11..11] + ] + end + + def test_invalid_message_name + result = Prism.parse("+.@foo,+=foo") + assert_equal :"", result.value.statements.body.first.write_name + end + + def test_invalid_operator_write_fcall + source = "foo! += 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..4] + ] + end + + def test_invalid_operator_write_dot + source = "foo.+= 1" + assert_errors expression(source), source, [ + ["unexpected write target", 5..6] + ] + end + + def test_unterminated_global_variable + assert_errors expression("$"), "$", [ + ["'$' is not allowed as a global variable name", 0..1] + ] + end + + def test_invalid_global_variable_write + assert_errors expression("$',"), "$',", [ + ["Can't set variable $'", 0..2], + ["unexpected write target", 0..2] + ] + end + + def test_invalid_multi_target + error_messages = ["unexpected write target"] + + assert_error_messages "foo,", error_messages + assert_error_messages "foo = 1; foo,", error_messages + assert_error_messages "foo.bar,", error_messages + assert_error_messages "*foo,", error_messages + assert_error_messages "@foo,", error_messages + assert_error_messages "@@foo,", error_messages + assert_error_messages "$foo,", error_messages + assert_error_messages "$1,", ["Can't set variable $1", *error_messages] + assert_error_messages "$+,", ["Can't set variable $+", *error_messages] + assert_error_messages "Foo,", error_messages + assert_error_messages "::Foo,", error_messages + assert_error_messages "Foo::Foo,", error_messages + assert_error_messages "Foo::foo,", error_messages + assert_error_messages "foo[foo],", error_messages + assert_error_messages "(foo, bar)", error_messages + assert_error_messages "foo((foo, bar))", error_messages + assert_error_messages "foo((*))", error_messages + assert_error_messages "foo(((foo, bar), *))", error_messages + assert_error_messages "(foo, bar) + 1", error_messages + assert_error_messages "(foo, bar) in baz", error_messages + end + + def test_call_with_block_and_write + source = "foo {} &&= 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..6], + ["unexpected operator after a call with a block", 7..10] + ] + end + + def test_call_with_block_or_write + source = "foo {} ||= 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..6], + ["unexpected operator after a call with a block", 7..10] + ] + end + + def test_call_with_block_operator_write + source = "foo {} += 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..6], + ["unexpected operator after a call with a block", 7..9] + ] + end + + def test_index_call_with_block_and_write + source = "foo[1] {} &&= 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..9], + ["unexpected operator after a call with arguments", 10..13], + ["unexpected operator after a call with a block", 10..13] + ] + end + + def test_index_call_with_block_or_write + source = "foo[1] {} ||= 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..9], + ["unexpected operator after a call with arguments", 10..13], + ["unexpected operator after a call with a block", 10..13] + ] + end + + def test_index_call_with_block_operator_write + source = "foo[1] {} += 1" + assert_errors expression(source), source, [ + ["unexpected write target", 0..9], + ["unexpected operator after a call with arguments", 10..12], + ["unexpected operator after a call with a block", 10..12] + ] + end + + if RUBY_VERSION >= "3.0" + def test_writing_numbered_parameter + assert_errors expression("-> { _1 = 0 }"), "-> { _1 = 0 }", [ + ["_1 is reserved for numbered parameters", 5..7] + ] + end + + def test_targeting_numbered_parameter + assert_errors expression("-> { _1, = 0 }"), "-> { _1, = 0 }", [ + ["_1 is reserved for numbered parameters", 5..7] + ] + end + + def test_defining_numbered_parameter + error_messages = ["_1 is reserved for numbered parameters"] + + assert_error_messages "def _1; end", error_messages + assert_error_messages "def self._1; end", error_messages + end + end + + def test_double_scope_numbered_parameters + source = "-> { _1 + -> { _2 } }" + errors = [["numbered parameter is already used in outer scope", 15..17]] + + assert_errors expression(source), source, errors, compare_ripper: false + end + + def test_invalid_number_underscores + error_messages = ["invalid underscore placement in number"] + + assert_error_messages "1__1", error_messages + assert_error_messages "0b1__1", error_messages + assert_error_messages "0o1__1", error_messages + assert_error_messages "01__1", error_messages + assert_error_messages "0d1__1", error_messages + assert_error_messages "0x1__1", error_messages + + assert_error_messages "1_1_", error_messages + assert_error_messages "0b1_1_", error_messages + assert_error_messages "0o1_1_", error_messages + assert_error_messages "01_1_", error_messages + assert_error_messages "0d1_1_", error_messages + assert_error_messages "0x1_1_", error_messages + end + + def test_alnum_delimiters + error_messages = ["invalid `%` token"] + + assert_error_messages "%qXfooX", error_messages + assert_error_messages "%QXfooX", error_messages + assert_error_messages "%wXfooX", error_messages + assert_error_messages "%WxfooX", error_messages + assert_error_messages "%iXfooX", error_messages + assert_error_messages "%IXfooX", error_messages + assert_error_messages "%xXfooX", error_messages + assert_error_messages "%rXfooX", error_messages + assert_error_messages "%sXfooX", error_messages + end + + def test_begin_at_toplevel + source = "def foo; BEGIN {}; end" + assert_errors expression(source), source, [ + ["BEGIN is permitted only at toplevel", 9..14], + ] + end + + if RUBY_VERSION >= "3.0" + def test_numbered_parameters_in_block_arguments + source = "foo { |_1| }" + assert_errors expression(source), source, [ + ["_1 is reserved for numbered parameters", 7..9], + ] + end + end + + def test_conditional_predicate_closed + source = "if 0 0; elsif 0 0; end\nunless 0 0; end" + assert_errors expression(source), source, [ + ["expected `then` or `;` or '\\n" + "'", 5..6], + ["expected `then` or `;` or '\\n" + "'", 16..17], + ["expected `then` or `;` or '\\n" + "'", 32..33], + ] + end + + def test_parameter_name_ending_with_bang_or_question_mark + source = "def foo(x!,y?); end" + errors = [ + ["unexpected name for a parameter", 8..10], + ["unexpected name for a parameter", 11..13] + ] + assert_errors expression(source), source, errors, compare_ripper: false + end + + def test_class_name + source = "class 0.X end" + assert_errors expression(source), source, [ + ["expected a constant name after `class`", 6..9], + ] + end + + def test_loop_conditional_is_closed + source = "while 0 0; foo; end; until 0 0; foo; end" + assert_errors expression(source), source, [ + ["expected a predicate expression for the `while` statement", 7..7], + ["expected a predicate expression for the `until` statement", 28..28], + ] + end + + def test_forwarding_arg_after_keyword_rest + source = "def f(**,...);end" + assert_errors expression(source), source, [ + ["unexpected `...` in parameters", 9..12], + ] + end + + def test_semicolon_after_inheritance_operator + source = "class Foo < Bar end" + assert_errors expression(source), source, [ + ["unexpected `end`, expecting ';' or '\\n'", 15..15], + ] + end + + def test_shadow_args_in_lambda + source = "->a;b{}" + + assert_errors expression(source), source, [ + ["expected a `do` keyword or a `{` to open the lambda block", 3..3], + ["unexpected end of file, expecting end-of-input", 7..7], + ["unexpected end of file, assuming it is closing the parent top level context", 7..7], + ["expected a lambda block beginning with `do` to end with `end`", 7..7] + ] + end + + def test_shadow_args_in_block + source = "tap{|a;a|}" + assert_errors expression(source), source, [ + ["repeated parameter name", 7..8], + ] + end + + def test_repeated_parameter_name_in_destructured_params + source = "def f(a, (b, (a))); end" + # In Ruby 3.0.x, `Ripper.sexp_raw` does not return `nil` for this case. + compare_ripper = RUBY_ENGINE == "ruby" && (RUBY_VERSION.split('.').map { |x| x.to_i } <=> [3, 1]) >= 1 + assert_errors expression(source), source, [ + ["repeated parameter name", 14..15], + ], compare_ripper: compare_ripper + end + + def test_assign_to_numbered_parameter + source = <<~RUBY + a in _1 + a => _1 + 1 => a, _1 + 1 in a, _1 + /(?<_1>)/ =~ a + RUBY + + message = "_1 is reserved for numbered parameters" + assert_errors expression(source), source, [ + [message, 5..7], + [message, 13..15], + [message, 24..26], + [message, 35..37], + [message, 42..44] + ] + end + + def test_symbol_in_keyword_parameter + source = "def foo(x:'y':); end" + assert_errors expression(source), source, [ + ["unexpected label terminator, expected a string literal terminator", 12..14] + ] + end + + def test_symbol_in_hash + source = "{x:'y':}" + assert_errors expression(source), source, [ + ["unexpected label terminator, expected a string literal terminator", 5..7] + ] + end + + def test_while_endless_method + source = "while def f = g do end" + + assert_errors expression(source), source, [ + ["expected a predicate expression for the `while` statement", 22..22], + ["unexpected end of file, assuming it is closing the parent top level context", 22..22], + ["expected an `end` to close the `while` statement", 22..22] + ] + end + + def test_match_plus + source = <<~RUBY + a in b + c + a => b + c + RUBY + + assert_errors expression(source), source, [ + ["unexpected '+', expecting end-of-input", 7..8], + ["unexpected '+', ignoring it", 7..8], + ["unexpected '+', expecting end-of-input", 18..19], + ["unexpected '+', ignoring it", 18..19] + ] + end + + def test_rational_number_with_exponential_portion + source = '1e1r; 1e1ri' + + assert_errors expression(source), source, [ + ["unexpected local variable or method, expecting end-of-input", 3..4], + ["unexpected local variable or method, expecting end-of-input", 9..11] + ] + end + + def test_check_value_expression + source = <<~RUBY + 1 => ^(return) + while true + 1 => ^(break) + 1 => ^(next) + 1 => ^(redo) + 1 => ^(retry) + 1 => ^(2 => a) + end + 1 => ^(if 1; (return) else (return) end) + 1 => ^(unless 1; (return) else (return) end) + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 7..13], + [message, 35..40], + [message, 51..55], + [message, 66..70], + [message, 81..86], + [message, 97..103], + [message, 123..129], + [message, 168..174], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_statement + source = <<~RUBY + if (return) + end + unless (return) + end + while (return) + end + until (return) + end + case (return) + when 1 + end + class A < (return) + end + class << (return) + end + for x in (return) + end + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 4..10], + [message, 24..30], + [message, 43..49], + [message, 62..68], + [message, 80..86], + [message, 110..116], + [message, 132..138], + [message, 154..160], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_def + source = <<~RUBY + def (return).x + end + def x(a = return) + end + def x(a: return) + end + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 5..11], + [message, 29..35], + [message, 50..56], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_assignment + source = <<~RUBY + a = return + a = 1, return + a, b = return, 1 + a, b = 1, *return + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 4..10], + [message, 18..24], + [message, 32..38], + [message, 53..59], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_modifier + source = <<~RUBY + 1 if (return) + 1 unless (return) + 1 while (return) + 1 until (return) + (return) => a + (return) in a + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 6..12], + [message, 24..30], + [message, 41..47], + [message, 58..64], + [message, 67..73], + [message, 81..87] + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_expression + source = <<~RUBY + (return) ? 1 : 1 + (return)..1 + 1..(return) + (return)...1 + 1...(return) + (..(return)) + (...(return)) + ((return)..) + ((return)...) + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 1..7], + [message, 18..24], + [message, 33..39], + [message, 42..48], + [message, 59..65], + [message, 71..77], + [message, 85..91], + [message, 96..102], + [message, 109..115] + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_array + source = <<~RUBY + [return] + [1, return] + [ return => 1 ] + [ 1 => return ] + [ a: return ] + [ *return ] + [ **return ] + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 1..7], + [message, 13..19], + [message, 23..29], + [message, 44..50], + [message, 58..64], + [message, 70..76], + [message, 83..89], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_hash + source = <<~RUBY + { return => 1 } + { 1 => return } + { a: return } + { **return } + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 2..8], + [message, 23..29], + [message, 37..43], + [message, 50..56], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_call + source = <<~RUBY + (return).foo + (return).(1) + (return)[1] + (return)[1] = 2 + (return)::foo + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 1..7], + [message, 14..20], + [message, 27..33], + [message, 39..45], + [message, 55..61], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_constant_path + source = <<~RUBY + (return)::A + class (return)::A; end + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 1..7], + [message, 19..25], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_arguments + source = <<~RUBY + foo(return) + foo(1, return) + foo(*return) + foo(**return) + foo(&return) + foo(return => 1) + foo(:a => return) + foo(a: return) + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 4..10], + [message, 19..25], + [message, 32..38], + [message, 46..52], + [message, 59..65], + [message, 71..77], + [message, 94..100], + [message, 109..115], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_unary_call + source = <<~RUBY + +(return) + not return + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 2..8], + [message, 14..20], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_void_value_expression_in_binary_call + source = <<~RUBY + 1 + (return) + (return) + 1 + 1 and (return) + (return) and 1 + 1 or (return) + (return) or 1 + RUBY + message = 'unexpected void value expression' + assert_errors expression(source), source, [ + [message, 5..11], + [message, 14..20], + [message, 42..48], + [message, 71..77], + ], compare_ripper: false # Ripper does not check 'void value expression'. + end + + def test_trailing_comma_in_calls + assert_errors expression("foo 1,"), "foo 1,", [ + ["expected an argument", 5..6] + ] + end + + def test_argument_after_ellipsis + source = 'def foo(...); foo(..., 1); end' + assert_errors expression(source), source, [ + ['unexpected argument after `...`', 23..24] + ] + end + + def test_ellipsis_in_no_paren_call + source = 'def foo(...); foo 1, ...; end' + assert_errors expression(source), source, [ + ['unexpected `...` in an non-parenthesized call', 21..24] + ] + end + + def test_non_assoc_range + source = '1....2' + + assert_errors expression(source), source, [ + ["unexpected '.', expecting end-of-input", 4..5], + ["unexpected '.', ignoring it", 4..5] + ] + end + + def test_upcase_end_in_def + assert_warning_messages "def foo; END { }; end", [ + "END in method; use at_exit" + ] + end + + def test_warnings_verbosity + warning = Prism.parse("def foo; END { }; end").warnings[0] + assert_equal "END in method; use at_exit", warning.message + assert_equal :default, warning.level + + warning = Prism.parse("foo /regexp/").warnings[0] + assert_equal "ambiguous `/`; wrap regexp in parentheses or add a space after `/` operator", warning.message + assert_equal :verbose, warning.level + end + + def test_statement_operators + source = <<~RUBY + alias x y + 1 + alias x y.z + BEGIN { bar } + 1 + BEGIN { bar }.z + END { bar } + 1 + END { bar }.z + undef x + 1 + undef x.z + RUBY + + assert_errors expression(source), source, [ + ["unexpected '+', expecting end-of-input", 10..11], + ["unexpected '+', ignoring it", 10..11], + ["unexpected '.', expecting end-of-input", 23..24], + ["unexpected '.', ignoring it", 23..24], + ["unexpected '+', expecting end-of-input", 40..41], + ["unexpected '+', ignoring it", 40..41], + ["unexpected '.', expecting end-of-input", 57..58], + ["unexpected '.', ignoring it", 57..58], + ["unexpected '+', expecting end-of-input", 72..73], + ["unexpected '+', ignoring it", 72..73], + ["unexpected '.', expecting end-of-input", 87..88], + ["unexpected '.', ignoring it", 87..88], + ["unexpected '+', expecting end-of-input", 98..99], + ["unexpected '+', ignoring it", 98..99], + ["unexpected '.', expecting end-of-input", 109..110], + ["unexpected '.', ignoring it", 109..110] + ] + end + + def test_statement_at_non_statement + source = <<~RUBY + foo(alias x y) + foo(BEGIN { bar }) + foo(END { bar }) + foo(undef x) + RUBY + assert_errors expression(source), source, [ + ['unexpected an `alias` at a non-statement position', 4..9], + ['unexpected a `BEGIN` at a non-statement position', 19..24], + ['unexpected an `END` at a non-statement position', 38..41], + ['unexpected an `undef` at a non-statement position', 55..60], + ] + end + + def test_binary_range_with_left_unary_range + source = <<~RUBY + ..1.. + ...1.. + RUBY + + assert_errors expression(source), source, [ + ["unexpected '..', expecting end-of-input", 3..5], + ["unexpected '..', ignoring it", 3..5], + ["unexpected '..', expecting end-of-input", 10..12], + ["unexpected '..', ignoring it", 10..12] + ] + end + + def test_circular_param + source = <<~RUBY + def foo(bar = bar) = 42 + def foo(bar: bar) = 42 + proc { |foo = foo| } + proc { |foo: foo| } + RUBY + message = 'parameter default value references itself' + assert_errors expression(source), source, [ + [message, 14..17], + [message, 37..40], + [message, 61..64], + [message, 81..84], + ], compare_ripper: false # Ripper does not check 'circular reference'. + end + + def test_command_calls + sources = <<~RUBY.lines + [a b] + {a: b c} + ...a b + if ...a b; end + a b, c d + a(b, c d) + a(*b c) + a(**b c) + a(&b c) + +a b + a + b c + a && b c + a =~ b c + a = b, c d + a = *b c + a, b = c = d f + a ? b c : d e + defined? a b + ! ! a b + def f a = b c; end + def f(a = b c); end + a = b rescue c d + def a = b rescue c d + ->a=b c{} + ->(a=b c){} + case; when a b; end + case; in a if a b; end + case; in a unless a b; end + begin; rescue a b; end + begin; rescue a b => c; end + RUBY + sources.each do |source| + assert_nil Ripper.sexp_raw(source) + assert_false(Prism.parse(source).success?) + end + end + + def test_range_and_bin_op + sources = <<~RUBY.lines + 1..2..3 + 1..2.. + 1.. || 2 + 1.. & 2 + 1.. * 2 + 1.. / 2 + 1.. % 2 + 1.. ** 2 + RUBY + sources.each do |source| + assert_nil Ripper.sexp_raw(source) + assert_false(Prism.parse(source).success?) + end + end + + def test_command_call_in + source = <<~RUBY + foo 1 in a + a = foo 2 in b + RUBY + + assert_errors expression(source), source, [ + ["unexpected `in` keyword in arguments", 9..10], + ["unexpected local variable or method, expecting end-of-input", 9..10], + ["unexpected `in` keyword in arguments", 24..25], + ["unexpected local variable or method, expecting end-of-input", 24..25] + ] + end + + def test_constant_assignment_in_method + source = 'def foo();A=1;end' + assert_errors expression(source), source, [ + ['dynamic constant assignment', 10..13] + ] + end + + def test_non_assoc_equality + source = <<~RUBY + 1 == 2 == 3 + 1 != 2 != 3 + 1 === 2 === 3 + 1 =~ 2 =~ 3 + 1 !~ 2 !~ 3 + 1 <=> 2 <=> 3 + RUBY + + assert_errors expression(source), source, [ + ["unexpected '==', expecting end-of-input", 7..9], + ["unexpected '==', ignoring it", 7..9], + ["unexpected '!=', expecting end-of-input", 19..21], + ["unexpected '!=', ignoring it", 19..21], + ["unexpected '===', expecting end-of-input", 32..35], + ["unexpected '===', ignoring it", 32..35], + ["unexpected '=~', expecting end-of-input", 45..47], + ["unexpected '=~', ignoring it", 45..47], + ["unexpected '!~', expecting end-of-input", 57..59], + ["unexpected '!~', ignoring it", 57..59], + ["unexpected '<=>', expecting end-of-input", 70..73], + ["unexpected '<=>', ignoring it", 70..73] + ] + end + + def test_block_arg_and_block + source = 'foo(&1) { }' + assert_errors expression(source), source, [ + ['multiple block arguments; only one block is allowed', 8..11] + ], compare_ripper: false # Ripper does not check 'both block arg and actual block given'. + end + + def test_forwarding_arg_and_block + source = 'def foo(...) = foo(...) { }' + assert_errors expression(source), source, [ + ['both a block argument and a forwarding argument; only one block is allowed', 24..27] + ], compare_ripper: false # Ripper does not check 'both block arg and actual block given'. + end + + def test_it_with_ordinary_parameter + source = "proc { || it }" + errors = [["`it` is not allowed when an ordinary parameter is defined", 10..12]] + + assert_errors expression(source), source, errors, compare_ripper: false + end + + def test_singleton_method_for_literals + source = <<~'RUBY' + def (1).g; end + def ((a; 1)).foo; end + def ((return; 1)).bar; end + def (((1))).foo; end + def (__FILE__).foo; end + def (__ENCODING__).foo; end + def (__LINE__).foo; end + def ("foo").foo; end + def (3.14).foo; end + def (3.14i).foo; end + def (:foo).foo; end + def (:'foo').foo; end + def (:'f{o}').foo; end + def ('foo').foo; end + def ("foo").foo; end + def ("#{fo}o").foo; end + def (/foo/).foo; end + def (/f#{oo}/).foo; end + def ([1]).foo; end + RUBY + errors = [ + ["cannot define singleton method for literals", 5..6], + ["cannot define singleton method for literals", 24..25], + ["cannot define singleton method for literals", 51..52], + ["cannot define singleton method for literals", 71..72], + ["cannot define singleton method for literals", 90..98], + ["cannot define singleton method for literals", 114..126], + ["cannot define singleton method for literals", 142..150], + ["cannot define singleton method for literals", 166..171], + ["cannot define singleton method for literals", 187..191], + ["cannot define singleton method for literals", 207..212], + ["cannot define singleton method for literals", 228..232], + ["cannot define singleton method for literals", 248..254], + ["cannot define singleton method for literals", 270..277], + ["cannot define singleton method for literals", 293..298], + ["cannot define singleton method for literals", 314..319], + ["cannot define singleton method for literals", 335..343], + ["cannot define singleton method for literals", 359..364], + ["cannot define singleton method for literals", 380..388], + ["cannot define singleton method for literals", 404..407] + ] + assert_errors expression(source), source, errors, compare_ripper: false + end + + def test_assignment_to_literal_in_conditionals + source = <<~RUBY + if (a = 2); end + if ($a = 2); end + if (@a = 2); end + if (@@a = 2); end + if a elsif b = 2; end + unless (a = 2); end + unless ($a = 2); end + unless (@a = 2); end + unless (@@a = 2); end + while (a = 2); end + while ($a = 2); end + while (@a = 2); end + while (@@a = 2); end + until (a = 2); end + until ($a = 2); end + until (@a = 2); end + until (@@a = 2); end + foo if a = 2 + foo if (a, b = 2) + (@foo = 1) ? a : b + !(a = 2) + not a = 2 + RUBY + assert_warning_messages source, [ + "found '= literal' in conditional, should be ==" + ] * source.lines.count + end + + private + + def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby") + # Ripper behaves differently on JRuby/TruffleRuby, so only check this on CRuby + assert_nil Ripper.sexp_raw(source) if compare_ripper + + result = Prism.parse(source) + node = result.value.statements.body.last + + assert_equal_nodes(expected, node, compare_location: false) + assert_equal(errors, result.errors.map { |e| [e.message, e.location.start_offset..e.location.end_offset] }) + end + + def assert_error_messages(source, errors, compare_ripper: RUBY_ENGINE == "ruby") + assert_nil Ripper.sexp_raw(source) if compare_ripper + result = Prism.parse(source) + assert_equal(errors, result.errors.map(&:message)) + end + + def assert_warning_messages(source, warnings) + result = Prism.parse(source) + assert_equal(warnings, result.warnings.map(&:message)) + end + + def expression(source) + Prism.parse(source).value.statements.body.last + end + end +end diff --git a/test/mri/prism/fixtures/alias.txt b/test/mri/prism/fixtures/alias.txt new file mode 100644 index 00000000000..376dacd7ccd --- /dev/null +++ b/test/mri/prism/fixtures/alias.txt @@ -0,0 +1,23 @@ +alias :foo :bar + +alias %s[abc] %s[def] + +alias :'abc' :'def' + +alias :"abc#{1}" :'def' + +alias $a $' + +alias foo bar + +alias $foo $bar + +alias foo if + +alias foo <=> + +alias :== :eql? + +alias A B + +alias :A :B diff --git a/test/mri/prism/fixtures/arithmetic.txt b/test/mri/prism/fixtures/arithmetic.txt new file mode 100644 index 00000000000..b1e1267b95c --- /dev/null +++ b/test/mri/prism/fixtures/arithmetic.txt @@ -0,0 +1,13 @@ +foo !bar + +-foo*bar + ++foo**bar + +foo ~bar + +foo << bar << baz + +-1**2 + +-1.zero? diff --git a/test/mri/prism/fixtures/arrays.txt b/test/mri/prism/fixtures/arrays.txt new file mode 100644 index 00000000000..cd4e3046f78 --- /dev/null +++ b/test/mri/prism/fixtures/arrays.txt @@ -0,0 +1,142 @@ +[*a] + +foo[bar, baz] = 1, 2, 3 + +[a: [:b, :c]] + + + +[:a, :b, +:c,1, + + + +:d, +] + + +[:a, :b, +:c,1, + + + +:d + + +] + +[foo => bar] + +foo[bar][baz] = qux + +foo[bar][baz] + +[ +] + +foo[bar, baz] + +foo[bar, baz] = qux + +foo[0], bar[0] = 1, 2 + +foo[bar[baz] = qux] + +foo[bar] + +foo[bar] = baz + +[**{}] + +[**kw] + +[1, **kw] + +[1, **kw, **{}, **kw] + +[ + foo => bar, +] + + +%i#one two three# + +%w#one two three# + +%x#one two three# + + +%i@one two three@ + +%w@one two three@ + +%x@one two three@ + + +%i{one two three} + +%w{one two three} + +%x{one two three} + +%w[\C:] + +foo[&bar] = 1 + +foo.foo[&bar] = 1 + +def foo(&) + bar[&] = 1 +end + +foo[] += 1 + +foo[] ||= 1 + +foo[] &&= 1 + +foo.foo[] += 1 + +foo.foo[] ||= 1 + +foo.foo[] &&= 1 + +foo[bar] += 1 + +foo[bar] ||= 1 + +foo[bar] &&= 1 + +foo.foo[bar] += 1 + +foo.foo[bar] ||= 1 + +foo.foo[bar] &&= 1 + +foo[bar, &baz] += 1 + +foo[bar, &baz] ||= 1 + +foo[bar, &baz] &&= 1 + +foo.foo[bar, &baz] += 1 + +foo.foo[bar, &baz] ||= 1 + +foo.foo[bar, &baz] &&= 1 + +def f(*); a[*]; end + +def f(*); a[1, *]; end + +def f(*); a[*] = 1; end + +def f(*); a[1, *] = 1; end + +def f(*); a[*] += 1; end + +def f(*); a[1, *] &&= 1; end + +def f(*); rescue => a[*]; end + +def f(*); rescue => a[1, *]; end diff --git a/test/mri/prism/fixtures/begin_ensure.txt b/test/mri/prism/fixtures/begin_ensure.txt new file mode 100644 index 00000000000..6cfb6274539 --- /dev/null +++ b/test/mri/prism/fixtures/begin_ensure.txt @@ -0,0 +1,21 @@ +begin +a +ensure +b +end + +begin; a; ensure; b; end + +begin a + ensure b + end + +begin a; ensure b; end + +begin begin:s.l begin ensure Module.new do + begin + break + ensure Module.new do + end + end +end end end end diff --git a/test/mri/prism/fixtures/begin_rescue.txt b/test/mri/prism/fixtures/begin_rescue.txt new file mode 100644 index 00000000000..0a56fbef9f5 --- /dev/null +++ b/test/mri/prism/fixtures/begin_rescue.txt @@ -0,0 +1,79 @@ +begin; a; rescue; b; else; c; end + +begin; a; rescue; b; else; c; ensure; d; end + +begin +a +end + +begin; a; end + +begin a + end + +begin a; end + +begin +a +rescue +b +rescue +c +rescue +d +end + +begin + a +rescue Exception => ex + b +rescue AnotherException, OneMoreException => ex + c +end + +begin + a +rescue Exception => ex + b +ensure + b +end + +%!abc! + +begin +a +rescue +b +end + +begin;a;rescue;b;end + +begin +a;rescue +b;end + +begin +a +rescue Exception +b +end + +begin +a +rescue Exception, CustomException +b +end + +begin + a +rescue Exception, CustomException => ex + b +end + +begin + a +rescue Exception => ex + b +end + diff --git a/test/mri/prism/fixtures/blocks.txt b/test/mri/prism/fixtures/blocks.txt new file mode 100644 index 00000000000..e33d95c150b --- /dev/null +++ b/test/mri/prism/fixtures/blocks.txt @@ -0,0 +1,54 @@ +foo[bar] { baz } + +foo[bar] do +baz +end + +x.reduce(0) { |x, memo| memo += x } + +foo do end + +foo bar, (baz do end) + +foo bar do end + +foo bar baz do end + +foo do |a = b[1]| +end + +foo do +rescue +end + +foo do + bar do + baz do + end + end +end + +foo[bar] { baz } + +foo { |x, y = 2, z:| x } + +foo { |x| } + +fork = 1 +fork do |a| +end + +fork { |a| } + +C do +end + +C {} + +foo lambda { | + a: 1, + b: 2 + | +} + +foo do |bar,| end diff --git a/test/mri/prism/fixtures/boolean_operators.txt b/test/mri/prism/fixtures/boolean_operators.txt new file mode 100644 index 00000000000..dd0b9c9f01e --- /dev/null +++ b/test/mri/prism/fixtures/boolean_operators.txt @@ -0,0 +1,5 @@ +a &&= b + +a += b + +a ||= b diff --git a/test/mri/prism/fixtures/booleans.txt b/test/mri/prism/fixtures/booleans.txt new file mode 100644 index 00000000000..d9417254b68 --- /dev/null +++ b/test/mri/prism/fixtures/booleans.txt @@ -0,0 +1,3 @@ +false + +true diff --git a/test/mri/prism/fixtures/break.txt b/test/mri/prism/fixtures/break.txt new file mode 100644 index 00000000000..61859d8a8a3 --- /dev/null +++ b/test/mri/prism/fixtures/break.txt @@ -0,0 +1,25 @@ +break + +break (1), (2), (3) + +break 1 + +break 1, 2, +3 + +break 1, 2, 3 + +break [1, 2, 3] + +break( + 1 + 2 +) + +break() + +break(1) + +foo { break 42 } == 42 + +foo { |a| break } == 42 diff --git a/test/mri/prism/fixtures/case.txt b/test/mri/prism/fixtures/case.txt new file mode 100644 index 00000000000..733e1e54d24 --- /dev/null +++ b/test/mri/prism/fixtures/case.txt @@ -0,0 +1,55 @@ +case :hi +when :hi +end + +case true; when true; puts :hi; when false; puts :bye; end + +case; when *foo; end + +case :hi +when :hi +else +:b +end + +case this; when FooBar, BazBonk; end + +case +when foo == bar +end + +case +when a +else + # empty +end + +case type; + ;when :b; + ; else; + end + +case ;;;;;;;; when 1; end + +case 1 in 2 +when 3 +end + +case 1 in 2; when 3; end + +case 1 in 2 +in 3 +end + +case 1 in 2; in 3; end + +case a +in b if c and d + e +end + +1.then do + case 1 + in ^_1 + end +end diff --git a/test/mri/prism/fixtures/classes.txt b/test/mri/prism/fixtures/classes.txt new file mode 100644 index 00000000000..056cb00e82f --- /dev/null +++ b/test/mri/prism/fixtures/classes.txt @@ -0,0 +1,35 @@ +class A a = 1 end + +class A; ensure; end + +class A; rescue; else; ensure; end + +class A < B +a = 1 +end + +class << not foo +end + +class A; class << self; ensure; end; end + +class A; class << self; rescue; else; ensure; end; end + +class << foo.bar +end + +class << foo.bar;end + +class << self +end + +class << self;end + +class << self +1 + 2 +end + +class << self;1 + 2;end + +class A < B[1] +end diff --git a/test/mri/prism/fixtures/command_method_call.txt b/test/mri/prism/fixtures/command_method_call.txt new file mode 100644 index 00000000000..182b87948b5 --- /dev/null +++ b/test/mri/prism/fixtures/command_method_call.txt @@ -0,0 +1,41 @@ +foo 1 + +foo bar 1 + +foo 1 if bar 2 + +foo 1 unless bar 2 + +foo 1 while bar 2 + +foo 1 until bar 2 + +foo 1 rescue bar 2 + +foo[bar 1] + +foo 1 and bar 2 + +foo 1 or bar 2 + +not foo 1 + +foo = bar = baz 1 + +def foo = bar 1 + +1.foo 2 + +1.foo.bar 2 + +1.foo[2].bar 3 + +1.foo(2).bar 3 + +1.foo(&2).bar 3 + +!foo 1 and !bar 2 + +!foo 1 or !bar 2 + +not !foo 1 diff --git a/test/mri/prism/fixtures/comments.txt b/test/mri/prism/fixtures/comments.txt new file mode 100644 index 00000000000..9bd853e9275 --- /dev/null +++ b/test/mri/prism/fixtures/comments.txt @@ -0,0 +1,24 @@ +a + # Comment +b + +c # Comment +d + +e +# Comment + .f + +g + # Comment +.h + +i # Comment +.j + +k # Comment + .l + +m + # Comment + &.n diff --git a/test/mri/prism/fixtures/constants.txt b/test/mri/prism/fixtures/constants.txt new file mode 100644 index 00000000000..d86f8d34020 --- /dev/null +++ b/test/mri/prism/fixtures/constants.txt @@ -0,0 +1,184 @@ +A::B + +A::B::C + +a::B + +A::B = 1 + +A = 1 + +ABC + +Foo 1 + +Foo *bar + +Foo **bar + +Foo &bar + +Foo::Bar *baz + +Foo::Bar **baz + +Foo::Bar &baz + +::A::foo + +::A = 1 + +::A::B = 1 + +::A::B + +::A + +A::false + +A::B::true + +A::& + +A::` + +A::! + +A::!= + +A::^ + +A::== + +A::=== + +A::=~ + +A::> + +A::>= + +A::>> + +A::<< + +A::\ +# +C + +A::alias + +A::and + +A::begin + +A::BEGIN + +A::break + +A::class + +A::def + +A::defined + +A::do + +A::else + +A::elsif + +A::end + +A::END + +A::ensure + +A::false + +A::for + +A::if + +A::in + +A::next + +A::nil + +A::not + +A::or + +A::redo + +A::rescue + +A::retry + +A::return + +A::self + +A::super + +A::then + +A::true + +A::undef + +A::unless + +A::until + +A::when + +A::while + +A::yield + +A::__ENCODING__ + +A::__FILE__ + +A::__LINE__ + +A::< + +A::<=> + +A::<< + +A::- + +A::% + +A::%i + +A::%w + +A::%x + +A::%I + +A::%W + +A::| + +A::+ + +A::/ + +A::* + +A::** + +A::~ + +A::_:: +C + +A::_.. + +A::__END__ diff --git a/test/mri/prism/fixtures/dash_heredocs.txt b/test/mri/prism/fixtures/dash_heredocs.txt new file mode 100644 index 00000000000..3e663fae632 --- /dev/null +++ b/test/mri/prism/fixtures/dash_heredocs.txt @@ -0,0 +1,63 @@ +<<-EOF + a +EOF + +<<-FIRST + <<-SECOND + a +FIRST + b +SECOND + +<<-`EOF` + a +#{b} +EOF + +<<-EOF #comment + a +EOF + +<<-EOF + a + b + EOF + +<<-"EOF" + a +#{b} +EOF + +<<-EOF + a +#{b} +EOF + +%#abc# + +<<-EOF + a + b +EOF + +<<-'' + + +<<-'EOF' + a #{1} +EOF + +<<-A + <<-B + a +A + b + #{2 + } +B + +<<-A + <<-B + a +A + b + #{ + 2} +B diff --git a/test/mri/prism/fixtures/defined.txt b/test/mri/prism/fixtures/defined.txt new file mode 100644 index 00000000000..247fa94e3a4 --- /dev/null +++ b/test/mri/prism/fixtures/defined.txt @@ -0,0 +1,10 @@ +defined? 1 and defined? 2 + +defined?(x %= 2) + +defined?(foo and bar) + +defined? 1 + +defined?("foo" +) diff --git a/test/mri/prism/fixtures/dos_endings.txt b/test/mri/prism/fixtures/dos_endings.txt new file mode 100644 index 00000000000..c105522fa17 --- /dev/null +++ b/test/mri/prism/fixtures/dos_endings.txt @@ -0,0 +1,20 @@ +puts "hi"\ + "there" + +%I{a\ +b} + +<<-E + 1 \ + 2 + 3 +E + +x = % + + + +a = foo(<<~EOF.chop) + + baz + EOF diff --git a/test/mri/prism/fixtures/dstring.txt b/test/mri/prism/fixtures/dstring.txt new file mode 100644 index 00000000000..085e0c6852a --- /dev/null +++ b/test/mri/prism/fixtures/dstring.txt @@ -0,0 +1,29 @@ +"foo + bar" + +"foo + #{bar}" + +"fo +o" "ba +r" + +" +foo\ +" + +" +foo\\ +" + +" +foo\\\ +" + +" +foo\\\\ +" + +" +foo\\\\\ +" diff --git a/test/mri/prism/fixtures/dsym_str.txt b/test/mri/prism/fixtures/dsym_str.txt new file mode 100644 index 00000000000..ee68dde88d5 --- /dev/null +++ b/test/mri/prism/fixtures/dsym_str.txt @@ -0,0 +1,2 @@ +:"foo + bar" diff --git a/test/mri/prism/fixtures/embdoc_no_newline_at_end.txt b/test/mri/prism/fixtures/embdoc_no_newline_at_end.txt new file mode 100644 index 00000000000..7dc2e32d738 --- /dev/null +++ b/test/mri/prism/fixtures/embdoc_no_newline_at_end.txt @@ -0,0 +1,2 @@ +=begin +=end \ No newline at end of file diff --git a/test/mri/prism/fixtures/emoji_method_calls.txt b/test/mri/prism/fixtures/emoji_method_calls.txt new file mode 100644 index 00000000000..96d0daba330 --- /dev/null +++ b/test/mri/prism/fixtures/emoji_method_calls.txt @@ -0,0 +1 @@ +foo.🌊 = 1 diff --git a/test/mri/prism/fixtures/endless_methods.txt b/test/mri/prism/fixtures/endless_methods.txt new file mode 100644 index 00000000000..8c2f2a30cc5 --- /dev/null +++ b/test/mri/prism/fixtures/endless_methods.txt @@ -0,0 +1,5 @@ +def foo = 1 + +def bar = A "" + +def method = 1 + 2 + 3 diff --git a/test/mri/prism/fixtures/endless_range_in_conditional.txt b/test/mri/prism/fixtures/endless_range_in_conditional.txt new file mode 100644 index 00000000000..6048008584e --- /dev/null +++ b/test/mri/prism/fixtures/endless_range_in_conditional.txt @@ -0,0 +1,3 @@ +if 1..2 ; end +if ..1 ; end +if 1.. ; end diff --git a/test/mri/prism/fixtures/for.txt b/test/mri/prism/fixtures/for.txt new file mode 100644 index 00000000000..b6eb2cb24ff --- /dev/null +++ b/test/mri/prism/fixtures/for.txt @@ -0,0 +1,19 @@ +for i in 1..10 +i +end + +for i in 1..10; i; end + +for i,j in 1..10 +i +end + +for i,j,k in 1..10 +i +end + +for i in 1..10 do +i +end + +for i in 1..10; i; end diff --git a/test/mri/prism/fixtures/global_variables.txt b/test/mri/prism/fixtures/global_variables.txt new file mode 100644 index 00000000000..3dc52722a00 --- /dev/null +++ b/test/mri/prism/fixtures/global_variables.txt @@ -0,0 +1,93 @@ +$global_variable + +$_ + +$-w + +$LOAD_PATH + +$stdin + +$stdout + +$stderr + +$! + +$? + +$~ + +$& + +$` + +$' + +$+ + +$: + +$; + +$, + +$DEBUG + +$FILENAME + +$0 + +$-0 + +$LOADED_FEATURES + +$VERBOSE + +$-K + +:$global_variable + +:$_ + +:$-w + +:$LOAD_PATH + +:$stdin + +:$stdout + +:$stderr + +:$! + +:$? + +:$~ + +:$& + +:$` + +:$' + +:$+ + +:$: + +:$; + +:$DEBUG + +:$FILENAME + +:$0 + +:$-0 + +:$LOADED_FEATURES + +:$VERBOSE + +:$-K diff --git a/test/mri/prism/fixtures/hashes.txt b/test/mri/prism/fixtures/hashes.txt new file mode 100644 index 00000000000..0afb8db496d --- /dev/null +++ b/test/mri/prism/fixtures/hashes.txt @@ -0,0 +1,28 @@ +{} + +{ +} + +{ a => b, c => d } + +{ a => b, **c } + +{ + a: b, + c: d + + + + } + +{ a: b, c: d, **e, f: g } + +{ "a": !b? } + +a = 1 +tap do + b = 1 + { a:, b:, c:, D: } +end + +{ a: -1 } diff --git a/test/mri/prism/fixtures/heredoc.txt b/test/mri/prism/fixtures/heredoc.txt new file mode 100644 index 00000000000..f94fd912df8 --- /dev/null +++ b/test/mri/prism/fixtures/heredoc.txt @@ -0,0 +1,2 @@ +< 2 + +1 == 2 + +1 === 2 + +1 =~ 2 + +1 > 2 + +1 >= 2 + +1 >> 2 + +1 ^ 2 + +1 | 2 + +1 && 2 + +1 and 2 + +1 * 2 ** 3 + +1 * 2 + 3 + +1 or 2 + +1 || 2 + +1 + 2 * 3 + +(1 + 1) diff --git a/test/mri/prism/fixtures/keyword_method_names.txt b/test/mri/prism/fixtures/keyword_method_names.txt new file mode 100644 index 00000000000..91544694410 --- /dev/null +++ b/test/mri/prism/fixtures/keyword_method_names.txt @@ -0,0 +1,29 @@ +def def +end + +def self.ensure +end + +private def foo + bar do + end +end + +def m(a, **nil) +end + +def __ENCODING__.a +end + +%{abc} + +%"abc" + +def __FILE__.a +end + +def __LINE__.a +end + +def nil::a +end diff --git a/test/mri/prism/fixtures/keywords.txt b/test/mri/prism/fixtures/keywords.txt new file mode 100644 index 00000000000..90cdfb41c72 --- /dev/null +++ b/test/mri/prism/fixtures/keywords.txt @@ -0,0 +1,11 @@ +redo + +retry + +self + +__ENCODING__ + +__FILE__ + +__LINE__ diff --git a/test/mri/prism/fixtures/lambda.txt b/test/mri/prism/fixtures/lambda.txt new file mode 100644 index 00000000000..5c21eafb24f --- /dev/null +++ b/test/mri/prism/fixtures/lambda.txt @@ -0,0 +1,11 @@ +->( + foo +) {} + +->(x: "b#{a}") { } + +->(a: b * 3) {} + +-> foo = bar do end + +-> foo: bar do end diff --git a/test/mri/prism/fixtures/method_calls.txt b/test/mri/prism/fixtures/method_calls.txt new file mode 100644 index 00000000000..987fb3f90ff --- /dev/null +++ b/test/mri/prism/fixtures/method_calls.txt @@ -0,0 +1,156 @@ +foo.bar %{baz} + +a.b(c, d) + +a.b() + +foo + .bar + &.baz + +a! + +a.() + +a.(1, 2, 3) + +a::b + +a::b c + +foo.bar = 1 + +a? + +a(&block) + +a(**kwargs) + +a.b.c + +a(b, c) + +a() + +a(*args) + +a b, c + +a.b c, d + +foo.foo, bar.bar = 1, 2 + +a&.b + +a&.() + +a&.b(c) + +a&.b() + +foo :a, :b if bar? or baz and qux + +foo(:a, + + :b +) + +foo(*rest) + +foo(:a, :h => [:x, :y], :a => :b, &:bar) + +hi 123, { :there => :friend, **{}, whatup: :dog } + +foo :a, b: true do |a, b| puts a end + +hi there: :friend + +hi :there => :friend, **{}, whatup: :dog + +hi(:there => :friend, **{}, whatup: :dog) + +foo({ a: true, b: false, }, &:block) + +hi :there => :friend + +foo(:a, +:b, +) + +foo( +:a, +b: :c, +) + +foo &:block + +foo a: true, b: false, &:block + +some_func 1, kwarg: 2 + +Kernel.Integer(10) + +x.each { } + +foo.map { $& } + +A::B::C :foo + +A::B::C(:foo) + +A::B::C(:foo) { } + +foo("a": -1) + +foo bar: { baz: qux do end } + +foo bar: { **kw do end } + +foo "#{bar.map do "baz" end}" do end + +foo class Bar baz do end end + +foo module Bar baz do end end + +foo [baz do end] + +p begin 1.times do 1 end end + +foo :a, + if x + bar do |a| + a + end + end + +foo :a, + while x + bar do |a| + a + end + end, + until x + baz do + end + end + +{} + A {} + +{} + A { |a| a } + +A {} + A {} + +lst << A {} + +"#{ join (" ") }" + +"#{(v)}" + +def f(*); p *; end + +foo 1, Bar { 1 } + +foo = 1 +foo {} + +@a.b "c#{name}": 42 diff --git a/test/mri/prism/fixtures/methods.txt b/test/mri/prism/fixtures/methods.txt new file mode 100644 index 00000000000..0d2286056fe --- /dev/null +++ b/test/mri/prism/fixtures/methods.txt @@ -0,0 +1,183 @@ +def foo((bar, baz)) +end + +def foo((bar, baz), optional = 1, (bin, bag)) +end + + +def a; ensure; end + +def (b).a +end + +def (a)::b +end + +def false.a +end + +def a(...) +end + +def $var.a +end + +def a.b +end + +def @var.a +end + +def a b:; end + +%,abc, + +def a(b:) +end + +def a(**b) +end + +def a(**) +end + +a = 1; def a +end + +def a b, c, d +end + +def nil.a +end + +def a b:, c: 1 +end + +def a(b:, c: 1) +end + +def a(b: + 1, c:) +end + +%.abc. + +def a b = 1, c = 2 +end + +def a() +end + +def a b, c = 2 +end + +def a b +end + +def a; rescue; else; ensure; end + +def a *b +end + +def a(*) +end + +def a +b = 1 +end + +def self.a +end + +def true.a +end + +def a +end + +def hi +return :hi if true +:bye +end + +def foo = 1 +def bar = 2 + +def foo(bar) = 123 + +def foo = 123 + +def a(*); b(*); end + +def a(...); b(...); end + +def a(...); b(1, 2, ...); end + +def (c = b).a +end + +def a &b +end + +def a(&) +end + +def @@var.a +end + +def (a = b).C +end + +def self.Array_function; end + +Const = 1; def Const.a +end + +def a(...); "foo#{b(...)}"; end + +def foo + {}.merge **bar, **baz, **qux +end + +def bar(a: (1...10)) +end + +def bar(a: (...10)) +end + +def bar(a: (1...)) +end + +def bar(a = (1...10)) +end + +def bar(a = (...10)) +end + +def bar(a = (1...)) +end + +def method(a) + item >> a {} +end + +foo = 1 +def foo.bar; end + +def f(*); [*]; end + +def f x:-a; end + +def f x:+a; end + +def f x:!a; end + +def foo x:%(xx); end + +def foo(...) + bar(&) +end + +def foo(bar = (def baz(bar) = bar; 1)) = 2 + +def (class Foo; end).foo(bar = 1) = 2 diff --git a/test/mri/prism/fixtures/modules.txt b/test/mri/prism/fixtures/modules.txt new file mode 100644 index 00000000000..76bd9bea43c --- /dev/null +++ b/test/mri/prism/fixtures/modules.txt @@ -0,0 +1,18 @@ +module A a = 1 end + +%Q{aaa #{bbb} ccc} + +module m::M +end + +module A + x = 1; rescue; end + +module ::A +end + +module A[]::B +end + +module A[1]::B +end diff --git a/test/mri/prism/fixtures/multi_write.txt b/test/mri/prism/fixtures/multi_write.txt new file mode 100644 index 00000000000..edbcafb9697 --- /dev/null +++ b/test/mri/prism/fixtures/multi_write.txt @@ -0,0 +1,4 @@ +foo = 1 rescue nil +foo, bar = 1 rescue nil +foo = 1, 2 rescue nil +foo, bar = 1, 2 rescue nil diff --git a/test/mri/prism/fixtures/newline_terminated.txt b/test/mri/prism/fixtures/newline_terminated.txt new file mode 100644 index 00000000000..12f3bda2297 Binary files /dev/null and b/test/mri/prism/fixtures/newline_terminated.txt differ diff --git a/test/mri/prism/fixtures/next.txt b/test/mri/prism/fixtures/next.txt new file mode 100644 index 00000000000..476f17ffe3e --- /dev/null +++ b/test/mri/prism/fixtures/next.txt @@ -0,0 +1,24 @@ +next + +next (1), (2), (3) + +next 1 + +next 1, 2, +3 + +next 1, 2, 3 + +next [1, 2, 3] + +next( + 1 + 2 +) + +next +1 + +next() + +next(1) diff --git a/test/mri/prism/fixtures/nils.txt b/test/mri/prism/fixtures/nils.txt new file mode 100644 index 00000000000..8084db2534e --- /dev/null +++ b/test/mri/prism/fixtures/nils.txt @@ -0,0 +1,13 @@ +nil + +() + +( +; +; +) + +END { 1 } + +BEGIN { 1 } + diff --git a/test/mri/prism/fixtures/non_alphanumeric_methods.txt b/test/mri/prism/fixtures/non_alphanumeric_methods.txt new file mode 100644 index 00000000000..1da3fd852b9 --- /dev/null +++ b/test/mri/prism/fixtures/non_alphanumeric_methods.txt @@ -0,0 +1,105 @@ +def ! +end + +def != +end + +def !~ +end + +def % +end + +def self.+ +end + +def & +end + +def * +end + +def ** +end + +%|abc| + +def + **b +end + +def +() +end + +def + b +end + +def self.+ +end + +def + +end + +def +@ +end + +def - +end + +def a.-;end + +def -@ +end + +def / +end + +def < +end + +def << +end + +def <= +end + +def <=> +end + +def == +end + +def === +end + +def =~ +end + +def > +end + +def >= +end + +def >> +end + +def [] +end + +def []= +end + +def ^ +end + +def ` +end + +def self.` +end + +def | +end + +def ~ +end diff --git a/test/mri/prism/fixtures/not.txt b/test/mri/prism/fixtures/not.txt new file mode 100644 index 00000000000..520b34fa37a --- /dev/null +++ b/test/mri/prism/fixtures/not.txt @@ -0,0 +1,37 @@ +not foo and not bar + +not(foo and bar) + +not foo + +not foo and not + bar + + +not foo and + not + bar + + +not foo and + not + + + bar + +not(foo + + +) + +not( + + +foo + + + ) + +not foo .. bar + +not (foo .. bar) diff --git a/test/mri/prism/fixtures/numbers.txt b/test/mri/prism/fixtures/numbers.txt new file mode 100644 index 00000000000..47f20dcb42d --- /dev/null +++ b/test/mri/prism/fixtures/numbers.txt @@ -0,0 +1,67 @@ +0 + +1 + +1.0 + +2 + +0b0 + +0b1 + +0b10 + +0d0 + +0d1 + +0d2 + +00 + +01 + +02 + +0o0 + +0o1 + +0o2 + +0x0 + +0x1 + +0x2 + +1i + +1r + +-1 + +1ri + +1.2r + +1.2ri + +-1ri + +-1.2r + +-1.2ri + +0o1r + +0o1i + +0o1ri + +0d1r + +0d1i + +0b1ri diff --git a/test/mri/prism/fixtures/patterns.txt b/test/mri/prism/fixtures/patterns.txt new file mode 100644 index 00000000000..7ce3b9e4a8e --- /dev/null +++ b/test/mri/prism/fixtures/patterns.txt @@ -0,0 +1,217 @@ +foo => bar +foo => 1 +foo => 1.0 +foo => 1i +foo => 1r +foo => :foo +foo => %s[foo] +foo => :"foo" +foo => /foo/ +foo => `foo` +foo => %x[foo] +foo => %i[foo] +foo => %I[foo] +foo => %w[foo] +foo => %W[foo] +foo => %q[foo] +foo => %Q[foo] +foo => "foo" +foo => nil +foo => self +foo => true +foo => false +foo => __FILE__ +foo => __LINE__ +foo => __ENCODING__ +foo => -> { bar } + +foo => 1 .. 1 +foo => 1.0 .. 1.0 +foo => 1i .. 1i +foo => 1r .. 1r +foo => :foo .. :foo +foo => %s[foo] .. %s[foo] +foo => :"foo" .. :"foo" +foo => /foo/ .. /foo/ +foo => `foo` .. `foo` +foo => %x[foo] .. %x[foo] +foo => %i[foo] .. %i[foo] +foo => %I[foo] .. %I[foo] +foo => %w[foo] .. %w[foo] +foo => %W[foo] .. %W[foo] +foo => %q[foo] .. %q[foo] +foo => %Q[foo] .. %Q[foo] +foo => "foo" .. "foo" +foo => nil .. nil +foo => self .. self +foo => true .. true +foo => false .. false +foo => __FILE__ .. __FILE__ +foo => __LINE__ .. __LINE__ +foo => __ENCODING__ .. __ENCODING__ +foo => -> { bar } .. -> { bar } + +bar = 1; foo => ^bar +foo => ^@bar +foo => ^@@bar +foo => ^$bar + +foo => ^(1) +foo => ^(nil) +foo => ^("bar" + "baz") + +foo => Foo +foo => Foo::Bar::Baz +foo => ::Foo +foo => ::Foo::Bar::Baz + +foo => Foo() +foo => Foo(1) +foo => Foo(1, 2, 3) +foo => Foo(bar) +foo => Foo(*bar, baz) +foo => Foo(bar, *baz) +foo => Foo(*bar, baz, *qux) + +foo => Foo[] +foo => Foo[1] +foo => Foo[1, 2, 3] +foo => Foo[Foo[]] +foo => Foo[bar] +foo => Foo[*bar, baz] +foo => Foo[bar, *baz] +foo => Foo[*bar, baz, *qux] + +foo => *bar +foo => *bar, baz, qux +foo => bar, *baz, qux +foo => bar, baz, *qux +foo => *bar, baz, *qux + +foo => bar, + +; # end the previous pattern for ParseTest#test_filepath_patterns.txt which parses the whole file at once + +foo => [] +foo => [[[[[]]]]] + +foo => [*bar] +foo => [*bar, baz, qux] +foo => [bar, *baz, qux] +foo => [bar, baz, *qux] +foo => [*bar, baz, *qux] + +foo in bar +foo in 1 +foo in 1.0 +foo in 1i +foo in 1r +foo in :foo +foo in %s[foo] +foo in :"foo" +foo in /foo/ +foo in `foo` +foo in %x[foo] +foo in %i[foo] +foo in %I[foo] +foo in %w[foo] +foo in %W[foo] +foo in %q[foo] +foo in %Q[foo] +foo in "foo" +foo in nil +foo in self +foo in true +foo in false +foo in __FILE__ +foo in __LINE__ +foo in __ENCODING__ +foo in -> { bar } + +foo in bar, + +; # end the previous pattern for ParseTest#test_filepath_patterns.txt which parses the whole file at once + +case foo; in bar then end +case foo; in 1 then end +case foo; in 1.0 then end +case foo; in 1i then end +case foo; in 1r then end +case foo; in :foo then end +case foo; in %s[foo] then end +case foo; in :"foo" then end +case foo; in /foo/ then end +case foo; in `foo` then end +case foo; in %x[foo] then end +case foo; in %i[foo] then end +case foo; in %I[foo] then end +case foo; in %w[foo] then end +case foo; in %W[foo] then end +case foo; in %q[foo] then end +case foo; in %Q[foo] then end +case foo; in "foo" then end +case foo; in nil then end +case foo; in self then end +case foo; in true then end +case foo; in false then end +case foo; in __FILE__ then end +case foo; in __LINE__ then end +case foo; in __ENCODING__ then end +case foo; in -> { bar } then end + +case foo; in bar if baz then end +case foo; in 1 if baz then end +case foo; in 1.0 if baz then end +case foo; in 1i if baz then end +case foo; in 1r if baz then end +case foo; in :foo if baz then end +case foo; in %s[foo] if baz then end +case foo; in :"foo" if baz then end +case foo; in /foo/ if baz then end +case foo; in `foo` if baz then end +case foo; in %x[foo] if baz then end +case foo; in %i[foo] if baz then end +case foo; in %I[foo] if baz then end +case foo; in %w[foo] if baz then end +case foo; in %W[foo] if baz then end +case foo; in %q[foo] if baz then end +case foo; in %Q[foo] if baz then end +case foo; in "foo" if baz then end +case foo; in nil if baz then end +case foo; in self if baz then end +case foo; in true if baz then end +case foo; in false if baz then end +case foo; in __FILE__ if baz then end +case foo; in __LINE__ if baz then end +case foo; in __ENCODING__ if baz then end +case foo; in -> { bar } if baz then end + +if a in [] +end + +a => [ + b +] + +foo in A[ + bar: B[ + value: a + ] +] + +foo in bar => baz +foo => bar => baz + +foo, bar, baz = 1, 2 +foo do + [1, 2] => [foo, bar] => baz +end + +foo => Object[{x:}] + +1.then { 1 in ^_1 } + +( + a, + b +) = c diff --git a/test/mri/prism/fixtures/procs.txt b/test/mri/prism/fixtures/procs.txt new file mode 100644 index 00000000000..7ffb11e78ab --- /dev/null +++ b/test/mri/prism/fixtures/procs.txt @@ -0,0 +1,27 @@ +-> (a; b, c, d) { b } + +-> do +ensure +end + +-> do +rescue +else +ensure +end + +-> { foo } + +-> do; foo; end + +-> a, b = 1, c:, d:, &e { a } + +-> (a, b = 1, *c, d:, e:, **f, &g) { a } + +-> (a, b = 1, *c, d:, e:, **f, &g) do + a +end + +-> (a) { -> b { a * b } } + +-> ((a, b), *c) { } diff --git a/test/mri/prism/fixtures/range_begin_open_exclusive.txt b/test/mri/prism/fixtures/range_begin_open_exclusive.txt new file mode 100644 index 00000000000..3b12672b4f4 --- /dev/null +++ b/test/mri/prism/fixtures/range_begin_open_exclusive.txt @@ -0,0 +1 @@ +...2 diff --git a/test/mri/prism/fixtures/range_begin_open_inclusive.txt b/test/mri/prism/fixtures/range_begin_open_inclusive.txt new file mode 100644 index 00000000000..052f45900b9 --- /dev/null +++ b/test/mri/prism/fixtures/range_begin_open_inclusive.txt @@ -0,0 +1 @@ +..2 diff --git a/test/mri/prism/fixtures/range_end_open_exclusive.txt b/test/mri/prism/fixtures/range_end_open_exclusive.txt new file mode 100644 index 00000000000..2ffd68afdb3 --- /dev/null +++ b/test/mri/prism/fixtures/range_end_open_exclusive.txt @@ -0,0 +1 @@ +2... diff --git a/test/mri/prism/fixtures/range_end_open_inclusive.txt b/test/mri/prism/fixtures/range_end_open_inclusive.txt new file mode 100644 index 00000000000..48445391f68 --- /dev/null +++ b/test/mri/prism/fixtures/range_end_open_inclusive.txt @@ -0,0 +1 @@ +2.. diff --git a/test/mri/prism/fixtures/ranges.txt b/test/mri/prism/fixtures/ranges.txt new file mode 100644 index 00000000000..e2e4136ae96 --- /dev/null +++ b/test/mri/prism/fixtures/ranges.txt @@ -0,0 +1,49 @@ +(...2) + +(..2) + +1...2 + +foo[...2] + +{ foo: ...bar } + +(1...) + +1..2 + +{ foo: ..bar } + +(1..) + +1 .. ..1 + +1.. && 2 + +1.. == 2 + +1.. != 2 + +1.. === 2 + +1.. <=> 2 + +1.. =~ 2 + +1.. !~ 2 + +1.. < 2 + +1.. > 2 + +1.. <= 2 + +1.. >= 2 + +1.. << 2 + +1.. >> 2 + +1.. + 2 + +1.. - 2 diff --git a/test/mri/prism/fixtures/regex.txt b/test/mri/prism/fixtures/regex.txt new file mode 100644 index 00000000000..ef2f6d45a32 --- /dev/null +++ b/test/mri/prism/fixtures/regex.txt @@ -0,0 +1,40 @@ +foo /bar/ + +%r{abc}i + +/a\b/ + +/aaa #$bbb/ + +/aaa #{bbb} ccc/ + +[/(?bar)/ =~ baz, foo] + +/abc/i + +%r/[a-z$._?][\w$.?#@~]*:/i + +%r/([a-z$._?][\w$.?#@~]*)(\s+)(equ)/i + +%r/[a-z$._?][\w$.?#@~]*/i + +%r( +(?:[\w#$%_']|\(\)|\(,\)|\[\]|[0-9])* + (?:[\w#$%_']+) +) + +/(?#\))/ =~ "hi" + +%r#pound# + +/aaa #{bbb}/o + +/(?)/ =~ ""; ab + +/(?)(?)/ =~ ""; abc + +/(?)/ =~ "" + +a = 1 +tap { /(?)/ =~ to_s } diff --git a/test/mri/prism/fixtures/regex_char_width.txt b/test/mri/prism/fixtures/regex_char_width.txt new file mode 100644 index 00000000000..7096b715844 --- /dev/null +++ b/test/mri/prism/fixtures/regex_char_width.txt @@ -0,0 +1,3 @@ +# encoding: sjis +/Ⅷ(?.)Ⅹ(?.)/ =~ 'ⅧaⅩb' +[a, b] diff --git a/test/mri/prism/fixtures/repeat_parameters.txt b/test/mri/prism/fixtures/repeat_parameters.txt new file mode 100644 index 00000000000..9c69e9718ad --- /dev/null +++ b/test/mri/prism/fixtures/repeat_parameters.txt @@ -0,0 +1,38 @@ +def foo(a, _) +end + +def foo(a, _, _) +end + +def foo(a, _, _, _b) +end + +def foo(a, _, _, _b, _b) +end + +def foo(a, (b, *_c, d), (e, *_c, f)) +end + +def foo(_a, _a, b, c) +end + +def foo((a, *_b, c), (d, *_b, e)) +end + +def foo(_a = 1, _a = 2) +end + +def foo(_a:, _a:) +end + +def foo(_a: 1, _a: 2) +end + +def foo(_a, **_a) +end + +def foo(_a, &_a) +end + +def foo(_a, *_a) +end diff --git a/test/mri/prism/fixtures/rescue.txt b/test/mri/prism/fixtures/rescue.txt new file mode 100644 index 00000000000..7cce866379a --- /dev/null +++ b/test/mri/prism/fixtures/rescue.txt @@ -0,0 +1,35 @@ +foo rescue nil + +foo rescue +nil + +break rescue nil + +next rescue nil + +return rescue nil + +foo rescue nil || 1 + +foo rescue nil ? 1 : 2 + +begin; a; rescue *b; end + +foo do |x| + bar(y) rescue ArgumentError fail "baz" +end + +if a = foo rescue nil + bar +end + +def some_method = other_method 42 rescue nil + +def a + a b: +rescue +end + +foo if bar rescue baz + +z = x y rescue c d diff --git a/test/mri/prism/fixtures/return.txt b/test/mri/prism/fixtures/return.txt new file mode 100644 index 00000000000..a8b5b95fabe --- /dev/null +++ b/test/mri/prism/fixtures/return.txt @@ -0,0 +1,24 @@ +return + +return (1), (2), (3) + +return *1 + +return 1 + +return 1, 2, +3 + +return 1, 2, 3 + +return [1, 2, 3] + +return( + 1 + 2 +) + +return() + +return(1) + diff --git a/test/mri/prism/fixtures/seattlerb/BEGIN.txt b/test/mri/prism/fixtures/seattlerb/BEGIN.txt new file mode 100644 index 00000000000..bed57559015 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/BEGIN.txt @@ -0,0 +1 @@ +BEGIN { 42 } diff --git a/test/mri/prism/fixtures/seattlerb/README.rdoc b/test/mri/prism/fixtures/seattlerb/README.rdoc new file mode 100644 index 00000000000..649e4e4c2fa --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/README.rdoc @@ -0,0 +1,113 @@ += ruby_parser + +home :: https://github.com/seattlerb/ruby_parser +bugs :: https://github.com/seattlerb/ruby_parser/issues +rdoc :: http://docs.seattlerb.org/ruby_parser + +== DESCRIPTION: + +ruby_parser (RP) is a ruby parser written in pure ruby (utilizing +racc--which does by default use a C extension). It outputs +s-expressions which can be manipulated and converted back to ruby via +the ruby2ruby gem. + +As an example: + + def conditional1 arg1 + return 1 if arg1 == 0 + return 0 + end + +becomes: + + s(:defn, :conditional1, s(:args, :arg1), + s(:if, + s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), + s(:return, s(:lit, 1)), + nil), + s(:return, s(:lit, 0))) + +Tested against 801,039 files from the latest of all rubygems (as of 2013-05): + +* 1.8 parser is at 99.9739% accuracy, 3.651 sigma +* 1.9 parser is at 99.9940% accuracy, 4.013 sigma +* 2.0 parser is at 99.9939% accuracy, 4.008 sigma +* 2.6 parser is at 99.9972% accuracy, 4.191 sigma +* 3.0 parser has a 100% parse rate. + * Tested against 2,672,412 unique ruby files across 167k gems. + * As do all the others now, basically. + +== FEATURES/PROBLEMS: + +* Pure ruby, no compiles. +* Includes preceding comment data for defn/defs/class/module nodes! +* Incredibly simple interface. +* Output is 100% equivalent to ParseTree. + * Can utilize PT's SexpProcessor and UnifiedRuby for language processing. +* Known Issue: Speed is now pretty good, but can always improve: + * RP parses a corpus of 3702 files in 125s (avg 108 Kb/s) + * MRI+PT parsed the same in 67.38s (avg 200.89 Kb/s) +* Known Issue: Code is much better, but still has a long way to go. +* Known Issue: Totally awesome. +* Known Issue: line number values can be slightly off. Parsing LR sucks. + +== SYNOPSIS: + + RubyParser.new.parse "1+1" + # => s(:call, s(:lit, 1), :+, s(:lit, 1)) + +You can also use Ruby19Parser, Ruby18Parser, or RubyParser.for_current_ruby: + + RubyParser.for_current_ruby.parse "1+1" + # => s(:call, s(:lit, 1), :+, s(:lit, 1)) + +== DEVELOPER NOTES: + +To add a new version: + +* New parser should be generated from lib/ruby[3]_parser.yy. +* Extend lib/ruby[3]_parser.yy with new class name. +* Add new version number to V2/V3 in Rakefile for rule creation. +* Add new `ruby_parse "x.y.z"` line to Rakefile for rake compare (line ~300). +* Require generated parser in lib/ruby_parser.rb. +* Add new V## = ::Ruby##Parser; end to ruby_parser.rb (bottom of file). +* Add empty TestRubyParserShared##Plus module and TestRubyParserV## to test/test_ruby_parser.rb. +* Extend Manifest.txt with generated file names. +* Add new version number to sexp_processor's pt_testcase.rb in all_versions + +Until all of these are done, you won't have a clean test run. + +== REQUIREMENTS: + +* ruby. woot. +* sexp_processor for Sexp and SexpProcessor classes, and testing. +* racc full package for parser development (compiling .y to .rb). + +== INSTALL: + +* sudo gem install ruby_parser + +== LICENSE: + +(The MIT License) + +Copyright (c) Ryan Davis, seattle.rb + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/mri/prism/fixtures/seattlerb/TestRubyParserShared.txt b/test/mri/prism/fixtures/seattlerb/TestRubyParserShared.txt new file mode 100644 index 00000000000..c55b3e1f70e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/TestRubyParserShared.txt @@ -0,0 +1,92 @@ +%I[ + + +] + +%I[ +line2 +line3 +] + +%W[ + + +] + +%W[ +line2 +line3 +] + +%i[ + + +] + +%i[ +line2 +line3 +] + +%r[ + + +] + +%w[ + + +] + +%w[ +line2 +line3 +] + +[ +:line2, +:line3 +] + +class X # line 1 + def self.y(a, # line 2 + b) # line 3 + a + b # line 4 + end # line 5 +end # line 6 + + +class X # line 1 + class Y # line 2 + Z = 42 # line 3 + end # line 4 +end # line 5 + + +class X # line 1 + def y(a, # line 2 + b) # line 3 + a + b # line 4 + end # line 5 +end # line 6 + + +module X + X = [ + :line3, + :line4, + ] +end + + +module X # line 1 + module Y # line 2 + Z = 42 # line 3 + end # line 4 +end # line 5 + + +x( +:line2, +:line3 +) diff --git a/test/mri/prism/fixtures/seattlerb/__ENCODING__.txt b/test/mri/prism/fixtures/seattlerb/__ENCODING__.txt new file mode 100644 index 00000000000..d6debf2f924 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/__ENCODING__.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/mri/prism/fixtures/seattlerb/alias_gvar_backref.txt b/test/mri/prism/fixtures/seattlerb/alias_gvar_backref.txt new file mode 100644 index 00000000000..016bd94fe09 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/alias_gvar_backref.txt @@ -0,0 +1 @@ +alias $MATCH $& diff --git a/test/mri/prism/fixtures/seattlerb/alias_resword.txt b/test/mri/prism/fixtures/seattlerb/alias_resword.txt new file mode 100644 index 00000000000..63e782614b2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/alias_resword.txt @@ -0,0 +1 @@ +alias in out diff --git a/test/mri/prism/fixtures/seattlerb/and_multi.txt b/test/mri/prism/fixtures/seattlerb/and_multi.txt new file mode 100644 index 00000000000..8902086cac8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/and_multi.txt @@ -0,0 +1,3 @@ +true and +not false and +true diff --git a/test/mri/prism/fixtures/seattlerb/aref_args_assocs.txt b/test/mri/prism/fixtures/seattlerb/aref_args_assocs.txt new file mode 100644 index 00000000000..3244eebafc4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/aref_args_assocs.txt @@ -0,0 +1 @@ +[1 => 2] diff --git a/test/mri/prism/fixtures/seattlerb/aref_args_lit_assocs.txt b/test/mri/prism/fixtures/seattlerb/aref_args_lit_assocs.txt new file mode 100644 index 00000000000..0b6ffa7e2c2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/aref_args_lit_assocs.txt @@ -0,0 +1 @@ +[1, 2 => 3] diff --git a/test/mri/prism/fixtures/seattlerb/args_kw_block.txt b/test/mri/prism/fixtures/seattlerb/args_kw_block.txt new file mode 100644 index 00000000000..cb6ab39852a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/args_kw_block.txt @@ -0,0 +1 @@ +def f(a: 1, &b); end diff --git a/test/mri/prism/fixtures/seattlerb/array_line_breaks.txt b/test/mri/prism/fixtures/seattlerb/array_line_breaks.txt new file mode 100644 index 00000000000..be9f2d9cb8c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/array_line_breaks.txt @@ -0,0 +1,4 @@ +[ +'a', +'b'] +1 diff --git a/test/mri/prism/fixtures/seattlerb/array_lits_trailing_calls.txt b/test/mri/prism/fixtures/seattlerb/array_lits_trailing_calls.txt new file mode 100644 index 00000000000..868384a4074 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/array_lits_trailing_calls.txt @@ -0,0 +1,3 @@ +%w[].b + +[].b diff --git a/test/mri/prism/fixtures/seattlerb/assoc__bare.txt b/test/mri/prism/fixtures/seattlerb/assoc__bare.txt new file mode 100644 index 00000000000..96c2940f314 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/assoc__bare.txt @@ -0,0 +1 @@ +{ y: } diff --git a/test/mri/prism/fixtures/seattlerb/assoc_label.txt b/test/mri/prism/fixtures/seattlerb/assoc_label.txt new file mode 100644 index 00000000000..372dc75031f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/assoc_label.txt @@ -0,0 +1 @@ +a(b:1) diff --git a/test/mri/prism/fixtures/seattlerb/attr_asgn_colon_id.txt b/test/mri/prism/fixtures/seattlerb/attr_asgn_colon_id.txt new file mode 100644 index 00000000000..f63c2f5dcb5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/attr_asgn_colon_id.txt @@ -0,0 +1 @@ +A::b = 1 diff --git a/test/mri/prism/fixtures/seattlerb/attrasgn_array_arg.txt b/test/mri/prism/fixtures/seattlerb/attrasgn_array_arg.txt new file mode 100644 index 00000000000..db9e2db0634 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/attrasgn_array_arg.txt @@ -0,0 +1 @@ +a[[1, 2]] = 3 diff --git a/test/mri/prism/fixtures/seattlerb/attrasgn_array_lhs.txt b/test/mri/prism/fixtures/seattlerb/attrasgn_array_lhs.txt new file mode 100644 index 00000000000..0b8e31632db --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/attrasgn_array_lhs.txt @@ -0,0 +1 @@ +[1, 2, 3, 4][from .. to] = ["a", "b", "c"] diff --git a/test/mri/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt b/test/mri/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt new file mode 100644 index 00000000000..380a718963d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt @@ -0,0 +1 @@ +a.B = 1 diff --git a/test/mri/prism/fixtures/seattlerb/backticks_interpolation_line.txt b/test/mri/prism/fixtures/seattlerb/backticks_interpolation_line.txt new file mode 100644 index 00000000000..b3ba31c72a2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/backticks_interpolation_line.txt @@ -0,0 +1 @@ +x `#{y}` diff --git a/test/mri/prism/fixtures/seattlerb/bang_eq.txt b/test/mri/prism/fixtures/seattlerb/bang_eq.txt new file mode 100644 index 00000000000..0283460e468 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bang_eq.txt @@ -0,0 +1 @@ +1 != 2 diff --git a/test/mri/prism/fixtures/seattlerb/bdot2.txt b/test/mri/prism/fixtures/seattlerb/bdot2.txt new file mode 100644 index 00000000000..4fb26922993 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bdot2.txt @@ -0,0 +1,3 @@ +..10 +; ..a +; c diff --git a/test/mri/prism/fixtures/seattlerb/bdot3.txt b/test/mri/prism/fixtures/seattlerb/bdot3.txt new file mode 100644 index 00000000000..8079cf98729 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bdot3.txt @@ -0,0 +1,3 @@ +...10 +; ...a +; c diff --git a/test/mri/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt b/test/mri/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt new file mode 100644 index 00000000000..51dde02ea38 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt @@ -0,0 +1,3 @@ +begin +ensure +end diff --git a/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt b/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt new file mode 100644 index 00000000000..ae6e2c36364 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt @@ -0,0 +1,9 @@ +begin + 1 +rescue + 2 +else + 3 +ensure + 4 +end diff --git a/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt b/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt new file mode 100644 index 00000000000..456d9a5d6e1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt @@ -0,0 +1,9 @@ +begin + +rescue + +else + +ensure + +end diff --git a/test/mri/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt b/test/mri/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt new file mode 100644 index 00000000000..896e3c030a1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt @@ -0,0 +1,4 @@ +begin +rescue +ensure +end diff --git a/test/mri/prism/fixtures/seattlerb/block_arg__bare.txt b/test/mri/prism/fixtures/seattlerb/block_arg__bare.txt new file mode 100644 index 00000000000..6454b003459 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg__bare.txt @@ -0,0 +1 @@ +def x(&); end diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_kwsplat.txt b/test/mri/prism/fixtures/seattlerb/block_arg_kwsplat.txt new file mode 100644 index 00000000000..a9c255cc669 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_kwsplat.txt @@ -0,0 +1 @@ +a { |**b| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt b/test/mri/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt new file mode 100644 index 00000000000..14cb02c68ef --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt @@ -0,0 +1 @@ +a { |b, c=1, d, &e| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat.txt b/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat.txt new file mode 100644 index 00000000000..a077ae1f34c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat.txt @@ -0,0 +1 @@ +a { |b, c = 1, *d| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..5016a7c6b96 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +a { |b, c=1, *d, e, &f| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_optional.txt b/test/mri/prism/fixtures/seattlerb/block_arg_optional.txt new file mode 100644 index 00000000000..966afc56404 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_optional.txt @@ -0,0 +1 @@ +a { |b = 1| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_scope.txt b/test/mri/prism/fixtures/seattlerb/block_arg_scope.txt new file mode 100644 index 00000000000..2362e085596 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_scope.txt @@ -0,0 +1 @@ +a { |b; c| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_scope2.txt b/test/mri/prism/fixtures/seattlerb/block_arg_scope2.txt new file mode 100644 index 00000000000..f7222dc7b12 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_scope2.txt @@ -0,0 +1 @@ +a {|b; c, d| } diff --git a/test/mri/prism/fixtures/seattlerb/block_arg_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/block_arg_splat_arg.txt new file mode 100644 index 00000000000..d7c31aae6bf --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_arg_splat_arg.txt @@ -0,0 +1 @@ +a { |b, *c, d| } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_kwargs.txt b/test/mri/prism/fixtures/seattlerb/block_args_kwargs.txt new file mode 100644 index 00000000000..467b577a7e3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_kwargs.txt @@ -0,0 +1 @@ +f { |**kwargs| kwargs } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_no_kwargs.txt b/test/mri/prism/fixtures/seattlerb/block_args_no_kwargs.txt new file mode 100644 index 00000000000..5c9bfa3a625 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_no_kwargs.txt @@ -0,0 +1 @@ +f { |**nil| } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_opt1.txt b/test/mri/prism/fixtures/seattlerb/block_args_opt1.txt new file mode 100644 index 00000000000..372689e36a5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_opt1.txt @@ -0,0 +1 @@ +f { |a, b = 42| [a, b] } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_opt2.txt b/test/mri/prism/fixtures/seattlerb/block_args_opt2.txt new file mode 100644 index 00000000000..10d07466462 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_opt2.txt @@ -0,0 +1 @@ +a { | b=1, c=2 | } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_opt2_2.txt b/test/mri/prism/fixtures/seattlerb/block_args_opt2_2.txt new file mode 100644 index 00000000000..563a9bf9156 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_opt2_2.txt @@ -0,0 +1 @@ +f { |a, b = 42, c = 24| [a, b, c] } diff --git a/test/mri/prism/fixtures/seattlerb/block_args_opt3.txt b/test/mri/prism/fixtures/seattlerb/block_args_opt3.txt new file mode 100644 index 00000000000..bb5a7c84580 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_args_opt3.txt @@ -0,0 +1 @@ +f { |a, b = 42, c = 24, &d| [a, b, c, d] } diff --git a/test/mri/prism/fixtures/seattlerb/block_break.txt b/test/mri/prism/fixtures/seattlerb/block_break.txt new file mode 100644 index 00000000000..35eabee187b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_break.txt @@ -0,0 +1 @@ +break foo arg do |bar| end diff --git a/test/mri/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt b/test/mri/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt new file mode 100644 index 00000000000..ff1b3a4c9f0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt @@ -0,0 +1,4 @@ +a def b(c) + d + end + e.f do end diff --git a/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt b/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt new file mode 100644 index 00000000000..63da9ee7af4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt @@ -0,0 +1 @@ +a.b c() do d end.e do |f| g end diff --git a/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt new file mode 100644 index 00000000000..24e7d0f1f10 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -0,0 +1 @@ +a.b c() do d end.e f do |g| h end diff --git a/test/mri/prism/fixtures/seattlerb/block_call_operation_colon.txt b/test/mri/prism/fixtures/seattlerb/block_call_operation_colon.txt new file mode 100644 index 00000000000..593b9e1bc0f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_operation_colon.txt @@ -0,0 +1 @@ +a.b c do end::d diff --git a/test/mri/prism/fixtures/seattlerb/block_call_operation_dot.txt b/test/mri/prism/fixtures/seattlerb/block_call_operation_dot.txt new file mode 100644 index 00000000000..20b8e4fcb8d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_operation_dot.txt @@ -0,0 +1 @@ +a.b c do end.d diff --git a/test/mri/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt b/test/mri/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt new file mode 100644 index 00000000000..7f8be951001 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt @@ -0,0 +1,2 @@ +a (b) +c.d do end diff --git a/test/mri/prism/fixtures/seattlerb/block_command_operation_colon.txt b/test/mri/prism/fixtures/seattlerb/block_command_operation_colon.txt new file mode 100644 index 00000000000..db221ad4968 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_command_operation_colon.txt @@ -0,0 +1 @@ +a :b do end::c :d diff --git a/test/mri/prism/fixtures/seattlerb/block_command_operation_dot.txt b/test/mri/prism/fixtures/seattlerb/block_command_operation_dot.txt new file mode 100644 index 00000000000..56b71677e80 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_command_operation_dot.txt @@ -0,0 +1 @@ +a :b do end.c :d diff --git a/test/mri/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt new file mode 100644 index 00000000000..96f5d5d2ec3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt @@ -0,0 +1 @@ +f { |(*, a)| } diff --git a/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat.txt b/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat.txt new file mode 100644 index 00000000000..f8db3874de3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat.txt @@ -0,0 +1 @@ +a { |(b, *)| } diff --git a/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt new file mode 100644 index 00000000000..e64f4e8c3dd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt @@ -0,0 +1 @@ +f { |(a, *b, c)| } diff --git a/test/mri/prism/fixtures/seattlerb/block_decomp_splat.txt b/test/mri/prism/fixtures/seattlerb/block_decomp_splat.txt new file mode 100644 index 00000000000..970f00a626e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_decomp_splat.txt @@ -0,0 +1 @@ +f { |(*a)| } diff --git a/test/mri/prism/fixtures/seattlerb/block_kw.txt b/test/mri/prism/fixtures/seattlerb/block_kw.txt new file mode 100644 index 00000000000..bacfd32e80d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_kw.txt @@ -0,0 +1 @@ +blah { |k:42| } diff --git a/test/mri/prism/fixtures/seattlerb/block_kw__required.txt b/test/mri/prism/fixtures/seattlerb/block_kw__required.txt new file mode 100644 index 00000000000..b84ab970378 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_kw__required.txt @@ -0,0 +1 @@ +blah do |k:| end diff --git a/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar.txt b/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar.txt new file mode 100644 index 00000000000..390b9195e0d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar.txt @@ -0,0 +1 @@ +bl { |kw: :val| kw } diff --git a/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt b/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt new file mode 100644 index 00000000000..df3e4afde8f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt @@ -0,0 +1 @@ +bl { |kw: :val, kw2: :val2 | kw } diff --git a/test/mri/prism/fixtures/seattlerb/block_next.txt b/test/mri/prism/fixtures/seattlerb/block_next.txt new file mode 100644 index 00000000000..760fcbf8098 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_next.txt @@ -0,0 +1 @@ +next foo arg do |bar| end diff --git a/test/mri/prism/fixtures/seattlerb/block_opt_arg.txt b/test/mri/prism/fixtures/seattlerb/block_opt_arg.txt new file mode 100644 index 00000000000..5e312fdf41b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_opt_arg.txt @@ -0,0 +1 @@ +a { |b=1, c| } diff --git a/test/mri/prism/fixtures/seattlerb/block_opt_splat.txt b/test/mri/prism/fixtures/seattlerb/block_opt_splat.txt new file mode 100644 index 00000000000..772a3fc412f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_opt_splat.txt @@ -0,0 +1 @@ +a { |b = 1, *c| } diff --git a/test/mri/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt b/test/mri/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..76466f9d548 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +a { |b=1, *c, d, &e| } diff --git a/test/mri/prism/fixtures/seattlerb/block_optarg.txt b/test/mri/prism/fixtures/seattlerb/block_optarg.txt new file mode 100644 index 00000000000..a471554da1c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_optarg.txt @@ -0,0 +1 @@ +a { |b = :c| } diff --git a/test/mri/prism/fixtures/seattlerb/block_paren_splat.txt b/test/mri/prism/fixtures/seattlerb/block_paren_splat.txt new file mode 100644 index 00000000000..3dd4bba1ed4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_paren_splat.txt @@ -0,0 +1 @@ +a { |(b, *c)| } diff --git a/test/mri/prism/fixtures/seattlerb/block_reg_optarg.txt b/test/mri/prism/fixtures/seattlerb/block_reg_optarg.txt new file mode 100644 index 00000000000..c024651f78f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_reg_optarg.txt @@ -0,0 +1 @@ +a { |b, c = :d| } diff --git a/test/mri/prism/fixtures/seattlerb/block_return.txt b/test/mri/prism/fixtures/seattlerb/block_return.txt new file mode 100644 index 00000000000..f30ba71d8f6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_return.txt @@ -0,0 +1 @@ +return foo arg do |bar| end diff --git a/test/mri/prism/fixtures/seattlerb/block_scope.txt b/test/mri/prism/fixtures/seattlerb/block_scope.txt new file mode 100644 index 00000000000..7a83d8ab87c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_scope.txt @@ -0,0 +1 @@ +a { |;b| } diff --git a/test/mri/prism/fixtures/seattlerb/block_splat_reg.txt b/test/mri/prism/fixtures/seattlerb/block_splat_reg.txt new file mode 100644 index 00000000000..58f0619e5de --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/block_splat_reg.txt @@ -0,0 +1 @@ +a { |*b, c| } diff --git a/test/mri/prism/fixtures/seattlerb/bug169.txt b/test/mri/prism/fixtures/seattlerb/bug169.txt new file mode 100644 index 00000000000..db2e5ace5ee --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug169.txt @@ -0,0 +1 @@ +m () {} diff --git a/test/mri/prism/fixtures/seattlerb/bug179.txt b/test/mri/prism/fixtures/seattlerb/bug179.txt new file mode 100644 index 00000000000..02ae07a3be5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug179.txt @@ -0,0 +1 @@ +p ()..nil diff --git a/test/mri/prism/fixtures/seattlerb/bug190.txt b/test/mri/prism/fixtures/seattlerb/bug190.txt new file mode 100644 index 00000000000..861b2d305f0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug190.txt @@ -0,0 +1 @@ +%r'\'' diff --git a/test/mri/prism/fixtures/seattlerb/bug191.txt b/test/mri/prism/fixtures/seattlerb/bug191.txt new file mode 100644 index 00000000000..03f7fd1228b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug191.txt @@ -0,0 +1,3 @@ +a ? "": b + +a ? '': b diff --git a/test/mri/prism/fixtures/seattlerb/bug202.txt b/test/mri/prism/fixtures/seattlerb/bug202.txt new file mode 100644 index 00000000000..a3b06ffdfc2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug202.txt @@ -0,0 +1,2 @@ +$测试 = 1 +测试 = 1 diff --git a/test/mri/prism/fixtures/seattlerb/bug236.txt b/test/mri/prism/fixtures/seattlerb/bug236.txt new file mode 100644 index 00000000000..cefe1eb058b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug236.txt @@ -0,0 +1,3 @@ +x{|a,|} + +x{|a|} diff --git a/test/mri/prism/fixtures/seattlerb/bug290.txt b/test/mri/prism/fixtures/seattlerb/bug290.txt new file mode 100644 index 00000000000..dbcd28cd487 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug290.txt @@ -0,0 +1,3 @@ +begin + foo +end diff --git a/test/mri/prism/fixtures/seattlerb/bug_187.txt b/test/mri/prism/fixtures/seattlerb/bug_187.txt new file mode 100644 index 00000000000..1e1ecd8202a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_187.txt @@ -0,0 +1,3 @@ +private def f +a.b do end +end diff --git a/test/mri/prism/fixtures/seattlerb/bug_215.txt b/test/mri/prism/fixtures/seattlerb/bug_215.txt new file mode 100644 index 00000000000..f0d09ba5ff6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_215.txt @@ -0,0 +1 @@ +undef %s(foo) diff --git a/test/mri/prism/fixtures/seattlerb/bug_249.txt b/test/mri/prism/fixtures/seattlerb/bug_249.txt new file mode 100644 index 00000000000..ccccdf53268 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_249.txt @@ -0,0 +1,4 @@ +mount (Class.new do +def initialize +end + end).new, :at => 'endpoint' diff --git a/test/mri/prism/fixtures/seattlerb/bug_and.txt b/test/mri/prism/fixtures/seattlerb/bug_and.txt new file mode 100644 index 00000000000..6243359a9e8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_and.txt @@ -0,0 +1,4 @@ +true and +true + +true and [] diff --git a/test/mri/prism/fixtures/seattlerb/bug_args__19.txt b/test/mri/prism/fixtures/seattlerb/bug_args__19.txt new file mode 100644 index 00000000000..08466554fd0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_args__19.txt @@ -0,0 +1 @@ +f { |(a, b)| d } diff --git a/test/mri/prism/fixtures/seattlerb/bug_args_masgn.txt b/test/mri/prism/fixtures/seattlerb/bug_args_masgn.txt new file mode 100644 index 00000000000..e0a71e91972 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_args_masgn.txt @@ -0,0 +1 @@ +f { |(a, b), c| } diff --git a/test/mri/prism/fixtures/seattlerb/bug_args_masgn2.txt b/test/mri/prism/fixtures/seattlerb/bug_args_masgn2.txt new file mode 100644 index 00000000000..2f12756bfe8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_args_masgn2.txt @@ -0,0 +1 @@ +f { |((a, b), c), d| } diff --git a/test/mri/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt b/test/mri/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt new file mode 100644 index 00000000000..a2b01786761 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -0,0 +1 @@ +f { |((k, v), i)| } diff --git a/test/mri/prism/fixtures/seattlerb/bug_call_arglist_parens.txt b/test/mri/prism/fixtures/seattlerb/bug_call_arglist_parens.txt new file mode 100644 index 00000000000..4f043688026 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_call_arglist_parens.txt @@ -0,0 +1,11 @@ + def f + g ( 1), 2 + end + + + def f() + g (1), 2 + end + + +g ( 1), 2 diff --git a/test/mri/prism/fixtures/seattlerb/bug_case_when_regexp.txt b/test/mri/prism/fixtures/seattlerb/bug_case_when_regexp.txt new file mode 100644 index 00000000000..2536696a42d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_case_when_regexp.txt @@ -0,0 +1 @@ +case :x; when /x/ then end diff --git a/test/mri/prism/fixtures/seattlerb/bug_comma.txt b/test/mri/prism/fixtures/seattlerb/bug_comma.txt new file mode 100644 index 00000000000..d86f1ea9dd4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_comma.txt @@ -0,0 +1 @@ +if test ?d, dir then end diff --git a/test/mri/prism/fixtures/seattlerb/bug_cond_pct.txt b/test/mri/prism/fixtures/seattlerb/bug_cond_pct.txt new file mode 100644 index 00000000000..1b4f90058e6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_cond_pct.txt @@ -0,0 +1 @@ +case; when %r%blahblah%; end diff --git a/test/mri/prism/fixtures/seattlerb/bug_hash_args.txt b/test/mri/prism/fixtures/seattlerb/bug_hash_args.txt new file mode 100644 index 00000000000..b815f8a666a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_hash_args.txt @@ -0,0 +1 @@ +foo(:bar, baz: nil) diff --git a/test/mri/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt new file mode 100644 index 00000000000..6057b245a5f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt @@ -0,0 +1 @@ +foo(:bar, baz: nil,) diff --git a/test/mri/prism/fixtures/seattlerb/bug_hash_interp_array.txt b/test/mri/prism/fixtures/seattlerb/bug_hash_interp_array.txt new file mode 100644 index 00000000000..01fe2380562 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_hash_interp_array.txt @@ -0,0 +1 @@ +{ "#{}": [] } diff --git a/test/mri/prism/fixtures/seattlerb/bug_masgn_right.txt b/test/mri/prism/fixtures/seattlerb/bug_masgn_right.txt new file mode 100644 index 00000000000..12ea7b8d62e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_masgn_right.txt @@ -0,0 +1 @@ +f { |a, (b, c)| } diff --git a/test/mri/prism/fixtures/seattlerb/bug_not_parens.txt b/test/mri/prism/fixtures/seattlerb/bug_not_parens.txt new file mode 100644 index 00000000000..8847b7bec69 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_not_parens.txt @@ -0,0 +1 @@ +not(a) diff --git a/test/mri/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt b/test/mri/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt new file mode 100644 index 00000000000..6a0b25cbdca --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt @@ -0,0 +1 @@ +a ||= b rescue nil diff --git a/test/mri/prism/fixtures/seattlerb/call_and.txt b/test/mri/prism/fixtures/seattlerb/call_and.txt new file mode 100644 index 00000000000..c17be8f356d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_and.txt @@ -0,0 +1 @@ +1 & 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_arg_assoc.txt b/test/mri/prism/fixtures/seattlerb/call_arg_assoc.txt new file mode 100644 index 00000000000..376c299be5d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_arg_assoc.txt @@ -0,0 +1 @@ +f(1, 2=>3) diff --git a/test/mri/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt b/test/mri/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt new file mode 100644 index 00000000000..a4be0fb62c2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt @@ -0,0 +1 @@ +f(1, kw: 2, **3) diff --git a/test/mri/prism/fixtures/seattlerb/call_arg_kwsplat.txt b/test/mri/prism/fixtures/seattlerb/call_arg_kwsplat.txt new file mode 100644 index 00000000000..4848fd9e8d4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_arg_kwsplat.txt @@ -0,0 +1 @@ +a(b, **1) diff --git a/test/mri/prism/fixtures/seattlerb/call_args_assoc_quoted.txt b/test/mri/prism/fixtures/seattlerb/call_args_assoc_quoted.txt new file mode 100644 index 00000000000..0af2259577f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_args_assoc_quoted.txt @@ -0,0 +1,5 @@ +x "#{k}":42 + +x "k":42 + +x 'k':42 diff --git a/test/mri/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt new file mode 100644 index 00000000000..6ad08f32386 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt @@ -0,0 +1 @@ +f(1, 2=>3,) diff --git a/test/mri/prism/fixtures/seattlerb/call_args_command.txt b/test/mri/prism/fixtures/seattlerb/call_args_command.txt new file mode 100644 index 00000000000..dd6df29c7b4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_args_command.txt @@ -0,0 +1 @@ +a.b c.d 1 diff --git a/test/mri/prism/fixtures/seattlerb/call_array_arg.txt b/test/mri/prism/fixtures/seattlerb/call_array_arg.txt new file mode 100644 index 00000000000..5c724fa328b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_array_arg.txt @@ -0,0 +1 @@ +1 == [:b, :c] diff --git a/test/mri/prism/fixtures/seattlerb/call_array_block_call.txt b/test/mri/prism/fixtures/seattlerb/call_array_block_call.txt new file mode 100644 index 00000000000..6d4c1b276e1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_array_block_call.txt @@ -0,0 +1 @@ +a [ nil, b do end ] diff --git a/test/mri/prism/fixtures/seattlerb/call_array_lambda_block_call.txt b/test/mri/prism/fixtures/seattlerb/call_array_lambda_block_call.txt new file mode 100644 index 00000000000..dc5b5807b2c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_array_lambda_block_call.txt @@ -0,0 +1,2 @@ +a [->() {}] do +end diff --git a/test/mri/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt b/test/mri/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt new file mode 100644 index 00000000000..daba00947ef --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt @@ -0,0 +1 @@ +a([:b, :c => 1]) diff --git a/test/mri/prism/fixtures/seattlerb/call_assoc.txt b/test/mri/prism/fixtures/seattlerb/call_assoc.txt new file mode 100644 index 00000000000..2adc1eee1c8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_assoc.txt @@ -0,0 +1 @@ +f(2=>3) diff --git a/test/mri/prism/fixtures/seattlerb/call_assoc_new.txt b/test/mri/prism/fixtures/seattlerb/call_assoc_new.txt new file mode 100644 index 00000000000..b8457bfdfcf --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_assoc_new.txt @@ -0,0 +1 @@ +f(a:3) diff --git a/test/mri/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt b/test/mri/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt new file mode 100644 index 00000000000..fe0a37dabb0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt @@ -0,0 +1,5 @@ +a(b: if :c +1 +else +2 +end) diff --git a/test/mri/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt new file mode 100644 index 00000000000..4d86a4541db --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt @@ -0,0 +1 @@ +f(1=>2,) diff --git a/test/mri/prism/fixtures/seattlerb/call_bang_command_call.txt b/test/mri/prism/fixtures/seattlerb/call_bang_command_call.txt new file mode 100644 index 00000000000..4f3ba4b93c4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_bang_command_call.txt @@ -0,0 +1 @@ +! a.b 1 diff --git a/test/mri/prism/fixtures/seattlerb/call_bang_squiggle.txt b/test/mri/prism/fixtures/seattlerb/call_bang_squiggle.txt new file mode 100644 index 00000000000..d7039f910a3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_bang_squiggle.txt @@ -0,0 +1 @@ +1 !~ 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_begin_call_block_call.txt b/test/mri/prism/fixtures/seattlerb/call_begin_call_block_call.txt new file mode 100644 index 00000000000..e9b43491fe5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_begin_call_block_call.txt @@ -0,0 +1,3 @@ +a begin +b.c do end +end diff --git a/test/mri/prism/fixtures/seattlerb/call_block_arg_named.txt b/test/mri/prism/fixtures/seattlerb/call_block_arg_named.txt new file mode 100644 index 00000000000..08fea89d117 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_block_arg_named.txt @@ -0,0 +1 @@ +x(&blk) diff --git a/test/mri/prism/fixtures/seattlerb/call_carat.txt b/test/mri/prism/fixtures/seattlerb/call_carat.txt new file mode 100644 index 00000000000..3e88c098378 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_carat.txt @@ -0,0 +1 @@ +1 ^ 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_colon2.txt b/test/mri/prism/fixtures/seattlerb/call_colon2.txt new file mode 100644 index 00000000000..47aab7e637f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_colon2.txt @@ -0,0 +1 @@ +A::b diff --git a/test/mri/prism/fixtures/seattlerb/call_colon_parens.txt b/test/mri/prism/fixtures/seattlerb/call_colon_parens.txt new file mode 100644 index 00000000000..51ed4df11b2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_colon_parens.txt @@ -0,0 +1 @@ +1::() diff --git a/test/mri/prism/fixtures/seattlerb/call_div.txt b/test/mri/prism/fixtures/seattlerb/call_div.txt new file mode 100644 index 00000000000..85b4d7b0b06 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_div.txt @@ -0,0 +1 @@ +1 / 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_dot_parens.txt b/test/mri/prism/fixtures/seattlerb/call_dot_parens.txt new file mode 100644 index 00000000000..0270596a070 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_dot_parens.txt @@ -0,0 +1 @@ +1.() diff --git a/test/mri/prism/fixtures/seattlerb/call_env.txt b/test/mri/prism/fixtures/seattlerb/call_env.txt new file mode 100644 index 00000000000..dadc0d38614 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_env.txt @@ -0,0 +1 @@ +a.happy diff --git a/test/mri/prism/fixtures/seattlerb/call_eq3.txt b/test/mri/prism/fixtures/seattlerb/call_eq3.txt new file mode 100644 index 00000000000..6a2fb465cbd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_eq3.txt @@ -0,0 +1 @@ +1 === 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_gt.txt b/test/mri/prism/fixtures/seattlerb/call_gt.txt new file mode 100644 index 00000000000..9d0a1caa900 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_gt.txt @@ -0,0 +1 @@ +1 > 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_kwsplat.txt b/test/mri/prism/fixtures/seattlerb/call_kwsplat.txt new file mode 100644 index 00000000000..eda700c3e1b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_kwsplat.txt @@ -0,0 +1 @@ +a(**1) diff --git a/test/mri/prism/fixtures/seattlerb/call_leading_dots.txt b/test/mri/prism/fixtures/seattlerb/call_leading_dots.txt new file mode 100644 index 00000000000..1e7b2e51791 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_leading_dots.txt @@ -0,0 +1,3 @@ +a +.b +.c diff --git a/test/mri/prism/fixtures/seattlerb/call_leading_dots_comment.txt b/test/mri/prism/fixtures/seattlerb/call_leading_dots_comment.txt new file mode 100644 index 00000000000..c5deec56423 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_leading_dots_comment.txt @@ -0,0 +1,4 @@ +a +.b +#.c +.d diff --git a/test/mri/prism/fixtures/seattlerb/call_lt.txt b/test/mri/prism/fixtures/seattlerb/call_lt.txt new file mode 100644 index 00000000000..17e69c79b50 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_lt.txt @@ -0,0 +1 @@ +1 < 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_lte.txt b/test/mri/prism/fixtures/seattlerb/call_lte.txt new file mode 100644 index 00000000000..7574027634a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_lte.txt @@ -0,0 +1 @@ +1 <= 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_not.txt b/test/mri/prism/fixtures/seattlerb/call_not.txt new file mode 100644 index 00000000000..51e4742f55b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_not.txt @@ -0,0 +1 @@ +not 42 diff --git a/test/mri/prism/fixtures/seattlerb/call_pipe.txt b/test/mri/prism/fixtures/seattlerb/call_pipe.txt new file mode 100644 index 00000000000..1555910665e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_pipe.txt @@ -0,0 +1 @@ +1 | 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_rshift.txt b/test/mri/prism/fixtures/seattlerb/call_rshift.txt new file mode 100644 index 00000000000..9ff1def4e0f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_rshift.txt @@ -0,0 +1 @@ +1 >> 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_self_brackets.txt b/test/mri/prism/fixtures/seattlerb/call_self_brackets.txt new file mode 100644 index 00000000000..6533df2ce03 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_self_brackets.txt @@ -0,0 +1 @@ +self[1] diff --git a/test/mri/prism/fixtures/seattlerb/call_spaceship.txt b/test/mri/prism/fixtures/seattlerb/call_spaceship.txt new file mode 100644 index 00000000000..905c3a1c46e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_spaceship.txt @@ -0,0 +1 @@ +1 <=> 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt b/test/mri/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt new file mode 100644 index 00000000000..2d1afdad280 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt @@ -0,0 +1 @@ +a -> do 1 end do 2 end diff --git a/test/mri/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt b/test/mri/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt new file mode 100644 index 00000000000..0d995a04d1d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt @@ -0,0 +1 @@ +a -> { 1 } do 2 end diff --git a/test/mri/prism/fixtures/seattlerb/call_star.txt b/test/mri/prism/fixtures/seattlerb/call_star.txt new file mode 100644 index 00000000000..096ec022d49 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_star.txt @@ -0,0 +1 @@ +1 * 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_star2.txt b/test/mri/prism/fixtures/seattlerb/call_star2.txt new file mode 100644 index 00000000000..bef4719d3cb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_star2.txt @@ -0,0 +1 @@ +1 ** 2 diff --git a/test/mri/prism/fixtures/seattlerb/call_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/call_trailing_comma.txt new file mode 100644 index 00000000000..e9a3ca35bea --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_trailing_comma.txt @@ -0,0 +1 @@ +f(1,) diff --git a/test/mri/prism/fixtures/seattlerb/call_trailing_dots.txt b/test/mri/prism/fixtures/seattlerb/call_trailing_dots.txt new file mode 100644 index 00000000000..960cdbb45fd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_trailing_dots.txt @@ -0,0 +1,3 @@ +a. +b. +c diff --git a/test/mri/prism/fixtures/seattlerb/call_unary_bang.txt b/test/mri/prism/fixtures/seattlerb/call_unary_bang.txt new file mode 100644 index 00000000000..91f702d4a91 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/call_unary_bang.txt @@ -0,0 +1 @@ +!1 diff --git a/test/mri/prism/fixtures/seattlerb/case_in.txt b/test/mri/prism/fixtures/seattlerb/case_in.txt new file mode 100644 index 00000000000..0835da09567 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in.txt @@ -0,0 +1,111 @@ +case :a +in "b": +end + +case :a +in %I[a b] +end + +case :a +in %W[a b] +end + +case :a +in %i[a b] +end + +case :a +in %w[a b] +end + +case :a +in (...10) +end + +case :a +in (..10) +end + +case :a +in (1...) +end + +case :a +in (1...3) +end + +case :a +in (42) +end + +case :a +in **nil +end + +case :a +in /regexp/ +end + +case :a +in :b, *_, :c +end + +case :a +in :b, [:c] +end + +case :a +in Symbol() +end + +case :a +in Symbol(*lhs, x, *rhs) +end + +case :a +in Symbol[*lhs, x, *rhs] +end + +case :a +in [->(b) { true }, c] +end + +case :a +in [:a, b, c, [:d, *e, nil]] +end + +case :a +in [A, *, B] +end + +case :a +in [[:b, c], [:d, ^e]] +end + +case :a +in [] +end + +case :a +in [^(a)] +end + +case :a +in [^@a, ^$b, ^@@c] +end + +case :a +in `echo hi` +end + +case :a +in nil, nil, nil +end + +case :a +in { "b": } +end + +case :a +in {} +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_31.txt b/test/mri/prism/fixtures/seattlerb/case_in_31.txt new file mode 100644 index 00000000000..b9bf25b132e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_31.txt @@ -0,0 +1,4 @@ +case :a +in [:b, *c] + :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_37.txt b/test/mri/prism/fixtures/seattlerb/case_in_37.txt new file mode 100644 index 00000000000..25b6fb92619 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_37.txt @@ -0,0 +1,4 @@ +case :a +in { b: [Hash, *] } + :c +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_42.txt b/test/mri/prism/fixtures/seattlerb/case_in_42.txt new file mode 100644 index 00000000000..bc6a2233f5d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_42.txt @@ -0,0 +1,3 @@ +case :a +in :b, *_ then nil +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_42_2.txt b/test/mri/prism/fixtures/seattlerb/case_in_42_2.txt new file mode 100644 index 00000000000..ce4b65a5d0f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_42_2.txt @@ -0,0 +1,3 @@ +case :a +in A(*list) then nil +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_47.txt b/test/mri/prism/fixtures/seattlerb/case_in_47.txt new file mode 100644 index 00000000000..60f17ed7ce7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_47.txt @@ -0,0 +1,4 @@ +case :a +in [*, :b, :c] + :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_67.txt b/test/mri/prism/fixtures/seattlerb/case_in_67.txt new file mode 100644 index 00000000000..c1c55e68c7b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_67.txt @@ -0,0 +1,3 @@ +case :a +in 1.. then nil +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_86.txt b/test/mri/prism/fixtures/seattlerb/case_in_86.txt new file mode 100644 index 00000000000..63ba92e5339 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_86.txt @@ -0,0 +1,3 @@ +case [:a, :b] +in ::NilClass, * then nil +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_86_2.txt b/test/mri/prism/fixtures/seattlerb/case_in_86_2.txt new file mode 100644 index 00000000000..4ad16c451aa --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_86_2.txt @@ -0,0 +1,3 @@ +case [:a, :b] +in *, ::NilClass then nil +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const.txt b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const.txt new file mode 100644 index 00000000000..8551e48e2c6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const.txt @@ -0,0 +1,4 @@ +case :a +in B[c] + :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const2.txt b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const2.txt new file mode 100644 index 00000000000..fca423ea615 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_const2.txt @@ -0,0 +1,4 @@ +case :a +in B::C[d] + :e +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt new file mode 100644 index 00000000000..c56f7283370 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt @@ -0,0 +1,4 @@ +case :a +in B(C => d) + :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_const.txt b/test/mri/prism/fixtures/seattlerb/case_in_const.txt new file mode 100644 index 00000000000..5b0dcc18e2a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_const.txt @@ -0,0 +1,4 @@ +case Array +in Class + :b +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_else.txt b/test/mri/prism/fixtures/seattlerb/case_in_else.txt new file mode 100644 index 00000000000..6f096862c57 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_else.txt @@ -0,0 +1,7 @@ +case Array +in Class + :b +else + :c +end + diff --git a/test/mri/prism/fixtures/seattlerb/case_in_find.txt b/test/mri/prism/fixtures/seattlerb/case_in_find.txt new file mode 100644 index 00000000000..476fcabe11c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_find.txt @@ -0,0 +1,3 @@ +case :a + in *a, :+, *b +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_find_array.txt b/test/mri/prism/fixtures/seattlerb/case_in_find_array.txt new file mode 100644 index 00000000000..5eb4010b7f9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_find_array.txt @@ -0,0 +1,3 @@ +case :a +in [*, :b, c, *] +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat.txt new file mode 100644 index 00000000000..cb012e8d991 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat.txt @@ -0,0 +1,5 @@ +case :a +in { b: 'c', d: "e" } then + :f +end + diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt new file mode 100644 index 00000000000..58fd59ff9c2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt @@ -0,0 +1,4 @@ +case :a +in { b: Integer => x, d: "e", f: } then + :g +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt new file mode 100644 index 00000000000..de3a10740cf --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt @@ -0,0 +1,4 @@ +case :a +in B(a: 42) + :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt new file mode 100644 index 00000000000..449fd0d4d4d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt @@ -0,0 +1,5 @@ +case :a +in b: true then + :c +end + diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt new file mode 100644 index 00000000000..6f67cb1d101 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt @@ -0,0 +1,3 @@ +case :a +in b: c, **rest then :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt new file mode 100644 index 00000000000..91d0592412a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt @@ -0,0 +1,3 @@ +case :a +in **rest then :d +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt b/test/mri/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt new file mode 100644 index 00000000000..dbe24a5c8a4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt @@ -0,0 +1,6 @@ +case :a +in A if true + :C +in D unless false + :E +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_multiple.txt b/test/mri/prism/fixtures/seattlerb/case_in_multiple.txt new file mode 100644 index 00000000000..1b6dd06cfe1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_multiple.txt @@ -0,0 +1,6 @@ +case :a +in A::B + :C +in D::E + :F +end diff --git a/test/mri/prism/fixtures/seattlerb/case_in_or.txt b/test/mri/prism/fixtures/seattlerb/case_in_or.txt new file mode 100644 index 00000000000..875e37749f8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/case_in_or.txt @@ -0,0 +1,5 @@ +case :a +in B | C + :d +end + diff --git a/test/mri/prism/fixtures/seattlerb/class_comments.txt b/test/mri/prism/fixtures/seattlerb/class_comments.txt new file mode 100644 index 00000000000..9701eca7e55 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/class_comments.txt @@ -0,0 +1,9 @@ +# blah 1 +# blah 2 + +class X + # blah 3 + def blah + # blah 4 + end +end diff --git a/test/mri/prism/fixtures/seattlerb/cond_unary_minus.txt b/test/mri/prism/fixtures/seattlerb/cond_unary_minus.txt new file mode 100644 index 00000000000..80293115da4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/cond_unary_minus.txt @@ -0,0 +1 @@ +if -1; end diff --git a/test/mri/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt b/test/mri/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt new file mode 100644 index 00000000000..6912c2d76bd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt @@ -0,0 +1 @@ +::X::Y ||= 1 diff --git a/test/mri/prism/fixtures/seattlerb/const_3_op_asgn_or.txt b/test/mri/prism/fixtures/seattlerb/const_3_op_asgn_or.txt new file mode 100644 index 00000000000..bbcd25a369e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/const_3_op_asgn_or.txt @@ -0,0 +1 @@ +::X ||= 1 diff --git a/test/mri/prism/fixtures/seattlerb/const_op_asgn_and1.txt b/test/mri/prism/fixtures/seattlerb/const_op_asgn_and1.txt new file mode 100644 index 00000000000..3964df0ead1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/const_op_asgn_and1.txt @@ -0,0 +1 @@ +::X &= 1 diff --git a/test/mri/prism/fixtures/seattlerb/const_op_asgn_and2.txt b/test/mri/prism/fixtures/seattlerb/const_op_asgn_and2.txt new file mode 100644 index 00000000000..1bef4b41547 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/const_op_asgn_and2.txt @@ -0,0 +1 @@ +::X &&= 1 diff --git a/test/mri/prism/fixtures/seattlerb/const_op_asgn_or.txt b/test/mri/prism/fixtures/seattlerb/const_op_asgn_or.txt new file mode 100644 index 00000000000..729e4252626 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/const_op_asgn_or.txt @@ -0,0 +1 @@ +X::Y ||= 1 diff --git a/test/mri/prism/fixtures/seattlerb/dasgn_icky2.txt b/test/mri/prism/fixtures/seattlerb/dasgn_icky2.txt new file mode 100644 index 00000000000..2f50d323041 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dasgn_icky2.txt @@ -0,0 +1,8 @@ +a do + v = nil + begin + yield + rescue Exception => v + break + end +end diff --git a/test/mri/prism/fixtures/seattlerb/defined_eh_parens.txt b/test/mri/prism/fixtures/seattlerb/defined_eh_parens.txt new file mode 100644 index 00000000000..5ca5d9f4c44 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defined_eh_parens.txt @@ -0,0 +1 @@ +defined?(42) diff --git a/test/mri/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt b/test/mri/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt new file mode 100644 index 00000000000..f629a5de60a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt @@ -0,0 +1 @@ +def call(interp, *, args) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_arg_forward_args.txt b/test/mri/prism/fixtures/seattlerb/defn_arg_forward_args.txt new file mode 100644 index 00000000000..500e2e1fe08 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_arg_forward_args.txt @@ -0,0 +1 @@ +def a(x, ...); b(x, ...); end diff --git a/test/mri/prism/fixtures/seattlerb/defn_args_forward_args.txt b/test/mri/prism/fixtures/seattlerb/defn_args_forward_args.txt new file mode 100644 index 00000000000..fc1ee138de5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_args_forward_args.txt @@ -0,0 +1 @@ +def a(x, y, z, ...); b(:get, z, ...); end diff --git a/test/mri/prism/fixtures/seattlerb/defn_comments.txt b/test/mri/prism/fixtures/seattlerb/defn_comments.txt new file mode 100644 index 00000000000..04c7ea1a101 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_comments.txt @@ -0,0 +1,5 @@ +# blah 1 +# blah 2 + +def blah +end diff --git a/test/mri/prism/fixtures/seattlerb/defn_endless_command.txt b/test/mri/prism/fixtures/seattlerb/defn_endless_command.txt new file mode 100644 index 00000000000..172de2ca6cc --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_endless_command.txt @@ -0,0 +1 @@ +def some_method = other_method 42 diff --git a/test/mri/prism/fixtures/seattlerb/defn_endless_command_rescue.txt b/test/mri/prism/fixtures/seattlerb/defn_endless_command_rescue.txt new file mode 100644 index 00000000000..05ed392e387 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_endless_command_rescue.txt @@ -0,0 +1 @@ +def some_method = other_method 42 rescue 24 diff --git a/test/mri/prism/fixtures/seattlerb/defn_forward_args.txt b/test/mri/prism/fixtures/seattlerb/defn_forward_args.txt new file mode 100644 index 00000000000..46ed1998757 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_forward_args.txt @@ -0,0 +1 @@ +def a(...); b(...); end diff --git a/test/mri/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt b/test/mri/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt new file mode 100644 index 00000000000..2d34077c936 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt @@ -0,0 +1,3 @@ +def f ... + m(...) +end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_env.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_env.txt new file mode 100644 index 00000000000..b512677195e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_env.txt @@ -0,0 +1 @@ +def test(**testing) test_splat(**testing) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt new file mode 100644 index 00000000000..3962d2645cb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt @@ -0,0 +1 @@ +def f(a, b: 1, c: 2) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt new file mode 100644 index 00000000000..bd398194824 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt @@ -0,0 +1 @@ +def a(b: 1, **c) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt new file mode 100644 index 00000000000..aba71cba075 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -0,0 +1 @@ +def a(b: 1, **) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_lvar.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_lvar.txt new file mode 100644 index 00000000000..9eac108cca8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_lvar.txt @@ -0,0 +1 @@ +def fun(kw: :val); kw; end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt new file mode 100644 index 00000000000..481457bf0eb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt @@ -0,0 +1,2 @@ +def f a: 1 +end diff --git a/test/mri/prism/fixtures/seattlerb/defn_kwarg_val.txt b/test/mri/prism/fixtures/seattlerb/defn_kwarg_val.txt new file mode 100644 index 00000000000..1a2803926f7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_kwarg_val.txt @@ -0,0 +1 @@ +def f(a, b:1) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_no_kwargs.txt b/test/mri/prism/fixtures/seattlerb/defn_no_kwargs.txt new file mode 100644 index 00000000000..857ec8debb3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_no_kwargs.txt @@ -0,0 +1 @@ +def x(**nil); end diff --git a/test/mri/prism/fixtures/seattlerb/defn_oneliner.txt b/test/mri/prism/fixtures/seattlerb/defn_oneliner.txt new file mode 100644 index 00000000000..4aef08ce464 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_oneliner.txt @@ -0,0 +1 @@ +def exec(cmd) = system(cmd) diff --git a/test/mri/prism/fixtures/seattlerb/defn_oneliner_eq2.txt b/test/mri/prism/fixtures/seattlerb/defn_oneliner_eq2.txt new file mode 100644 index 00000000000..1b1ce27a153 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_oneliner_eq2.txt @@ -0,0 +1,3 @@ +class X + def ==(o) = 42 +end diff --git a/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs.txt b/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs.txt new file mode 100644 index 00000000000..cb4f76d2449 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs.txt @@ -0,0 +1 @@ +def exec = system diff --git a/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt b/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt new file mode 100644 index 00000000000..c582e896c13 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt @@ -0,0 +1 @@ +def exec() = system diff --git a/test/mri/prism/fixtures/seattlerb/defn_oneliner_rescue.txt b/test/mri/prism/fixtures/seattlerb/defn_oneliner_rescue.txt new file mode 100644 index 00000000000..ffe2228c9dd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_oneliner_rescue.txt @@ -0,0 +1,13 @@ +def exec(cmd) + system(cmd) +rescue + nil +end + + +def exec(cmd) + system(cmd) rescue nil +end + + +def exec(cmd) = system(cmd) rescue nil diff --git a/test/mri/prism/fixtures/seattlerb/defn_opt_last_arg.txt b/test/mri/prism/fixtures/seattlerb/defn_opt_last_arg.txt new file mode 100644 index 00000000000..91500bf1371 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_opt_last_arg.txt @@ -0,0 +1,2 @@ +def m arg = false +end diff --git a/test/mri/prism/fixtures/seattlerb/defn_opt_reg.txt b/test/mri/prism/fixtures/seattlerb/defn_opt_reg.txt new file mode 100644 index 00000000000..c665674bc47 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_opt_reg.txt @@ -0,0 +1 @@ +def f(a=nil, b) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_opt_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/defn_opt_splat_arg.txt new file mode 100644 index 00000000000..876398b4789 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_opt_splat_arg.txt @@ -0,0 +1 @@ +def f (a = 1, *b, c) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_powarg.txt b/test/mri/prism/fixtures/seattlerb/defn_powarg.txt new file mode 100644 index 00000000000..73415f0db99 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_powarg.txt @@ -0,0 +1 @@ +def f(**opts) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_reg_opt_reg.txt b/test/mri/prism/fixtures/seattlerb/defn_reg_opt_reg.txt new file mode 100644 index 00000000000..69f501a38e6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_reg_opt_reg.txt @@ -0,0 +1 @@ +def f(a, b = :c, d) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/defn_splat_arg.txt new file mode 100644 index 00000000000..a2a84bed307 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_splat_arg.txt @@ -0,0 +1 @@ +def f(*, a) end diff --git a/test/mri/prism/fixtures/seattlerb/defn_unary_not.txt b/test/mri/prism/fixtures/seattlerb/defn_unary_not.txt new file mode 100644 index 00000000000..fb83c84a133 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defn_unary_not.txt @@ -0,0 +1 @@ +def !@; true; end diff --git a/test/mri/prism/fixtures/seattlerb/defns_reserved.txt b/test/mri/prism/fixtures/seattlerb/defns_reserved.txt new file mode 100644 index 00000000000..7de9322f0da --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defns_reserved.txt @@ -0,0 +1 @@ +def self.return; end diff --git a/test/mri/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt b/test/mri/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt new file mode 100644 index 00000000000..4d493d73dd3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -0,0 +1 @@ +p def self.b; x.y do; end; end diff --git a/test/mri/prism/fixtures/seattlerb/defs_comments.txt b/test/mri/prism/fixtures/seattlerb/defs_comments.txt new file mode 100644 index 00000000000..52b9b4a6b3d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_comments.txt @@ -0,0 +1,5 @@ +# blah 1 +# blah 2 + +def self.blah +end diff --git a/test/mri/prism/fixtures/seattlerb/defs_endless_command.txt b/test/mri/prism/fixtures/seattlerb/defs_endless_command.txt new file mode 100644 index 00000000000..3b605657de1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_endless_command.txt @@ -0,0 +1 @@ +def x.some_method = other_method 42 diff --git a/test/mri/prism/fixtures/seattlerb/defs_endless_command_rescue.txt b/test/mri/prism/fixtures/seattlerb/defs_endless_command_rescue.txt new file mode 100644 index 00000000000..6ece366db0e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_endless_command_rescue.txt @@ -0,0 +1 @@ +def x.some_method = other_method 42 rescue 24 diff --git a/test/mri/prism/fixtures/seattlerb/defs_kwarg.txt b/test/mri/prism/fixtures/seattlerb/defs_kwarg.txt new file mode 100644 index 00000000000..59970a371e2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_kwarg.txt @@ -0,0 +1,2 @@ +def self.a b: 1 +end diff --git a/test/mri/prism/fixtures/seattlerb/defs_oneliner.txt b/test/mri/prism/fixtures/seattlerb/defs_oneliner.txt new file mode 100644 index 00000000000..1867edcfbf9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_oneliner.txt @@ -0,0 +1 @@ +def self.exec(cmd) = system(cmd) diff --git a/test/mri/prism/fixtures/seattlerb/defs_oneliner_eq2.txt b/test/mri/prism/fixtures/seattlerb/defs_oneliner_eq2.txt new file mode 100644 index 00000000000..1e55f68bf30 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_oneliner_eq2.txt @@ -0,0 +1,3 @@ +class X + def self.==(o) = 42 +end diff --git a/test/mri/prism/fixtures/seattlerb/defs_oneliner_rescue.txt b/test/mri/prism/fixtures/seattlerb/defs_oneliner_rescue.txt new file mode 100644 index 00000000000..7a04012b8ff --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/defs_oneliner_rescue.txt @@ -0,0 +1,13 @@ +def self.exec(cmd) + system(cmd) +rescue + nil +end + + +def self.exec(cmd) + system(cmd) rescue nil +end + + +def self.exec(cmd) = system(cmd) rescue nil diff --git a/test/mri/prism/fixtures/seattlerb/difficult0_.txt b/test/mri/prism/fixtures/seattlerb/difficult0_.txt new file mode 100644 index 00000000000..5c73907cae8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult0_.txt @@ -0,0 +1,4 @@ +p <<-END+'b + a + END + c'+'d' diff --git a/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers.txt b/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers.txt new file mode 100644 index 00000000000..8008127dc91 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers.txt @@ -0,0 +1,13 @@ +if true + p 1 + a.b 2 + c.d 3, 4 + e.f 5 + g.h 6, 7 + p(1) + a.b(2) + c.d(3, 4) + e.f(5) + g.h(6, 7) +end + diff --git a/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers2.txt b/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers2.txt new file mode 100644 index 00000000000..1964562416b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult1_line_numbers2.txt @@ -0,0 +1,8 @@ +if true then + p("a") + b = 1 + p b + c =1 +end +a + diff --git a/test/mri/prism/fixtures/seattlerb/difficult2_.txt b/test/mri/prism/fixtures/seattlerb/difficult2_.txt new file mode 100644 index 00000000000..32590974928 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult2_.txt @@ -0,0 +1,2 @@ +1 ? b('') : 2 +a d: 3 diff --git a/test/mri/prism/fixtures/seattlerb/difficult3_.txt b/test/mri/prism/fixtures/seattlerb/difficult3_.txt new file mode 100644 index 00000000000..9f95860b82f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3_.txt @@ -0,0 +1 @@ +f { |a, (b, *c)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3_2.txt b/test/mri/prism/fixtures/seattlerb/difficult3_2.txt new file mode 100644 index 00000000000..8abfe3f6349 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3_2.txt @@ -0,0 +1 @@ +f { |*a, b| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3_3.txt b/test/mri/prism/fixtures/seattlerb/difficult3_3.txt new file mode 100644 index 00000000000..6f43ab7b1df --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3_3.txt @@ -0,0 +1 @@ +f { |*a, b, &c| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3_4.txt b/test/mri/prism/fixtures/seattlerb/difficult3_4.txt new file mode 100644 index 00000000000..7070e1e9641 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3_4.txt @@ -0,0 +1 @@ +a=b ? true: false diff --git a/test/mri/prism/fixtures/seattlerb/difficult3_5.txt b/test/mri/prism/fixtures/seattlerb/difficult3_5.txt new file mode 100644 index 00000000000..6d52692481b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3_5.txt @@ -0,0 +1 @@ +f ->() { g do end } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__10.txt b/test/mri/prism/fixtures/seattlerb/difficult3__10.txt new file mode 100644 index 00000000000..89974f51144 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__10.txt @@ -0,0 +1 @@ +f { |a, (*b, c)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__11.txt b/test/mri/prism/fixtures/seattlerb/difficult3__11.txt new file mode 100644 index 00000000000..911d0379619 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__11.txt @@ -0,0 +1 @@ +f { |a, (*)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__12.txt b/test/mri/prism/fixtures/seattlerb/difficult3__12.txt new file mode 100644 index 00000000000..2405a80ec15 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__12.txt @@ -0,0 +1 @@ +f { |a, (*, b)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__6.txt b/test/mri/prism/fixtures/seattlerb/difficult3__6.txt new file mode 100644 index 00000000000..3a45ae86fbe --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__6.txt @@ -0,0 +1 @@ +f { |a, (b, *c, d)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__7.txt b/test/mri/prism/fixtures/seattlerb/difficult3__7.txt new file mode 100644 index 00000000000..55272a1fc45 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__7.txt @@ -0,0 +1 @@ +f { |a, (b, *)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__8.txt b/test/mri/prism/fixtures/seattlerb/difficult3__8.txt new file mode 100644 index 00000000000..76740db4fff --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__8.txt @@ -0,0 +1 @@ +f { |a, (b, *, c)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult3__9.txt b/test/mri/prism/fixtures/seattlerb/difficult3__9.txt new file mode 100644 index 00000000000..b65f7fd0524 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult3__9.txt @@ -0,0 +1 @@ +f { |a, (*b)| } diff --git a/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots.txt b/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots.txt new file mode 100644 index 00000000000..332dc8225cc --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots.txt @@ -0,0 +1,2 @@ +a +.b diff --git a/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots2.txt b/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots2.txt new file mode 100644 index 00000000000..fe73f641fed --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult4__leading_dots2.txt @@ -0,0 +1,2 @@ +1 +..3 diff --git a/test/mri/prism/fixtures/seattlerb/difficult6_.txt b/test/mri/prism/fixtures/seattlerb/difficult6_.txt new file mode 100644 index 00000000000..7396a9a76f9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult6_.txt @@ -0,0 +1 @@ +->(a, b=nil) { p [a, b] } diff --git a/test/mri/prism/fixtures/seattlerb/difficult6__7.txt b/test/mri/prism/fixtures/seattlerb/difficult6__7.txt new file mode 100644 index 00000000000..048358bbdc3 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult6__7.txt @@ -0,0 +1 @@ +a.b (1) {c} diff --git a/test/mri/prism/fixtures/seattlerb/difficult6__8.txt b/test/mri/prism/fixtures/seattlerb/difficult6__8.txt new file mode 100644 index 00000000000..ba1cbc235df --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult6__8.txt @@ -0,0 +1 @@ +a::b (1) {c} diff --git a/test/mri/prism/fixtures/seattlerb/difficult7_.txt b/test/mri/prism/fixtures/seattlerb/difficult7_.txt new file mode 100644 index 00000000000..112b75c5f24 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/difficult7_.txt @@ -0,0 +1,5 @@ + { + a: lambda { b ? c() : d }, + e: nil, + } + diff --git a/test/mri/prism/fixtures/seattlerb/do_bug.txt b/test/mri/prism/fixtures/seattlerb/do_bug.txt new file mode 100644 index 00000000000..a274e72baf2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/do_bug.txt @@ -0,0 +1,4 @@ +a 1 +a.b do |c| + # do nothing +end diff --git a/test/mri/prism/fixtures/seattlerb/do_lambda.txt b/test/mri/prism/fixtures/seattlerb/do_lambda.txt new file mode 100644 index 00000000000..06d2a38d306 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/do_lambda.txt @@ -0,0 +1 @@ +->() do end diff --git a/test/mri/prism/fixtures/seattlerb/dot2_nil__26.txt b/test/mri/prism/fixtures/seattlerb/dot2_nil__26.txt new file mode 100644 index 00000000000..cc070eb69f2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dot2_nil__26.txt @@ -0,0 +1 @@ +a.. diff --git a/test/mri/prism/fixtures/seattlerb/dot3_nil__26.txt b/test/mri/prism/fixtures/seattlerb/dot3_nil__26.txt new file mode 100644 index 00000000000..7f4aef7af73 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dot3_nil__26.txt @@ -0,0 +1 @@ +a... diff --git a/test/mri/prism/fixtures/seattlerb/dstr_evstr.txt b/test/mri/prism/fixtures/seattlerb/dstr_evstr.txt new file mode 100644 index 00000000000..5fe4a858c1d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dstr_evstr.txt @@ -0,0 +1 @@ +"#{'a'}#{b}" diff --git a/test/mri/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt b/test/mri/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt new file mode 100644 index 00000000000..7a55030fa8e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt @@ -0,0 +1 @@ +:"#{field}" diff --git a/test/mri/prism/fixtures/seattlerb/dstr_lex_state.txt b/test/mri/prism/fixtures/seattlerb/dstr_lex_state.txt new file mode 100644 index 00000000000..6cac1d8e95b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dstr_lex_state.txt @@ -0,0 +1 @@ +"#{p:a}" diff --git a/test/mri/prism/fixtures/seattlerb/dstr_str.txt b/test/mri/prism/fixtures/seattlerb/dstr_str.txt new file mode 100644 index 00000000000..226ce2b1910 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dstr_str.txt @@ -0,0 +1 @@ +"#{'a'} b" diff --git a/test/mri/prism/fixtures/seattlerb/dsym_esc_to_sym.txt b/test/mri/prism/fixtures/seattlerb/dsym_esc_to_sym.txt new file mode 100644 index 00000000000..e5781453c15 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dsym_esc_to_sym.txt @@ -0,0 +1 @@ +:"Variet\303\240" diff --git a/test/mri/prism/fixtures/seattlerb/dsym_to_sym.txt b/test/mri/prism/fixtures/seattlerb/dsym_to_sym.txt new file mode 100644 index 00000000000..813c90342c0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/dsym_to_sym.txt @@ -0,0 +1,3 @@ +alias :"<<" :">>" + +alias :<< :>> diff --git a/test/mri/prism/fixtures/seattlerb/eq_begin_line_numbers.txt b/test/mri/prism/fixtures/seattlerb/eq_begin_line_numbers.txt new file mode 100644 index 00000000000..aae82e1207c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/eq_begin_line_numbers.txt @@ -0,0 +1,6 @@ +1 +=begin +comment +comment +=end +2 diff --git a/test/mri/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt b/test/mri/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt new file mode 100644 index 00000000000..88ff599e91a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -0,0 +1,3 @@ +h[k]=begin + 42 + end diff --git a/test/mri/prism/fixtures/seattlerb/evstr_evstr.txt b/test/mri/prism/fixtures/seattlerb/evstr_evstr.txt new file mode 100644 index 00000000000..cf0b5ee8736 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/evstr_evstr.txt @@ -0,0 +1 @@ +"#{a}#{b}" diff --git a/test/mri/prism/fixtures/seattlerb/evstr_str.txt b/test/mri/prism/fixtures/seattlerb/evstr_str.txt new file mode 100644 index 00000000000..5746909b192 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/evstr_str.txt @@ -0,0 +1 @@ +"#{a} b" diff --git a/test/mri/prism/fixtures/seattlerb/expr_not_bang.txt b/test/mri/prism/fixtures/seattlerb/expr_not_bang.txt new file mode 100644 index 00000000000..6ed80c76d3d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/expr_not_bang.txt @@ -0,0 +1 @@ +! a b diff --git a/test/mri/prism/fixtures/seattlerb/f_kw.txt b/test/mri/prism/fixtures/seattlerb/f_kw.txt new file mode 100644 index 00000000000..4dd42662b88 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/f_kw.txt @@ -0,0 +1 @@ +def x k:42; end diff --git a/test/mri/prism/fixtures/seattlerb/f_kw__required.txt b/test/mri/prism/fixtures/seattlerb/f_kw__required.txt new file mode 100644 index 00000000000..2e1e258ff0d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/f_kw__required.txt @@ -0,0 +1 @@ +def x k:; end diff --git a/test/mri/prism/fixtures/seattlerb/flip2_env_lvar.txt b/test/mri/prism/fixtures/seattlerb/flip2_env_lvar.txt new file mode 100644 index 00000000000..619b2c915eb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/flip2_env_lvar.txt @@ -0,0 +1 @@ +if a..b then end diff --git a/test/mri/prism/fixtures/seattlerb/float_with_if_modifier.txt b/test/mri/prism/fixtures/seattlerb/float_with_if_modifier.txt new file mode 100644 index 00000000000..6a62d4a3082 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/float_with_if_modifier.txt @@ -0,0 +1 @@ +1.0if true diff --git a/test/mri/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt b/test/mri/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt new file mode 100644 index 00000000000..cfbcb2a11da --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt @@ -0,0 +1,5 @@ +str = <<-XXX +before\ +after +XXX + diff --git a/test/mri/prism/fixtures/seattlerb/heredoc_backslash_nl.txt b/test/mri/prism/fixtures/seattlerb/heredoc_backslash_nl.txt new file mode 100644 index 00000000000..0cc5b35fd5c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/heredoc_backslash_nl.txt @@ -0,0 +1,8 @@ +" why would someone do this? \ + blah +" + +<<-DESC + why would someone do this? \ + blah +DESC diff --git a/test/mri/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt b/test/mri/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt new file mode 100644 index 00000000000..2c386cc6a98 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt @@ -0,0 +1,3 @@ +s = < do end + +f -> {} + +f ->() do end + +f ->() {} diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt b/test/mri/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt new file mode 100644 index 00000000000..0dad496c288 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt @@ -0,0 +1 @@ +a = 1 rescue 2 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt b/test/mri/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt new file mode 100644 index 00000000000..3f63c0b748e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt @@ -0,0 +1 @@ +a = b(1) rescue 2 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt b/test/mri/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt new file mode 100644 index 00000000000..0e86f1587d5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt @@ -0,0 +1 @@ +a = b 1 rescue 2 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_command.txt b/test/mri/prism/fixtures/seattlerb/lasgn_command.txt new file mode 100644 index 00000000000..aca35b880ce --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_command.txt @@ -0,0 +1 @@ +a = b.c 1 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_env.txt b/test/mri/prism/fixtures/seattlerb/lasgn_env.txt new file mode 100644 index 00000000000..aec10273e52 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_env.txt @@ -0,0 +1 @@ +a = 42 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_ivar_env.txt b/test/mri/prism/fixtures/seattlerb/lasgn_ivar_env.txt new file mode 100644 index 00000000000..2fa8471c013 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_ivar_env.txt @@ -0,0 +1 @@ +@a = 42 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt b/test/mri/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt new file mode 100644 index 00000000000..5147131852b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt @@ -0,0 +1 @@ +a = b = c 1 diff --git a/test/mri/prism/fixtures/seattlerb/lasgn_middle_splat.txt b/test/mri/prism/fixtures/seattlerb/lasgn_middle_splat.txt new file mode 100644 index 00000000000..bb378ca6802 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/lasgn_middle_splat.txt @@ -0,0 +1 @@ +a = b, *c, d diff --git a/test/mri/prism/fixtures/seattlerb/magic_encoding_comment.txt b/test/mri/prism/fixtures/seattlerb/magic_encoding_comment.txt new file mode 100644 index 00000000000..a02711ea050 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/magic_encoding_comment.txt @@ -0,0 +1,4 @@ +# encoding: utf-8 +class ExampleUTF8ClassNameVarietà; def self.è; così = :però; end +end + diff --git a/test/mri/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt new file mode 100644 index 00000000000..b796a742ede --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt @@ -0,0 +1 @@ +*, a = b diff --git a/test/mri/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt b/test/mri/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt new file mode 100644 index 00000000000..e0919793d43 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt @@ -0,0 +1 @@ +a, b::c = d diff --git a/test/mri/prism/fixtures/seattlerb/masgn_arg_ident.txt b/test/mri/prism/fixtures/seattlerb/masgn_arg_ident.txt new file mode 100644 index 00000000000..45f248d854b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_arg_ident.txt @@ -0,0 +1 @@ +a, b.C = d diff --git a/test/mri/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt new file mode 100644 index 00000000000..05fe7c4d5f6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt @@ -0,0 +1 @@ +a, *b, c = d diff --git a/test/mri/prism/fixtures/seattlerb/masgn_colon2.txt b/test/mri/prism/fixtures/seattlerb/masgn_colon2.txt new file mode 100644 index 00000000000..4e4f838d7d5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_colon2.txt @@ -0,0 +1 @@ +a, b::C = 1, 2 diff --git a/test/mri/prism/fixtures/seattlerb/masgn_colon3.txt b/test/mri/prism/fixtures/seattlerb/masgn_colon3.txt new file mode 100644 index 00000000000..46098ba8c57 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_colon3.txt @@ -0,0 +1 @@ +::A, ::B = 1, 2 diff --git a/test/mri/prism/fixtures/seattlerb/masgn_command_call.txt b/test/mri/prism/fixtures/seattlerb/masgn_command_call.txt new file mode 100644 index 00000000000..6da01e8a311 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_command_call.txt @@ -0,0 +1 @@ +a, = b.c 1 diff --git a/test/mri/prism/fixtures/seattlerb/masgn_double_paren.txt b/test/mri/prism/fixtures/seattlerb/masgn_double_paren.txt new file mode 100644 index 00000000000..ffac0a85a39 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_double_paren.txt @@ -0,0 +1 @@ +((a,b))=c diff --git a/test/mri/prism/fixtures/seattlerb/masgn_lhs_splat.txt b/test/mri/prism/fixtures/seattlerb/masgn_lhs_splat.txt new file mode 100644 index 00000000000..2419ef16718 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_lhs_splat.txt @@ -0,0 +1 @@ +*a = 1, 2, 3 diff --git a/test/mri/prism/fixtures/seattlerb/masgn_paren.txt b/test/mri/prism/fixtures/seattlerb/masgn_paren.txt new file mode 100644 index 00000000000..3889b9ff48e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_paren.txt @@ -0,0 +1 @@ +(a, b) = c.d diff --git a/test/mri/prism/fixtures/seattlerb/masgn_splat_arg.txt b/test/mri/prism/fixtures/seattlerb/masgn_splat_arg.txt new file mode 100644 index 00000000000..a7c91425b04 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_splat_arg.txt @@ -0,0 +1 @@ +*a, b = c diff --git a/test/mri/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt b/test/mri/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt new file mode 100644 index 00000000000..46196bd703b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt @@ -0,0 +1 @@ +*a, b, c = d diff --git a/test/mri/prism/fixtures/seattlerb/masgn_star.txt b/test/mri/prism/fixtures/seattlerb/masgn_star.txt new file mode 100644 index 00000000000..c5eea37de21 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_star.txt @@ -0,0 +1 @@ +* = 1 diff --git a/test/mri/prism/fixtures/seattlerb/masgn_var_star_var.txt b/test/mri/prism/fixtures/seattlerb/masgn_var_star_var.txt new file mode 100644 index 00000000000..04089c36ac1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/masgn_var_star_var.txt @@ -0,0 +1 @@ +a, *, b = c diff --git a/test/mri/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt b/test/mri/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt new file mode 100644 index 00000000000..a7d1035ae3f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt @@ -0,0 +1 @@ +a (B::C *= d e) diff --git a/test/mri/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt new file mode 100644 index 00000000000..86f0fbdfc97 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt @@ -0,0 +1 @@ +a.f(1=>2,) diff --git a/test/mri/prism/fixtures/seattlerb/method_call_trailing_comma.txt b/test/mri/prism/fixtures/seattlerb/method_call_trailing_comma.txt new file mode 100644 index 00000000000..1a155fba12a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/method_call_trailing_comma.txt @@ -0,0 +1 @@ +a.f(1,) diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt new file mode 100644 index 00000000000..7389b955637 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt @@ -0,0 +1 @@ +a, b, c, * = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_back_splat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_back_splat.txt new file mode 100644 index 00000000000..ec5d23889a2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_back_splat.txt @@ -0,0 +1 @@ +a, b, c, *s = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt new file mode 100644 index 00000000000..67e569438c4 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt @@ -0,0 +1 @@ +*, x, y, z = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_front_splat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_front_splat.txt new file mode 100644 index 00000000000..dabadc382df --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_front_splat.txt @@ -0,0 +1 @@ +*s, x, y, z = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_keyword.txt b/test/mri/prism/fixtures/seattlerb/mlhs_keyword.txt new file mode 100644 index 00000000000..899e7f8ed3e --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_keyword.txt @@ -0,0 +1 @@ +a.!=(true, true) diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt new file mode 100644 index 00000000000..a70a7e531b2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt @@ -0,0 +1 @@ +a, b, c, *, x, y, z = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_mid_splat.txt b/test/mri/prism/fixtures/seattlerb/mlhs_mid_splat.txt new file mode 100644 index 00000000000..2d23fd39662 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_mid_splat.txt @@ -0,0 +1 @@ +a, b, c, *s, x, y, z = f diff --git a/test/mri/prism/fixtures/seattlerb/mlhs_rescue.txt b/test/mri/prism/fixtures/seattlerb/mlhs_rescue.txt new file mode 100644 index 00000000000..b4c79ae32ed --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/mlhs_rescue.txt @@ -0,0 +1 @@ +a, b = f rescue 42 diff --git a/test/mri/prism/fixtures/seattlerb/module_comments.txt b/test/mri/prism/fixtures/seattlerb/module_comments.txt new file mode 100644 index 00000000000..cecb717c5b7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/module_comments.txt @@ -0,0 +1,10 @@ +# blah 1 + + # blah 2 + +module X + # blah 3 + def blah + # blah 4 + end +end diff --git a/test/mri/prism/fixtures/seattlerb/multiline_hash_declaration.txt b/test/mri/prism/fixtures/seattlerb/multiline_hash_declaration.txt new file mode 100644 index 00000000000..21530307d2c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/multiline_hash_declaration.txt @@ -0,0 +1,8 @@ +f(state: + { +}) + +f(state: { +}) + +f(state: {}) diff --git a/test/mri/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt b/test/mri/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt new file mode 100644 index 00000000000..1e14673f4e5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,5 @@ +%i( +a +b +) +1 diff --git a/test/mri/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt b/test/mri/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt new file mode 100644 index 00000000000..79c1418770c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt @@ -0,0 +1,5 @@ +%w( +a +b +) +1 diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_command_call.txt new file mode 100644 index 00000000000..92c989cb0d8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_command_call.txt @@ -0,0 +1 @@ +a ||= b.c 2 diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt new file mode 100644 index 00000000000..89cfccda66c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt @@ -0,0 +1 @@ +A.B ||= c 1 diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_index_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_index_command_call.txt new file mode 100644 index 00000000000..2bfced81feb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_index_command_call.txt @@ -0,0 +1 @@ +a[:b] ||= c 1, 2 diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt new file mode 100644 index 00000000000..a567f60e83c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt @@ -0,0 +1 @@ +A::B *= c d diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt new file mode 100644 index 00000000000..0784b491670 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt @@ -0,0 +1 @@ +A::b += 1 diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt new file mode 100644 index 00000000000..c0f16eb3c1c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt @@ -0,0 +1 @@ +A::b *= c d diff --git a/test/mri/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt b/test/mri/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt new file mode 100644 index 00000000000..69057abf043 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt @@ -0,0 +1 @@ +a.b ||= c 1 diff --git a/test/mri/prism/fixtures/seattlerb/parse_def_special_name.txt b/test/mri/prism/fixtures/seattlerb/parse_def_special_name.txt new file mode 100644 index 00000000000..8d7d06c6889 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_def_special_name.txt @@ -0,0 +1 @@ +def next; end diff --git a/test/mri/prism/fixtures/seattlerb/parse_if_not_canonical.txt b/test/mri/prism/fixtures/seattlerb/parse_if_not_canonical.txt new file mode 100644 index 00000000000..1fd9bb7327c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_if_not_canonical.txt @@ -0,0 +1,2 @@ +if not var.nil? then 'foo' else 'bar' +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt b/test/mri/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt new file mode 100644 index 00000000000..1fd9bb7327c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt @@ -0,0 +1,2 @@ +if not var.nil? then 'foo' else 'bar' +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_block.txt b/test/mri/prism/fixtures/seattlerb/parse_line_block.txt new file mode 100644 index 00000000000..21664649db6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_block.txt @@ -0,0 +1,2 @@ +a = 42 +p a diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt new file mode 100644 index 00000000000..f55ced714f2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt @@ -0,0 +1,3 @@ +a +b # comment +c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt new file mode 100644 index 00000000000..6f1fee62a08 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt @@ -0,0 +1,7 @@ + + + +a +b # comment +# another comment +c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt new file mode 100644 index 00000000000..b00de34dc0d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt @@ -0,0 +1,4 @@ +a +b # comment +# another comment +c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt b/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt new file mode 100644 index 00000000000..73785eb794b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt @@ -0,0 +1,2 @@ +a @b + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt b/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt new file mode 100644 index 00000000000..6f136e6d6f9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt @@ -0,0 +1,2 @@ +a(@b +) diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_call_no_args.txt b/test/mri/prism/fixtures/seattlerb/parse_line_call_no_args.txt new file mode 100644 index 00000000000..7900afd4b82 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_call_no_args.txt @@ -0,0 +1,3 @@ +f do |x, y| + x + y +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_defn_complex.txt b/test/mri/prism/fixtures/seattlerb/parse_line_defn_complex.txt new file mode 100644 index 00000000000..244a8e862b7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_defn_complex.txt @@ -0,0 +1,5 @@ +def x(y) + p(y) + y *= 2 + return y; +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt b/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt new file mode 100644 index 00000000000..373ca7fbec5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt @@ -0,0 +1,6 @@ +def f + +end + +def f +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt b/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt new file mode 100644 index 00000000000..10f004a149c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt @@ -0,0 +1,2 @@ +def f a +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dot2.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dot2.txt new file mode 100644 index 00000000000..61c75542212 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dot2.txt @@ -0,0 +1,5 @@ +0.. +4 +a.. +b +c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dot2_open.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dot2_open.txt new file mode 100644 index 00000000000..b3e1e5aaf93 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dot2_open.txt @@ -0,0 +1,3 @@ +0.. +; a.. +; c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dot3.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dot3.txt new file mode 100644 index 00000000000..d1866b41de2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dot3.txt @@ -0,0 +1,5 @@ +0... +4 +a... +b +c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dot3_open.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dot3_open.txt new file mode 100644 index 00000000000..38e7634b214 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dot3_open.txt @@ -0,0 +1,3 @@ +0... +; a... +; c diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt new file mode 100644 index 00000000000..29c1754915c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt @@ -0,0 +1,3 @@ +"a\n#{ +}" +true diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt b/test/mri/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt new file mode 100644 index 00000000000..e4dbd7bcb2c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt @@ -0,0 +1,4 @@ +"a +#{ +}" +true diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt b/test/mri/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt new file mode 100644 index 00000000000..c1d91a51c43 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt @@ -0,0 +1,2 @@ +"a"\ +"#{b}" diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_hash_lit.txt b/test/mri/prism/fixtures/seattlerb/parse_line_hash_lit.txt new file mode 100644 index 00000000000..25f8c90a068 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_hash_lit.txt @@ -0,0 +1,3 @@ +{ +:s1 => 1, +} diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_heredoc.txt b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc.txt new file mode 100644 index 00000000000..201339534c9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc.txt @@ -0,0 +1,5 @@ + string = <<-HEREDOC.strip + very long string + HEREDOC + puts string + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt new file mode 100644 index 00000000000..d50844db4b5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt @@ -0,0 +1,4 @@ +<<-A +a +#{b} +A diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt new file mode 100644 index 00000000000..3fbf0f2c263 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt @@ -0,0 +1,7 @@ +<<-EOFOO +\n\n\n\n\n\n\n\n\n +EOFOO + +class Foo +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt new file mode 100644 index 00000000000..5dab9cf4e75 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt @@ -0,0 +1,5 @@ + string = <<-"^D" + very long string + ^D + puts string + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt b/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt new file mode 100644 index 00000000000..bf1b33c8a22 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt @@ -0,0 +1,3 @@ +f a do |x, y| + x + y +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt b/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt new file mode 100644 index 00000000000..25e9ea1c671 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt @@ -0,0 +1,3 @@ +f(a) do |x, y| + x + y +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str.txt b/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str.txt new file mode 100644 index 00000000000..cdefb3c9b72 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str.txt @@ -0,0 +1,3 @@ +"a +b" +1 diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt b/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt new file mode 100644 index 00000000000..a179ba8c9cb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt @@ -0,0 +1,2 @@ +"a\nb" +1 diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_newlines.txt b/test/mri/prism/fixtures/seattlerb/parse_line_newlines.txt new file mode 100644 index 00000000000..28b0c286e84 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_newlines.txt @@ -0,0 +1,3 @@ +true + + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_op_asgn.txt b/test/mri/prism/fixtures/seattlerb/parse_line_op_asgn.txt new file mode 100644 index 00000000000..f2691c2ce46 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_op_asgn.txt @@ -0,0 +1,4 @@ + foo += + bar + baz + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_postexe.txt b/test/mri/prism/fixtures/seattlerb/parse_line_postexe.txt new file mode 100644 index 00000000000..fd8b318d19d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_postexe.txt @@ -0,0 +1,3 @@ +END { +foo +} diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_preexe.txt b/test/mri/prism/fixtures/seattlerb/parse_line_preexe.txt new file mode 100644 index 00000000000..b3eda77ebc8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_preexe.txt @@ -0,0 +1,3 @@ +BEGIN { +foo +} diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_rescue.txt b/test/mri/prism/fixtures/seattlerb/parse_line_rescue.txt new file mode 100644 index 00000000000..a583160ce23 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_rescue.txt @@ -0,0 +1,8 @@ +begin + a +rescue + b +rescue + c +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_return.txt b/test/mri/prism/fixtures/seattlerb/parse_line_return.txt new file mode 100644 index 00000000000..81021c26444 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_return.txt @@ -0,0 +1,6 @@ + def blah + if true then + return 42 + end + end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt b/test/mri/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt new file mode 100644 index 00000000000..b2b6bb8234c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt @@ -0,0 +1 @@ +a("\n", true) diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_to_ary.txt b/test/mri/prism/fixtures/seattlerb/parse_line_to_ary.txt new file mode 100644 index 00000000000..590d0abd147 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_to_ary.txt @@ -0,0 +1,3 @@ +a, +b = c +d diff --git a/test/mri/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt b/test/mri/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt new file mode 100644 index 00000000000..afa826fb509 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt @@ -0,0 +1,2 @@ +a +b diff --git a/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt b/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt new file mode 100644 index 00000000000..649c109ea17 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt @@ -0,0 +1 @@ +1[2=>3,] diff --git a/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt b/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt new file mode 100644 index 00000000000..741cd4ffd14 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt @@ -0,0 +1 @@ +1[2,] diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_019.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_019.txt new file mode 100644 index 00000000000..1e8a75902db --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_019.txt @@ -0,0 +1,5 @@ +case 0 +in -1..1 + true +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_044.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_044.txt new file mode 100644 index 00000000000..a6a0ac6c1c0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_044.txt @@ -0,0 +1,5 @@ +case obj +in Object[] + true +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_051.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_051.txt new file mode 100644 index 00000000000..b7cf769f500 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_051.txt @@ -0,0 +1,5 @@ +case [0, 1, 2] +in [0, 1,] + true +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_058.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_058.txt new file mode 100644 index 00000000000..bd7537098e0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_058.txt @@ -0,0 +1,5 @@ +case {a: 0} +in {a:, **rest} + [a, rest] +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_058_2.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_058_2.txt new file mode 100644 index 00000000000..eb1b3cd8abb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_058_2.txt @@ -0,0 +1,5 @@ +case {a: 0} +in {a:, **} + [a] +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_069.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_069.txt new file mode 100644 index 00000000000..f43dff89592 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_069.txt @@ -0,0 +1,5 @@ +case :a +in Object[b: 1] + 1 +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_pattern_076.txt b/test/mri/prism/fixtures/seattlerb/parse_pattern_076.txt new file mode 100644 index 00000000000..bb947605b34 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_pattern_076.txt @@ -0,0 +1,5 @@ +case {a: 1} +in {a: 1, **nil} + true +end + diff --git a/test/mri/prism/fixtures/seattlerb/parse_until_not_canonical.txt b/test/mri/prism/fixtures/seattlerb/parse_until_not_canonical.txt new file mode 100644 index 00000000000..4de38968dc8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_until_not_canonical.txt @@ -0,0 +1,3 @@ +until not var.nil? + 'foo' +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt b/test/mri/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt new file mode 100644 index 00000000000..4de38968dc8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt @@ -0,0 +1,3 @@ +until not var.nil? + 'foo' +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_while_not_canonical.txt b/test/mri/prism/fixtures/seattlerb/parse_while_not_canonical.txt new file mode 100644 index 00000000000..5aa464167f7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_while_not_canonical.txt @@ -0,0 +1,3 @@ +while not var.nil? + 'foo' +end diff --git a/test/mri/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt b/test/mri/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt new file mode 100644 index 00000000000..5aa464167f7 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt @@ -0,0 +1,3 @@ +while not var.nil? + 'foo' +end diff --git a/test/mri/prism/fixtures/seattlerb/pctW_lineno.txt b/test/mri/prism/fixtures/seattlerb/pctW_lineno.txt new file mode 100644 index 00000000000..b222ff0174d --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/pctW_lineno.txt @@ -0,0 +1,5 @@ +%W(a\nb +c d +e\ +f +gy h\y i\y) diff --git a/test/mri/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt b/test/mri/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt new file mode 100644 index 00000000000..4420560d2be --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt @@ -0,0 +1,2 @@ +%q{ \ +} diff --git a/test/mri/prism/fixtures/seattlerb/pct_nl.txt b/test/mri/prism/fixtures/seattlerb/pct_nl.txt new file mode 100644 index 00000000000..2cee1cdd442 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/pct_nl.txt @@ -0,0 +1,3 @@ +x = % + + diff --git a/test/mri/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt b/test/mri/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt new file mode 100644 index 00000000000..4e084661bfa --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt @@ -0,0 +1,4 @@ +%W( 1 #{< 1 + +return 1, :z => 1, :w => 2 + +return y :z=>1 + +return y z:1 + +return y(z:1) + +return y(z=>1) diff --git a/test/mri/prism/fixtures/seattlerb/rhs_asgn.txt b/test/mri/prism/fixtures/seattlerb/rhs_asgn.txt new file mode 100644 index 00000000000..ca581031e2a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/rhs_asgn.txt @@ -0,0 +1 @@ +42 => n diff --git a/test/mri/prism/fixtures/seattlerb/ruby21_numbers.txt b/test/mri/prism/fixtures/seattlerb/ruby21_numbers.txt new file mode 100644 index 00000000000..34ceb63a0c6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/ruby21_numbers.txt @@ -0,0 +1 @@ +[1i, 2r, 3ri] diff --git a/test/mri/prism/fixtures/seattlerb/safe_attrasgn.txt b/test/mri/prism/fixtures/seattlerb/safe_attrasgn.txt new file mode 100644 index 00000000000..1279e02cfc9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_attrasgn.txt @@ -0,0 +1 @@ +a&.b = 1 diff --git a/test/mri/prism/fixtures/seattlerb/safe_attrasgn_constant.txt b/test/mri/prism/fixtures/seattlerb/safe_attrasgn_constant.txt new file mode 100644 index 00000000000..3a17ac6bcfc --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_attrasgn_constant.txt @@ -0,0 +1 @@ +a&.B = 1 diff --git a/test/mri/prism/fixtures/seattlerb/safe_call.txt b/test/mri/prism/fixtures/seattlerb/safe_call.txt new file mode 100644 index 00000000000..8ecd27e0fe6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call.txt @@ -0,0 +1 @@ +a&.b diff --git a/test/mri/prism/fixtures/seattlerb/safe_call_after_newline.txt b/test/mri/prism/fixtures/seattlerb/safe_call_after_newline.txt new file mode 100644 index 00000000000..58e3fba5548 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call_after_newline.txt @@ -0,0 +1,2 @@ +a +&.b diff --git a/test/mri/prism/fixtures/seattlerb/safe_call_dot_parens.txt b/test/mri/prism/fixtures/seattlerb/safe_call_dot_parens.txt new file mode 100644 index 00000000000..5def0766406 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call_dot_parens.txt @@ -0,0 +1 @@ +a&.() diff --git a/test/mri/prism/fixtures/seattlerb/safe_call_newline.txt b/test/mri/prism/fixtures/seattlerb/safe_call_newline.txt new file mode 100644 index 00000000000..8778b46585a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call_newline.txt @@ -0,0 +1,2 @@ +a&.b + diff --git a/test/mri/prism/fixtures/seattlerb/safe_call_operator.txt b/test/mri/prism/fixtures/seattlerb/safe_call_operator.txt new file mode 100644 index 00000000000..f3fe2b0392f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call_operator.txt @@ -0,0 +1 @@ +a&.> 1 diff --git a/test/mri/prism/fixtures/seattlerb/safe_call_rhs_newline.txt b/test/mri/prism/fixtures/seattlerb/safe_call_rhs_newline.txt new file mode 100644 index 00000000000..d3b07b77b23 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_call_rhs_newline.txt @@ -0,0 +1,2 @@ +c = a&.b + diff --git a/test/mri/prism/fixtures/seattlerb/safe_calls.txt b/test/mri/prism/fixtures/seattlerb/safe_calls.txt new file mode 100644 index 00000000000..eafeace500b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_calls.txt @@ -0,0 +1 @@ +a&.b&.c(1) diff --git a/test/mri/prism/fixtures/seattlerb/safe_op_asgn.txt b/test/mri/prism/fixtures/seattlerb/safe_op_asgn.txt new file mode 100644 index 00000000000..8915a1cccf2 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_op_asgn.txt @@ -0,0 +1 @@ +a&.b += x 1 diff --git a/test/mri/prism/fixtures/seattlerb/safe_op_asgn2.txt b/test/mri/prism/fixtures/seattlerb/safe_op_asgn2.txt new file mode 100644 index 00000000000..0960b2548b8 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/safe_op_asgn2.txt @@ -0,0 +1,2 @@ +a&.b ||= +x; diff --git a/test/mri/prism/fixtures/seattlerb/slashy_newlines_within_string.txt b/test/mri/prism/fixtures/seattlerb/slashy_newlines_within_string.txt new file mode 100644 index 00000000000..421989c76fa --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/slashy_newlines_within_string.txt @@ -0,0 +1,7 @@ +puts "hello\ + my\ + dear\ + friend" + +a + b + diff --git a/test/mri/prism/fixtures/seattlerb/stabby_arg_no_paren.txt b/test/mri/prism/fixtures/seattlerb/stabby_arg_no_paren.txt new file mode 100644 index 00000000000..f16bed4ccfc --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_arg_no_paren.txt @@ -0,0 +1 @@ +->a{} diff --git a/test/mri/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt b/test/mri/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..87a7c5dad30 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +->(b, c=1, *d, e, &f){} diff --git a/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call.txt b/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call.txt new file mode 100644 index 00000000000..5e9e3f55271 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call.txt @@ -0,0 +1,4 @@ +x -> () do +a.b do +end +end diff --git a/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt b/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt new file mode 100644 index 00000000000..7235394751a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -0,0 +1,4 @@ +x -> () do +a(1) do +end +end diff --git a/test/mri/prism/fixtures/seattlerb/stabby_block_kw.txt b/test/mri/prism/fixtures/seattlerb/stabby_block_kw.txt new file mode 100644 index 00000000000..74d9e0a328f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_block_kw.txt @@ -0,0 +1 @@ +-> (k:42) { } diff --git a/test/mri/prism/fixtures/seattlerb/stabby_block_kw__required.txt b/test/mri/prism/fixtures/seattlerb/stabby_block_kw__required.txt new file mode 100644 index 00000000000..bd16ffa73c6 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_block_kw__required.txt @@ -0,0 +1 @@ +-> (k:) { } diff --git a/test/mri/prism/fixtures/seattlerb/stabby_proc_scope.txt b/test/mri/prism/fixtures/seattlerb/stabby_proc_scope.txt new file mode 100644 index 00000000000..1f7f9ff52b0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/stabby_proc_scope.txt @@ -0,0 +1 @@ +->(a; b) {} diff --git a/test/mri/prism/fixtures/seattlerb/str_backslashes.txt b/test/mri/prism/fixtures/seattlerb/str_backslashes.txt new file mode 100644 index 00000000000..5fd6da361bc --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_backslashes.txt @@ -0,0 +1 @@ +x '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' diff --git a/test/mri/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt b/test/mri/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt new file mode 100644 index 00000000000..2b022a55f62 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt @@ -0,0 +1 @@ +a "\\n";b diff --git a/test/mri/prism/fixtures/seattlerb/str_double_escaped_newline.txt b/test/mri/prism/fixtures/seattlerb/str_double_escaped_newline.txt new file mode 100644 index 00000000000..e439225344c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_double_escaped_newline.txt @@ -0,0 +1 @@ +a "\n";b diff --git a/test/mri/prism/fixtures/seattlerb/str_double_newline.txt b/test/mri/prism/fixtures/seattlerb/str_double_newline.txt new file mode 100644 index 00000000000..2d439506ca0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_double_newline.txt @@ -0,0 +1,2 @@ +a " +";b diff --git a/test/mri/prism/fixtures/seattlerb/str_evstr.txt b/test/mri/prism/fixtures/seattlerb/str_evstr.txt new file mode 100644 index 00000000000..86c6d1526da --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_evstr.txt @@ -0,0 +1 @@ +"a #{b}" diff --git a/test/mri/prism/fixtures/seattlerb/str_evstr_escape.txt b/test/mri/prism/fixtures/seattlerb/str_evstr_escape.txt new file mode 100644 index 00000000000..517dfd47784 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_evstr_escape.txt @@ -0,0 +1 @@ +"a #{b}\302\275" diff --git a/test/mri/prism/fixtures/seattlerb/str_heredoc_interp.txt b/test/mri/prism/fixtures/seattlerb/str_heredoc_interp.txt new file mode 100644 index 00000000000..aa2613008cb --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_heredoc_interp.txt @@ -0,0 +1,5 @@ +<<"" +#{x} +blah2 + + diff --git a/test/mri/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt b/test/mri/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt new file mode 100644 index 00000000000..fe6637678f5 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt @@ -0,0 +1 @@ +"#{a.b? ? ""+a+"": ""}" diff --git a/test/mri/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt b/test/mri/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt new file mode 100644 index 00000000000..f4eb3971bbe --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt @@ -0,0 +1,2 @@ +"\xE3\xD3\x8B\xE3\x83\xBC\x83\xE3\x83\xE3\x82\xB3\xA3\x82\x99" \ + "\xE3\x83\xB3\xE3\x83\x8F\xE3\x82\x9A\xC3\xBD;foo@bar.com" diff --git a/test/mri/prism/fixtures/seattlerb/str_newline_hash_line_number.txt b/test/mri/prism/fixtures/seattlerb/str_newline_hash_line_number.txt new file mode 100644 index 00000000000..9c8f702000b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_newline_hash_line_number.txt @@ -0,0 +1,2 @@ +"\n\n\n\n#" +1 diff --git a/test/mri/prism/fixtures/seattlerb/str_pct_Q_nested.txt b/test/mri/prism/fixtures/seattlerb/str_pct_Q_nested.txt new file mode 100644 index 00000000000..1f3d0613e5c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_pct_Q_nested.txt @@ -0,0 +1 @@ +%Q[before [#{nest}] after] diff --git a/test/mri/prism/fixtures/seattlerb/str_pct_nested_nested.txt b/test/mri/prism/fixtures/seattlerb/str_pct_nested_nested.txt new file mode 100644 index 00000000000..cb124152154 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_pct_nested_nested.txt @@ -0,0 +1 @@ +%{ { #{ "#{1}" } } } diff --git a/test/mri/prism/fixtures/seattlerb/str_pct_q.txt b/test/mri/prism/fixtures/seattlerb/str_pct_q.txt new file mode 100644 index 00000000000..65d71197c97 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_pct_q.txt @@ -0,0 +1 @@ +%q{a b c} diff --git a/test/mri/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt b/test/mri/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt new file mode 100644 index 00000000000..2ff0aec111f --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt @@ -0,0 +1 @@ +a '\\n';b diff --git a/test/mri/prism/fixtures/seattlerb/str_single_escaped_newline.txt b/test/mri/prism/fixtures/seattlerb/str_single_escaped_newline.txt new file mode 100644 index 00000000000..5abb8d6334a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_single_escaped_newline.txt @@ -0,0 +1 @@ +a '\n';b diff --git a/test/mri/prism/fixtures/seattlerb/str_single_newline.txt b/test/mri/prism/fixtures/seattlerb/str_single_newline.txt new file mode 100644 index 00000000000..1033cc7e960 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_single_newline.txt @@ -0,0 +1,2 @@ +a ' +';b diff --git a/test/mri/prism/fixtures/seattlerb/str_str.txt b/test/mri/prism/fixtures/seattlerb/str_str.txt new file mode 100644 index 00000000000..388d777dc2a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_str.txt @@ -0,0 +1 @@ +"a #{'b'}" diff --git a/test/mri/prism/fixtures/seattlerb/str_str_str.txt b/test/mri/prism/fixtures/seattlerb/str_str_str.txt new file mode 100644 index 00000000000..d64e01dc5d9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/str_str_str.txt @@ -0,0 +1 @@ +"a #{'b'} c" diff --git a/test/mri/prism/fixtures/seattlerb/super_arg.txt b/test/mri/prism/fixtures/seattlerb/super_arg.txt new file mode 100644 index 00000000000..1b19ecd51ce --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/super_arg.txt @@ -0,0 +1 @@ +super 42 diff --git a/test/mri/prism/fixtures/seattlerb/symbol_empty.txt b/test/mri/prism/fixtures/seattlerb/symbol_empty.txt new file mode 100644 index 00000000000..cbb260bb4ec --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbol_empty.txt @@ -0,0 +1 @@ +:'' diff --git a/test/mri/prism/fixtures/seattlerb/symbol_list.txt b/test/mri/prism/fixtures/seattlerb/symbol_list.txt new file mode 100644 index 00000000000..d3571951845 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbol_list.txt @@ -0,0 +1 @@ +%I[#{a} #{b}] diff --git a/test/mri/prism/fixtures/seattlerb/symbols.txt b/test/mri/prism/fixtures/seattlerb/symbols.txt new file mode 100644 index 00000000000..3ec930ce664 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbols.txt @@ -0,0 +1 @@ +%i(a b c) diff --git a/test/mri/prism/fixtures/seattlerb/symbols_empty.txt b/test/mri/prism/fixtures/seattlerb/symbols_empty.txt new file mode 100644 index 00000000000..840948efb25 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbols_empty.txt @@ -0,0 +1 @@ +%i() diff --git a/test/mri/prism/fixtures/seattlerb/symbols_empty_space.txt b/test/mri/prism/fixtures/seattlerb/symbols_empty_space.txt new file mode 100644 index 00000000000..16c2e68a2b9 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbols_empty_space.txt @@ -0,0 +1 @@ +%i( ) diff --git a/test/mri/prism/fixtures/seattlerb/symbols_interp.txt b/test/mri/prism/fixtures/seattlerb/symbols_interp.txt new file mode 100644 index 00000000000..63116eb632c --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/symbols_interp.txt @@ -0,0 +1 @@ +%i(a b#{1+1} c) diff --git a/test/mri/prism/fixtures/seattlerb/thingy.txt b/test/mri/prism/fixtures/seattlerb/thingy.txt new file mode 100644 index 00000000000..5aa598c4bee --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/thingy.txt @@ -0,0 +1,3 @@ +f.(42) + +f::(42) diff --git a/test/mri/prism/fixtures/seattlerb/uminus_float.txt b/test/mri/prism/fixtures/seattlerb/uminus_float.txt new file mode 100644 index 00000000000..1344bfd9dbd --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/uminus_float.txt @@ -0,0 +1 @@ +-0.0 diff --git a/test/mri/prism/fixtures/seattlerb/unary_minus.txt b/test/mri/prism/fixtures/seattlerb/unary_minus.txt new file mode 100644 index 00000000000..66af866f850 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/unary_minus.txt @@ -0,0 +1 @@ +-a diff --git a/test/mri/prism/fixtures/seattlerb/unary_plus.txt b/test/mri/prism/fixtures/seattlerb/unary_plus.txt new file mode 100644 index 00000000000..daea40b71e0 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/unary_plus.txt @@ -0,0 +1 @@ ++a diff --git a/test/mri/prism/fixtures/seattlerb/unary_plus_on_literal.txt b/test/mri/prism/fixtures/seattlerb/unary_plus_on_literal.txt new file mode 100644 index 00000000000..752331df47a --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/unary_plus_on_literal.txt @@ -0,0 +1 @@ ++:a diff --git a/test/mri/prism/fixtures/seattlerb/unary_tilde.txt b/test/mri/prism/fixtures/seattlerb/unary_tilde.txt new file mode 100644 index 00000000000..f0a507b4375 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/unary_tilde.txt @@ -0,0 +1 @@ +~a diff --git a/test/mri/prism/fixtures/seattlerb/utf8_bom.txt b/test/mri/prism/fixtures/seattlerb/utf8_bom.txt new file mode 100644 index 00000000000..c8e9e1cbae1 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/utf8_bom.txt @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby -w +p 0 + diff --git a/test/mri/prism/fixtures/seattlerb/when_splat.txt b/test/mri/prism/fixtures/seattlerb/when_splat.txt new file mode 100644 index 00000000000..6b79f5dad05 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/when_splat.txt @@ -0,0 +1 @@ +case a; when *b then; end diff --git a/test/mri/prism/fixtures/seattlerb/words_interp.txt b/test/mri/prism/fixtures/seattlerb/words_interp.txt new file mode 100644 index 00000000000..f71486495ba --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/words_interp.txt @@ -0,0 +1 @@ +%W(#{1}b) diff --git a/test/mri/prism/fixtures/seattlerb/yield_arg.txt b/test/mri/prism/fixtures/seattlerb/yield_arg.txt new file mode 100644 index 00000000000..7e752f62e25 --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/yield_arg.txt @@ -0,0 +1 @@ +yield 42 diff --git a/test/mri/prism/fixtures/seattlerb/yield_call_assocs.txt b/test/mri/prism/fixtures/seattlerb/yield_call_assocs.txt new file mode 100644 index 00000000000..95963dfcf9b --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/yield_call_assocs.txt @@ -0,0 +1,11 @@ +yield 1, :z => 1 + +yield 1, :z => 1, :w => 2 + +yield y :z=>1 + +yield y z:1 + +yield y(z:1) + +yield y(z=>1) diff --git a/test/mri/prism/fixtures/seattlerb/yield_empty_parens.txt b/test/mri/prism/fixtures/seattlerb/yield_empty_parens.txt new file mode 100644 index 00000000000..cff86b243ad --- /dev/null +++ b/test/mri/prism/fixtures/seattlerb/yield_empty_parens.txt @@ -0,0 +1 @@ +yield() diff --git a/test/mri/prism/fixtures/single_method_call_with_bang.txt b/test/mri/prism/fixtures/single_method_call_with_bang.txt new file mode 100644 index 00000000000..929efb30534 --- /dev/null +++ b/test/mri/prism/fixtures/single_method_call_with_bang.txt @@ -0,0 +1 @@ +foo! diff --git a/test/mri/prism/fixtures/single_quote_heredocs.txt b/test/mri/prism/fixtures/single_quote_heredocs.txt new file mode 100644 index 00000000000..0122b2726cc --- /dev/null +++ b/test/mri/prism/fixtures/single_quote_heredocs.txt @@ -0,0 +1,3 @@ +<<-'EOS' + cd L:\Work\MG3710IQPro\Develop +EOS diff --git a/test/mri/prism/fixtures/spanning_heredoc.txt b/test/mri/prism/fixtures/spanning_heredoc.txt new file mode 100644 index 00000000000..d09cb11b1f7 --- /dev/null +++ b/test/mri/prism/fixtures/spanning_heredoc.txt @@ -0,0 +1,63 @@ +# test regex, string, and lists that span a heredoc thanks to an escaped newline + +# ripper incorrectly creates a "b\nb" token instead of two separate string tokens +pp <<-A.gsub(/b\ +a +A +b/, "") + +# ripper incorrectly creates a "d\nd" token instead of two separate string tokens +pp <<-A, "d\ +c +A +d" + +# ripper gets this right +pp <<-A, %q[f\ +e +A +f] + +# ripper incorrectly creates a "h\nh" token instead of two separate string tokens +pp <<-A, %Q[h\ +g +A +h] + +# ripper can't parse this successfully, though ruby runs it correctly +pp <<-A, %w[j\ +i +A +j] + +# ripper can't parse this successfully, though ruby runs it correctly +# TODO: prism does not include the "\n" in "l\nl" in the AST like ruby does +pp <<-A, %W[l\ +k +A +l] + +# ripper can't parse this successfully, though ruby runs it correctly +pp <<-A, %i[n\ +m +A +n] + +# ripper gets this one wrong in the same way that prism does ... +# TODO: prism does not include the "\n" in "p\np" in the AST like ruby does +pp <<-A, %I[p\ +o +A +p] + +<)/ =~ '' + +<= + +:>> + +:> + +:<=> + +:<= + +:<< + +:< + +:__LINE__ + +:__FILE__ + +:__ENCODING__ diff --git a/test/mri/prism/fixtures/ternary_operator.txt b/test/mri/prism/fixtures/ternary_operator.txt new file mode 100644 index 00000000000..79d2d7d8373 --- /dev/null +++ b/test/mri/prism/fixtures/ternary_operator.txt @@ -0,0 +1,15 @@ +a ? b : c + +a ? defined? b : defined? c + +empty??true:nil + +empty??false:nil + +empty??nil:nil + +a??nil:nil + +a ?var1 : var2 + +nil??_a =2:1 diff --git a/test/mri/prism/fixtures/tilde_heredocs.txt b/test/mri/prism/fixtures/tilde_heredocs.txt new file mode 100644 index 00000000000..cca47ef00bb --- /dev/null +++ b/test/mri/prism/fixtures/tilde_heredocs.txt @@ -0,0 +1,97 @@ +<<~EOF + a +#{1} + a +EOF + +<<~EOF + a +EOF + +<<~EOF + a + b + c +EOF + +<<~EOF + #{1} a +EOF + +<<~EOF + a #{1} +EOF + +<<~EOF + a + #{1} +EOF + +<<~EOF + a + #{1} +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~'EOF' + a #{1} +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + + b +EOF + +<<~EOF + a + + b +EOF + +<<~EOF + a + + + + b +EOF + +<<~EOF + + #{1}a + EOF + +<<~EOT + #{1} + b +EOT diff --git a/test/mri/prism/fixtures/undef.txt b/test/mri/prism/fixtures/undef.txt new file mode 100644 index 00000000000..129c3494337 --- /dev/null +++ b/test/mri/prism/fixtures/undef.txt @@ -0,0 +1,17 @@ +undef a + +undef a, b + +undef if + +undef <=> + +undef :a + +undef :a, :b, :c + +undef :'abc' + +undef :"abc#{1}" + +undef Constant diff --git a/test/mri/prism/fixtures/unescaping.txt b/test/mri/prism/fixtures/unescaping.txt new file mode 100644 index 00000000000..e2da5a696c4 --- /dev/null +++ b/test/mri/prism/fixtures/unescaping.txt @@ -0,0 +1,9 @@ +["\c#{1}"] + +/\c#{1}/ + +"\c#{1}" + +<<~HERE + \c#{1} +HERE diff --git a/test/mri/prism/fixtures/unless.txt b/test/mri/prism/fixtures/unless.txt new file mode 100644 index 00000000000..410d460e690 --- /dev/null +++ b/test/mri/prism/fixtures/unless.txt @@ -0,0 +1,14 @@ +unless true; 1; end + +unless true +1 else 2 end + +1 unless true + +break unless true + +next unless true + +return unless true + +foo :a, :b unless bar? diff --git a/test/mri/prism/fixtures/unparser/LICENSE b/test/mri/prism/fixtures/unparser/LICENSE new file mode 100644 index 00000000000..44863d7afb9 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Markus Schirp + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/alias.txt b/test/mri/prism/fixtures/unparser/corpus/literal/alias.txt new file mode 100644 index 00000000000..fb06a295e89 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/alias.txt @@ -0,0 +1,2 @@ +alias $foo $bar +alias :foo :bar diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/assignment.txt b/test/mri/prism/fixtures/unparser/corpus/literal/assignment.txt new file mode 100644 index 00000000000..84a74e89281 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/assignment.txt @@ -0,0 +1,53 @@ +$a = 1 +($a, $b) = [1, 2] +((a,), b) = 1 +(*a) = [] +(*foo) = [1, 2] +(@@a, @@b) = [1, 2] +(@a, @b) = [1, 2] +(a, (b, c)) = [1, [2, 3]] +(a, *) = [1, 2] +(a, *foo) = [1, 2] +(a, b) = [1, 2] +(a, b) = foo +(a,) = foo +(a.foo, a.bar) = [1, 2] +(a[*foo], a[1]) = [1, 2] +(a[0], a[1]) = [1, 2] +(*c.foo) = 1 +::Foo = ::Bar +@@a = 1 +@a = 1 +CONST = 1 +Name::Spaced::CONST = 1 +a = ((b, c) = 1) +a = 1 +foo = foo() +foo.[]=() +foo.[]=(1, 2) +foo.[]=true +foo[*index] = value +foo[1..2] = value +foo[] = 1 +foo[a, b] = value +foo[index] = value +x = %() +x.x=%() +x[%()] = bar +a[%()] ||= bar +@a ||= %() +x = <<-HEREDOC + #{} +HEREDOC +x.x=<<-HEREDOC + #{} +HEREDOC +x[] = <<-HEREDOC + #{} +HEREDOC +a[<<-HEREDOC] ||= bar + #{} +HEREDOC +@a ||= <<-HEREDOC + #{} +HEREDOC diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/block.txt b/test/mri/prism/fixtures/unparser/corpus/literal/block.txt new file mode 100644 index 00000000000..b2baf1dc127 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/block.txt @@ -0,0 +1,96 @@ +foo { +} +foo { |a| +} +foo { |a,| +} +foo { |a,; x| +} +foo { |a, b| +} +foo(1) { + nil +} +foo { |a, *b| + nil +} +foo { |a, *| + nil +} +foo { + bar +} +foo.bar { |(a, b), c| + d +} +foo.bar { |*a; b| +} +foo.bar { |a; b| +} +foo.bar { |; a, b| +} +foo.bar { |*| + d +} +foo.bar { |(*)| + d +} +foo.bar { |((*))| + d +} +foo.bar { |(a, (*))| + d +} +foo.bar { |(a, b)| + d +} +foo.bar { +}.baz +m do +rescue Exception => e +end +m do + foo +rescue Exception => bar + bar +end +m do + bar +rescue SomeError, *bar + baz +end +m do + bar +rescue SomeError, *bar => exception + baz +end +m do + bar +rescue *bar + baz +end +m do + bar +rescue LoadError +end +m do + bar +rescue +else + baz +end +m do + bar +rescue *bar => exception + baz +end +m do +ensure +end +m do +rescue +ensure +end +bar { + _1 + _2 +} diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/case.txt b/test/mri/prism/fixtures/unparser/corpus/literal/case.txt new file mode 100644 index 00000000000..c455fd7c39f --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/case.txt @@ -0,0 +1,37 @@ +case +when bar + baz +when baz + bar +end +case foo +when bar +when baz + bar +end +case foo +when bar + baz +when baz + bar +end +case foo +when bar, baz + :other +end +case foo +when *bar + :value +end +case foo +when bar + baz +else + :foo +end +case foo +when *bar | baz +end +case foo +when *bar.baz=1 +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/class.txt b/test/mri/prism/fixtures/unparser/corpus/literal/class.txt new file mode 100644 index 00000000000..f0198625e91 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/class.txt @@ -0,0 +1,35 @@ +class A +end + +class << a +end + +class << a + b +end + +class A::B +end + +class A::B::C +end + +class A < B +end + +class A < B::C +end + +class A::B < C::D +end + +class A + include(B.new) + + def foo + :bar + end +end + +class ::A +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/control.txt b/test/mri/prism/fixtures/unparser/corpus/literal/control.txt new file mode 100644 index 00000000000..648782bc962 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/control.txt @@ -0,0 +1,15 @@ +next +return +break +retry +redo +return 1 +return 1, 2 +return true ? 1 : 2 +break true ? 1 : 2 +next true ? 1 : 2 +return true, if true + 1 +else + 2 +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/def.txt b/test/mri/prism/fixtures/unparser/corpus/literal/def.txt new file mode 100644 index 00000000000..61339bd4a6e --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/def.txt @@ -0,0 +1,134 @@ +def foo + a +rescue + b +else + c +ensure + d +end + +def foo + a rescue b +rescue + b +else + c +ensure + d +end + +def foo(bar:, baz:) +end + +def foo +end + +def foo + bar +end + +def foo + foo +rescue + bar +ensure + baz +end + +def foo + bar +ensure + baz +end + +def foo + bar +rescue + baz +end + +def foo(bar) + bar +end + +def foo(bar, baz) + bar +end + +def foo(bar = ()) + bar +end + +def foo(bar = (baz; nil)) +end + +def foo(bar = true) + bar +end + +def foo(bar, baz = true) + bar +end + +def foo(bar: 1) +end + +def foo(bar: baz) +end + +def foo(bar: bar()) +end + +def foo(*) + bar +end + +def foo(*bar) + bar +end + +def foo(bar, *baz) + bar +end + +def foo(baz = true, *bor) + bar +end + +def foo(baz = true, *bor, &block) + bar +end + +def foo(bar, baz = true, *bor) + bar +end + +def foo(&block) + bar +end + +def foo(bar, &block) + bar +end + +def foo + bar + baz +end + +def f(((a))) +end + +def foo(bar:, baz: "value") +end + +def f + <<-HEREDOC + #{} + HEREDOC +end + +def f + %() +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/defined.txt b/test/mri/prism/fixtures/unparser/corpus/literal/defined.txt new file mode 100644 index 00000000000..65e7c370fd1 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/defined.txt @@ -0,0 +1,3 @@ +defined?(@foo) +defined?(Foo) +defined?(((a, b) = [1, 2])) diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/defs.txt b/test/mri/prism/fixtures/unparser/corpus/literal/defs.txt new file mode 100644 index 00000000000..b70aa9efc51 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/defs.txt @@ -0,0 +1,40 @@ +def self.foo +end + +def self.foo + bar +end + +def self.foo + bar + baz +end + +def Foo.bar + bar +end + +def (foo { |bar| +}).bar + bar +end + +def (foo(1)).bar + bar +end + +def (Foo::Bar.baz).bar + baz +end + +def (Foo::Bar).bar + baz +end + +def Foo.bar + baz +end + +def foo.bar + baz +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/dstr.txt b/test/mri/prism/fixtures/unparser/corpus/literal/dstr.txt new file mode 100644 index 00000000000..8a912d28ede --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/dstr.txt @@ -0,0 +1,37 @@ +if true + "#{}a" +end +if true + <<-HEREDOC +a +#{}a +b + HEREDOC + x +end +<<-HEREDOC +\#{}\#{} +#{} +#{} +#{} +HEREDOC +<<-HEREDOC rescue nil +#{} +a +HEREDOC +"a#$1" +"a#$a" +"a#@a" +"a#@@a" +if true + return <<-HEREDOC + #{42} + HEREDOC +end +foo(<<-HEREDOC) + #{bar} +HEREDOC +foo(<<-HEREDOC) { |x| + #{bar} +HEREDOC +} diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/empty.txt b/test/mri/prism/fixtures/unparser/corpus/literal/empty.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/empty_begin.txt b/test/mri/prism/fixtures/unparser/corpus/literal/empty_begin.txt new file mode 100644 index 00000000000..6a452c185a8 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/empty_begin.txt @@ -0,0 +1 @@ +() diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/flipflop.txt b/test/mri/prism/fixtures/unparser/corpus/literal/flipflop.txt new file mode 100644 index 00000000000..8badd39d573 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/flipflop.txt @@ -0,0 +1,6 @@ +if ((i == 4)..(i == 4)) + foo +end +if ((i == 4)...(i == 4)) + foo +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/for.txt b/test/mri/prism/fixtures/unparser/corpus/literal/for.txt new file mode 100644 index 00000000000..4c19a352d96 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/for.txt @@ -0,0 +1,12 @@ +bar(for a in bar do + baz +end) +for a in bar do + baz +end +for (a, *b) in bar do + baz +end +for (a, b) in bar do + baz +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/hookexe.txt b/test/mri/prism/fixtures/unparser/corpus/literal/hookexe.txt new file mode 100644 index 00000000000..08f14f47b34 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/hookexe.txt @@ -0,0 +1,7 @@ +BEGIN { + foo +} +bar +END { + baz +} diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/if.txt b/test/mri/prism/fixtures/unparser/corpus/literal/if.txt new file mode 100644 index 00000000000..0c13801f9e4 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/if.txt @@ -0,0 +1,36 @@ +if /foo/ + bar +end +if 3 + 9 +end +if 4 + 5 +else + 6 +end +unless 3 + nil +end +unless 3 + 9 +end +if foo +end + +module A + foo = bar if foo +end + +module B + foo = bar unless foo +end +unless foo + foo = bar +end +if foo { |pair| + pair +} + pair = :foo + foo +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/kwbegin.txt b/test/mri/prism/fixtures/unparser/corpus/literal/kwbegin.txt new file mode 100644 index 00000000000..6cc1e74ca64 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/kwbegin.txt @@ -0,0 +1,80 @@ +begin +rescue +end + +begin +ensure +end + +begin + a +end + +begin + a +rescue + b +end + +begin + a + b +rescue + b +end + +begin +rescue A +end + +begin +rescue A => foo +end + +begin + a +rescue A + b +rescue B + c +ensure + d +end + +begin + begin + foo + bar + rescue + end +rescue + baz + bar +end + +begin + raise(Exception) rescue foo = bar +rescue Exception +end + +begin + foo +rescue => bar + bar +end + +begin + foo +rescue Exception, Other => bar + bar +end + +begin + bar +rescue SomeError, *bar => exception + baz +end + +class << self + undef :bar rescue nil +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/lambda.txt b/test/mri/prism/fixtures/unparser/corpus/literal/lambda.txt new file mode 100644 index 00000000000..4eb722dad1b --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/lambda.txt @@ -0,0 +1,13 @@ +lambda { +} +lambda { |a, b| + a +} +->() { +} +->(a) { +} +->(a, b) { +} +->(a, b; c) { +} diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/literal.txt b/test/mri/prism/fixtures/unparser/corpus/literal/literal.txt new file mode 100644 index 00000000000..2fc7cd1d790 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/literal.txt @@ -0,0 +1,91 @@ +{ "foo" => <<-HEREDOC, "bar" => :baz } + #{} +HEREDOC +{ "foo" => %(), "bar" => :baz } +["foo", %()] +a(<<-HEREDOC).a + #{} +HEREDOC +a(%()).a +{ "foo" => <<-HEREDOC, **baz } + #{} +HEREDOC +{ "foo" => %(), **baz } +"#@a #@@a #$a" +0 +++1 +1 +1 +1r +1.5r +1.3r +5i +-5i +0.6i +-0.6i +1000000000000000000000000000000i +1ri +"foo" "bar" +"foobar #{baz}" +"foo#{1}bar" +"\\\\#{}" +"#{}\#{}" +"\#{}#{}" +"foo\\\#{@bar}" +"\"" +"foo bar" +"foo\nbar" +`foo` +`foo#{@bar}` +`)` +`\`` +`"` +:foo +:"A B" +:foo +:"A B" +:"A\"B" +:"" +/foo/ +/[^-+',.\/:@[:alnum:]\[\]]+/ +/foo#{@bar}/ +/foo#{@bar}/imx +/#{"\u0000"}/ +/\n/ +/\n/ +/\n/x +/\/\//x +:"foo#{bar}baz" +:"#{"foo"}" +(0.0 / 0.0)..1 +1..(0.0 / 0.0) +(0.0 / 0.0)..100 +-0.1 +0.1 +[1, 2] +[1, (), n2] +[1] +[] +[1, *@foo] +[*@foo, 1] +[*@foo, *@baz] +{} +{ () => () } +{ 1 => 2 } +{ 1 => 2, 3 => 4 } +{ a: (1 rescue foo), b: 2 } +{ a: 1, b: 2 } +{ a: :a } +{ :"a b" => 1 } +{ :-@ => 1 } +"#{} +#{}\na" +foo { + "#{} +#{}\na" +} +:"a\\ +b" +` x +#{foo} +#` diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/module.txt b/test/mri/prism/fixtures/unparser/corpus/literal/module.txt new file mode 100644 index 00000000000..cec03f3bfd9 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/module.txt @@ -0,0 +1,16 @@ +module A +end + +module A::B +end + +module A::B::C +end + +module A + include(B.new) + + def foo + :bar + end +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/opasgn.txt b/test/mri/prism/fixtures/unparser/corpus/literal/opasgn.txt new file mode 100644 index 00000000000..5858d773d09 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/opasgn.txt @@ -0,0 +1,24 @@ +a += 2 +a -= 2 +a **= 2 +a *= 2 +a /= 2 +a &&= b +a ||= 2 +(a ||= 2).bar +(h ||= {})[k] = v +a.b += 2 +a.b -= 2 +a.b **= 2 +a.b *= 2 +a.b /= 2 +a.b &&= b +a.b ||= 2 +a[b] += 2 +a[b] -= 2 +a[b] **= 2 +a[b] *= 2 +a[b] /= 2 +a[b] &&= b +a[b] ||= 2 +foo.A += 1 diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/pattern.txt b/test/mri/prism/fixtures/unparser/corpus/literal/pattern.txt new file mode 100644 index 00000000000..7cfaa4dc67f --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/pattern.txt @@ -0,0 +1,41 @@ +case foo +in A[1, 2, *a, 3] then + true +in [1, 2, ] then + y +in A(x:) then + true +in {**a} then + true +in {} if true then + true +in [x, y, *] then + true +in {a: 1, aa: 2} then + true +in {} then + true +in {**nil} then + true +in {"a": 1} then + true +in 1 | 2 then + true +in 1 => a then + true +in ^x then + true +in 1 +in 2 then + true +else + true +end +case foo +in A[1, 2, *a, 3] +end +case foo +in A +else +end +1 in [a] diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/pragma.txt b/test/mri/prism/fixtures/unparser/corpus/literal/pragma.txt new file mode 100644 index 00000000000..4f6dd71b389 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/pragma.txt @@ -0,0 +1,4 @@ +__ENCODING__ +__FILE__ +__LINE__ +__dir__ diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/range.txt b/test/mri/prism/fixtures/unparser/corpus/literal/range.txt new file mode 100644 index 00000000000..eb1f3874c07 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/range.txt @@ -0,0 +1,4 @@ +(1..) +1..2 +(1...) +1...2 diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/rescue.txt b/test/mri/prism/fixtures/unparser/corpus/literal/rescue.txt new file mode 100644 index 00000000000..a7878168085 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/rescue.txt @@ -0,0 +1,3 @@ +foo rescue bar +foo rescue return bar +x = (foo rescue return bar) diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/send.txt b/test/mri/prism/fixtures/unparser/corpus/literal/send.txt new file mode 100644 index 00000000000..1e9c2a94be0 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/send.txt @@ -0,0 +1,84 @@ +module A + foo ||= ((a, _) = b) +end + +module A + local = 1 + local.bar +end +class A +end.bar +module A +end.bar +begin +rescue +end.bar +case (def foo +end; :bar) +when bar +end.baz +case foo +when bar +end.baz +class << self +end.bar +def self.foo +end.bar +def foo +end.bar +until foo +end.bar +while foo +end.bar +loop { +}.bar +if foo +end.baz +(/bar/ =~ :foo).foo +(1..2).max +(foo =~ /bar/).foo +/bar/ =~ :foo +/bar/ =~ foo +1..2.max +A.foo +FOO() +a&.b +a.foo +foo +foo << (bar * baz) +foo =~ /bar/ +foo(&(foo || bar)) +foo(&block) +foo(*args, &block) +foo(*arguments) +foo(1, 2) +foo(bar) +foo(bar, *args) +foo(foo =~ /bar/) +foo.bar(&baz) +foo.bar(*arga, foo, *argb) +foo.bar(*args) +foo.bar(*args, foo) +foo.bar(:baz, &baz) +foo.bar(baz: boz) +foo.bar(foo, "baz" => boz) +foo.bar(foo, *args) +foo.bar(foo, *args, &block) +foo.bar(foo, {}) +foo.bar({ foo: boz }, boz) +foo.bar=:baz +foo(a: b) +foo.&(a: b) +foo.&(**a) +foo[*baz] +foo[1, 2] +foo[] +self.foo +self.foo=:bar +(a + b) / (c - d) +(a + b) / c.-(e, f) +(a + b) / c.-(*f) +x(**foo) +foo&.! +foo.~(b) +a&.+(b) diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/since/27.txt b/test/mri/prism/fixtures/unparser/corpus/literal/since/27.txt new file mode 100644 index 00000000000..c332f9e48e2 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/since/27.txt @@ -0,0 +1,4 @@ +-> { + _1 + _2 +} +(..1) diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/since/30.txt b/test/mri/prism/fixtures/unparser/corpus/literal/since/30.txt new file mode 100644 index 00000000000..b73328a4b04 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/since/30.txt @@ -0,0 +1,4 @@ +1 => [a] +1 => [*] +1 in [*, 42, *] +1 in [*, a, *foo] diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/since/31.txt b/test/mri/prism/fixtures/unparser/corpus/literal/since/31.txt new file mode 100644 index 00000000000..504eb94d5b5 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/since/31.txt @@ -0,0 +1,7 @@ +def foo(&) + bar(&) +end + +def foo(a, &) + bar(&) +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/since/32.txt b/test/mri/prism/fixtures/unparser/corpus/literal/since/32.txt new file mode 100644 index 00000000000..fa279f11cf8 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/since/32.txt @@ -0,0 +1,7 @@ +def foo(argument, **) + bar(argument, **) +end + +def foo(argument, *) + bar(argument, *) +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/singletons.txt b/test/mri/prism/fixtures/unparser/corpus/literal/singletons.txt new file mode 100644 index 00000000000..496e6a41ce6 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/singletons.txt @@ -0,0 +1,4 @@ +false +nil +self +true diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/super.txt b/test/mri/prism/fixtures/unparser/corpus/literal/super.txt new file mode 100644 index 00000000000..0e73e6f052f --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/super.txt @@ -0,0 +1,21 @@ +super +super() +super(a) +super(a, b) +super(&block) +super(a, &block) +super(a { + foo +}) +super { + foo +} +super(a) { + foo +} +super() { + foo +} +super(a, b) { + foo +} diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/unary.txt b/test/mri/prism/fixtures/unparser/corpus/literal/unary.txt new file mode 100644 index 00000000000..77685cb71d0 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/unary.txt @@ -0,0 +1,8 @@ +!1 +!(!1) +!(!(foo || bar)) +!(!1).baz +~a +-a ++a +-(-a).foo diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/undef.txt b/test/mri/prism/fixtures/unparser/corpus/literal/undef.txt new file mode 100644 index 00000000000..a65d8d0cc47 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/undef.txt @@ -0,0 +1,2 @@ +undef :foo +undef :foo, :bar diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/variables.txt b/test/mri/prism/fixtures/unparser/corpus/literal/variables.txt new file mode 100644 index 00000000000..1de938f376f --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/variables.txt @@ -0,0 +1,10 @@ +a +@a +@@a +$a +$1 +$` +CONST +SCOPED::CONST +::TOPLEVEL +::TOPLEVEL::CONST diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/while.txt b/test/mri/prism/fixtures/unparser/corpus/literal/while.txt new file mode 100644 index 00000000000..19a60ef5ff3 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/while.txt @@ -0,0 +1,73 @@ +module A + foo { |bar| + while foo + foo = bar + end + } +end + +def foo + foo = bar while foo != baz +end + +module A + foo = bar while foo +end + +module A + foo = bar until foo +end + +module A + while foo + foo = bar + end +end + +module A + each { |baz| + while foo + foo = bar + end + } +end + +module A + each { |foo| + while foo + foo = bar + end + } +end +x = (begin + foo +end while baz) +begin + foo +end while baz +begin + foo + bar +end until baz +begin + foo + bar +end while baz +while false +end +while false + 3 +end +while (foo { +}) + :body +end +until false +end +until false + 3 +end +until (foo { +}) + :body +end diff --git a/test/mri/prism/fixtures/unparser/corpus/literal/yield.txt b/test/mri/prism/fixtures/unparser/corpus/literal/yield.txt new file mode 100644 index 00000000000..c0b58208424 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/literal/yield.txt @@ -0,0 +1,3 @@ +yield +yield(a) +yield(a, b) diff --git a/test/mri/prism/fixtures/unparser/corpus/semantic/and.txt b/test/mri/prism/fixtures/unparser/corpus/semantic/and.txt new file mode 100644 index 00000000000..43d17124458 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/semantic/and.txt @@ -0,0 +1,8 @@ +a...b or c...d +a...b and c...d + +if a...b or c...d +end + +if a...b and c...d +end diff --git a/test/mri/prism/fixtures/unparser/corpus/semantic/block.txt b/test/mri/prism/fixtures/unparser/corpus/semantic/block.txt new file mode 100644 index 00000000000..58916900259 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/semantic/block.txt @@ -0,0 +1,26 @@ +foo do +end + +foo do +rescue +end + +foo do + nil rescue nil + nil +end + +foo do |a| +end + +foo(<<-DOC) do |a| + b +DOC + a +end + +foo(<<-DOC) do + b +DOC + a +end diff --git a/test/mri/prism/fixtures/unparser/corpus/semantic/def.txt b/test/mri/prism/fixtures/unparser/corpus/semantic/def.txt new file mode 100644 index 00000000000..75746193920 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/semantic/def.txt @@ -0,0 +1,7 @@ +def foo + (a - b) +end + +def foo + a rescue Exception +end diff --git a/test/mri/prism/fixtures/unparser/corpus/semantic/dstr.txt b/test/mri/prism/fixtures/unparser/corpus/semantic/dstr.txt new file mode 100644 index 00000000000..919e7360775 --- /dev/null +++ b/test/mri/prism/fixtures/unparser/corpus/semantic/dstr.txt @@ -0,0 +1,127 @@ +< + +Parts of the source are derived from ruby_parser: +Copyright (c) Ryan Davis, seattle.rb + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/mri/prism/fixtures/whitequark/__ENCODING__.txt b/test/mri/prism/fixtures/whitequark/__ENCODING__.txt new file mode 100644 index 00000000000..d6debf2f924 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/__ENCODING__.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/mri/prism/fixtures/whitequark/__ENCODING___legacy_.txt b/test/mri/prism/fixtures/whitequark/__ENCODING___legacy_.txt new file mode 100644 index 00000000000..d6debf2f924 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/__ENCODING___legacy_.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/mri/prism/fixtures/whitequark/alias.txt b/test/mri/prism/fixtures/whitequark/alias.txt new file mode 100644 index 00000000000..e33b1200226 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/alias.txt @@ -0,0 +1 @@ +alias :foo bar diff --git a/test/mri/prism/fixtures/whitequark/alias_gvar.txt b/test/mri/prism/fixtures/whitequark/alias_gvar.txt new file mode 100644 index 00000000000..b975d97f8e2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/alias_gvar.txt @@ -0,0 +1,3 @@ +alias $a $+ + +alias $a $b diff --git a/test/mri/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt b/test/mri/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt new file mode 100644 index 00000000000..9b2e3afad5e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt @@ -0,0 +1 @@ +a ? b & '': nil diff --git a/test/mri/prism/fixtures/whitequark/and.txt b/test/mri/prism/fixtures/whitequark/and.txt new file mode 100644 index 00000000000..43fa6a65cdd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/and.txt @@ -0,0 +1,3 @@ +foo && bar + +foo and bar diff --git a/test/mri/prism/fixtures/whitequark/and_asgn.txt b/test/mri/prism/fixtures/whitequark/and_asgn.txt new file mode 100644 index 00000000000..a9792659144 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/and_asgn.txt @@ -0,0 +1,3 @@ +foo.a &&= 1 + +foo[0, 1] &&= 2 diff --git a/test/mri/prism/fixtures/whitequark/and_or_masgn.txt b/test/mri/prism/fixtures/whitequark/and_or_masgn.txt new file mode 100644 index 00000000000..e3460416045 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/and_or_masgn.txt @@ -0,0 +1,3 @@ +foo && (a, b = bar) + +foo || (a, b = bar) diff --git a/test/mri/prism/fixtures/whitequark/anonymous_blockarg.txt b/test/mri/prism/fixtures/whitequark/anonymous_blockarg.txt new file mode 100644 index 00000000000..e3eaaad6ce4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/anonymous_blockarg.txt @@ -0,0 +1 @@ +def foo(&); bar(&); end diff --git a/test/mri/prism/fixtures/whitequark/arg.txt b/test/mri/prism/fixtures/whitequark/arg.txt new file mode 100644 index 00000000000..b1984ad5c4a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/arg.txt @@ -0,0 +1,3 @@ +def f(foo); end + +def f(foo, bar); end diff --git a/test/mri/prism/fixtures/whitequark/arg_duplicate_ignored.txt b/test/mri/prism/fixtures/whitequark/arg_duplicate_ignored.txt new file mode 100644 index 00000000000..0f5cc339618 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/arg_duplicate_ignored.txt @@ -0,0 +1,3 @@ +def foo(_, _); end + +def foo(_a, _a); end diff --git a/test/mri/prism/fixtures/whitequark/arg_label.txt b/test/mri/prism/fixtures/whitequark/arg_label.txt new file mode 100644 index 00000000000..82db416cb42 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/arg_label.txt @@ -0,0 +1,6 @@ +def foo + a:b end + +def foo() a:b end + +f { || a:b } diff --git a/test/mri/prism/fixtures/whitequark/arg_scope.txt b/test/mri/prism/fixtures/whitequark/arg_scope.txt new file mode 100644 index 00000000000..6c67ab72e38 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/arg_scope.txt @@ -0,0 +1 @@ +lambda{|;a|a} diff --git a/test/mri/prism/fixtures/whitequark/args.txt b/test/mri/prism/fixtures/whitequark/args.txt new file mode 100644 index 00000000000..773be477d32 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args.txt @@ -0,0 +1,63 @@ +def f &b; end + +def f (((a))); end + +def f ((*)); end + +def f ((*, p)); end + +def f ((*r)); end + +def f ((*r, p)); end + +def f ((a, *)); end + +def f ((a, *, p)); end + +def f ((a, *r)); end + +def f ((a, *r, p)); end + +def f ((a, a1)); end + +def f (foo: 1, &b); end + +def f (foo: 1, bar: 2, **baz, &b); end + +def f **baz, &b; end + +def f *, **; end + +def f *r, &b; end + +def f *r, p, &b; end + +def f ; end + +def f a, &b; end + +def f a, *r, &b; end + +def f a, *r, p, &b; end + +def f a, o=1, &b; end + +def f a, o=1, *r, &b; end + +def f a, o=1, *r, p, &b; end + +def f a, o=1, p, &b; end + +def f foo: +; end + +def f foo: -1 +; end + +def f o=1, &b; end + +def f o=1, *r, &b; end + +def f o=1, *r, p, &b; end + +def f o=1, p, &b; end diff --git a/test/mri/prism/fixtures/whitequark/args_args_assocs.txt b/test/mri/prism/fixtures/whitequark/args_args_assocs.txt new file mode 100644 index 00000000000..445f899442c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_args_assocs.txt @@ -0,0 +1,3 @@ +fun(foo, :foo => 1) + +fun(foo, :foo => 1, &baz) diff --git a/test/mri/prism/fixtures/whitequark/args_args_assocs_comma.txt b/test/mri/prism/fixtures/whitequark/args_args_assocs_comma.txt new file mode 100644 index 00000000000..b566a590375 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_args_assocs_comma.txt @@ -0,0 +1 @@ +foo[bar, :baz => 1,] diff --git a/test/mri/prism/fixtures/whitequark/args_args_comma.txt b/test/mri/prism/fixtures/whitequark/args_args_comma.txt new file mode 100644 index 00000000000..80770716dd5 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_args_comma.txt @@ -0,0 +1 @@ +foo[bar,] diff --git a/test/mri/prism/fixtures/whitequark/args_args_star.txt b/test/mri/prism/fixtures/whitequark/args_args_star.txt new file mode 100644 index 00000000000..d4dc9cc5798 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_args_star.txt @@ -0,0 +1,3 @@ +fun(foo, *bar) + +fun(foo, *bar, &baz) diff --git a/test/mri/prism/fixtures/whitequark/args_assocs.txt b/test/mri/prism/fixtures/whitequark/args_assocs.txt new file mode 100644 index 00000000000..b33e1311818 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_assocs.txt @@ -0,0 +1,11 @@ +fun(:foo => 1) + +fun(:foo => 1, &baz) + +self.[]= foo, :a => 1 + +self[:bar => 1] + +super(:foo => 42) + +yield(:foo => 42) diff --git a/test/mri/prism/fixtures/whitequark/args_assocs_comma.txt b/test/mri/prism/fixtures/whitequark/args_assocs_comma.txt new file mode 100644 index 00000000000..15e5cd65dc0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_assocs_comma.txt @@ -0,0 +1 @@ +foo[:baz => 1,] diff --git a/test/mri/prism/fixtures/whitequark/args_assocs_legacy.txt b/test/mri/prism/fixtures/whitequark/args_assocs_legacy.txt new file mode 100644 index 00000000000..b33e1311818 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_assocs_legacy.txt @@ -0,0 +1,11 @@ +fun(:foo => 1) + +fun(:foo => 1, &baz) + +self.[]= foo, :a => 1 + +self[:bar => 1] + +super(:foo => 42) + +yield(:foo => 42) diff --git a/test/mri/prism/fixtures/whitequark/args_block_pass.txt b/test/mri/prism/fixtures/whitequark/args_block_pass.txt new file mode 100644 index 00000000000..35d7d238856 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_block_pass.txt @@ -0,0 +1 @@ +fun(&bar) diff --git a/test/mri/prism/fixtures/whitequark/args_cmd.txt b/test/mri/prism/fixtures/whitequark/args_cmd.txt new file mode 100644 index 00000000000..dd0c8891d07 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_cmd.txt @@ -0,0 +1 @@ +fun(f bar) diff --git a/test/mri/prism/fixtures/whitequark/args_star.txt b/test/mri/prism/fixtures/whitequark/args_star.txt new file mode 100644 index 00000000000..ce1e6f8465b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/args_star.txt @@ -0,0 +1,3 @@ +fun(*bar) + +fun(*bar, &baz) diff --git a/test/mri/prism/fixtures/whitequark/array_assocs.txt b/test/mri/prism/fixtures/whitequark/array_assocs.txt new file mode 100644 index 00000000000..fcecfcdefcc --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_assocs.txt @@ -0,0 +1,3 @@ +[ 1 => 2 ] + +[ 1, 2 => 3 ] diff --git a/test/mri/prism/fixtures/whitequark/array_plain.txt b/test/mri/prism/fixtures/whitequark/array_plain.txt new file mode 100644 index 00000000000..44e2ace7e54 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_plain.txt @@ -0,0 +1 @@ +[1, 2] diff --git a/test/mri/prism/fixtures/whitequark/array_splat.txt b/test/mri/prism/fixtures/whitequark/array_splat.txt new file mode 100644 index 00000000000..144c1eb1243 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_splat.txt @@ -0,0 +1,5 @@ +[*foo] + +[1, *foo, 2] + +[1, *foo] diff --git a/test/mri/prism/fixtures/whitequark/array_symbols.txt b/test/mri/prism/fixtures/whitequark/array_symbols.txt new file mode 100644 index 00000000000..a9f9df0404f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_symbols.txt @@ -0,0 +1 @@ +%i[foo bar] diff --git a/test/mri/prism/fixtures/whitequark/array_symbols_empty.txt b/test/mri/prism/fixtures/whitequark/array_symbols_empty.txt new file mode 100644 index 00000000000..da3a89ee9b0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_symbols_empty.txt @@ -0,0 +1,3 @@ +%I() + +%i[] diff --git a/test/mri/prism/fixtures/whitequark/array_symbols_interp.txt b/test/mri/prism/fixtures/whitequark/array_symbols_interp.txt new file mode 100644 index 00000000000..d4950d0c057 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_symbols_interp.txt @@ -0,0 +1,3 @@ +%I[foo #{bar}] + +%I[foo#{bar}] diff --git a/test/mri/prism/fixtures/whitequark/array_words.txt b/test/mri/prism/fixtures/whitequark/array_words.txt new file mode 100644 index 00000000000..a07380cadc8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_words.txt @@ -0,0 +1 @@ +%w[foo bar] diff --git a/test/mri/prism/fixtures/whitequark/array_words_empty.txt b/test/mri/prism/fixtures/whitequark/array_words_empty.txt new file mode 100644 index 00000000000..7568263f4a0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_words_empty.txt @@ -0,0 +1,3 @@ +%W() + +%w[] diff --git a/test/mri/prism/fixtures/whitequark/array_words_interp.txt b/test/mri/prism/fixtures/whitequark/array_words_interp.txt new file mode 100644 index 00000000000..1460f7dc034 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/array_words_interp.txt @@ -0,0 +1,3 @@ +%W[foo #{bar}] + +%W[foo #{bar}foo#@baz] diff --git a/test/mri/prism/fixtures/whitequark/asgn_cmd.txt b/test/mri/prism/fixtures/whitequark/asgn_cmd.txt new file mode 100644 index 00000000000..81f8cc1c8dd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/asgn_cmd.txt @@ -0,0 +1,3 @@ +foo = bar = m foo + +foo = m foo diff --git a/test/mri/prism/fixtures/whitequark/asgn_mrhs.txt b/test/mri/prism/fixtures/whitequark/asgn_mrhs.txt new file mode 100644 index 00000000000..f0b0055e556 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/asgn_mrhs.txt @@ -0,0 +1,5 @@ +foo = *bar + +foo = bar, 1 + +foo = baz, *bar diff --git a/test/mri/prism/fixtures/whitequark/back_ref.txt b/test/mri/prism/fixtures/whitequark/back_ref.txt new file mode 100644 index 00000000000..03166e10ee4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/back_ref.txt @@ -0,0 +1 @@ +$+ diff --git a/test/mri/prism/fixtures/whitequark/bang.txt b/test/mri/prism/fixtures/whitequark/bang.txt new file mode 100644 index 00000000000..6cf9410cf54 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bang.txt @@ -0,0 +1 @@ +!foo diff --git a/test/mri/prism/fixtures/whitequark/bang_cmd.txt b/test/mri/prism/fixtures/whitequark/bang_cmd.txt new file mode 100644 index 00000000000..0a5252c0018 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bang_cmd.txt @@ -0,0 +1 @@ +!m foo diff --git a/test/mri/prism/fixtures/whitequark/begin_cmdarg.txt b/test/mri/prism/fixtures/whitequark/begin_cmdarg.txt new file mode 100644 index 00000000000..a5873668e94 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/begin_cmdarg.txt @@ -0,0 +1 @@ +p begin 1.times do 1 end end diff --git a/test/mri/prism/fixtures/whitequark/beginless_erange_after_newline.txt b/test/mri/prism/fixtures/whitequark/beginless_erange_after_newline.txt new file mode 100644 index 00000000000..ae6c75564a0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/beginless_erange_after_newline.txt @@ -0,0 +1,2 @@ +foo +...100 diff --git a/test/mri/prism/fixtures/whitequark/beginless_irange_after_newline.txt b/test/mri/prism/fixtures/whitequark/beginless_irange_after_newline.txt new file mode 100644 index 00000000000..bfc8d5e5e89 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/beginless_irange_after_newline.txt @@ -0,0 +1,2 @@ +foo +..100 diff --git a/test/mri/prism/fixtures/whitequark/beginless_range.txt b/test/mri/prism/fixtures/whitequark/beginless_range.txt new file mode 100644 index 00000000000..ef52703b8a0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/beginless_range.txt @@ -0,0 +1,3 @@ +...100 + +..100 diff --git a/test/mri/prism/fixtures/whitequark/blockarg.txt b/test/mri/prism/fixtures/whitequark/blockarg.txt new file mode 100644 index 00000000000..63552e97be9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/blockarg.txt @@ -0,0 +1 @@ +def f(&block); end diff --git a/test/mri/prism/fixtures/whitequark/blockargs.txt b/test/mri/prism/fixtures/whitequark/blockargs.txt new file mode 100644 index 00000000000..cdd2c4f331a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/blockargs.txt @@ -0,0 +1,71 @@ +f{ } + +f{ | | } + +f{ |&b| } + +f{ |**baz, &b| } + +f{ |*, &b| } + +f{ |*r, p, &b| } + +f{ |*s, &b| } + +f{ |*s| } + +f{ |*| } + +f{ |; +a +| } + +f{ |;a| } + +f{ |a, &b| } + +f{ |a, *, &b| } + +f{ |a, *r, p, &b| } + +f{ |a, *s, &b| } + +f{ |a, *s| } + +f{ |a, *| } + +f{ |a, b,| } + +f{ |a, c| } + +f{ |a, o=1, &b| } + +f{ |a, o=1, *r, p, &b| } + +f{ |a, o=1, o1=2, *r, &b| } + +f{ |a, o=1, p, &b| } + +f{ |a,| } + +f{ |a| } + +f{ |a| } + +f{ |a| } + +f{ |foo: 1, &b| } + +f{ |foo: 1, bar: 2, **baz, &b| } + +f{ |foo:| } + +f{ |o=1, &b| } + +f{ |o=1, *r, &b| } + +f{ |o=1, *r, p, &b| } + +f{ |o=1, p, &b| } + +f{ || } diff --git a/test/mri/prism/fixtures/whitequark/break.txt b/test/mri/prism/fixtures/whitequark/break.txt new file mode 100644 index 00000000000..da51ec7c31e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/break.txt @@ -0,0 +1,7 @@ +break + +break foo + +break() + +break(foo) diff --git a/test/mri/prism/fixtures/whitequark/break_block.txt b/test/mri/prism/fixtures/whitequark/break_block.txt new file mode 100644 index 00000000000..4b58c58d5ea --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/break_block.txt @@ -0,0 +1 @@ +break fun foo do end diff --git a/test/mri/prism/fixtures/whitequark/bug_435.txt b/test/mri/prism/fixtures/whitequark/bug_435.txt new file mode 100644 index 00000000000..3e4e0d5abda --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_435.txt @@ -0,0 +1 @@ +"#{-> foo {}}" diff --git a/test/mri/prism/fixtures/whitequark/bug_447.txt b/test/mri/prism/fixtures/whitequark/bug_447.txt new file mode 100644 index 00000000000..7da59bbc2fd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_447.txt @@ -0,0 +1,3 @@ +m [] do end + +m [], 1 do end diff --git a/test/mri/prism/fixtures/whitequark/bug_452.txt b/test/mri/prism/fixtures/whitequark/bug_452.txt new file mode 100644 index 00000000000..8b41dd60275 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_452.txt @@ -0,0 +1 @@ +td (1_500).toString(); td.num do; end diff --git a/test/mri/prism/fixtures/whitequark/bug_466.txt b/test/mri/prism/fixtures/whitequark/bug_466.txt new file mode 100644 index 00000000000..ad02ad38aed --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_466.txt @@ -0,0 +1 @@ +foo "#{(1+1).to_i}" do; end diff --git a/test/mri/prism/fixtures/whitequark/bug_473.txt b/test/mri/prism/fixtures/whitequark/bug_473.txt new file mode 100644 index 00000000000..0d2ea883a15 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_473.txt @@ -0,0 +1 @@ +m "#{[]}" diff --git a/test/mri/prism/fixtures/whitequark/bug_480.txt b/test/mri/prism/fixtures/whitequark/bug_480.txt new file mode 100644 index 00000000000..0558b2c9576 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_480.txt @@ -0,0 +1 @@ +m "#{}#{()}" diff --git a/test/mri/prism/fixtures/whitequark/bug_481.txt b/test/mri/prism/fixtures/whitequark/bug_481.txt new file mode 100644 index 00000000000..6328e9dbbd6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_481.txt @@ -0,0 +1 @@ +m def x(); end; 1.tap do end diff --git a/test/mri/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt b/test/mri/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt new file mode 100644 index 00000000000..85399bd19a7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt @@ -0,0 +1,2 @@ +# coding:utf-8 + "\xD0\xBF\xD1\x80\xD0\xBE\xD0\xB2\xD0\xB5\xD1\x80\xD0\xBA\xD0\xB0" diff --git a/test/mri/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt b/test/mri/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt new file mode 100644 index 00000000000..7e9e54c5182 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt @@ -0,0 +1 @@ +desc "foo" do end diff --git a/test/mri/prism/fixtures/whitequark/bug_cmdarg.txt b/test/mri/prism/fixtures/whitequark/bug_cmdarg.txt new file mode 100644 index 00000000000..0281cd66683 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_cmdarg.txt @@ -0,0 +1,5 @@ +assert do: true + +assert dogs + +f x: -> do meth do end end diff --git a/test/mri/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt b/test/mri/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt new file mode 100644 index 00000000000..615dc882176 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt @@ -0,0 +1,4 @@ +def foo +=begin +=end +end diff --git a/test/mri/prism/fixtures/whitequark/bug_do_block_in_call_args.txt b/test/mri/prism/fixtures/whitequark/bug_do_block_in_call_args.txt new file mode 100644 index 00000000000..21340fd6e84 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_do_block_in_call_args.txt @@ -0,0 +1 @@ +bar def foo; self.each do end end diff --git a/test/mri/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt b/test/mri/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt new file mode 100644 index 00000000000..7dece50408e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt @@ -0,0 +1 @@ +tap (proc do end) diff --git a/test/mri/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt b/test/mri/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt new file mode 100644 index 00000000000..6c4dd205d2a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt @@ -0,0 +1,9 @@ +p :foo, {"a": proc do end, b: proc do end} + +p :foo, {** proc do end, b: proc do end} + +p :foo, {:a => proc do end, b: proc do end} + +p :foo, {a: proc do end, b: proc do end} + +p :foo, {proc do end => proc do end, b: proc do end} diff --git a/test/mri/prism/fixtures/whitequark/bug_heredoc_do.txt b/test/mri/prism/fixtures/whitequark/bug_heredoc_do.txt new file mode 100644 index 00000000000..06fef0a99fe --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_heredoc_do.txt @@ -0,0 +1,3 @@ +f <<-TABLE do +TABLE +end diff --git a/test/mri/prism/fixtures/whitequark/bug_interp_single.txt b/test/mri/prism/fixtures/whitequark/bug_interp_single.txt new file mode 100644 index 00000000000..be0b1a85424 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_interp_single.txt @@ -0,0 +1,3 @@ +"#{1}" + +%W"#{1}" diff --git a/test/mri/prism/fixtures/whitequark/bug_lambda_leakage.txt b/test/mri/prism/fixtures/whitequark/bug_lambda_leakage.txt new file mode 100644 index 00000000000..372b36929ae --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_lambda_leakage.txt @@ -0,0 +1 @@ +->(scope) {}; scope diff --git a/test/mri/prism/fixtures/whitequark/bug_regex_verification.txt b/test/mri/prism/fixtures/whitequark/bug_regex_verification.txt new file mode 100644 index 00000000000..f8483c8b10f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_regex_verification.txt @@ -0,0 +1 @@ +/#)/x diff --git a/test/mri/prism/fixtures/whitequark/bug_rescue_empty_else.txt b/test/mri/prism/fixtures/whitequark/bug_rescue_empty_else.txt new file mode 100644 index 00000000000..e8c81edc572 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_rescue_empty_else.txt @@ -0,0 +1 @@ +begin; rescue LoadError; else; end diff --git a/test/mri/prism/fixtures/whitequark/bug_while_not_parens_do.txt b/test/mri/prism/fixtures/whitequark/bug_while_not_parens_do.txt new file mode 100644 index 00000000000..628c36ef133 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/bug_while_not_parens_do.txt @@ -0,0 +1 @@ +while not (true) do end diff --git a/test/mri/prism/fixtures/whitequark/case_cond.txt b/test/mri/prism/fixtures/whitequark/case_cond.txt new file mode 100644 index 00000000000..a236b27ebd8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/case_cond.txt @@ -0,0 +1 @@ +case; when foo; 'foo'; end diff --git a/test/mri/prism/fixtures/whitequark/case_cond_else.txt b/test/mri/prism/fixtures/whitequark/case_cond_else.txt new file mode 100644 index 00000000000..06eefa4a1be --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/case_cond_else.txt @@ -0,0 +1 @@ +case; when foo; 'foo'; else 'bar'; end diff --git a/test/mri/prism/fixtures/whitequark/case_expr.txt b/test/mri/prism/fixtures/whitequark/case_expr.txt new file mode 100644 index 00000000000..472672c781b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/case_expr.txt @@ -0,0 +1 @@ +case foo; when 'bar'; bar; end diff --git a/test/mri/prism/fixtures/whitequark/case_expr_else.txt b/test/mri/prism/fixtures/whitequark/case_expr_else.txt new file mode 100644 index 00000000000..3c558261341 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/case_expr_else.txt @@ -0,0 +1 @@ +case foo; when 'bar'; bar; else baz; end diff --git a/test/mri/prism/fixtures/whitequark/casgn_scoped.txt b/test/mri/prism/fixtures/whitequark/casgn_scoped.txt new file mode 100644 index 00000000000..964d0f4c9b4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/casgn_scoped.txt @@ -0,0 +1 @@ +Bar::Foo = 10 diff --git a/test/mri/prism/fixtures/whitequark/casgn_toplevel.txt b/test/mri/prism/fixtures/whitequark/casgn_toplevel.txt new file mode 100644 index 00000000000..047a3b67457 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/casgn_toplevel.txt @@ -0,0 +1 @@ +::Foo = 10 diff --git a/test/mri/prism/fixtures/whitequark/casgn_unscoped.txt b/test/mri/prism/fixtures/whitequark/casgn_unscoped.txt new file mode 100644 index 00000000000..5632cf64ee3 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/casgn_unscoped.txt @@ -0,0 +1 @@ +Foo = 10 diff --git a/test/mri/prism/fixtures/whitequark/character.txt b/test/mri/prism/fixtures/whitequark/character.txt new file mode 100644 index 00000000000..b22ffbb71a7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/character.txt @@ -0,0 +1 @@ +?a diff --git a/test/mri/prism/fixtures/whitequark/class.txt b/test/mri/prism/fixtures/whitequark/class.txt new file mode 100644 index 00000000000..a30a248e96d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/class.txt @@ -0,0 +1,3 @@ +class Foo end + +class Foo; end diff --git a/test/mri/prism/fixtures/whitequark/class_definition_in_while_cond.txt b/test/mri/prism/fixtures/whitequark/class_definition_in_while_cond.txt new file mode 100644 index 00000000000..10427314b59 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/class_definition_in_while_cond.txt @@ -0,0 +1,7 @@ +while class << self; a = tap do end; end; break; end + +while class << self; tap do end; end; break; end + +while class Foo a = tap do end; end; break; end + +while class Foo; tap do end; end; break; end diff --git a/test/mri/prism/fixtures/whitequark/class_super.txt b/test/mri/prism/fixtures/whitequark/class_super.txt new file mode 100644 index 00000000000..8829d82d36b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/class_super.txt @@ -0,0 +1 @@ +class Foo < Bar; end diff --git a/test/mri/prism/fixtures/whitequark/class_super_label.txt b/test/mri/prism/fixtures/whitequark/class_super_label.txt new file mode 100644 index 00000000000..5d47897ab66 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/class_super_label.txt @@ -0,0 +1 @@ +class Foo < a:b; end diff --git a/test/mri/prism/fixtures/whitequark/comments_before_leading_dot__27.txt b/test/mri/prism/fixtures/whitequark/comments_before_leading_dot__27.txt new file mode 100644 index 00000000000..208f2d87fe5 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/comments_before_leading_dot__27.txt @@ -0,0 +1,19 @@ +a # + # +&.foo + + +a # + # +.foo + + +a # +# +&.foo + + +a # +# +.foo + diff --git a/test/mri/prism/fixtures/whitequark/complex.txt b/test/mri/prism/fixtures/whitequark/complex.txt new file mode 100644 index 00000000000..1dbf2c13f4b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/complex.txt @@ -0,0 +1,7 @@ +42.1i + +42.1ri + +42i + +42ri diff --git a/test/mri/prism/fixtures/whitequark/cond_begin.txt b/test/mri/prism/fixtures/whitequark/cond_begin.txt new file mode 100644 index 00000000000..49d709b79ca --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cond_begin.txt @@ -0,0 +1 @@ +if (bar); foo; end diff --git a/test/mri/prism/fixtures/whitequark/cond_begin_masgn.txt b/test/mri/prism/fixtures/whitequark/cond_begin_masgn.txt new file mode 100644 index 00000000000..f9b65026b4d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cond_begin_masgn.txt @@ -0,0 +1 @@ +if (bar; a, b = foo); end diff --git a/test/mri/prism/fixtures/whitequark/cond_eflipflop.txt b/test/mri/prism/fixtures/whitequark/cond_eflipflop.txt new file mode 100644 index 00000000000..1236c2dbb59 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cond_eflipflop.txt @@ -0,0 +1,3 @@ +!(foo...bar) + +if foo...bar; end diff --git a/test/mri/prism/fixtures/whitequark/cond_iflipflop.txt b/test/mri/prism/fixtures/whitequark/cond_iflipflop.txt new file mode 100644 index 00000000000..84bee71a74b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cond_iflipflop.txt @@ -0,0 +1,3 @@ +!(foo..bar) + +if foo..bar; end diff --git a/test/mri/prism/fixtures/whitequark/cond_match_current_line.txt b/test/mri/prism/fixtures/whitequark/cond_match_current_line.txt new file mode 100644 index 00000000000..21878c7bd88 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cond_match_current_line.txt @@ -0,0 +1,3 @@ +!/wat/ + +if /wat/; end diff --git a/test/mri/prism/fixtures/whitequark/const_op_asgn.txt b/test/mri/prism/fixtures/whitequark/const_op_asgn.txt new file mode 100644 index 00000000000..e72e7adee8c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/const_op_asgn.txt @@ -0,0 +1,9 @@ +::A += 1 + +A += 1 + +B::A += 1 + +def x; ::A ||= 1; end + +def x; self::A ||= 1; end diff --git a/test/mri/prism/fixtures/whitequark/const_scoped.txt b/test/mri/prism/fixtures/whitequark/const_scoped.txt new file mode 100644 index 00000000000..4b03d85fc07 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/const_scoped.txt @@ -0,0 +1 @@ +Bar::Foo diff --git a/test/mri/prism/fixtures/whitequark/const_toplevel.txt b/test/mri/prism/fixtures/whitequark/const_toplevel.txt new file mode 100644 index 00000000000..f783ae752bf --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/const_toplevel.txt @@ -0,0 +1 @@ +::Foo diff --git a/test/mri/prism/fixtures/whitequark/const_unscoped.txt b/test/mri/prism/fixtures/whitequark/const_unscoped.txt new file mode 100644 index 00000000000..bc56c4d8944 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/const_unscoped.txt @@ -0,0 +1 @@ +Foo diff --git a/test/mri/prism/fixtures/whitequark/cpath.txt b/test/mri/prism/fixtures/whitequark/cpath.txt new file mode 100644 index 00000000000..a4041692d1f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cpath.txt @@ -0,0 +1,3 @@ +module ::Foo; end + +module Bar::Foo; end diff --git a/test/mri/prism/fixtures/whitequark/cvar.txt b/test/mri/prism/fixtures/whitequark/cvar.txt new file mode 100644 index 00000000000..4997896e4a9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cvar.txt @@ -0,0 +1 @@ +@@foo diff --git a/test/mri/prism/fixtures/whitequark/cvasgn.txt b/test/mri/prism/fixtures/whitequark/cvasgn.txt new file mode 100644 index 00000000000..8f7e19c4fed --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/cvasgn.txt @@ -0,0 +1 @@ +@@var = 10 diff --git a/test/mri/prism/fixtures/whitequark/dedenting_heredoc.txt b/test/mri/prism/fixtures/whitequark/dedenting_heredoc.txt new file mode 100644 index 00000000000..84937d84abf --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/dedenting_heredoc.txt @@ -0,0 +1,75 @@ +p <<~"E" + x + #{" y"} +E + +p <<~"E" + x + #{foo} +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + \ y +E + +p <<~E + x + \ y +E + +p <<~E + E + +p <<~E + x + +y +E + +p <<~E + x + + y +E + +p <<~E + x + y +E + +p <<~E + x +E + +p <<~E + ð +E + +p <<~E +E + +p <<~`E` + x + #{foo} +E diff --git a/test/mri/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt b/test/mri/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt new file mode 100644 index 00000000000..0427715d612 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt @@ -0,0 +1,4 @@ +<<~'FOO' + baz\\ + qux +FOO diff --git a/test/mri/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt b/test/mri/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt new file mode 100644 index 00000000000..fd7bc024191 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt @@ -0,0 +1,4 @@ +<<~'FOO' + baz\ + qux +FOO diff --git a/test/mri/prism/fixtures/whitequark/def.txt b/test/mri/prism/fixtures/whitequark/def.txt new file mode 100644 index 00000000000..d96a4238b3b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/def.txt @@ -0,0 +1,11 @@ +def BEGIN; end + +def END; end + +def String; end + +def String=; end + +def foo; end + +def until; end diff --git a/test/mri/prism/fixtures/whitequark/defined.txt b/test/mri/prism/fixtures/whitequark/defined.txt new file mode 100644 index 00000000000..5cf93e22e3f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/defined.txt @@ -0,0 +1,5 @@ +defined? @foo + +defined? foo + +defined?(foo) diff --git a/test/mri/prism/fixtures/whitequark/defs.txt b/test/mri/prism/fixtures/whitequark/defs.txt new file mode 100644 index 00000000000..e0b7aa86eb3 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/defs.txt @@ -0,0 +1,9 @@ +def (foo).foo; end + +def String.foo; end + +def String::foo; end + +def self.foo; end + +def self::foo; end diff --git a/test/mri/prism/fixtures/whitequark/empty_stmt.txt b/test/mri/prism/fixtures/whitequark/empty_stmt.txt new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/empty_stmt.txt @@ -0,0 +1 @@ + diff --git a/test/mri/prism/fixtures/whitequark/endless_comparison_method.txt b/test/mri/prism/fixtures/whitequark/endless_comparison_method.txt new file mode 100644 index 00000000000..e10c3a6ced6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_comparison_method.txt @@ -0,0 +1,11 @@ +def !=(other) = do_something + +def !=(other) = do_something + +def <=(other) = do_something + +def ==(other) = do_something + +def ===(other) = do_something + +def >=(other) = do_something diff --git a/test/mri/prism/fixtures/whitequark/endless_method.txt b/test/mri/prism/fixtures/whitequark/endless_method.txt new file mode 100644 index 00000000000..70025262293 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_method.txt @@ -0,0 +1,7 @@ +def foo() = 42 + +def inc(x) = x + 1 + +def obj.foo() = 42 + +def obj.inc(x) = x + 1 diff --git a/test/mri/prism/fixtures/whitequark/endless_method_command_syntax.txt b/test/mri/prism/fixtures/whitequark/endless_method_command_syntax.txt new file mode 100644 index 00000000000..d9dad2d7476 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_method_command_syntax.txt @@ -0,0 +1,15 @@ +def foo = puts "Hello" + +def foo() = puts "Hello" + +def foo(x) = puts x + +def obj.foo = puts "Hello" + +def obj.foo() = puts "Hello" + +def obj.foo(x) = puts x + +def rescued(x) = raise "to be caught" rescue "instance #{x}" + +def self.rescued(x) = raise "to be caught" rescue "class #{x}" diff --git a/test/mri/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt b/test/mri/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt new file mode 100644 index 00000000000..5955e40b5b9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt @@ -0,0 +1 @@ +def foo(...) = bar(...) diff --git a/test/mri/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt b/test/mri/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt new file mode 100644 index 00000000000..93dc63a45d9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt @@ -0,0 +1,3 @@ +def m() = 1 rescue 2 + +def self.m() = 1 rescue 2 diff --git a/test/mri/prism/fixtures/whitequark/endless_method_without_args.txt b/test/mri/prism/fixtures/whitequark/endless_method_without_args.txt new file mode 100644 index 00000000000..90ea8f7c6dd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/endless_method_without_args.txt @@ -0,0 +1,7 @@ +def foo = 42 + +def foo = 42 rescue nil + +def self.foo = 42 + +def self.foo = 42 rescue nil diff --git a/test/mri/prism/fixtures/whitequark/ensure.txt b/test/mri/prism/fixtures/whitequark/ensure.txt new file mode 100644 index 00000000000..6c4b47c63c1 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ensure.txt @@ -0,0 +1 @@ +begin; meth; ensure; bar; end diff --git a/test/mri/prism/fixtures/whitequark/ensure_empty.txt b/test/mri/prism/fixtures/whitequark/ensure_empty.txt new file mode 100644 index 00000000000..39a175c371f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ensure_empty.txt @@ -0,0 +1 @@ +begin ensure end diff --git a/test/mri/prism/fixtures/whitequark/false.txt b/test/mri/prism/fixtures/whitequark/false.txt new file mode 100644 index 00000000000..c508d5366f7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/false.txt @@ -0,0 +1 @@ +false diff --git a/test/mri/prism/fixtures/whitequark/float.txt b/test/mri/prism/fixtures/whitequark/float.txt new file mode 100644 index 00000000000..8c7592a192f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/float.txt @@ -0,0 +1,3 @@ +-1.33 + +1.33 diff --git a/test/mri/prism/fixtures/whitequark/for.txt b/test/mri/prism/fixtures/whitequark/for.txt new file mode 100644 index 00000000000..a27ae578da6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/for.txt @@ -0,0 +1,3 @@ +for a in foo do p a; end + +for a in foo; p a; end diff --git a/test/mri/prism/fixtures/whitequark/for_mlhs.txt b/test/mri/prism/fixtures/whitequark/for_mlhs.txt new file mode 100644 index 00000000000..53cd5229a4e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/for_mlhs.txt @@ -0,0 +1 @@ +for a, b in foo; p a, b; end diff --git a/test/mri/prism/fixtures/whitequark/forward_arg.txt b/test/mri/prism/fixtures/whitequark/forward_arg.txt new file mode 100644 index 00000000000..c7590a8d531 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forward_arg.txt @@ -0,0 +1 @@ +def foo(...); bar(...); end diff --git a/test/mri/prism/fixtures/whitequark/forward_arg_with_open_args.txt b/test/mri/prism/fixtures/whitequark/forward_arg_with_open_args.txt new file mode 100644 index 00000000000..fd4c06bcb5a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forward_arg_with_open_args.txt @@ -0,0 +1,27 @@ +(def foo ... + bar(...) +end) + +(def foo ...; bar(...); end) + +def foo ... +end + +def foo ...; bar(...); end + +def foo a, ... + bar(...) +end + +def foo a, ...; bar(...); end + +def foo a, b = 1, ... +end + +def foo b = 1, ... + bar(...) +end + +def foo b = 1, ...; bar(...); end + +def foo(a, ...) bar(...) end diff --git a/test/mri/prism/fixtures/whitequark/forward_args_legacy.txt b/test/mri/prism/fixtures/whitequark/forward_args_legacy.txt new file mode 100644 index 00000000000..0d9162457fb --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forward_args_legacy.txt @@ -0,0 +1,5 @@ +def foo(...); bar(...); end + +def foo(...); end + +def foo(...); super(...); end diff --git a/test/mri/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt b/test/mri/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt new file mode 100644 index 00000000000..7dbf472232e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt @@ -0,0 +1 @@ +def foo(argument, **); bar(argument, **); end diff --git a/test/mri/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt b/test/mri/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt new file mode 100644 index 00000000000..f734bfd9ec5 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt @@ -0,0 +1 @@ +def foo(argument, *); bar(argument, *); end diff --git a/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg.txt b/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg.txt new file mode 100644 index 00000000000..16cd8b29139 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg.txt @@ -0,0 +1 @@ +def foo(**); bar(**); end diff --git a/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt b/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt new file mode 100644 index 00000000000..52759b838fd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt @@ -0,0 +1 @@ +def foo(**); bar(**, from_foo: true); end diff --git a/test/mri/prism/fixtures/whitequark/forwarded_restarg.txt b/test/mri/prism/fixtures/whitequark/forwarded_restarg.txt new file mode 100644 index 00000000000..65ac2cc1ed8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/forwarded_restarg.txt @@ -0,0 +1 @@ +def foo(*); bar(*); end diff --git a/test/mri/prism/fixtures/whitequark/gvar.txt b/test/mri/prism/fixtures/whitequark/gvar.txt new file mode 100644 index 00000000000..bbf13489adc --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/gvar.txt @@ -0,0 +1 @@ +$foo diff --git a/test/mri/prism/fixtures/whitequark/gvasgn.txt b/test/mri/prism/fixtures/whitequark/gvasgn.txt new file mode 100644 index 00000000000..2bcc22cdd10 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/gvasgn.txt @@ -0,0 +1 @@ +$var = 10 diff --git a/test/mri/prism/fixtures/whitequark/hash_empty.txt b/test/mri/prism/fixtures/whitequark/hash_empty.txt new file mode 100644 index 00000000000..ffcd4415b08 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_empty.txt @@ -0,0 +1 @@ +{ } diff --git a/test/mri/prism/fixtures/whitequark/hash_hashrocket.txt b/test/mri/prism/fixtures/whitequark/hash_hashrocket.txt new file mode 100644 index 00000000000..2cbb3bd96d1 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_hashrocket.txt @@ -0,0 +1,3 @@ +{ 1 => 2 } + +{ 1 => 2, :foo => "bar" } diff --git a/test/mri/prism/fixtures/whitequark/hash_kwsplat.txt b/test/mri/prism/fixtures/whitequark/hash_kwsplat.txt new file mode 100644 index 00000000000..921aa97c7c3 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_kwsplat.txt @@ -0,0 +1 @@ +{ foo: 2, **bar } diff --git a/test/mri/prism/fixtures/whitequark/hash_label.txt b/test/mri/prism/fixtures/whitequark/hash_label.txt new file mode 100644 index 00000000000..3aacae4b699 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_label.txt @@ -0,0 +1 @@ +{ foo: 2 } diff --git a/test/mri/prism/fixtures/whitequark/hash_label_end.txt b/test/mri/prism/fixtures/whitequark/hash_label_end.txt new file mode 100644 index 00000000000..ac9f7c4b413 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_label_end.txt @@ -0,0 +1,5 @@ +f(a ? "a":1) + +{ 'foo': 2 } + +{ 'foo': 2, 'bar': {}} diff --git a/test/mri/prism/fixtures/whitequark/hash_pair_value_omission.txt b/test/mri/prism/fixtures/whitequark/hash_pair_value_omission.txt new file mode 100644 index 00000000000..9d8ccb58774 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/hash_pair_value_omission.txt @@ -0,0 +1,5 @@ +{BAR:} + +{a:, b:} + +{puts:} diff --git a/test/mri/prism/fixtures/whitequark/heredoc.txt b/test/mri/prism/fixtures/whitequark/heredoc.txt new file mode 100644 index 00000000000..1bfc963f948 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/heredoc.txt @@ -0,0 +1,14 @@ +<<'HERE' +foo +bar +HERE + +<(**nil) {} + +def f(**nil); end + +m { |**nil| } diff --git a/test/mri/prism/fixtures/whitequark/kwoptarg.txt b/test/mri/prism/fixtures/whitequark/kwoptarg.txt new file mode 100644 index 00000000000..dc3ce728d65 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/kwoptarg.txt @@ -0,0 +1 @@ +def f(foo: 1); end diff --git a/test/mri/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt b/test/mri/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt new file mode 100644 index 00000000000..99dcc7239b2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt @@ -0,0 +1 @@ +def f(a: nil, **); b(**) end diff --git a/test/mri/prism/fixtures/whitequark/kwrestarg_named.txt b/test/mri/prism/fixtures/whitequark/kwrestarg_named.txt new file mode 100644 index 00000000000..e17a661001f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/kwrestarg_named.txt @@ -0,0 +1 @@ +def f(**foo); end diff --git a/test/mri/prism/fixtures/whitequark/kwrestarg_unnamed.txt b/test/mri/prism/fixtures/whitequark/kwrestarg_unnamed.txt new file mode 100644 index 00000000000..1b26b1d2acd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/kwrestarg_unnamed.txt @@ -0,0 +1 @@ +def f(**); end diff --git a/test/mri/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt b/test/mri/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt new file mode 100644 index 00000000000..277c200c9fc --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt @@ -0,0 +1 @@ +let (:a) { m do; end } diff --git a/test/mri/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt b/test/mri/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt new file mode 100644 index 00000000000..dc3a98b1c87 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt @@ -0,0 +1,3 @@ +foo (-1.3).abs + +meth (-1.3).abs diff --git a/test/mri/prism/fixtures/whitequark/lvar.txt b/test/mri/prism/fixtures/whitequark/lvar.txt new file mode 100644 index 00000000000..257cc5642cb --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/lvar.txt @@ -0,0 +1 @@ +foo diff --git a/test/mri/prism/fixtures/whitequark/lvar_injecting_match.txt b/test/mri/prism/fixtures/whitequark/lvar_injecting_match.txt new file mode 100644 index 00000000000..ba814a1088a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/lvar_injecting_match.txt @@ -0,0 +1 @@ +/(?bar)/ =~ 'bar'; match diff --git a/test/mri/prism/fixtures/whitequark/lvasgn.txt b/test/mri/prism/fixtures/whitequark/lvasgn.txt new file mode 100644 index 00000000000..330b8eff27c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/lvasgn.txt @@ -0,0 +1 @@ +var = 10; var diff --git a/test/mri/prism/fixtures/whitequark/masgn.txt b/test/mri/prism/fixtures/whitequark/masgn.txt new file mode 100644 index 00000000000..032124287cc --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn.txt @@ -0,0 +1,5 @@ +(foo, bar) = 1, 2 + +foo, bar = 1, 2 + +foo, bar, baz = 1, 2 diff --git a/test/mri/prism/fixtures/whitequark/masgn_attr.txt b/test/mri/prism/fixtures/whitequark/masgn_attr.txt new file mode 100644 index 00000000000..91a703ef44c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn_attr.txt @@ -0,0 +1,5 @@ +self.A, foo = foo + +self.a, self[1, 2] = foo + +self::a, foo = foo diff --git a/test/mri/prism/fixtures/whitequark/masgn_cmd.txt b/test/mri/prism/fixtures/whitequark/masgn_cmd.txt new file mode 100644 index 00000000000..18e096f1ee2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn_cmd.txt @@ -0,0 +1 @@ +foo, bar = m foo diff --git a/test/mri/prism/fixtures/whitequark/masgn_const.txt b/test/mri/prism/fixtures/whitequark/masgn_const.txt new file mode 100644 index 00000000000..3b6fba588a8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn_const.txt @@ -0,0 +1,3 @@ +::A, foo = foo + +self::A, foo = foo diff --git a/test/mri/prism/fixtures/whitequark/masgn_nested.txt b/test/mri/prism/fixtures/whitequark/masgn_nested.txt new file mode 100644 index 00000000000..a1ccf4e385e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn_nested.txt @@ -0,0 +1,3 @@ +((b, )) = foo + +a, (b, c) = foo diff --git a/test/mri/prism/fixtures/whitequark/masgn_splat.txt b/test/mri/prism/fixtures/whitequark/masgn_splat.txt new file mode 100644 index 00000000000..a15dab10f20 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/masgn_splat.txt @@ -0,0 +1,19 @@ +* = bar + +*, c, d = bar + +*b = bar + +*b, c = bar + +@foo, @@bar = *foo + +a, * = bar + +a, *, c = bar + +a, *b = bar + +a, *b, c = bar + +a, b = *foo, bar diff --git a/test/mri/prism/fixtures/whitequark/method_definition_in_while_cond.txt b/test/mri/prism/fixtures/whitequark/method_definition_in_while_cond.txt new file mode 100644 index 00000000000..6ec38906a1e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/method_definition_in_while_cond.txt @@ -0,0 +1,7 @@ +while def foo a = tap do end; end; break; end + +while def foo; tap do end; end; break; end + +while def self.foo a = tap do end; end; break; end + +while def self.foo; tap do end; end; break; end diff --git a/test/mri/prism/fixtures/whitequark/module.txt b/test/mri/prism/fixtures/whitequark/module.txt new file mode 100644 index 00000000000..f999df37919 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/module.txt @@ -0,0 +1 @@ +module Foo; end diff --git a/test/mri/prism/fixtures/whitequark/multiple_pattern_matches.txt b/test/mri/prism/fixtures/whitequark/multiple_pattern_matches.txt new file mode 100644 index 00000000000..54a4bb4774b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/multiple_pattern_matches.txt @@ -0,0 +1,5 @@ +{a: 0} => a: +{a: 0} => a: + +{a: 0} in a: +{a: 0} in a: diff --git a/test/mri/prism/fixtures/whitequark/newline_in_hash_argument.txt b/test/mri/prism/fixtures/whitequark/newline_in_hash_argument.txt new file mode 100644 index 00000000000..16818443315 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/newline_in_hash_argument.txt @@ -0,0 +1,14 @@ +case foo +in a: +0 +true +in "b": +0 +true +end + +obj.set "foo": +1 + +obj.set foo: +1 diff --git a/test/mri/prism/fixtures/whitequark/next.txt b/test/mri/prism/fixtures/whitequark/next.txt new file mode 100644 index 00000000000..7556ac2b74b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/next.txt @@ -0,0 +1,7 @@ +next + +next foo + +next() + +next(foo) diff --git a/test/mri/prism/fixtures/whitequark/next_block.txt b/test/mri/prism/fixtures/whitequark/next_block.txt new file mode 100644 index 00000000000..d3b51dfa218 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/next_block.txt @@ -0,0 +1 @@ +next fun foo do end diff --git a/test/mri/prism/fixtures/whitequark/nil.txt b/test/mri/prism/fixtures/whitequark/nil.txt new file mode 100644 index 00000000000..607602cfc6e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/nil.txt @@ -0,0 +1 @@ +nil diff --git a/test/mri/prism/fixtures/whitequark/nil_expression.txt b/test/mri/prism/fixtures/whitequark/nil_expression.txt new file mode 100644 index 00000000000..aabf53f0052 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/nil_expression.txt @@ -0,0 +1,3 @@ +() + +begin end diff --git a/test/mri/prism/fixtures/whitequark/non_lvar_injecting_match.txt b/test/mri/prism/fixtures/whitequark/non_lvar_injecting_match.txt new file mode 100644 index 00000000000..f1eb7d3c2ce --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/non_lvar_injecting_match.txt @@ -0,0 +1 @@ +/#{1}(?bar)/ =~ 'bar' diff --git a/test/mri/prism/fixtures/whitequark/not.txt b/test/mri/prism/fixtures/whitequark/not.txt new file mode 100644 index 00000000000..d87f68f48c4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/not.txt @@ -0,0 +1,5 @@ +not foo + +not() + +not(foo) diff --git a/test/mri/prism/fixtures/whitequark/not_cmd.txt b/test/mri/prism/fixtures/whitequark/not_cmd.txt new file mode 100644 index 00000000000..685ec209eec --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/not_cmd.txt @@ -0,0 +1 @@ +not m foo diff --git a/test/mri/prism/fixtures/whitequark/not_masgn__24.txt b/test/mri/prism/fixtures/whitequark/not_masgn__24.txt new file mode 100644 index 00000000000..cb93b9103d2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/not_masgn__24.txt @@ -0,0 +1 @@ +!(a, b = foo) diff --git a/test/mri/prism/fixtures/whitequark/nth_ref.txt b/test/mri/prism/fixtures/whitequark/nth_ref.txt new file mode 100644 index 00000000000..16ef65b1050 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/nth_ref.txt @@ -0,0 +1 @@ +$10 diff --git a/test/mri/prism/fixtures/whitequark/numbered_args_after_27.txt b/test/mri/prism/fixtures/whitequark/numbered_args_after_27.txt new file mode 100644 index 00000000000..96fe7a32e25 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/numbered_args_after_27.txt @@ -0,0 +1,7 @@ +-> do _1 + _9 end + +-> { _1 + _9} + +m do _1 + _9 end + +m { _1 + _9 } diff --git a/test/mri/prism/fixtures/whitequark/numparam_outside_block.txt b/test/mri/prism/fixtures/whitequark/numparam_outside_block.txt new file mode 100644 index 00000000000..37cbce182d1 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/numparam_outside_block.txt @@ -0,0 +1,9 @@ +_1 + +class << foo; _1; end + +class A; _1; end + +def self.m; _1; end + +module A; _1; end diff --git a/test/mri/prism/fixtures/whitequark/op_asgn.txt b/test/mri/prism/fixtures/whitequark/op_asgn.txt new file mode 100644 index 00000000000..a5a28b10106 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/op_asgn.txt @@ -0,0 +1,5 @@ +foo.A += 1 + +foo.a += 1 + +foo::a += 1 diff --git a/test/mri/prism/fixtures/whitequark/op_asgn_cmd.txt b/test/mri/prism/fixtures/whitequark/op_asgn_cmd.txt new file mode 100644 index 00000000000..017aa9bef72 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/op_asgn_cmd.txt @@ -0,0 +1,7 @@ +foo.A += m foo + +foo.a += m foo + +foo::A += m foo + +foo::a += m foo diff --git a/test/mri/prism/fixtures/whitequark/op_asgn_index.txt b/test/mri/prism/fixtures/whitequark/op_asgn_index.txt new file mode 100644 index 00000000000..92cfb225fc9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/op_asgn_index.txt @@ -0,0 +1 @@ +foo[0, 1] += 2 diff --git a/test/mri/prism/fixtures/whitequark/op_asgn_index_cmd.txt b/test/mri/prism/fixtures/whitequark/op_asgn_index_cmd.txt new file mode 100644 index 00000000000..161b244bd46 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/op_asgn_index_cmd.txt @@ -0,0 +1 @@ +foo[0, 1] += m foo diff --git a/test/mri/prism/fixtures/whitequark/optarg.txt b/test/mri/prism/fixtures/whitequark/optarg.txt new file mode 100644 index 00000000000..9d60609961f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/optarg.txt @@ -0,0 +1,3 @@ +def f foo = 1; end + +def f(foo=1, bar=2); end diff --git a/test/mri/prism/fixtures/whitequark/or.txt b/test/mri/prism/fixtures/whitequark/or.txt new file mode 100644 index 00000000000..c2042ebb418 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/or.txt @@ -0,0 +1,3 @@ +foo or bar + +foo || bar diff --git a/test/mri/prism/fixtures/whitequark/or_asgn.txt b/test/mri/prism/fixtures/whitequark/or_asgn.txt new file mode 100644 index 00000000000..6e4ecc9f933 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/or_asgn.txt @@ -0,0 +1,3 @@ +foo.a ||= 1 + +foo[0, 1] ||= 2 diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_272.txt b/test/mri/prism/fixtures/whitequark/parser_bug_272.txt new file mode 100644 index 00000000000..2f2f2b84d29 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_272.txt @@ -0,0 +1 @@ +a @b do |c|;end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_490.txt b/test/mri/prism/fixtures/whitequark/parser_bug_490.txt new file mode 100644 index 00000000000..cf544b1ff64 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_490.txt @@ -0,0 +1,5 @@ +def m; class << self; A = nil; end; end + +def m; class << self; class C; end; end; end + +def m; class << self; module M; end; end; end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_507.txt b/test/mri/prism/fixtures/whitequark/parser_bug_507.txt new file mode 100644 index 00000000000..bf616b85c8f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_507.txt @@ -0,0 +1 @@ +m = -> *args do end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_518.txt b/test/mri/prism/fixtures/whitequark/parser_bug_518.txt new file mode 100644 index 00000000000..22f4afe3c8f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_518.txt @@ -0,0 +1,2 @@ +class A < B +end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_525.txt b/test/mri/prism/fixtures/whitequark/parser_bug_525.txt new file mode 100644 index 00000000000..59d0e735b40 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_525.txt @@ -0,0 +1 @@ +m1 :k => m2 do; m3() do end; end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_604.txt b/test/mri/prism/fixtures/whitequark/parser_bug_604.txt new file mode 100644 index 00000000000..7eb91c2f469 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_604.txt @@ -0,0 +1 @@ +m a + b do end diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_640.txt b/test/mri/prism/fixtures/whitequark/parser_bug_640.txt new file mode 100644 index 00000000000..fb62ded04c4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_640.txt @@ -0,0 +1,4 @@ +<<~FOO + baz\ + qux +FOO diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_645.txt b/test/mri/prism/fixtures/whitequark/parser_bug_645.txt new file mode 100644 index 00000000000..cb1e5a0dcf7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_645.txt @@ -0,0 +1 @@ +-> (arg={}) {} diff --git a/test/mri/prism/fixtures/whitequark/parser_bug_830.txt b/test/mri/prism/fixtures/whitequark/parser_bug_830.txt new file mode 100644 index 00000000000..e5865e960d9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_bug_830.txt @@ -0,0 +1 @@ +/\(/ diff --git a/test/mri/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt b/test/mri/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt new file mode 100644 index 00000000000..bddae8e153d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt @@ -0,0 +1,3 @@ +<<~HERE + #{} +HERE diff --git a/test/mri/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt b/test/mri/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt new file mode 100644 index 00000000000..564cebdd74b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt @@ -0,0 +1,62 @@ +"a\ +b" + +%I{a\ +b} + +%Q{a\ +b} + +%W{a\ +b} + +%i{a\ +b} + +%q{a\ +b} + +%r{a\ +b} + +%s{a\ +b} + +%w{a\ +b} + +%x{a\ +b} + +%{a\ +b} + +'a\ +b' + +/a\ +b/ + +:"a\ +b" + +:'a\ +b' + +<<-"HERE" +a\ +b +HERE + +<<-'HERE' +a\ +b +HERE + +<<-`HERE` +a\ +b +HERE + +`a\ +b` diff --git a/test/mri/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt b/test/mri/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt new file mode 100644 index 00000000000..fe0edaed55e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt @@ -0,0 +1,4 @@ + case [__FILE__, __LINE__ + 1, __ENCODING__] + in [__FILE__, __LINE__, __ENCODING__] + end + diff --git a/test/mri/prism/fixtures/whitequark/pattern_matching_blank_else.txt b/test/mri/prism/fixtures/whitequark/pattern_matching_blank_else.txt new file mode 100644 index 00000000000..6bf059af41c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/pattern_matching_blank_else.txt @@ -0,0 +1 @@ +case 1; in 2; 3; else; end diff --git a/test/mri/prism/fixtures/whitequark/pattern_matching_else.txt b/test/mri/prism/fixtures/whitequark/pattern_matching_else.txt new file mode 100644 index 00000000000..29f14c91abd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/pattern_matching_else.txt @@ -0,0 +1 @@ +case 1; in 2; 3; else; 4; end diff --git a/test/mri/prism/fixtures/whitequark/pattern_matching_single_line.txt b/test/mri/prism/fixtures/whitequark/pattern_matching_single_line.txt new file mode 100644 index 00000000000..12279afa248 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/pattern_matching_single_line.txt @@ -0,0 +1,3 @@ +1 => [a]; a + +1 in [a]; a diff --git a/test/mri/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt b/test/mri/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt new file mode 100644 index 00000000000..1e429335d06 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt @@ -0,0 +1,11 @@ +[1, 2] => a, b; a + +[1, 2] in a, b; a + +{a: 1} => a:; a + +{a: 1} in a:; a + +{key: :value} => key: value; value + +{key: :value} in key: value; value diff --git a/test/mri/prism/fixtures/whitequark/postexe.txt b/test/mri/prism/fixtures/whitequark/postexe.txt new file mode 100644 index 00000000000..baee33af665 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/postexe.txt @@ -0,0 +1 @@ +END { 1 } diff --git a/test/mri/prism/fixtures/whitequark/preexe.txt b/test/mri/prism/fixtures/whitequark/preexe.txt new file mode 100644 index 00000000000..9e802f3f4e2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/preexe.txt @@ -0,0 +1 @@ +BEGIN { 1 } diff --git a/test/mri/prism/fixtures/whitequark/procarg0.txt b/test/mri/prism/fixtures/whitequark/procarg0.txt new file mode 100644 index 00000000000..74cae2c2eb4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/procarg0.txt @@ -0,0 +1,3 @@ +m { |(foo, bar)| } + +m { |foo| } diff --git a/test/mri/prism/fixtures/whitequark/range_exclusive.txt b/test/mri/prism/fixtures/whitequark/range_exclusive.txt new file mode 100644 index 00000000000..9e07faed27e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/range_exclusive.txt @@ -0,0 +1 @@ +1...2 diff --git a/test/mri/prism/fixtures/whitequark/range_inclusive.txt b/test/mri/prism/fixtures/whitequark/range_inclusive.txt new file mode 100644 index 00000000000..8c12abf7dea --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/range_inclusive.txt @@ -0,0 +1 @@ +1..2 diff --git a/test/mri/prism/fixtures/whitequark/rational.txt b/test/mri/prism/fixtures/whitequark/rational.txt new file mode 100644 index 00000000000..e11cacc742e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rational.txt @@ -0,0 +1,3 @@ +42.1r + +42r diff --git a/test/mri/prism/fixtures/whitequark/redo.txt b/test/mri/prism/fixtures/whitequark/redo.txt new file mode 100644 index 00000000000..f49789cbab8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/redo.txt @@ -0,0 +1 @@ +redo diff --git a/test/mri/prism/fixtures/whitequark/regex_interp.txt b/test/mri/prism/fixtures/whitequark/regex_interp.txt new file mode 100644 index 00000000000..f9ad7fcbc82 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/regex_interp.txt @@ -0,0 +1 @@ +/foo#{bar}baz/ diff --git a/test/mri/prism/fixtures/whitequark/regex_plain.txt b/test/mri/prism/fixtures/whitequark/regex_plain.txt new file mode 100644 index 00000000000..b86faecf98c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/regex_plain.txt @@ -0,0 +1 @@ +/source/im diff --git a/test/mri/prism/fixtures/whitequark/resbody_list.txt b/test/mri/prism/fixtures/whitequark/resbody_list.txt new file mode 100644 index 00000000000..e40d45fc450 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/resbody_list.txt @@ -0,0 +1 @@ +begin; meth; rescue Exception; bar; end diff --git a/test/mri/prism/fixtures/whitequark/resbody_list_mrhs.txt b/test/mri/prism/fixtures/whitequark/resbody_list_mrhs.txt new file mode 100644 index 00000000000..92b8bb2c023 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/resbody_list_mrhs.txt @@ -0,0 +1 @@ +begin; meth; rescue Exception, foo; bar; end diff --git a/test/mri/prism/fixtures/whitequark/resbody_list_var.txt b/test/mri/prism/fixtures/whitequark/resbody_list_var.txt new file mode 100644 index 00000000000..0a2fb90b6d4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/resbody_list_var.txt @@ -0,0 +1 @@ +begin; meth; rescue foo => ex; bar; end diff --git a/test/mri/prism/fixtures/whitequark/resbody_var.txt b/test/mri/prism/fixtures/whitequark/resbody_var.txt new file mode 100644 index 00000000000..2104ac58e78 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/resbody_var.txt @@ -0,0 +1,3 @@ +begin; meth; rescue => @ex; bar; end + +begin; meth; rescue => ex; bar; end diff --git a/test/mri/prism/fixtures/whitequark/rescue.txt b/test/mri/prism/fixtures/whitequark/rescue.txt new file mode 100644 index 00000000000..2d3be9dc567 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue.txt @@ -0,0 +1 @@ +begin; meth; rescue; foo; end diff --git a/test/mri/prism/fixtures/whitequark/rescue_else.txt b/test/mri/prism/fixtures/whitequark/rescue_else.txt new file mode 100644 index 00000000000..a22f8d100e2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_else.txt @@ -0,0 +1 @@ +begin; meth; rescue; foo; else; bar; end diff --git a/test/mri/prism/fixtures/whitequark/rescue_else_ensure.txt b/test/mri/prism/fixtures/whitequark/rescue_else_ensure.txt new file mode 100644 index 00000000000..167eee194a6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_else_ensure.txt @@ -0,0 +1 @@ +begin; meth; rescue; baz; else foo; ensure; bar end diff --git a/test/mri/prism/fixtures/whitequark/rescue_ensure.txt b/test/mri/prism/fixtures/whitequark/rescue_ensure.txt new file mode 100644 index 00000000000..8237257c41c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_ensure.txt @@ -0,0 +1 @@ +begin; meth; rescue; baz; ensure; bar; end diff --git a/test/mri/prism/fixtures/whitequark/rescue_in_lambda_block.txt b/test/mri/prism/fixtures/whitequark/rescue_in_lambda_block.txt new file mode 100644 index 00000000000..ccd8ed72c58 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_in_lambda_block.txt @@ -0,0 +1 @@ +-> do rescue; end diff --git a/test/mri/prism/fixtures/whitequark/rescue_mod.txt b/test/mri/prism/fixtures/whitequark/rescue_mod.txt new file mode 100644 index 00000000000..06375d3e9b7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_mod.txt @@ -0,0 +1 @@ +meth rescue bar diff --git a/test/mri/prism/fixtures/whitequark/rescue_mod_asgn.txt b/test/mri/prism/fixtures/whitequark/rescue_mod_asgn.txt new file mode 100644 index 00000000000..abf7cd9a3d8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_mod_asgn.txt @@ -0,0 +1 @@ +foo = meth rescue bar diff --git a/test/mri/prism/fixtures/whitequark/rescue_mod_masgn.txt b/test/mri/prism/fixtures/whitequark/rescue_mod_masgn.txt new file mode 100644 index 00000000000..0716eb1f670 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_mod_masgn.txt @@ -0,0 +1 @@ +foo, bar = meth rescue [1, 2] diff --git a/test/mri/prism/fixtures/whitequark/rescue_mod_op_assign.txt b/test/mri/prism/fixtures/whitequark/rescue_mod_op_assign.txt new file mode 100644 index 00000000000..178efa3a20e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_mod_op_assign.txt @@ -0,0 +1 @@ +foo += meth rescue bar diff --git a/test/mri/prism/fixtures/whitequark/rescue_without_begin_end.txt b/test/mri/prism/fixtures/whitequark/rescue_without_begin_end.txt new file mode 100644 index 00000000000..8416569e2c7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/rescue_without_begin_end.txt @@ -0,0 +1 @@ +meth do; foo; rescue; bar; end diff --git a/test/mri/prism/fixtures/whitequark/restarg_named.txt b/test/mri/prism/fixtures/whitequark/restarg_named.txt new file mode 100644 index 00000000000..355cd8f4933 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/restarg_named.txt @@ -0,0 +1 @@ +def f(*foo); end diff --git a/test/mri/prism/fixtures/whitequark/restarg_unnamed.txt b/test/mri/prism/fixtures/whitequark/restarg_unnamed.txt new file mode 100644 index 00000000000..c9932dd30c0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/restarg_unnamed.txt @@ -0,0 +1 @@ +def f(*); end diff --git a/test/mri/prism/fixtures/whitequark/retry.txt b/test/mri/prism/fixtures/whitequark/retry.txt new file mode 100644 index 00000000000..77428f7b73e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/retry.txt @@ -0,0 +1 @@ +retry diff --git a/test/mri/prism/fixtures/whitequark/return.txt b/test/mri/prism/fixtures/whitequark/return.txt new file mode 100644 index 00000000000..e3d966bda09 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/return.txt @@ -0,0 +1,7 @@ +return + +return foo + +return() + +return(foo) diff --git a/test/mri/prism/fixtures/whitequark/return_block.txt b/test/mri/prism/fixtures/whitequark/return_block.txt new file mode 100644 index 00000000000..00723a7517d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/return_block.txt @@ -0,0 +1 @@ +return fun foo do end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_10279.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_10279.txt new file mode 100644 index 00000000000..4d0fb213d8f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_10279.txt @@ -0,0 +1 @@ +{a: if true then 42 end} diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_10653.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_10653.txt new file mode 100644 index 00000000000..51354a1f700 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_10653.txt @@ -0,0 +1,5 @@ +false ? raise do end : tap do end + +false ? raise {} : tap {} + +true ? 1.tap do |n| p n end : 0 diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11107.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11107.txt new file mode 100644 index 00000000000..1f28cb06f6e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11107.txt @@ -0,0 +1 @@ +p ->() do a() do end end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11380.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11380.txt new file mode 100644 index 00000000000..1631548e3a0 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11380.txt @@ -0,0 +1 @@ +p -> { :hello }, a: 1 do end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11873.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11873.txt new file mode 100644 index 00000000000..a25aa9e2679 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11873.txt @@ -0,0 +1,23 @@ +a b(c d), "x" do end + +a b(c d), /x/ do end + +a b(c d), /x/m do end + +a b(c(d)), "x" do end + +a b(c(d)), /x/ do end + +a b(c(d)), /x/m do end + +a b{c d}, "x" do end + +a b{c d}, /x/ do end + +a b{c d}, /x/m do end + +a b{c(d)}, "x" do end + +a b{c(d)}, /x/ do end + +a b{c(d)}, /x/m do end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11873_a.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11873_a.txt new file mode 100644 index 00000000000..1856235ce52 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11873_a.txt @@ -0,0 +1,39 @@ +a b(c d), 1 do end + +a b(c d), 1.0 do end + +a b(c d), 1.0i do end + +a b(c d), 1.0r do end + +a b(c d), :e do end + +a b(c(d)), 1 do end + +a b(c(d)), 1.0 do end + +a b(c(d)), 1.0i do end + +a b(c(d)), 1.0r do end + +a b(c(d)), :e do end + +a b{c d}, 1 do end + +a b{c d}, 1.0 do end + +a b{c d}, 1.0i do end + +a b{c d}, 1.0r do end + +a b{c d}, :e do end + +a b{c(d)}, 1 do end + +a b{c(d)}, 1.0 do end + +a b{c(d)}, 1.0i do end + +a b{c(d)}, 1.0r do end + +a b{c(d)}, :e do end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11873_b.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11873_b.txt new file mode 100644 index 00000000000..1b86662008d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11873_b.txt @@ -0,0 +1 @@ +p p{p(p);p p}, tap do end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11989.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11989.txt new file mode 100644 index 00000000000..d49b8614edd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11989.txt @@ -0,0 +1,3 @@ +p <<~"E" + x\n y +E diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_11990.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_11990.txt new file mode 100644 index 00000000000..d0fe7b27392 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_11990.txt @@ -0,0 +1,3 @@ +p <<~E " y" + x +E diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_12073.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_12073.txt new file mode 100644 index 00000000000..b2e37844220 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_12073.txt @@ -0,0 +1,3 @@ +a = 1; a b: 1 + +def foo raise; raise A::B, ''; end diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_12402.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_12402.txt new file mode 100644 index 00000000000..060d5d95a16 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_12402.txt @@ -0,0 +1,27 @@ +foo += raise bar rescue nil + +foo += raise(bar) rescue nil + +foo = raise bar rescue nil + +foo = raise(bar) rescue nil + +foo.C += raise bar rescue nil + +foo.C += raise(bar) rescue nil + +foo.m += raise bar rescue nil + +foo.m += raise(bar) rescue nil + +foo::C ||= raise bar rescue nil + +foo::C ||= raise(bar) rescue nil + +foo::m += raise bar rescue nil + +foo::m += raise(bar) rescue nil + +foo[0] += raise bar rescue nil + +foo[0] += raise(bar) rescue nil diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_12669.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_12669.txt new file mode 100644 index 00000000000..cd896894465 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_12669.txt @@ -0,0 +1,7 @@ +a += b += raise :x + +a += b = raise :x + +a = b += raise :x + +a = b = raise :x diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_12686.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_12686.txt new file mode 100644 index 00000000000..7742e791b87 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_12686.txt @@ -0,0 +1 @@ +f (g rescue nil) diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_13547.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_13547.txt new file mode 100644 index 00000000000..29eafc3a4cf --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_13547.txt @@ -0,0 +1 @@ +meth[] {} diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_14690.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_14690.txt new file mode 100644 index 00000000000..b73b1d8aad7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_14690.txt @@ -0,0 +1 @@ +let () { m(a) do; end } diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_15789.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_15789.txt new file mode 100644 index 00000000000..6324db51109 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_15789.txt @@ -0,0 +1,3 @@ +m ->(a = ->{_1}) {a} + +m ->(a: ->{_1}) {a} diff --git a/test/mri/prism/fixtures/whitequark/ruby_bug_9669.txt b/test/mri/prism/fixtures/whitequark/ruby_bug_9669.txt new file mode 100644 index 00000000000..60dfa09d518 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ruby_bug_9669.txt @@ -0,0 +1,8 @@ +def a b: +return +end + +o = { +a: +1 +} diff --git a/test/mri/prism/fixtures/whitequark/sclass.txt b/test/mri/prism/fixtures/whitequark/sclass.txt new file mode 100644 index 00000000000..e6aadaef21e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/sclass.txt @@ -0,0 +1 @@ +class << foo; nil; end diff --git a/test/mri/prism/fixtures/whitequark/self.txt b/test/mri/prism/fixtures/whitequark/self.txt new file mode 100644 index 00000000000..31f9efa4a1f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/self.txt @@ -0,0 +1 @@ +self diff --git a/test/mri/prism/fixtures/whitequark/send_attr_asgn.txt b/test/mri/prism/fixtures/whitequark/send_attr_asgn.txt new file mode 100644 index 00000000000..b477966b2a7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_attr_asgn.txt @@ -0,0 +1,7 @@ +foo.A = 1 + +foo.a = 1 + +foo::A = 1 + +foo::a = 1 diff --git a/test/mri/prism/fixtures/whitequark/send_attr_asgn_conditional.txt b/test/mri/prism/fixtures/whitequark/send_attr_asgn_conditional.txt new file mode 100644 index 00000000000..1279e02cfc9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_attr_asgn_conditional.txt @@ -0,0 +1 @@ +a&.b = 1 diff --git a/test/mri/prism/fixtures/whitequark/send_binary_op.txt b/test/mri/prism/fixtures/whitequark/send_binary_op.txt new file mode 100644 index 00000000000..3e3e9300b30 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_binary_op.txt @@ -0,0 +1,41 @@ +foo != 1 + +foo !~ 1 + +foo % 1 + +foo & 1 + +foo * 1 + +foo ** 1 + +foo + 1 + +foo - 1 + +foo / 1 + +foo < 1 + +foo << 1 + +foo <= 1 + +foo <=> 1 + +foo == 1 + +foo === 1 + +foo =~ 1 + +foo > 1 + +foo >= 1 + +foo >> 1 + +foo ^ 1 + +foo | 1 diff --git a/test/mri/prism/fixtures/whitequark/send_block_chain_cmd.txt b/test/mri/prism/fixtures/whitequark/send_block_chain_cmd.txt new file mode 100644 index 00000000000..c6fe1aab0e7 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_block_chain_cmd.txt @@ -0,0 +1,13 @@ +meth 1 do end.fun bar + +meth 1 do end.fun bar do end + +meth 1 do end.fun {} + +meth 1 do end.fun(bar) + +meth 1 do end.fun(bar) {} + +meth 1 do end::fun bar + +meth 1 do end::fun(bar) diff --git a/test/mri/prism/fixtures/whitequark/send_block_conditional.txt b/test/mri/prism/fixtures/whitequark/send_block_conditional.txt new file mode 100644 index 00000000000..dcc83617628 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_block_conditional.txt @@ -0,0 +1 @@ +foo&.bar {} diff --git a/test/mri/prism/fixtures/whitequark/send_call.txt b/test/mri/prism/fixtures/whitequark/send_call.txt new file mode 100644 index 00000000000..99701270bb1 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_call.txt @@ -0,0 +1,3 @@ +foo.(1) + +foo::(1) diff --git a/test/mri/prism/fixtures/whitequark/send_conditional.txt b/test/mri/prism/fixtures/whitequark/send_conditional.txt new file mode 100644 index 00000000000..8ecd27e0fe6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_conditional.txt @@ -0,0 +1 @@ +a&.b diff --git a/test/mri/prism/fixtures/whitequark/send_index.txt b/test/mri/prism/fixtures/whitequark/send_index.txt new file mode 100644 index 00000000000..f9c4dafc4e8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_index.txt @@ -0,0 +1 @@ +foo[1, 2] diff --git a/test/mri/prism/fixtures/whitequark/send_index_asgn.txt b/test/mri/prism/fixtures/whitequark/send_index_asgn.txt new file mode 100644 index 00000000000..e232fa3b968 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_index_asgn.txt @@ -0,0 +1 @@ +foo[1, 2] = 3 diff --git a/test/mri/prism/fixtures/whitequark/send_index_asgn_legacy.txt b/test/mri/prism/fixtures/whitequark/send_index_asgn_legacy.txt new file mode 100644 index 00000000000..e232fa3b968 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_index_asgn_legacy.txt @@ -0,0 +1 @@ +foo[1, 2] = 3 diff --git a/test/mri/prism/fixtures/whitequark/send_index_cmd.txt b/test/mri/prism/fixtures/whitequark/send_index_cmd.txt new file mode 100644 index 00000000000..32090e7536e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_index_cmd.txt @@ -0,0 +1 @@ +foo[m bar] diff --git a/test/mri/prism/fixtures/whitequark/send_index_legacy.txt b/test/mri/prism/fixtures/whitequark/send_index_legacy.txt new file mode 100644 index 00000000000..f9c4dafc4e8 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_index_legacy.txt @@ -0,0 +1 @@ +foo[1, 2] diff --git a/test/mri/prism/fixtures/whitequark/send_lambda.txt b/test/mri/prism/fixtures/whitequark/send_lambda.txt new file mode 100644 index 00000000000..eadd6c9c039 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_lambda.txt @@ -0,0 +1,5 @@ +-> * { } + +-> do end + +->{ } diff --git a/test/mri/prism/fixtures/whitequark/send_lambda_args.txt b/test/mri/prism/fixtures/whitequark/send_lambda_args.txt new file mode 100644 index 00000000000..68392f2f348 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_lambda_args.txt @@ -0,0 +1,3 @@ +-> (a) { } + +->(a) { } diff --git a/test/mri/prism/fixtures/whitequark/send_lambda_args_noparen.txt b/test/mri/prism/fixtures/whitequark/send_lambda_args_noparen.txt new file mode 100644 index 00000000000..c0ae077f95f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_lambda_args_noparen.txt @@ -0,0 +1,3 @@ +-> a: 1 { } + +-> a: { } diff --git a/test/mri/prism/fixtures/whitequark/send_lambda_args_shadow.txt b/test/mri/prism/fixtures/whitequark/send_lambda_args_shadow.txt new file mode 100644 index 00000000000..230f35ab896 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_lambda_args_shadow.txt @@ -0,0 +1 @@ +->(a; foo, bar) { } diff --git a/test/mri/prism/fixtures/whitequark/send_lambda_legacy.txt b/test/mri/prism/fixtures/whitequark/send_lambda_legacy.txt new file mode 100644 index 00000000000..a509407c438 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_lambda_legacy.txt @@ -0,0 +1 @@ +->{ } diff --git a/test/mri/prism/fixtures/whitequark/send_op_asgn_conditional.txt b/test/mri/prism/fixtures/whitequark/send_op_asgn_conditional.txt new file mode 100644 index 00000000000..906088dcd1e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_op_asgn_conditional.txt @@ -0,0 +1 @@ +a&.b &&= 1 diff --git a/test/mri/prism/fixtures/whitequark/send_plain.txt b/test/mri/prism/fixtures/whitequark/send_plain.txt new file mode 100644 index 00000000000..ebaf1d18c76 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_plain.txt @@ -0,0 +1,5 @@ +foo.fun + +foo::Fun() + +foo::fun diff --git a/test/mri/prism/fixtures/whitequark/send_plain_cmd.txt b/test/mri/prism/fixtures/whitequark/send_plain_cmd.txt new file mode 100644 index 00000000000..e3fd63f272b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_plain_cmd.txt @@ -0,0 +1,5 @@ +foo.fun bar + +foo::Fun bar + +foo::fun bar diff --git a/test/mri/prism/fixtures/whitequark/send_self.txt b/test/mri/prism/fixtures/whitequark/send_self.txt new file mode 100644 index 00000000000..f084b9bca70 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_self.txt @@ -0,0 +1,5 @@ +fun + +fun! + +fun(1) diff --git a/test/mri/prism/fixtures/whitequark/send_self_block.txt b/test/mri/prism/fixtures/whitequark/send_self_block.txt new file mode 100644 index 00000000000..1cd6703c82c --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_self_block.txt @@ -0,0 +1,7 @@ +fun do end + +fun { } + +fun() { } + +fun(1) { } diff --git a/test/mri/prism/fixtures/whitequark/send_unary_op.txt b/test/mri/prism/fixtures/whitequark/send_unary_op.txt new file mode 100644 index 00000000000..73814d199f9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/send_unary_op.txt @@ -0,0 +1,5 @@ ++foo + +-foo + +~foo diff --git a/test/mri/prism/fixtures/whitequark/slash_newline_in_heredocs.txt b/test/mri/prism/fixtures/whitequark/slash_newline_in_heredocs.txt new file mode 100644 index 00000000000..4962a058eac --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/slash_newline_in_heredocs.txt @@ -0,0 +1,13 @@ +<<-E + 1 \ + 2 + 3 +E + + +<<~E + 1 \ + 2 + 3 +E + diff --git a/test/mri/prism/fixtures/whitequark/space_args_arg.txt b/test/mri/prism/fixtures/whitequark/space_args_arg.txt new file mode 100644 index 00000000000..47957cba541 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_arg.txt @@ -0,0 +1 @@ +fun (1) diff --git a/test/mri/prism/fixtures/whitequark/space_args_arg_block.txt b/test/mri/prism/fixtures/whitequark/space_args_arg_block.txt new file mode 100644 index 00000000000..5560a82818a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_arg_block.txt @@ -0,0 +1,5 @@ +foo.fun (1) {} + +foo::fun (1) {} + +fun (1) {} diff --git a/test/mri/prism/fixtures/whitequark/space_args_arg_call.txt b/test/mri/prism/fixtures/whitequark/space_args_arg_call.txt new file mode 100644 index 00000000000..3b0ae831fef --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_arg_call.txt @@ -0,0 +1 @@ +fun (1).to_i diff --git a/test/mri/prism/fixtures/whitequark/space_args_arg_newline.txt b/test/mri/prism/fixtures/whitequark/space_args_arg_newline.txt new file mode 100644 index 00000000000..a6cdac6ed15 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_arg_newline.txt @@ -0,0 +1,2 @@ +fun (1 +) diff --git a/test/mri/prism/fixtures/whitequark/space_args_block.txt b/test/mri/prism/fixtures/whitequark/space_args_block.txt new file mode 100644 index 00000000000..555a097605b --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_block.txt @@ -0,0 +1 @@ +fun () {} diff --git a/test/mri/prism/fixtures/whitequark/space_args_cmd.txt b/test/mri/prism/fixtures/whitequark/space_args_cmd.txt new file mode 100644 index 00000000000..a749695cb78 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/space_args_cmd.txt @@ -0,0 +1 @@ +fun (f bar) diff --git a/test/mri/prism/fixtures/whitequark/string___FILE__.txt b/test/mri/prism/fixtures/whitequark/string___FILE__.txt new file mode 100644 index 00000000000..4815727d05f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/string___FILE__.txt @@ -0,0 +1 @@ +__FILE__ diff --git a/test/mri/prism/fixtures/whitequark/string_concat.txt b/test/mri/prism/fixtures/whitequark/string_concat.txt new file mode 100644 index 00000000000..30cc4f81166 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/string_concat.txt @@ -0,0 +1 @@ +"foo#@a" "bar" diff --git a/test/mri/prism/fixtures/whitequark/string_dvar.txt b/test/mri/prism/fixtures/whitequark/string_dvar.txt new file mode 100644 index 00000000000..bbe5b617b22 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/string_dvar.txt @@ -0,0 +1 @@ +"#@a #@@a #$a" diff --git a/test/mri/prism/fixtures/whitequark/string_interp.txt b/test/mri/prism/fixtures/whitequark/string_interp.txt new file mode 100644 index 00000000000..5fdd803341f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/string_interp.txt @@ -0,0 +1 @@ +"foo#{bar}baz" diff --git a/test/mri/prism/fixtures/whitequark/string_plain.txt b/test/mri/prism/fixtures/whitequark/string_plain.txt new file mode 100644 index 00000000000..4aca78decb2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/string_plain.txt @@ -0,0 +1,3 @@ +%q(foobar) + +'foobar' diff --git a/test/mri/prism/fixtures/whitequark/super.txt b/test/mri/prism/fixtures/whitequark/super.txt new file mode 100644 index 00000000000..9e68a9e9887 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/super.txt @@ -0,0 +1,5 @@ +super foo + +super() + +super(foo) diff --git a/test/mri/prism/fixtures/whitequark/super_block.txt b/test/mri/prism/fixtures/whitequark/super_block.txt new file mode 100644 index 00000000000..05a7d7fdd83 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/super_block.txt @@ -0,0 +1,3 @@ +super do end + +super foo, bar do end diff --git a/test/mri/prism/fixtures/whitequark/symbol_interp.txt b/test/mri/prism/fixtures/whitequark/symbol_interp.txt new file mode 100644 index 00000000000..d5011b270de --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/symbol_interp.txt @@ -0,0 +1 @@ +:"foo#{bar}baz" diff --git a/test/mri/prism/fixtures/whitequark/symbol_plain.txt b/test/mri/prism/fixtures/whitequark/symbol_plain.txt new file mode 100644 index 00000000000..fd1fd0017cf --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/symbol_plain.txt @@ -0,0 +1,3 @@ +:'foo' + +:foo diff --git a/test/mri/prism/fixtures/whitequark/ternary.txt b/test/mri/prism/fixtures/whitequark/ternary.txt new file mode 100644 index 00000000000..3a149d4e1c2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ternary.txt @@ -0,0 +1 @@ +foo ? 1 : 2 diff --git a/test/mri/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt b/test/mri/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt new file mode 100644 index 00000000000..19aa523c07e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt @@ -0,0 +1 @@ +t=1;(foo)?t:T diff --git a/test/mri/prism/fixtures/whitequark/trailing_forward_arg.txt b/test/mri/prism/fixtures/whitequark/trailing_forward_arg.txt new file mode 100644 index 00000000000..043870ade2a --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/trailing_forward_arg.txt @@ -0,0 +1 @@ +def foo(a, b, ...); bar(a, 42, ...); end diff --git a/test/mri/prism/fixtures/whitequark/true.txt b/test/mri/prism/fixtures/whitequark/true.txt new file mode 100644 index 00000000000..27ba77ddaf6 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/true.txt @@ -0,0 +1 @@ +true diff --git a/test/mri/prism/fixtures/whitequark/unary_num_pow_precedence.txt b/test/mri/prism/fixtures/whitequark/unary_num_pow_precedence.txt new file mode 100644 index 00000000000..f0343e3c8be --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/unary_num_pow_precedence.txt @@ -0,0 +1,5 @@ ++2.0 ** 10 + +-2 ** 10 + +-2.0 ** 10 diff --git a/test/mri/prism/fixtures/whitequark/undef.txt b/test/mri/prism/fixtures/whitequark/undef.txt new file mode 100644 index 00000000000..3e88ec7084f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/undef.txt @@ -0,0 +1 @@ +undef foo, :bar, :"foo#{1}" diff --git a/test/mri/prism/fixtures/whitequark/unless.txt b/test/mri/prism/fixtures/whitequark/unless.txt new file mode 100644 index 00000000000..d04043ed903 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/unless.txt @@ -0,0 +1,3 @@ +unless foo then bar; end + +unless foo; bar; end diff --git a/test/mri/prism/fixtures/whitequark/unless_else.txt b/test/mri/prism/fixtures/whitequark/unless_else.txt new file mode 100644 index 00000000000..8243d420314 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/unless_else.txt @@ -0,0 +1,3 @@ +unless foo then bar; else baz; end + +unless foo; bar; else baz; end diff --git a/test/mri/prism/fixtures/whitequark/unless_mod.txt b/test/mri/prism/fixtures/whitequark/unless_mod.txt new file mode 100644 index 00000000000..2d0376a3107 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/unless_mod.txt @@ -0,0 +1 @@ +bar unless foo diff --git a/test/mri/prism/fixtures/whitequark/until.txt b/test/mri/prism/fixtures/whitequark/until.txt new file mode 100644 index 00000000000..06082233cbd --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/until.txt @@ -0,0 +1,3 @@ +until foo do meth end + +until foo; meth end diff --git a/test/mri/prism/fixtures/whitequark/until_mod.txt b/test/mri/prism/fixtures/whitequark/until_mod.txt new file mode 100644 index 00000000000..46a85d2ba9e --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/until_mod.txt @@ -0,0 +1 @@ +meth until foo diff --git a/test/mri/prism/fixtures/whitequark/until_post.txt b/test/mri/prism/fixtures/whitequark/until_post.txt new file mode 100644 index 00000000000..988e43b6659 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/until_post.txt @@ -0,0 +1 @@ +begin meth end until foo diff --git a/test/mri/prism/fixtures/whitequark/var_and_asgn.txt b/test/mri/prism/fixtures/whitequark/var_and_asgn.txt new file mode 100644 index 00000000000..25502968f93 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/var_and_asgn.txt @@ -0,0 +1 @@ +a &&= 1 diff --git a/test/mri/prism/fixtures/whitequark/var_op_asgn.txt b/test/mri/prism/fixtures/whitequark/var_op_asgn.txt new file mode 100644 index 00000000000..402d818a7e4 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/var_op_asgn.txt @@ -0,0 +1,7 @@ +@@var |= 10 + +@a |= 1 + +a += 1 + +def a; @@var |= 10; end diff --git a/test/mri/prism/fixtures/whitequark/var_op_asgn_cmd.txt b/test/mri/prism/fixtures/whitequark/var_op_asgn_cmd.txt new file mode 100644 index 00000000000..33f4bc0e736 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/var_op_asgn_cmd.txt @@ -0,0 +1 @@ +foo += m foo diff --git a/test/mri/prism/fixtures/whitequark/var_or_asgn.txt b/test/mri/prism/fixtures/whitequark/var_or_asgn.txt new file mode 100644 index 00000000000..aa30b3d5ca9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/var_or_asgn.txt @@ -0,0 +1 @@ +a ||= 1 diff --git a/test/mri/prism/fixtures/whitequark/when_multi.txt b/test/mri/prism/fixtures/whitequark/when_multi.txt new file mode 100644 index 00000000000..b4fbd331258 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/when_multi.txt @@ -0,0 +1 @@ +case foo; when 'bar', 'baz'; bar; end diff --git a/test/mri/prism/fixtures/whitequark/when_splat.txt b/test/mri/prism/fixtures/whitequark/when_splat.txt new file mode 100644 index 00000000000..695e5da34e3 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/when_splat.txt @@ -0,0 +1 @@ +case foo; when 1, *baz; bar; when *foo; end diff --git a/test/mri/prism/fixtures/whitequark/when_then.txt b/test/mri/prism/fixtures/whitequark/when_then.txt new file mode 100644 index 00000000000..63293452b32 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/when_then.txt @@ -0,0 +1 @@ +case foo; when 'bar' then bar; end diff --git a/test/mri/prism/fixtures/whitequark/while.txt b/test/mri/prism/fixtures/whitequark/while.txt new file mode 100644 index 00000000000..28b204f247d --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/while.txt @@ -0,0 +1,3 @@ +while foo do meth end + +while foo; meth end diff --git a/test/mri/prism/fixtures/whitequark/while_mod.txt b/test/mri/prism/fixtures/whitequark/while_mod.txt new file mode 100644 index 00000000000..ce3cf01d14f --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/while_mod.txt @@ -0,0 +1 @@ +meth while foo diff --git a/test/mri/prism/fixtures/whitequark/while_post.txt b/test/mri/prism/fixtures/whitequark/while_post.txt new file mode 100644 index 00000000000..ac6e05008b9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/while_post.txt @@ -0,0 +1 @@ +begin meth end while foo diff --git a/test/mri/prism/fixtures/whitequark/xstring_interp.txt b/test/mri/prism/fixtures/whitequark/xstring_interp.txt new file mode 100644 index 00000000000..dfede8123fe --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/xstring_interp.txt @@ -0,0 +1 @@ +`foo#{bar}baz` diff --git a/test/mri/prism/fixtures/whitequark/xstring_plain.txt b/test/mri/prism/fixtures/whitequark/xstring_plain.txt new file mode 100644 index 00000000000..fce255049d2 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/xstring_plain.txt @@ -0,0 +1 @@ +`foobar` diff --git a/test/mri/prism/fixtures/whitequark/yield.txt b/test/mri/prism/fixtures/whitequark/yield.txt new file mode 100644 index 00000000000..0ecf6395891 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/yield.txt @@ -0,0 +1,7 @@ +yield + +yield foo + +yield() + +yield(foo) diff --git a/test/mri/prism/fixtures/whitequark/zsuper.txt b/test/mri/prism/fixtures/whitequark/zsuper.txt new file mode 100644 index 00000000000..16f5c2d3aa9 --- /dev/null +++ b/test/mri/prism/fixtures/whitequark/zsuper.txt @@ -0,0 +1 @@ +super diff --git a/test/mri/prism/fixtures/xstring.txt b/test/mri/prism/fixtures/xstring.txt new file mode 100644 index 00000000000..7ec09468d8c --- /dev/null +++ b/test/mri/prism/fixtures/xstring.txt @@ -0,0 +1,13 @@ +%x[foo] + +`foo #{bar} baz` + +`foo` + +%x{ + foo +} + +`` + +%x{} diff --git a/test/mri/prism/fixtures/xstring_with_backslash.txt b/test/mri/prism/fixtures/xstring_with_backslash.txt new file mode 100644 index 00000000000..b51bb0f6f90 --- /dev/null +++ b/test/mri/prism/fixtures/xstring_with_backslash.txt @@ -0,0 +1 @@ +`f\oo` diff --git a/test/mri/prism/fixtures/yield.txt b/test/mri/prism/fixtures/yield.txt new file mode 100644 index 00000000000..d75ab57a187 --- /dev/null +++ b/test/mri/prism/fixtures/yield.txt @@ -0,0 +1,7 @@ +yield + +yield() + +yield(1) + +yield(1, 2, 3) diff --git a/test/mri/prism/format_errors_test.rb b/test/mri/prism/format_errors_test.rb new file mode 100644 index 00000000000..a1edbef2e86 --- /dev/null +++ b/test/mri/prism/format_errors_test.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if Prism::BACKEND == :FFI + +module Prism + class FormatErrorsTest < TestCase + def test_format_errors + assert_equal <<~ERROR, Debug.format_errors("<>", false) + > 1 | <> + | ^ unexpected '<', ignoring it + | ^ unexpected '>', ignoring it + ERROR + + assert_equal <<~'ERROR', Debug.format_errors('"%W"\u"', false) + > 1 | "%W"\u" + | ^ unexpected backslash, ignoring it + | ^ unexpected local variable or method, expecting end-of-input + | ^ unterminated string meets end of file + ERROR + end + end +end diff --git a/test/mri/prism/fuzzer_test.rb b/test/mri/prism/fuzzer_test.rb new file mode 100644 index 00000000000..ac112f897ac --- /dev/null +++ b/test/mri/prism/fuzzer_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + # These tests are simply to exercise snippets found by the fuzzer that caused invalid memory access. + class FuzzerTest < TestCase + def self.snippet(name, source) + define_method(:"test_fuzzer_#{name}") { Prism.dump(source) } + end + + snippet "incomplete global variable", "$" + snippet "incomplete symbol", ":" + snippet "incomplete escaped string", '"\\' + snippet "trailing comment", "1\n#\n" + snippet "comment followed by whitespace at end of file", "1\n#\n " + snippet "trailing asterisk", "a *" + snippet "incomplete decimal number", "0d" + snippet "incomplete binary number", "0b" + snippet "incomplete octal number", "0o" + snippet "incomplete hex number", "0x" + snippet "incomplete escaped list", "%w[\\" + snippet "incomplete escaped regex", "/a\\" + snippet "unterminated heredoc with unterminated escape at end of file", "< bar | baz", 7...16, &:pattern) + end + + def test_AndNode + assert_location(AndNode, "foo and bar") + assert_location(AndNode, "foo && bar") + end + + def test_ArgumentsNode + assert_location(ArgumentsNode, "foo(bar, baz, qux)", 4...17, &:arguments) + end + + def test_ArrayNode + assert_location(ArrayNode, "[foo, bar, baz]") + assert_location(ArrayNode, "%i[foo bar baz]") + assert_location(ArrayNode, "%I[foo bar baz]") + assert_location(ArrayNode, "%w[foo bar baz]") + assert_location(ArrayNode, "%W[foo bar baz]") + end + + def test_ArrayPatternNode + assert_location(ArrayPatternNode, "foo => bar, baz", 7...15, &:pattern) + assert_location(ArrayPatternNode, "foo => [bar, baz]", 7...17, &:pattern) + assert_location(ArrayPatternNode, "foo => *bar", 7...11, &:pattern) + assert_location(ArrayPatternNode, "foo => []", 7...9, &:pattern) + assert_location(ArrayPatternNode, "foo => Foo[]", 7...12, &:pattern) + assert_location(ArrayPatternNode, "foo => Foo[bar]", 7...15, &:pattern) + end + + def test_AssocNode + assert_location(AssocNode, "{ '': 1 }", 2...7) { |node| node.elements.first } + assert_location(AssocNode, "{ foo: :bar }", 2...11) { |node| node.elements.first } + assert_location(AssocNode, "{ :foo => :bar }", 2...14) { |node| node.elements.first } + assert_location(AssocNode, "foo(bar: :baz)", 4...13) { |node| node.arguments.arguments.first.elements.first } + end + + def test_AssocSplatNode + assert_location(AssocSplatNode, "{ **foo }", 2...7) { |node| node.elements.first } + assert_location(AssocSplatNode, "foo(**bar)", 4...9) { |node| node.arguments.arguments.first.elements.first } + end + + def test_BackReferenceReadNode + assert_location(BackReferenceReadNode, "$+") + end + + def test_BeginNode + assert_location(BeginNode, "begin foo end") + assert_location(BeginNode, "begin foo rescue bar end") + assert_location(BeginNode, "begin foo; rescue bar\nelse baz end") + assert_location(BeginNode, "begin foo; rescue bar\nelse baz\nensure qux end") + + assert_location(BeginNode, "class Foo\nrescue then end", 0..25, &:body) + assert_location(BeginNode, "module Foo\nrescue then end", 0..26, &:body) + end + + def test_BlockArgumentNode + assert_location(BlockArgumentNode, "foo(&bar)", 4...8, &:block) + end + + def test_BlockLocalVariableNode + assert_location(BlockLocalVariableNode, "foo { |;bar| }", 8...11) do |node| + node.block.parameters.locals.first + end + end + + def test_BlockNode + assert_location(BlockNode, "foo {}", 4...6, &:block) + assert_location(BlockNode, "foo do end", 4...10, &:block) + end + + def test_BlockParameterNode + assert_location(BlockParameterNode, "def foo(&bar) end", 8...12) { |node| node.parameters.block } + end + + def test_BlockParametersNode + assert_location(BlockParametersNode, "foo { || }", 6...8) { |node| node.block.parameters } + assert_location(BlockParametersNode, "foo { |bar| baz }", 6...11) { |node| node.block.parameters } + assert_location(BlockParametersNode, "foo { |bar; baz| baz }", 6...16) { |node| node.block.parameters } + + assert_location(BlockParametersNode, "-> () {}", 3...5, &:parameters) + assert_location(BlockParametersNode, "-> (bar) { baz }", 3...8, &:parameters) + assert_location(BlockParametersNode, "-> (bar; baz) { baz }", 3...13, &:parameters) + end + + def test_BreakNode + assert_location(BreakNode, "break") + assert_location(BreakNode, "break foo") + assert_location(BreakNode, "break foo, bar") + assert_location(BreakNode, "break(foo)") + end + + def test_CallNode + assert_location(CallNode, "foo") + assert_location(CallNode, "foo?") + assert_location(CallNode, "foo!") + + assert_location(CallNode, "foo()") + assert_location(CallNode, "foo?()") + assert_location(CallNode, "foo!()") + + assert_location(CallNode, "foo(bar)") + assert_location(CallNode, "foo?(bar)") + assert_location(CallNode, "foo!(bar)") + + assert_location(CallNode, "!foo") + assert_location(CallNode, "~foo") + assert_location(CallNode, "+foo") + assert_location(CallNode, "-foo") + + assert_location(CallNode, "not foo") + assert_location(CallNode, "not(foo)") + assert_location(CallNode, "not()") + + assert_location(CallNode, "foo + bar") + assert_location(CallNode, "foo -\n bar") + + assert_location(CallNode, "Foo()") + assert_location(CallNode, "Foo(bar)") + + assert_location(CallNode, "Foo::Bar()") + assert_location(CallNode, "Foo::Bar(baz)") + + assert_location(CallNode, "Foo::bar") + assert_location(CallNode, "Foo::bar()") + assert_location(CallNode, "Foo::bar(baz)") + + assert_location(CallNode, "Foo.bar") + assert_location(CallNode, "Foo.bar()") + assert_location(CallNode, "Foo.bar(baz)") + + assert_location(CallNode, "foo::bar") + assert_location(CallNode, "foo::bar()") + assert_location(CallNode, "foo::bar(baz)") + + assert_location(CallNode, "foo.bar") + assert_location(CallNode, "foo.bar()") + assert_location(CallNode, "foo.bar(baz)") + + assert_location(CallNode, "foo&.bar") + assert_location(CallNode, "foo&.bar()") + assert_location(CallNode, "foo&.bar(baz)") + + assert_location(CallNode, "foo[]") + assert_location(CallNode, "foo[bar]") + assert_location(CallNode, "foo[bar, baz]") + + assert_location(CallNode, "foo[] = 1") + assert_location(CallNode, "foo[bar] = 1") + assert_location(CallNode, "foo[bar, baz] = 1") + + assert_location(CallNode, "foo.()") + assert_location(CallNode, "foo.(bar)") + + assert_location(CallNode, "foo&.()") + assert_location(CallNode, "foo&.(bar)") + + assert_location(CallNode, "foo::()") + assert_location(CallNode, "foo::(bar)") + assert_location(CallNode, "foo::(bar, baz)") + + assert_location(CallNode, "foo bar baz") + assert_location(CallNode, "foo bar('baz')") + + assert_location(CallNode, "-> { it }", 5...7, version: "3.3.0") do |node| + node.body.body.first + end + + assert_location(LocalVariableReadNode, "-> { it }", 5...7, version: "3.4.0") do |node| + node.body.body.first + end + end + + def test_CallAndWriteNode + assert_location(CallAndWriteNode, "foo.foo &&= bar") + end + + def test_CallOperatorWriteNode + assert_location(CallOperatorWriteNode, "foo.foo += bar") + end + + def test_CallOrWriteNode + assert_location(CallOrWriteNode, "foo.foo ||= bar") + end + + def test_CallTargetNode + assert_location(CallTargetNode, "foo.bar, = baz", 0...7) do |node| + node.lefts.first + end + end + + def test_CapturePatternNode + assert_location(CapturePatternNode, "case foo; in bar => baz; end", 13...23) do |node| + node.conditions.first.pattern + end + end + + def test_CaseNode + assert_location(CaseNode, "case foo; when bar; end") + assert_location(CaseNode, "case foo; when bar; else; end") + assert_location(CaseNode, "case foo; when bar; when baz; end") + assert_location(CaseNode, "case foo; when bar; when baz; else; end") + end + + def test_CaseMatchNode + assert_location(CaseMatchNode, "case foo; in bar; end") + assert_location(CaseMatchNode, "case foo; in bar; else; end") + assert_location(CaseMatchNode, "case foo; in bar; in baz; end") + assert_location(CaseMatchNode, "case foo; in bar; in baz; else; end") + end + + def test_ClassNode + assert_location(ClassNode, "class Foo end") + assert_location(ClassNode, "class Foo < Bar; end") + end + + def test_ClassVariableAndWriteNode + assert_location(ClassVariableAndWriteNode, "@@foo &&= bar") + end + + def test_ClassVariableOperatorWriteNode + assert_location(ClassVariableOperatorWriteNode, "@@foo += bar") + end + + def test_ClassVariableOrWriteNode + assert_location(ClassVariableOrWriteNode, "@@foo ||= bar") + end + + def test_ClassVariableReadNode + assert_location(ClassVariableReadNode, "@@foo") + end + + def test_ClassVariableTargetNode + assert_location(ClassVariableTargetNode, "@@foo, @@bar = baz", 0...5) do |node| + node.lefts.first + end + end + + def test_ClassVariableWriteNode + assert_location(ClassVariableWriteNode, "@@foo = bar") + end + + def test_ConstantPathAndWriteNode + assert_location(ConstantPathAndWriteNode, "Parent::Child &&= bar") + end + + def test_ConstantPathNode + assert_location(ConstantPathNode, "Foo::Bar") + assert_location(ConstantPathNode, "::Foo") + assert_location(ConstantPathNode, "::Foo::Bar") + end + + def test_ConstantPathOperatorWriteNode + assert_location(ConstantPathOperatorWriteNode, "Parent::Child += bar") + end + + def test_ConstantPathOrWriteNode + assert_location(ConstantPathOrWriteNode, "Parent::Child ||= bar") + end + + def test_ConstantPathTargetNode + assert_location(ConstantPathTargetNode, "::Foo, ::Bar = baz", 0...5) do |node| + node.lefts.first + end + end + + def test_ConstantPathWriteNode + assert_location(ConstantPathWriteNode, "Foo::Bar = baz") + assert_location(ConstantPathWriteNode, "::Foo = bar") + assert_location(ConstantPathWriteNode, "::Foo::Bar = baz") + end + + def test_ConstantAndWriteNode + assert_location(ConstantAndWriteNode, "Foo &&= bar") + end + + def test_ConstantOperatorWriteNode + assert_location(ConstantOperatorWriteNode, "Foo += bar") + end + + def test_ConstantOrWriteNode + assert_location(ConstantOrWriteNode, "Foo ||= bar") + end + + def test_ConstantReadNode + assert_location(ConstantReadNode, "Foo") + assert_location(ConstantReadNode, "Foo::Bar", 5...8, &:child) + end + + def test_ConstantTargetNode + assert_location(ConstantTargetNode, "Foo, Bar = baz", 0...3) do |node| + node.lefts.first + end + end + + def test_ConstantWriteNode + assert_location(ConstantWriteNode, "Foo = bar") + end + + def test_DefNode + assert_location(DefNode, "def foo; bar; end") + assert_location(DefNode, "def foo = bar") + assert_location(DefNode, "def foo.bar; baz; end") + assert_location(DefNode, "def foo.bar = baz") + end + + def test_DefinedNode + assert_location(DefinedNode, "defined? foo") + assert_location(DefinedNode, "defined?(foo)") + end + + def test_ElseNode + assert_location(ElseNode, "if foo; bar; else; baz; end", 13...27, &:consequent) + assert_location(ElseNode, "foo ? bar : baz", 10...15, &:consequent) + end + + def test_EmbeddedStatementsNode + assert_location(EmbeddedStatementsNode, '"foo #{bar} baz"', 5...11) { |node| node.parts[1] } + end + + def test_EmbeddedVariableNode + assert_location(EmbeddedVariableNode, '"foo #@@bar baz"', 5...11) { |node| node.parts[1] } + end + + def test_EnsureNode + assert_location(EnsureNode, "begin; foo; ensure; bar; end", 12...28, &:ensure_clause) + end + + def test_FalseNode + assert_location(FalseNode, "false") + end + + def test_FindPatternNode + assert_location(FindPatternNode, "case foo; in *, bar, *; end", 13...22) do |node| + node.conditions.first.pattern + end + end + + def test_FlipFlopNode + assert_location(FlipFlopNode, "if foo..bar; end", 3..11, &:predicate) + end + + def test_FloatNode + assert_location(FloatNode, "0.0") + assert_location(FloatNode, "1.0") + assert_location(FloatNode, "1.0e10") + assert_location(FloatNode, "1.0e-10") + end + + def test_ForNode + assert_location(ForNode, "for foo in bar; end") + assert_location(ForNode, "for foo, bar in baz do end") + end + + def test_ForwardingArgumentsNode + assert_location(ForwardingArgumentsNode, "def foo(...); bar(...); end", 18...21) do |node| + node.body.body.first.arguments.arguments.first + end + end + + def test_ForwardingParameterNode + assert_location(ForwardingParameterNode, "def foo(...); end", 8...11) do |node| + node.parameters.keyword_rest + end + end + + def test_ForwardingSuperNode + assert_location(ForwardingSuperNode, "super") + assert_location(ForwardingSuperNode, "super {}") + end + + def test_GlobalVariableAndWriteNode + assert_location(GlobalVariableAndWriteNode, "$foo &&= bar") + end + + def test_GlobalVariableOperatorWriteNode + assert_location(GlobalVariableOperatorWriteNode, "$foo += bar") + end + + def test_GlobalVariableOrWriteNode + assert_location(GlobalVariableOrWriteNode, "$foo ||= bar") + end + + def test_GlobalVariableReadNode + assert_location(GlobalVariableReadNode, "$foo") + end + + def test_GlobalVariableTargetNode + assert_location(GlobalVariableTargetNode, "$foo, $bar = baz", 0...4) do |node| + node.lefts.first + end + end + + def test_GlobalVariableWriteNode + assert_location(GlobalVariableWriteNode, "$foo = bar") + end + + def test_HashNode + assert_location(HashNode, "{ foo: 2 }") + assert_location(HashNode, "{ \nfoo: 2, \nbar: 3 \n}") + end + + def test_HashPatternNode + assert_location(HashPatternNode, "case foo; in bar: baz; end", 13...21) do |node| + node.conditions.first.pattern + end + end + + def test_IfNode + assert_location(IfNode, "if type in 1;elsif type in B;end") + end + + def test_ImaginaryNode + assert_location(ImaginaryNode, "1i") + assert_location(ImaginaryNode, "1ri") + end + + def test_ImplicitNode + assert_location(ImplicitNode, "{ foo: }", 2...6) do |node| + node.elements.first.value + end + + assert_location(ImplicitNode, "{ Foo: }", 2..6) do |node| + node.elements.first.value + end + + assert_location(ImplicitNode, "foo = 1; { foo: }", 11..15) do |node| + node.elements.first.value + end + end + + def test_ImplicitRestNode + assert_location(ImplicitRestNode, "foo, = bar", 3..4, &:rest) + + assert_location(ImplicitRestNode, "for foo, in bar do end", 7..8) do |node| + node.index.rest + end + + assert_location(ImplicitRestNode, "foo { |bar,| }", 10..11) do |node| + node.block.parameters.parameters.rest + end + + assert_location(ImplicitRestNode, "foo in [bar,]", 11..12) do |node| + node.pattern.rest + end + end + + def test_InNode + assert_location(InNode, "case foo; in bar; end", 10...16) do |node| + node.conditions.first + end + end + + def test_IndexAndWriteNode + assert_location(IndexAndWriteNode, "foo[foo] &&= bar") + end + + def test_IndexOperatorWriteNode + assert_location(IndexOperatorWriteNode, "foo[foo] += bar") + end + + def test_IndexOrWriteNode + assert_location(IndexOrWriteNode, "foo[foo] ||= bar") + end + + def test_IndexTargetNode + assert_location(IndexTargetNode, "foo[bar, &baz], = qux", 0...14) do |node| + node.lefts.first + end + end + + def test_InstanceVariableAndWriteNode + assert_location(InstanceVariableAndWriteNode, "@foo &&= bar") + end + + def test_InstanceVariableOperatorWriteNode + assert_location(InstanceVariableOperatorWriteNode, "@foo += bar") + end + + def test_InstanceVariableOrWriteNode + assert_location(InstanceVariableOrWriteNode, "@foo ||= bar") + end + + def test_InstanceVariableReadNode + assert_location(InstanceVariableReadNode, "@foo") + end + + def test_InstanceVariableTargetNode + assert_location(InstanceVariableTargetNode, "@foo, @bar = baz", 0...4) do |node| + node.lefts.first + end + end + + def test_InstanceVariableWriteNode + assert_location(InstanceVariableWriteNode, "@foo = bar") + end + + def test_IntegerNode + assert_location(IntegerNode, "0") + assert_location(IntegerNode, "1") + assert_location(IntegerNode, "1_000") + assert_location(IntegerNode, "0x1") + assert_location(IntegerNode, "0x1_000") + assert_location(IntegerNode, "0b1") + assert_location(IntegerNode, "0b1_000") + assert_location(IntegerNode, "0o1") + assert_location(IntegerNode, "0o1_000") + end + + def test_InterpolatedMatchLastLineNode + assert_location(InterpolatedMatchLastLineNode, "if /foo \#{bar}/ then end", 3...15, &:predicate) + end + + def test_InterpolatedRegularExpressionNode + assert_location(InterpolatedRegularExpressionNode, "/\#{foo}/") + end + + def test_InterpolatedStringNode + assert_location(InterpolatedStringNode, "\"foo \#@bar baz\"") + assert_location(InterpolatedStringNode, "<<~A\nhello \#{1} world\nA", 0...4) + assert_location(InterpolatedStringNode, '"foo" "bar"') + end + + def test_InterpolatedSymbolNode + assert_location(InterpolatedSymbolNode, ':"#{foo}bar"') + end + + def test_InterpolatedXStringNode + assert_location(InterpolatedXStringNode, '`foo #{bar} baz`') + end + + def test_ItParametersNode + assert_location(ItParametersNode, "-> { it }", &:parameters) + end + + def test_KeywordHashNode + assert_location(KeywordHashNode, "foo(a, b: 1)", 7...11) { |node| node.arguments.arguments[1] } + end + + def test_KeywordRestParameterNode + assert_location(KeywordRestParameterNode, "def foo(**); end", 8...10) do |node| + node.parameters.keyword_rest + end + + assert_location(KeywordRestParameterNode, "def foo(**bar); end", 8...13) do |node| + node.parameters.keyword_rest + end + end + + def test_LambdaNode + assert_location(LambdaNode, "-> { foo }") + assert_location(LambdaNode, "-> do foo end") + end + + def test_LocalVariableAndWriteNode + assert_location(LocalVariableAndWriteNode, "foo &&= bar") + assert_location(LocalVariableAndWriteNode, "foo = 1; foo &&= bar", 9...20) + end + + def test_LocalVariableOperatorWriteNode + assert_location(LocalVariableOperatorWriteNode, "foo += bar") + assert_location(LocalVariableOperatorWriteNode, "foo = 1; foo += bar", 9...19) + end + + def test_LocalVariableOrWriteNode + assert_location(LocalVariableOrWriteNode, "foo ||= bar") + assert_location(LocalVariableOrWriteNode, "foo = 1; foo ||= bar", 9...20) + end + + def test_LocalVariableReadNode + assert_location(LocalVariableReadNode, "foo = 1; foo", 9...12) + assert_location(LocalVariableReadNode, "-> { it }", 5...7) do |node| + node.body.body.first + end + assert_location(LocalVariableReadNode, "foo { it }", 6...8) do |node| + node.block.body.body.first + end + end + + def test_LocalVariableTargetNode + assert_location(LocalVariableTargetNode, "foo, bar = baz", 0...3) do |node| + node.lefts.first + end + end + + def test_LocalVariableWriteNode + assert_location(LocalVariableWriteNode, "foo = bar") + end + + def test_MatchLastLineNode + assert_location(MatchLastLineNode, "if /foo/ then end", 3...8, &:predicate) + end + + def test_MatchPredicateNode + assert_location(MatchPredicateNode, "foo in bar") + end + + def test_MatchRequiredNode + assert_location(MatchRequiredNode, "foo => bar") + end + + def test_MatchWriteNode + assert_location(MatchWriteNode, "/(?)/ =~ foo") + end + + def test_ModuleNode + assert_location(ModuleNode, "module Foo end") + end + + def test_MultiTargetNode + assert_location(MultiTargetNode, "for foo, bar in baz do end", 4...12, &:index) + assert_location(MultiTargetNode, "foo, (bar, baz) = qux", 5...15) { |node| node.lefts.last } + assert_location(MultiTargetNode, "def foo((bar)); end", 8...13) do |node| + node.parameters.requireds.first + end + end + + def test_MultiWriteNode + assert_location(MultiWriteNode, "foo, bar = baz") + assert_location(MultiWriteNode, "(foo, bar) = baz") + assert_location(MultiWriteNode, "((foo, bar)) = baz") + end + + def test_NextNode + assert_location(NextNode, "next") + assert_location(NextNode, "next foo") + assert_location(NextNode, "next foo, bar") + assert_location(NextNode, "next(foo)") + end + + def test_NilNode + assert_location(NilNode, "nil") + end + + def test_NoKeywordsParameterNode + assert_location(NoKeywordsParameterNode, "def foo(**nil); end", 8...13) { |node| node.parameters.keyword_rest } + end + + def test_NumberedParametersNode + assert_location(NumberedParametersNode, "-> { _1 }", &:parameters) + assert_location(NumberedParametersNode, "foo { _1 }", 4...10) { |node| node.block.parameters } + end + + def test_NumberedReferenceReadNode + assert_location(NumberedReferenceReadNode, "$1") + end + + def test_OptionalKeywordParameterNode + assert_location(OptionalKeywordParameterNode, "def foo(bar: nil); end", 8...16) do |node| + node.parameters.keywords.first + end + end + + def test_OptionalParameterNode + assert_location(OptionalParameterNode, "def foo(bar = nil); end", 8...17) do |node| + node.parameters.optionals.first + end + end + + def test_OrNode + assert_location(OrNode, "foo || bar") + assert_location(OrNode, "foo or bar") + end + + def test_ParametersNode + assert_location(ParametersNode, "def foo(bar, baz); end", 8...16, &:parameters) + end + + def test_ParenthesesNode + assert_location(ParenthesesNode, "()") + assert_location(ParenthesesNode, "(foo)") + assert_location(ParenthesesNode, "foo (bar), baz", 4...9) { |node| node.arguments.arguments.first } + assert_location(ParenthesesNode, "def (foo).bar; end", 4...9, &:receiver) + end + + def test_PinnedExpressionNode + assert_location(PinnedExpressionNode, "foo in ^(bar)", 7...13, &:pattern) + end + + def test_PinnedVariableNode + assert_location(PinnedVariableNode, "bar = 1; foo in ^bar", 16...20, &:pattern) + assert_location(PinnedVariableNode, "proc { 1 in ^it }.call(1)", 12...15) do |node| + node.receiver.block.body.body.first.pattern + end + end + + def test_PostExecutionNode + assert_location(PostExecutionNode, "END {}") + assert_location(PostExecutionNode, "END { foo }") + end + + def test_PreExecutionNode + assert_location(PreExecutionNode, "BEGIN {}") + assert_location(PreExecutionNode, "BEGIN { foo }") + end + + def test_RangeNode + assert_location(RangeNode, "1..2") + assert_location(RangeNode, "1...2") + + assert_location(RangeNode, "..2") + assert_location(RangeNode, "...2") + + assert_location(RangeNode, "1..") + assert_location(RangeNode, "1...") + end + + def test_RationalNode + assert_location(RationalNode, "1r") + assert_location(RationalNode, "1.0r") + end + + def test_RedoNode + assert_location(RedoNode, "redo") + end + + def test_RegularExpressionNode + assert_location(RegularExpressionNode, "/foo/") + end + + def test_RequiredKeywordParameterNode + assert_location(RequiredKeywordParameterNode, "def foo(bar:); end", 8...12) do |node| + node.parameters.keywords.first + end + end + + def test_RequiredParameterNode + assert_location(RequiredParameterNode, "def foo(bar); end", 8...11) do |node| + node.parameters.requireds.first + end + end + + def test_RescueNode + code = <<~RUBY + begin + body + rescue TypeError + rescue ArgumentError + end + RUBY + assert_location(RescueNode, code, 13...50) { |node| node.rescue_clause } + assert_location(RescueNode, code, 30...50) { |node| node.rescue_clause.consequent } + end + + def test_RescueModifierNode + assert_location(RescueModifierNode, "foo rescue bar") + end + + def test_RestParameterNode + assert_location(RestParameterNode, "def foo(*bar); end", 8...12) do |node| + node.parameters.rest + end + end + + def test_RetryNode + assert_location(RetryNode, "retry") + end + + def test_ReturnNode + assert_location(ReturnNode, "return") + assert_location(ReturnNode, "return foo") + assert_location(ReturnNode, "return foo, bar") + assert_location(ReturnNode, "return(foo)") + end + + def test_SelfNode + assert_location(SelfNode, "self") + end + + def test_ShareableConstantNode + source = <<~RUBY + # shareable_constant_value: literal + C = { foo: 1 } + RUBY + + assert_location(ShareableConstantNode, source, 36...50) + end + + def test_SingletonClassNode + assert_location(SingletonClassNode, "class << self; end") + end + + def test_SourceEncodingNode + assert_location(SourceEncodingNode, "__ENCODING__") + end + + def test_SourceFileNode + assert_location(SourceFileNode, "__FILE__") + end + + def test_SourceLineNode + assert_location(SourceLineNode, "__LINE__") + end + + def test_SplatNode + assert_location(SplatNode, "*foo = bar", 0...4, &:rest) + end + + def test_StatementsNode + assert_location(StatementsNode, "foo { 1 }", 6...7) { |node| node.block.body } + + assert_location(StatementsNode, "(1)", 1...2, &:body) + + assert_location(StatementsNode, "def foo; 1; end", 9...10, &:body) + assert_location(StatementsNode, "def foo = 1", 10...11, &:body) + assert_location(StatementsNode, "def foo; 1\n2; end", 9...12, &:body) + + assert_location(StatementsNode, "if foo; bar; end", 8...11, &:statements) + assert_location(StatementsNode, "foo if bar", 0...3, &:statements) + + assert_location(StatementsNode, "if foo; foo; elsif bar; bar; end", 24...27) { |node| node.consequent.statements } + assert_location(StatementsNode, "if foo; foo; else; bar; end", 19...22) { |node| node.consequent.statements } + + assert_location(StatementsNode, "unless foo; bar; end", 12...15, &:statements) + assert_location(StatementsNode, "foo unless bar", 0...3, &:statements) + + assert_location(StatementsNode, "case; when foo; bar; end", 16...19) { |node| node.conditions.first.statements } + + assert_location(StatementsNode, "while foo; bar; end", 11...14, &:statements) + assert_location(StatementsNode, "foo while bar", 0...3, &:statements) + + assert_location(StatementsNode, "until foo; bar; end", 11...14, &:statements) + assert_location(StatementsNode, "foo until bar", 0...3, &:statements) + + assert_location(StatementsNode, "for foo in bar; baz; end", 16...19, &:statements) + + assert_location(StatementsNode, "begin; foo; end", 7...10, &:statements) + assert_location(StatementsNode, "begin; rescue; foo; end", 15...18) { |node| node.rescue_clause.statements } + assert_location(StatementsNode, "begin; ensure; foo; end", 15...18) { |node| node.ensure_clause.statements } + assert_location(StatementsNode, "begin; rescue; else; foo; end", 21...24) { |node| node.else_clause.statements } + + assert_location(StatementsNode, "class Foo; foo; end", 11...14, &:body) + assert_location(StatementsNode, "module Foo; foo; end", 12...15, &:body) + assert_location(StatementsNode, "class << self; foo; end", 15...18, &:body) + + assert_location(StatementsNode, "-> { foo }", 5...8, &:body) + assert_location(StatementsNode, "BEGIN { foo }", 8...11, &:statements) + assert_location(StatementsNode, "END { foo }", 6...9, &:statements) + + assert_location(StatementsNode, "\"\#{foo}\"", 3...6) { |node| node.parts.first.statements } + end + + def test_StringNode + assert_location(StringNode, '"foo"') + assert_location(StringNode, '%q[foo]') + end + + def test_SuperNode + assert_location(SuperNode, "super foo") + assert_location(SuperNode, "super foo, bar") + + assert_location(SuperNode, "super()") + assert_location(SuperNode, "super(foo)") + assert_location(SuperNode, "super(foo, bar)") + + assert_location(SuperNode, "super() {}") + end + + def test_SymbolNode + assert_location(SymbolNode, ":foo") + end + + def test_TrueNode + assert_location(TrueNode, "true") + end + + def test_UndefNode + assert_location(UndefNode, "undef foo") + assert_location(UndefNode, "undef foo, bar") + end + + def test_UnlessNode + assert_location(UnlessNode, "foo unless bar") + assert_location(UnlessNode, "unless bar; foo; end") + end + + def test_UntilNode + assert_location(UntilNode, "foo = bar until baz") + assert_location(UntilNode, "until bar;baz;end") + end + + def test_WhenNode + assert_location(WhenNode, "case foo; when bar; end", 10...18) { |node| node.conditions.first } + end + + def test_WhileNode + assert_location(WhileNode, "foo = bar while foo != baz") + assert_location(WhileNode, "while a;bar;baz;end") + end + + def test_XStringNode + assert_location(XStringNode, "`foo`") + assert_location(XStringNode, "%x[foo]") + end + + def test_YieldNode + assert_location(YieldNode, "yield") + assert_location(YieldNode, "yield foo") + assert_location(YieldNode, "yield foo, bar") + assert_location(YieldNode, "yield(foo)") + end + + def test_all_tested + expected = Prism.constants.grep(/.Node$/).sort - %i[MissingNode ProgramNode] + actual = LocationTest.instance_methods(false).grep(/.Node$/).map { |name| name[5..].to_sym }.sort + assert_equal expected, actual + end + + private + + def assert_location(kind, source, expected = 0...source.length, **options) + result = Prism.parse(source, **options) + assert result.success? + + node = result.value.statements.body.last + node = yield node if block_given? + + if expected.begin == 0 + assert_equal 0, node.location.start_column + end + + if expected.end == source.length + assert_equal source.split("\n").last.length, node.location.end_column + end + + assert_kind_of kind, node + assert_equal expected.begin, node.location.start_offset + assert_equal expected.end, node.location.end_offset + end + end +end diff --git a/test/mri/prism/magic_comment_test.rb b/test/mri/prism/magic_comment_test.rb new file mode 100644 index 00000000000..5e232c2d004 --- /dev/null +++ b/test/mri/prism/magic_comment_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class MagicCommentTest < TestCase + examples = [ + "# encoding: ascii", + "# coding: ascii", + "# eNcOdInG: ascii", + "# CoDiNg: ascii", + "# \s\t\v encoding \s\t\v : \s\t\v ascii \s\t\v", + "# -*- encoding: ascii -*-", + "# -*- coding: ascii -*-", + "# -*- eNcOdInG: ascii -*-", + "# -*- CoDiNg: ascii -*-", + "# -*- \s\t\v encoding \s\t\v : \s\t\v ascii \s\t\v -*-", + "# -*- foo: bar; encoding: ascii -*-", + "# coding \t \r \v : \t \v \r ascii-8bit", + "# vim: filetype=ruby, fileencoding=big5, tabsize=3, shiftwidth=3" + ] + + examples.each do |example| + define_method(:"test_magic_comment_#{example}") do + assert_magic_comment(example) + end + end + + private + + def assert_magic_comment(example) + expected = Ripper.new(example).tap(&:parse).encoding + actual = Prism.parse(example).encoding + assert_equal expected, actual + end + end +end diff --git a/test/mri/prism/memsize_test.rb b/test/mri/prism/memsize_test.rb new file mode 100644 index 00000000000..d7e1448dbc0 --- /dev/null +++ b/test/mri/prism/memsize_test.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if Prism::BACKEND == :FFI + +module Prism + class MemsizeTest < TestCase + def test_memsize + result = Debug.memsize("2 + 3") + + assert_equal 5, result[:length] + assert_kind_of Integer, result[:memsize] + assert_equal 6, result[:node_count] + end + end +end diff --git a/test/mri/prism/newline_test.rb b/test/mri/prism/newline_test.rb new file mode 100644 index 00000000000..e9975b346e8 --- /dev/null +++ b/test/mri/prism/newline_test.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return unless defined?(RubyVM::InstructionSequence) + +module Prism + class NewlineTest < TestCase + base = File.expand_path("../", __FILE__) + filepaths = Dir["*.rb", base: base] - %w[encoding_test.rb errors_test.rb parser_test.rb static_literals_test.rb unescape_test.rb] + + filepaths.each do |relative| + define_method("test_newline_flags_#{relative}") do + assert_newlines(base, relative) + end + end + + private + + def assert_newlines(base, relative) + filepath = File.join(base, relative) + source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) + expected = rubyvm_lines(source) + + result = Prism.parse_file(filepath) + assert_empty result.errors + actual = prism_lines(result) + + source.each_line.with_index(1) do |line, line_number| + # Lines like `while (foo = bar)` result in two line flags in the + # bytecode but only one newline flag in the AST. We need to remove the + # extra line flag from the bytecode to make the test pass. + if line.match?(/while \(/) + index = expected.index(line_number) + expected.delete_at(index) if index + end + + # Lines like `foo =` where the value is on the next line result in + # another line flag in the bytecode but only one newline flag in the + # AST. + if line.match?(/^\s+\w+ =$/) + if source.lines[line_number].match?(/^\s+case/) + actual[actual.index(line_number)] += 1 + else + actual.delete_at(actual.index(line_number)) + end + end + + if line.match?(/^\s+\w+ = \[$/) + if !expected.include?(line_number) && !expected.include?(line_number + 2) + actual[actual.index(line_number)] += 1 + end + end + end + + assert_equal expected, actual + end + + def ignore_warnings + previous_verbosity = $VERBOSE + $VERBOSE = nil + yield + ensure + $VERBOSE = previous_verbosity + end + + def rubyvm_lines(source) + queue = [ignore_warnings { RubyVM::InstructionSequence.compile(source) }] + lines = [] + + while iseq = queue.shift + lines.concat(iseq.trace_points.filter_map { |line, event| line if event == :line }) + iseq.each_child { |insn| queue << insn unless insn.label.start_with?("ensure in ") } + end + + lines.sort + end + + def prism_lines(result) + result.mark_newlines! + + queue = [result.value] + newlines = [] + + while node = queue.shift + queue.concat(node.compact_child_nodes) + newlines << result.source.line(node.location.start_offset) if node&.newline? + end + + newlines.sort + end + end +end diff --git a/test/mri/prism/parameters_signature_test.rb b/test/mri/prism/parameters_signature_test.rb new file mode 100644 index 00000000000..788ce7b9071 --- /dev/null +++ b/test/mri/prism/parameters_signature_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if RUBY_VERSION < "3.2" || RUBY_ENGINE == "truffleruby" + +module Prism + class ParametersSignatureTest < TestCase + def test_req + assert_parameters([[:req, :a]], "a") + end + + def test_req_destructure + assert_parameters([[:req]], "(a, b)") + end + + def test_opt + assert_parameters([[:opt, :a]], "a = 1") + end + + def test_rest + assert_parameters([[:rest, :a]], "*a") + end + + def test_rest_anonymous + assert_parameters([[:rest, :*]], "*") + end + + def test_post + assert_parameters([[:rest, :a], [:req, :b]], "*a, b") + end + + def test_post_destructure + assert_parameters([[:rest, :a], [:req]], "*a, (b, c)") + end + + def test_keyreq + assert_parameters([[:keyreq, :a]], "a:") + end + + def test_key + assert_parameters([[:key, :a]], "a: 1") + end + + def test_keyrest + assert_parameters([[:keyrest, :a]], "**a") + end + + def test_nokey + assert_parameters([[:nokey]], "**nil") + end + + def test_keyrest_anonymous + assert_parameters([[:keyrest, :**]], "**") + end + + def test_key_ordering + assert_parameters([[:keyreq, :a], [:keyreq, :b], [:key, :c], [:key, :d]], "a:, c: 1, b:, d: 2") + end + + def test_block + assert_parameters([[:block, :a]], "&a") + end + + def test_block_anonymous + assert_parameters([[:block, :&]], "&") + end + + def test_forwarding + assert_parameters([[:rest, :*], [:keyrest, :**], [:block, :&]], "...") + end + + private + + def assert_parameters(expected, source) + eval("def self.m(#{source}); end") + + begin + assert_equal(expected, method(:m).parameters) + assert_equal(expected, signature(source)) + ensure + singleton_class.undef_method(:m) + end + end + + def signature(source) + program = Prism.parse("def m(#{source}); end").value + program.statements.body.first.parameters.signature + end + end +end diff --git a/test/mri/prism/parse_comments_test.rb b/test/mri/prism/parse_comments_test.rb new file mode 100644 index 00000000000..30086e31552 --- /dev/null +++ b/test/mri/prism/parse_comments_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class ParseCommentsTest < TestCase + def test_parse_comments + comments = Prism.parse_comments("# foo") + + assert_kind_of Array, comments + assert_equal 1, comments.length + end + + def test_parse_file_comments + comments = Prism.parse_file_comments(__FILE__) + + assert_kind_of Array, comments + assert_equal 1, comments.length + end + end +end diff --git a/test/mri/prism/parse_stream_test.rb b/test/mri/prism/parse_stream_test.rb new file mode 100644 index 00000000000..9e6347b92b0 --- /dev/null +++ b/test/mri/prism/parse_stream_test.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require_relative "test_helper" +require "stringio" + +module Prism + class ParseStreamTest < TestCase + def test_single_line + io = StringIO.new("1 + 2") + result = Prism.parse_stream(io) + + assert result.success? + assert_kind_of Prism::CallNode, result.value.statements.body.first + end + + def test_multi_line + io = StringIO.new("1 + 2\n3 + 4") + result = Prism.parse_stream(io) + + assert result.success? + assert_kind_of Prism::CallNode, result.value.statements.body.first + assert_kind_of Prism::CallNode, result.value.statements.body.last + end + + def test_multi_read + io = StringIO.new("a" * 4096 * 4) + result = Prism.parse_stream(io) + + assert result.success? + assert_kind_of Prism::CallNode, result.value.statements.body.first + end + + def test___END__ + io = StringIO.new("1 + 2\n3 + 4\n__END__\n5 + 6") + result = Prism.parse_stream(io) + + assert result.success? + assert_equal 2, result.value.statements.body.length + assert_equal "5 + 6", io.read + end + + def test_false___END___in_string + io = StringIO.new("1 + 2\n3 + 4\n\"\n__END__\n\"\n5 + 6") + result = Prism.parse_stream(io) + + assert result.success? + assert_equal 4, result.value.statements.body.length + end + + def test_false___END___in_regexp + io = StringIO.new("1 + 2\n3 + 4\n/\n__END__\n/\n5 + 6") + result = Prism.parse_stream(io) + + assert result.success? + assert_equal 4, result.value.statements.body.length + end + + def test_false___END___in_list + io = StringIO.new("1 + 2\n3 + 4\n%w[\n__END__\n]\n5 + 6") + result = Prism.parse_stream(io) + + assert result.success? + assert_equal 4, result.value.statements.body.length + end + + def test_false___END___in_heredoc + io = StringIO.new("1 + 2\n3 + 4\n<<-EOF\n__END__\nEOF\n5 + 6") + result = Prism.parse_stream(io) + + assert result.success? + assert_equal 4, result.value.statements.body.length + end + end +end diff --git a/test/mri/prism/parse_test.rb b/test/mri/prism/parse_test.rb new file mode 100644 index 00000000000..574a1c1714f --- /dev/null +++ b/test/mri/prism/parse_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class ParseTest < TestCase + # A subclass of Ripper that extracts out magic comments. + class MagicCommentRipper < Ripper + attr_reader :magic_comments + + def initialize(*) + super + @magic_comments = [] + end + + def on_magic_comment(key, value) + @magic_comments << [key, value] + super + end + end + + # When we pretty-print the trees to compare against the snapshots, we want to + # be certain that we print with the same external encoding. This is because + # methods like Symbol#inspect take into account external encoding and it could + # change how the snapshot is generated. On machines with certain settings + # (like LANG=C or -Eascii-8bit) this could have been changed. So here we're + # going to force it to be UTF-8 to keep the snapshots consistent. + def setup + @previous_default_external = Encoding.default_external + ignore_warnings { Encoding.default_external = Encoding::UTF_8 } + end + + def teardown + ignore_warnings { Encoding.default_external = @previous_default_external } + end + + def test_empty_string + result = Prism.parse("") + assert_equal [], result.value.statements.body + end + + def test_parse_takes_file_path + filepath = "filepath.rb" + result = Prism.parse("def foo; __FILE__; end", filepath: filepath) + + assert_equal filepath, find_source_file_node(result.value).filepath + end + + def test_parse_takes_line + line = 4 + result = Prism.parse("def foo\n __FILE__\nend", line: line) + + assert_equal line, result.value.location.start_line + assert_equal line + 1, find_source_file_node(result.value).location.start_line + + result = Prism.parse_lex("def foo\n __FILE__\nend", line: line) + assert_equal line, result.value.first.location.start_line + end + + def test_parse_takes_negative_lines + line = -2 + result = Prism.parse("def foo\n __FILE__\nend", line: line) + + assert_equal line, result.value.location.start_line + assert_equal line + 1, find_source_file_node(result.value).location.start_line + + result = Prism.parse_lex("def foo\n __FILE__\nend", line: line) + assert_equal line, result.value.first.location.start_line + end + + def test_parse_lex + node, tokens = Prism.parse_lex("def foo; end").value + + assert_kind_of ProgramNode, node + assert_equal 5, tokens.length + end + + def test_dump_file + assert_nothing_raised do + Prism.dump_file(__FILE__) + end + + error = assert_raise Errno::ENOENT do + Prism.dump_file("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.dump_file(nil) + end + end + + def test_lex_file + assert_nothing_raised do + Prism.lex_file(__FILE__) + end + + error = assert_raise Errno::ENOENT do + Prism.lex_file("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.lex_file(nil) + end + end + + def test_parse_lex_file + node, tokens = Prism.parse_lex_file(__FILE__).value + + assert_kind_of ProgramNode, node + refute_empty tokens + + error = assert_raise Errno::ENOENT do + Prism.parse_lex_file("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.parse_lex_file(nil) + end + end + + def test_parse_file + node = Prism.parse_file(__FILE__).value + assert_kind_of ProgramNode, node + + error = assert_raise Errno::ENOENT do + Prism.parse_file("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.parse_file(nil) + end + end + + def test_parse_file_success + assert_predicate Prism.parse_file_comments(__FILE__), :any? + + error = assert_raise Errno::ENOENT do + Prism.parse_file_comments("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.parse_file_comments(nil) + end + end + + def test_parse_file_comments + assert_predicate Prism.parse_file_comments(__FILE__), :any? + + error = assert_raise Errno::ENOENT do + Prism.parse_file_comments("idontexist.rb") + end + + assert_equal "No such file or directory - idontexist.rb", error.message + + assert_raise TypeError do + Prism.parse_file_comments(nil) + end + end + + # To accurately compare against Ripper, we need to make sure that we're + # running on CRuby 3.2+. + ripper_enabled = RUBY_ENGINE == "ruby" && RUBY_VERSION >= "3.2.0" + + # The FOCUS environment variable allows you to specify one particular fixture + # to test, instead of all of them. + base = File.join(__dir__, "fixtures") + relatives = ENV["FOCUS"] ? [ENV["FOCUS"]] : Dir["**/*.txt", base: base] + + relatives.each do |relative| + # These fail on TruffleRuby due to a difference in Symbol#inspect: :测试 vs :"测试" + next if RUBY_ENGINE == "truffleruby" and %w[emoji_method_calls.txt seattlerb/bug202.txt seattlerb/magic_encoding_comment.txt].include?(relative) + + filepath = File.join(base, relative) + snapshot = File.expand_path(File.join("snapshots", relative), __dir__) + + directory = File.dirname(snapshot) + FileUtils.mkdir_p(directory) unless File.directory?(directory) + + ripper_should_parse = ripper_should_match = ripper_enabled + + # This file has changed behavior in Ripper in Ruby 3.3, so we skip it if + # we're on an earlier version. + ripper_should_match = false if relative == "seattlerb/pct_w_heredoc_interp_nested.txt" && RUBY_VERSION < "3.3.0" + + # It seems like there are some oddities with nested heredocs and ripper. + # Waiting for feedback on https://bugs.ruby-lang.org/issues/19838. + ripper_should_match = false if relative == "seattlerb/heredoc_nested.txt" + + # Ripper seems to have a bug that the regex portions before and after the heredoc are combined + # into a single token. See https://bugs.ruby-lang.org/issues/19838. + # + # Additionally, Ripper cannot parse the %w[] fixture in this file, so set ripper_should_parse to false. + ripper_should_parse = false if relative == "spanning_heredoc.txt" + + # Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace charactes in the heredoc start. + # Example: <<~' EOF' or <<-' EOF' + # https://bugs.ruby-lang.org/issues/19539 + ripper_should_parse = false if relative == "heredocs_leading_whitespace.txt" && RUBY_VERSION < "3.3.0" + + define_method "test_filepath_#{relative}" do + # First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows, + # and explicitly set the external encoding to UTF-8 to override the binmode default. + source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) + + if ripper_should_parse + src = source + + case relative + when /break|next|redo|if|unless|rescue|control|keywords|retry/ + # Uncaught syntax errors: Invalid break, Invalid next + src = "->do\nrescue\n#{src}\nend" + ripper_should_match = false + end + case src + when /^ *yield/ + # Uncaught syntax errors: Invalid yield + src = "def __invalid_yield__\n#{src}\nend" + ripper_should_match = false + end + + # Make sure that it can be correctly parsed by Ripper. If it can't, then we have a fixture + # that is invalid Ruby. + refute_nil(Ripper.sexp_raw(src), "Ripper failed to parse") + end + + # Next, assert that there were no errors during parsing. + result = Prism.parse(source, filepath: relative) + assert_empty result.errors + + # Next, pretty print the source. + printed = PP.pp(result.value, +"", 79) + + if File.exist?(snapshot) + saved = File.read(snapshot) + + # If the snapshot file exists, but the printed value does not match the + # snapshot, then update the snapshot file. + if printed != saved + File.write(snapshot, printed) + warn("Updated snapshot at #{snapshot}.") + end + + # If the snapshot file exists, then assert that the printed value + # matches the snapshot. + assert_equal(saved, printed) + else + # If the snapshot file does not yet exist, then write it out now. + File.write(snapshot, printed) + warn("Created snapshot at #{snapshot}.") + end + + # Next, assert that the value can be serialized and deserialized without + # changing the shape of the tree. + assert_equal_nodes(result.value, Prism.load(source, Prism.dump(source, filepath: relative)).value) + + # Next, check that the location ranges of each node in the tree are a + # superset of their respective child nodes. + assert_non_overlapping_locations(result.value) + + # Next, assert that the newlines are in the expected places. + expected_newlines = [0] + source.b.scan("\n") { expected_newlines << $~.offset(0)[0] + 1 } + assert_equal expected_newlines, Debug.newlines(source) + + if ripper_should_parse && ripper_should_match + # Finally, assert that we can lex the source and get the same tokens as + # Ripper. + lex_result = Prism.lex_compat(source) + assert_equal [], lex_result.errors + tokens = lex_result.value + + begin + Prism.lex_ripper(source).zip(tokens).each do |(ripper, prism)| + assert_equal ripper, prism + end + rescue SyntaxError + raise ArgumentError, "Test file has invalid syntax #{filepath}" + end + + # Next, check that we get the correct number of magic comments when + # lexing with ripper. + expected = MagicCommentRipper.new(source).tap(&:parse).magic_comments + actual = result.magic_comments + + assert_equal expected.length, actual.length + expected.zip(actual).each do |(expected_key, expected_value), magic_comment| + assert_equal expected_key, magic_comment.key + assert_equal expected_value, magic_comment.value + end + end + end + end + + Dir["*.txt", base: base].each do |relative| + next if relative == "newline_terminated.txt" || relative == "spanning_heredoc_newlines.txt" + + # We test every snippet (separated by \n\n) in isolation + # to ensure the parser does not try to read bytes further than the end of each snippet + define_method "test_individual_snippets_#{relative}" do + filepath = File.join(base, relative) + + # First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows, + # and explicitly set the external encoding to UTF-8 to override the binmode default. + file_contents = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) + + file_contents.split(/(?<=\S)\n\n(?=\S)/).each do |snippet| + snippet = snippet.rstrip + result = Prism.parse(snippet, filepath: relative) + assert_empty result.errors + + assert_equal_nodes(result.value, Prism.load(snippet, Prism.dump(snippet, filepath: relative)).value) + end + end + end + + private + + # Check that the location ranges of each node in the tree are a superset of + # their respective child nodes. + def assert_non_overlapping_locations(node) + queue = [node] + + while (current = queue.shift) + # We only want to compare parent/child location overlap in the case that + # we are not looking at a heredoc. That's because heredoc locations are + # special in that they only use the declaration of the heredoc. + compare = !(current.is_a?(StringNode) || + current.is_a?(XStringNode) || + current.is_a?(InterpolatedStringNode) || + current.is_a?(InterpolatedXStringNode)) || + !current.opening&.start_with?("<<") + + current.child_nodes.each do |child| + # child_nodes can return nil values, so we need to skip those. + next unless child + + # Now that we know we have a child node, add that to the queue. + queue << child + + if compare + assert_operator current.location.start_offset, :<=, child.location.start_offset + assert_operator current.location.end_offset, :>=, child.location.end_offset + end + end + end + end + + def find_source_file_node(program) + queue = [program] + while (node = queue.shift) + return node if node.is_a?(SourceFileNode) + queue.concat(node.compact_child_nodes) + end + end + + def ignore_warnings + previous_verbosity = $VERBOSE + $VERBOSE = nil + yield + ensure + $VERBOSE = previous_verbosity + end + end +end diff --git a/test/mri/prism/parser_test.rb b/test/mri/prism/parser_test.rb new file mode 100644 index 00000000000..237a4397cae --- /dev/null +++ b/test/mri/prism/parser_test.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +begin + verbose, $VERBOSE = $VERBOSE, nil + require "parser/ruby33" + require "prism/translation/parser33" +rescue LoadError + # In CRuby's CI, we're not going to test against the parser gem because we + # don't want to have to install it. So in this case we'll just skip this test. + return +ensure + $VERBOSE = verbose +end + +# First, opt in to every AST feature. +Parser::Builders::Default.modernize + +# Modify the source map == check so that it doesn't check against the node +# itself so we don't get into a recursive loop. +Parser::Source::Map.prepend( + Module.new { + def ==(other) + self.class == other.class && + (instance_variables - %i[@node]).map do |ivar| + instance_variable_get(ivar) == other.instance_variable_get(ivar) + end.reduce(:&) + end + } +) + +# Next, ensure that we're comparing the nodes and also comparing the source +# ranges so that we're getting all of the necessary information. +Parser::AST::Node.prepend( + Module.new { + def ==(other) + super && (location == other.location) + end + } +) + +module Prism + class ParserTest < TestCase + base = File.join(__dir__, "fixtures") + + # These files are erroring because of the parser gem being wrong. + skip_incorrect = [ + "embdoc_no_newline_at_end.txt" + ] + + # These files are either failing to parse or failing to translate, so we'll + # skip them for now. + skip_all = skip_incorrect | [ + "dash_heredocs.txt", + "dos_endings.txt", + "heredocs_with_ignored_newlines.txt", + "regex.txt", + "regex_char_width.txt", + "spanning_heredoc.txt", + "spanning_heredoc_newlines.txt", + "tilde_heredocs.txt", + "unescaping.txt" + ] + + # Not sure why these files are failing on JRuby, but skipping them for now. + if RUBY_ENGINE == "jruby" + skip_all.push("emoji_method_calls.txt", "symbols.txt") + end + + # These files are failing to translate their lexer output into the lexer + # output expected by the parser gem, so we'll skip them for now. + skip_tokens = [ + "comments.txt", + "heredoc_with_comment.txt", + "indented_file_end.txt", + "strings.txt", + "xstring_with_backslash.txt" + ] + + Dir["*.txt", base: base].each do |name| + next if skip_all.include?(name) + + define_method("test_#{name}") do + assert_equal_parses(File.join(base, name), compare_tokens: !skip_tokens.include?(name)) + end + end + + private + + def assert_equal_parses(filepath, compare_tokens: true) + buffer = Parser::Source::Buffer.new(filepath, 1) + buffer.source = File.read(filepath) + + parser = Parser::Ruby33.new + parser.diagnostics.consumer = ->(*) {} + parser.diagnostics.all_errors_are_fatal = true + + expected_ast, expected_comments, expected_tokens = + begin + parser.tokenize(buffer) + rescue ArgumentError, Parser::SyntaxError + return + end + + actual_ast, actual_comments, actual_tokens = + Prism::Translation::Parser33.new.tokenize(buffer) + + assert_equal expected_ast, actual_ast, -> { assert_equal_asts_message(expected_ast, actual_ast) } + assert_equal_tokens(expected_tokens, actual_tokens) if compare_tokens + assert_equal_comments(expected_comments, actual_comments) + end + + def assert_equal_asts_message(expected_ast, actual_ast) + queue = [[expected_ast, actual_ast]] + + while (left, right = queue.shift) + if left.type != right.type + return "expected: #{left.type}\nactual: #{right.type}" + end + + if left.location != right.location + return "expected:\n#{left.inspect}\n#{left.location.inspect}\nactual:\n#{right.inspect}\n#{right.location.inspect}" + end + + if left.type == :str && left.children[0] != right.children[0] + return "expected: #{left.inspect}\nactual: #{right.inspect}" + end + + left.children.zip(right.children).each do |left_child, right_child| + queue << [left_child, right_child] if left_child.is_a?(Parser::AST::Node) + end + end + + "expected: #{expected_ast.inspect}\nactual: #{actual_ast.inspect}" + end + + def assert_equal_tokens(expected_tokens, actual_tokens) + if expected_tokens != actual_tokens + expected_index = 0 + actual_index = 0 + + while expected_index < expected_tokens.length + expected_token = expected_tokens[expected_index] + actual_token = actual_tokens[actual_index] + + expected_index += 1 + actual_index += 1 + + # The parser gem always has a space before a string end in list + # literals, but we don't. So we'll skip over the space. + if expected_token[0] == :tSPACE && actual_token[0] == :tSTRING_END + expected_index += 1 + next + end + + # There are a lot of tokens that have very specific meaning according + # to the context of the parser. We don't expose that information in + # prism, so we need to normalize these tokens a bit. + case actual_token[0] + when :kDO + actual_token[0] = expected_token[0] if %i[kDO_BLOCK kDO_LAMBDA].include?(expected_token[0]) + when :tLPAREN + actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2 + when :tPOW + actual_token[0] = expected_token[0] if expected_token[0] == :tDSTAR + end + + # Now we can assert that the tokens are actually equal. + assert_equal expected_token, actual_token, -> { + "expected: #{expected_token.inspect}\n" \ + "actual: #{actual_token.inspect}" + } + end + end + end + + def assert_equal_comments(expected_comments, actual_comments) + assert_equal expected_comments, actual_comments, -> { + "expected: #{expected_comments.inspect}\n" \ + "actual: #{actual_comments.inspect}" + } + end + end +end diff --git a/test/mri/prism/pattern_test.rb b/test/mri/prism/pattern_test.rb new file mode 100644 index 00000000000..e0aa079cb9c --- /dev/null +++ b/test/mri/prism/pattern_test.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class PatternTest < TestCase + def test_invalid_syntax + assert_raise(Pattern::CompilationError) { scan("", "<>") } + end + + def test_invalid_constant + assert_raise(Pattern::CompilationError) { scan("", "Foo") } + end + + def test_invalid_nested_constant + assert_raise(Pattern::CompilationError) { scan("", "Foo::Bar") } + end + + def test_regexp_with_interpolation + assert_raise(Pattern::CompilationError) { scan("", "/\#{foo}/") } + end + + def test_string_with_interpolation + assert_raise(Pattern::CompilationError) { scan("", '"#{foo}"') } + end + + def test_symbol_with_interpolation + assert_raise(Pattern::CompilationError) { scan("", ":\"\#{foo}\"") } + end + + def test_invalid_node + assert_raise(Pattern::CompilationError) { scan("", "IntegerNode[^foo]") } + end + + def test_self + assert_raise(Pattern::CompilationError) { scan("", "self") } + end + + def test_array_pattern_no_constant + results = scan("1 + 2", "[IntegerNode]") + + assert_equal 1, results.length + end + + def test_array_pattern + results = scan("1 + 2", "CallNode[name: :+, receiver: IntegerNode, arguments: [IntegerNode]]") + + assert_equal 1, results.length + end + + def test_alternation_pattern + results = scan("Foo + Bar + 1", "ConstantReadNode | IntegerNode") + + assert_equal 3, results.length + assert_equal 1, results.grep(IntegerNode).first.value + end + + def test_constant_read_node + results = scan("Foo + Bar + Baz", "ConstantReadNode") + + assert_equal 3, results.length + assert_equal %w[Bar Baz Foo], results.map(&:slice).sort + end + + def test_object_const + results = scan("1 + 2 + 3", "IntegerNode[]") + + assert_equal 3, results.length + end + + def test_constant_path + results = scan("Foo + Bar + Baz", "Prism::ConstantReadNode") + + assert_equal 3, results.length + end + + def test_hash_pattern_no_constant + results = scan("Foo + Bar + Baz", "{ name: :+ }") + + assert_equal 2, results.length + end + + def test_hash_pattern_regexp + results = scan("Foo + Bar + Baz", "{ name: /^[[:punct:]]$/ }") + + assert_equal 2, results.length + assert_equal ["Prism::CallNode"], results.map { |node| node.class.name }.uniq + end + + def test_nil + results = scan("foo", "{ receiver: nil }") + + assert_equal 1, results.length + end + + def test_regexp_options + results = scan("@foo + @bar + @baz", "InstanceVariableReadNode[name: /^@B/i]") + + assert_equal 2, results.length + end + + def test_string_empty + results = scan("", "''") + + assert_empty results + end + + def test_symbol_empty + results = scan("", ":''") + + assert_empty results + end + + def test_symbol_plain + results = scan("@foo", "{ name: :\"@foo\" }") + + assert_equal 1, results.length + end + + def test_symbol + results = scan("@foo", "{ name: :@foo }") + + assert_equal 1, results.length + end + + private + + def scan(source, query) + Prism::Pattern.new(query).scan(Prism.parse(source).value).to_a + end + end +end diff --git a/test/mri/prism/regexp_test.rb b/test/mri/prism/regexp_test.rb new file mode 100644 index 00000000000..0a5fc2b4fc4 --- /dev/null +++ b/test/mri/prism/regexp_test.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if Prism::BACKEND == :FFI + +module Prism + class RegexpTest < TestCase + ############################################################################## + # These tests test the actual use case of extracting named capture groups + ############################################################################## + + def test_named_captures_with_arrows + assert_equal(["foo"], named_captures("(?bar)")) + end + + def test_named_captures_with_single_quotes + assert_equal(["foo"], named_captures("(?'foo'bar)")) + end + + def test_nested_named_captures_with_arrows + assert_equal(["foo", "bar"], named_captures("(?(?baz))")) + end + + def test_nested_named_captures_with_single_quotes + assert_equal(["foo", "bar"], named_captures("(?'foo'(?'bar'baz))")) + end + + def test_allows_duplicate_named_captures + assert_equal(["foo", "foo"], named_captures("(?bar)(?baz)")) + end + + def test_named_capture_inside_fake_range_quantifier + assert_equal(["foo"], named_captures("foo{1, (?2)}")) + end + + ############################################################################## + # These tests test the rest of the AST. They are not exhaustive, but they + # should cover the most common cases. We test these to make sure we don't + # accidentally regress and stop being able to extract named captures. + ############################################################################## + + def test_alternation + refute_nil(named_captures("foo|bar")) + end + + def test_anchors + refute_nil(named_captures("^foo$")) + end + + def test_any + refute_nil(named_captures(".")) + end + + def test_posix_character_classes + refute_nil(named_captures("[[:digit:]]")) + end + + def test_negated_posix_character_classes + refute_nil(named_captures("[[:^digit:]]")) + end + + def test_invalid_posix_character_classes_should_fall_back_to_regular_classes + refute_nil(named_captures("[[:foo]]")) + end + + def test_character_sets + refute_nil(named_captures("[abc]")) + end + + def test_nested_character_sets + refute_nil(named_captures("[[abc]]")) + end + + def test_nested_character_sets_with_operators + refute_nil(named_captures("[[abc] && [def]]")) + end + + def test_named_capture_inside_nested_character_set + assert_equal([], named_captures("[foo (?bar)]")) + end + + def test_negated_character_sets + refute_nil(named_captures("[^abc]")) + end + + def test_character_ranges + refute_nil(named_captures("[a-z]")) + end + + def test_negated_character_ranges + refute_nil(named_captures("[^a-z]")) + end + + def test_fake_named_captures_inside_character_sets + assert_equal([], named_captures("[a-z(?)]")) + end + + def test_fake_named_capture_inside_character_set_with_escaped_ending + assert_equal([], named_captures("[a-z\\](?)]")) + end + + def test_comments + refute_nil(named_captures("(?#foo)")) + end + + def test_comments_with_escaped_parentheses + refute_nil(named_captures("(?#foo\\)\\))")) + end + + def test_non_capturing_groups + refute_nil(named_captures("(?:foo)")) + end + + def test_positive_lookaheads + refute_nil(named_captures("(?=foo)")) + end + + def test_negative_lookaheads + refute_nil(named_captures("(?!foo)")) + end + + def test_positive_lookbehinds + refute_nil(named_captures("(?<=foo)")) + end + + def test_negative_lookbehinds + refute_nil(named_captures("(?foo)")) + end + + def test_absence_operator + refute_nil(named_captures("(?~foo)")) + end + + def test_conditional_expression_with_index + refute_nil(named_captures("(?(1)foo)")) + end + + def test_conditional_expression_with_name + refute_nil(named_captures("(?(foo)bar)")) + end + + def test_conditional_expression_with_group + refute_nil(named_captures("(?()bar)")) + end + + def test_options_on_groups + refute_nil(named_captures("(?imxdau:foo)")) + end + + def test_options_on_groups_with_invalid_options + assert_nil(named_captures("(?z:bar)")) + end + + def test_options_on_groups_getting_turned_off + refute_nil(named_captures("(?-imx:foo)")) + end + + def test_options_on_groups_some_getting_turned_on_some_getting_turned_off + refute_nil(named_captures("(?im-x:foo)")) + end + + def test_star_quantifier + refute_nil(named_captures("foo*")) + end + + def test_plus_quantifier + refute_nil(named_captures("foo+")) + end + + def test_question_mark_quantifier + refute_nil(named_captures("foo?")) + end + + def test_endless_range_quantifier + refute_nil(named_captures("foo{1,}")) + end + + def test_beginless_range_quantifier + refute_nil(named_captures("foo{,1}")) + end + + def test_range_quantifier + refute_nil(named_captures("foo{1,2}")) + end + + def test_fake_range_quantifier_because_of_spaces + refute_nil(named_captures("foo{1, 2}")) + end + + ############################################################################## + # These test that flag values are correct. + ############################################################################## + + def test_flag_ignorecase + assert_equal(Regexp::IGNORECASE, options("i")) + end + + def test_flag_extended + assert_equal(Regexp::EXTENDED, options("x")) + end + + def test_flag_multiline + assert_equal(Regexp::MULTILINE, options("m")) + end + + def test_flag_fixedencoding + assert_equal(Regexp::FIXEDENCODING, options("e")) + assert_equal(Regexp::FIXEDENCODING, options("u")) + assert_equal(Regexp::FIXEDENCODING, options("s")) + end + + def test_flag_noencoding + assert_equal(Regexp::NOENCODING, options("n")) + end + + def test_flag_once + assert_equal(0, options("o")) + end + + def test_flag_combined + value = Regexp::IGNORECASE | Regexp::MULTILINE | Regexp::EXTENDED + assert_equal(value, options("mix")) + end + + def test_last_encoding_option_wins + regex = "/foo/nu" + option = Prism.parse(regex).value.statements.body.first.options + + assert_equal Regexp::FIXEDENCODING, option + + regex = "/foo/un" + option = Prism.parse(regex).value.statements.body.first.options + + assert_equal Regexp::NOENCODING, option + end + + private + + def named_captures(source) + Debug.named_captures(source) + end + + def options(flags) + options = + ["/foo/#{flags}", "/foo\#{1}/#{flags}"].map do |source| + Prism.parse(source).value.statements.body.first.options + end + + # Check that we get the same set of options from both regular expressions + # and interpolated regular expressions. + assert_equal(1, options.uniq.length) + + # Return the options from the first regular expression since we know they + # are the same. + options.first + end + end +end diff --git a/test/mri/prism/ripper_test.rb b/test/mri/prism/ripper_test.rb new file mode 100644 index 00000000000..07238fc3d54 --- /dev/null +++ b/test/mri/prism/ripper_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +return if RUBY_VERSION < "3.3" + +require_relative "test_helper" + +module Prism + class RipperTest < TestCase + base = File.join(__dir__, "fixtures") + relatives = ENV["FOCUS"] ? [ENV["FOCUS"]] : Dir["**/*.txt", base: base] + + incorrect = [ + # Ripper incorrectly attributes the block to the keyword. + "seattlerb/block_break.txt", + "seattlerb/block_next.txt", + "seattlerb/block_return.txt", + "whitequark/break_block.txt", + "whitequark/next_block.txt", + "whitequark/return_block.txt", + + # Ripper is not accounting for locals created by patterns using the ** + # operator within an `in` clause. + "seattlerb/parse_pattern_058.txt", + + # Ripper cannot handle named capture groups in regular expressions. + "regex.txt", + "regex_char_width.txt", + "whitequark/lvar_injecting_match.txt", + + # Ripper fails to understand some structures that span across heredocs. + "spanning_heredoc.txt" + ] + + omitted = [ + "dos_endings.txt", + "heredocs_with_ignored_newlines.txt", + "seattlerb/block_call_dot_op2_brace_block.txt", + "seattlerb/block_command_operation_colon.txt", + "seattlerb/block_command_operation_dot.txt", + "seattlerb/heredoc__backslash_dos_format.txt", + "seattlerb/heredoc_backslash_nl.txt", + "seattlerb/heredoc_nested.txt", + "seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt", + "tilde_heredocs.txt", + "unparser/corpus/semantic/dstr.txt", + "whitequark/dedenting_heredoc.txt", + "whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt", + "whitequark/parser_slash_slash_n_escaping_in_literals.txt", + "whitequark/send_block_chain_cmd.txt", + "whitequark/slash_newline_in_heredocs.txt" + ] + + relatives.each do |relative| + # Skip the tests that Ripper is reporting the wrong results for. + next if incorrect.include?(relative) + + # Skip the tests we haven't implemented yet. + next if omitted.include?(relative) + + filepath = File.join(__dir__, "fixtures", relative) + + define_method "test_ripper_#{relative}" do + source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) + + case relative + when /break|next|redo|if|unless|rescue|control|keywords|retry/ + source = "-> do\nrescue\n#{source}\nend" + end + + case source + when /^ *yield/ + source = "def __invalid_yield__\n#{source}\nend" + end + + assert_ripper(source) + end + end + + private + + def assert_ripper(source) + assert_equal Ripper.sexp_raw(source), Prism::Translation::Ripper.sexp_raw(source) + end + end +end diff --git a/test/mri/prism/ruby_api_test.rb b/test/mri/prism/ruby_api_test.rb new file mode 100644 index 00000000000..80f7cb05d3e --- /dev/null +++ b/test/mri/prism/ruby_api_test.rb @@ -0,0 +1,255 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class RubyAPITest < TestCase + def test_ruby_api + filepath = __FILE__ + source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) + + assert_equal Prism.lex(source, filepath: filepath).value, Prism.lex_file(filepath).value + assert_equal Prism.dump(source, filepath: filepath), Prism.dump_file(filepath) + + serialized = Prism.dump(source, filepath: filepath) + ast1 = Prism.load(source, serialized).value + ast2 = Prism.parse(source, filepath: filepath).value + ast3 = Prism.parse_file(filepath).value + + assert_equal_nodes ast1, ast2 + assert_equal_nodes ast2, ast3 + end + + def test_parse_success? + assert Prism.parse_success?("1") + refute Prism.parse_success?("<>") + end + + def test_parse_file_success? + assert Prism.parse_file_success?(__FILE__) + end + + def test_options + assert_equal "", Prism.parse("__FILE__").value.statements.body[0].filepath + assert_equal "foo.rb", Prism.parse("__FILE__", filepath: "foo.rb").value.statements.body[0].filepath + + assert_equal 1, Prism.parse("foo").value.statements.body[0].location.start_line + assert_equal 10, Prism.parse("foo", line: 10).value.statements.body[0].location.start_line + + refute Prism.parse("\"foo\"").value.statements.body[0].frozen? + assert Prism.parse("\"foo\"", frozen_string_literal: true).value.statements.body[0].frozen? + refute Prism.parse("\"foo\"", frozen_string_literal: false).value.statements.body[0].frozen? + + assert_kind_of Prism::CallNode, Prism.parse("foo").value.statements.body[0] + assert_kind_of Prism::LocalVariableReadNode, Prism.parse("foo", scopes: [[:foo]]).value.statements.body[0] + assert_equal 1, Prism.parse("foo", scopes: [[:foo], []]).value.statements.body[0].depth + + assert_equal [:foo], Prism.parse("foo", scopes: [[:foo]]).value.locals + end + + def test_literal_value_method + assert_equal 123, parse_expression("123").value + assert_equal 3.14, parse_expression("3.14").value + assert_equal 42i, parse_expression("42i").value + assert_equal 42.1ri, parse_expression("42.1ri").value + assert_equal 3.14i, parse_expression("3.14i").value + assert_equal 42r, parse_expression("42r").value + assert_equal 0.5r, parse_expression("0.5r").value + assert_equal 42ri, parse_expression("42ri").value + assert_equal 0.5ri, parse_expression("0.5ri").value + assert_equal 0xFFr, parse_expression("0xFFr").value + assert_equal 0xFFri, parse_expression("0xFFri").value + end + + def test_location_join + recv, args_node, _ = parse_expression("1234 + 567").child_nodes + arg = args_node.arguments[0] + + joined = recv.location.join(arg.location) + assert_equal 0, joined.start_offset + assert_equal 10, joined.length + + assert_raise RuntimeError, "Incompatible locations" do + arg.location.join(recv.location) + end + + other_arg = parse_expression("1234 + 567").arguments.arguments[0] + + assert_raise RuntimeError, "Incompatible sources" do + other_arg.location.join(recv.location) + end + + assert_raise RuntimeError, "Incompatible sources" do + recv.location.join(other_arg.location) + end + end + + def test_location_character_offsets + program = Prism.parse("😀 + 😀\n😍 ||= 😍").value + + # first 😀 + location = program.statements.body.first.receiver.location + assert_equal 0, location.start_character_offset + assert_equal 1, location.end_character_offset + assert_equal 0, location.start_character_column + assert_equal 1, location.end_character_column + + # second 😀 + location = program.statements.body.first.arguments.arguments.first.location + assert_equal 4, location.start_character_offset + assert_equal 5, location.end_character_offset + assert_equal 4, location.start_character_column + assert_equal 5, location.end_character_column + + # first 😍 + location = program.statements.body.last.name_loc + assert_equal 6, location.start_character_offset + assert_equal 7, location.end_character_offset + assert_equal 0, location.start_character_column + assert_equal 1, location.end_character_column + + # second 😍 + location = program.statements.body.last.value.location + assert_equal 12, location.start_character_offset + assert_equal 13, location.end_character_offset + assert_equal 6, location.start_character_column + assert_equal 7, location.end_character_column + end + + def test_location_code_units + program = Prism.parse("😀 + 😀\n😍 ||= 😍").value + + # first 😀 + location = program.statements.body.first.receiver.location + + assert_equal 0, location.start_code_units_offset(Encoding::UTF_8) + assert_equal 0, location.start_code_units_offset(Encoding::UTF_16LE) + assert_equal 0, location.start_code_units_offset(Encoding::UTF_32LE) + + assert_equal 1, location.end_code_units_offset(Encoding::UTF_8) + assert_equal 2, location.end_code_units_offset(Encoding::UTF_16LE) + assert_equal 1, location.end_code_units_offset(Encoding::UTF_32LE) + + assert_equal 0, location.start_code_units_column(Encoding::UTF_8) + assert_equal 0, location.start_code_units_column(Encoding::UTF_16LE) + assert_equal 0, location.start_code_units_column(Encoding::UTF_32LE) + + assert_equal 1, location.end_code_units_column(Encoding::UTF_8) + assert_equal 2, location.end_code_units_column(Encoding::UTF_16LE) + assert_equal 1, location.end_code_units_column(Encoding::UTF_32LE) + + # second 😀 + location = program.statements.body.first.arguments.arguments.first.location + + assert_equal 4, location.start_code_units_offset(Encoding::UTF_8) + assert_equal 5, location.start_code_units_offset(Encoding::UTF_16LE) + assert_equal 4, location.start_code_units_offset(Encoding::UTF_32LE) + + assert_equal 5, location.end_code_units_offset(Encoding::UTF_8) + assert_equal 7, location.end_code_units_offset(Encoding::UTF_16LE) + assert_equal 5, location.end_code_units_offset(Encoding::UTF_32LE) + + assert_equal 4, location.start_code_units_column(Encoding::UTF_8) + assert_equal 5, location.start_code_units_column(Encoding::UTF_16LE) + assert_equal 4, location.start_code_units_column(Encoding::UTF_32LE) + + assert_equal 5, location.end_code_units_column(Encoding::UTF_8) + assert_equal 7, location.end_code_units_column(Encoding::UTF_16LE) + assert_equal 5, location.end_code_units_column(Encoding::UTF_32LE) + + # first 😍 + location = program.statements.body.last.name_loc + + assert_equal 6, location.start_code_units_offset(Encoding::UTF_8) + assert_equal 8, location.start_code_units_offset(Encoding::UTF_16LE) + assert_equal 6, location.start_code_units_offset(Encoding::UTF_32LE) + + assert_equal 7, location.end_code_units_offset(Encoding::UTF_8) + assert_equal 10, location.end_code_units_offset(Encoding::UTF_16LE) + assert_equal 7, location.end_code_units_offset(Encoding::UTF_32LE) + + assert_equal 0, location.start_code_units_column(Encoding::UTF_8) + assert_equal 0, location.start_code_units_column(Encoding::UTF_16LE) + assert_equal 0, location.start_code_units_column(Encoding::UTF_32LE) + + assert_equal 1, location.end_code_units_column(Encoding::UTF_8) + assert_equal 2, location.end_code_units_column(Encoding::UTF_16LE) + assert_equal 1, location.end_code_units_column(Encoding::UTF_32LE) + + # second 😍 + location = program.statements.body.last.value.location + + assert_equal 12, location.start_code_units_offset(Encoding::UTF_8) + assert_equal 15, location.start_code_units_offset(Encoding::UTF_16LE) + assert_equal 12, location.start_code_units_offset(Encoding::UTF_32LE) + + assert_equal 13, location.end_code_units_offset(Encoding::UTF_8) + assert_equal 17, location.end_code_units_offset(Encoding::UTF_16LE) + assert_equal 13, location.end_code_units_offset(Encoding::UTF_32LE) + + assert_equal 6, location.start_code_units_column(Encoding::UTF_8) + assert_equal 7, location.start_code_units_column(Encoding::UTF_16LE) + assert_equal 6, location.start_code_units_column(Encoding::UTF_32LE) + + assert_equal 7, location.end_code_units_column(Encoding::UTF_8) + assert_equal 9, location.end_code_units_column(Encoding::UTF_16LE) + assert_equal 7, location.end_code_units_column(Encoding::UTF_32LE) + end + + def test_heredoc? + refute parse_expression("\"foo\"").heredoc? + refute parse_expression("\"foo \#{1}\"").heredoc? + refute parse_expression("`foo`").heredoc? + refute parse_expression("`foo \#{1}`").heredoc? + + assert parse_expression("<<~HERE\nfoo\nHERE\n").heredoc? + assert parse_expression("<<~HERE\nfoo \#{1}\nHERE\n").heredoc? + assert parse_expression("<<~`HERE`\nfoo\nHERE\n").heredoc? + assert parse_expression("<<~`HERE`\nfoo \#{1}\nHERE\n").heredoc? + end + + # Through some bit hackery, we want to allow consumers to use the integer + # base flags as the base itself. It has a nice property that the current + # alignment provides them in the correct order. So here we test that our + # assumption holds so that it doesn't change out from under us. + # + # In C, this would look something like: + # + # ((flags & ~DECIMAL) << 1) || 10 + # + # We have to do some other work in Ruby because 0 is truthy and ~ on an + # integer doesn't have a fixed width. + def test_integer_base_flags + base = -> (node) do + value = (node.send(:flags) & (0b1111 - IntegerBaseFlags::DECIMAL)) << 1 + value == 0 ? 10 : value + end + + assert_equal 2, base[parse_expression("0b1")] + assert_equal 8, base[parse_expression("0o1")] + assert_equal 10, base[parse_expression("0d1")] + assert_equal 16, base[parse_expression("0x1")] + end + + def test_offset + source = <<~RUBY + #!/bin/sh + + echo "foo" + exit 0 + + #!/usr/bin/env ruby + + puts "bar" + RUBY + + assert Prism.parse_success?(source, offset: 30) + end + + private + + def parse_expression(source) + Prism.parse(source).value.statements.body.first + end + end +end diff --git a/test/mri/prism/ruby_parser_test.rb b/test/mri/prism/ruby_parser_test.rb new file mode 100644 index 00000000000..1d22f0e7b87 --- /dev/null +++ b/test/mri/prism/ruby_parser_test.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +return if RUBY_ENGINE == "jruby" + +require_relative "test_helper" + +begin + require "ruby_parser" +rescue LoadError + # In CRuby's CI, we're not going to test against the ruby_parser gem because + # we don't want to have to install it. So in this case we'll just skip this + # test. + return +end + +# We want to also compare lines and files to make sure we're setting them +# correctly. +Sexp.prepend( + Module.new do + def ==(other) + super && line == other.line && max_line == other.max_line && file == other.file + end + end +) + +module Prism + class RubyParserTest < TestCase + base = File.join(__dir__, "fixtures") + + todos = %w[ + heredocs_nested.txt + newline_terminated.txt + regex_char_width.txt + seattlerb/bug169.txt + seattlerb/dstr_evstr.txt + seattlerb/heredoc_squiggly_interp.txt + seattlerb/masgn_colon3.txt + seattlerb/messy_op_asgn_lineno.txt + seattlerb/op_asgn_primary_colon_const_command_call.txt + seattlerb/parse_line_evstr_after_break.txt + seattlerb/regexp_esc_C_slash.txt + seattlerb/str_lit_concat_bad_encodings.txt + seattlerb/str_pct_nested_nested.txt + unescaping.txt + unparser/corpus/literal/kwbegin.txt + unparser/corpus/literal/send.txt + unparser/corpus/semantic/dstr.txt + whitequark/masgn_const.txt + whitequark/ruby_bug_12402.txt + whitequark/ruby_bug_14690.txt + whitequark/space_args_block.txt + whitequark/string_concat.txt + ] + + # These files contain CRLF line endings, which ruby_parser translates into + # LF before it gets back to the node. This means the node actually has the + # wrong contents. + crlf = %w[ + dos_endings.txt + heredoc_with_comment.txt + seattlerb/heredoc__backslash_dos_format.txt + seattlerb/heredoc_with_carriage_return_escapes_windows.txt + seattlerb/heredoc_with_extra_carriage_horrible_mix.txt + seattlerb/heredoc_with_extra_carriage_returns_windows.txt + seattlerb/heredoc_with_extra_carriage_returns.txt + seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt + seattlerb/heredoc_with_only_carriage_returns_windows.txt + seattlerb/heredoc_with_only_carriage_returns.txt + ] + + # https://github.com/seattlerb/ruby_parser/issues/344 + failures = crlf | %w[ + alias.txt + heredocs_with_ignored_newlines.txt + method_calls.txt + methods.txt + multi_write.txt + not.txt + patterns.txt + regex.txt + seattlerb/and_multi.txt + seattlerb/heredoc_bad_hex_escape.txt + seattlerb/heredoc_bad_oct_escape.txt + spanning_heredoc_newlines.txt + spanning_heredoc.txt + tilde_heredocs.txt + unparser/corpus/literal/literal.txt + while.txt + whitequark/class_definition_in_while_cond.txt + whitequark/cond_eflipflop.txt + whitequark/cond_iflipflop.txt + whitequark/cond_match_current_line.txt + whitequark/dedenting_heredoc.txt + whitequark/if_while_after_class__since_32.txt + whitequark/lvar_injecting_match.txt + whitequark/not.txt + whitequark/op_asgn_cmd.txt + whitequark/parser_bug_640.txt + whitequark/parser_slash_slash_n_escaping_in_literals.txt + whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt + whitequark/pattern_matching_single_line.txt + whitequark/ruby_bug_11989.txt + whitequark/slash_newline_in_heredocs.txt + ] + + Dir["**/*.txt", base: base].each do |name| + next if failures.include?(name) + + define_method("test_#{name}") do + begin + # Parsing with ruby parser tends to be noisy with warnings, so we're + # turning those off. + previous_verbose, $VERBOSE = $VERBOSE, nil + assert_parse_file(base, name, todos.include?(name)) + ensure + $VERBOSE = previous_verbose + end + end + end + + private + + def assert_parse_file(base, name, allowed_failure) + filepath = File.join(base, name) + expected = ::RubyParser.new.parse(File.read(filepath), filepath) + actual = Prism::Translation::RubyParser.parse_file(filepath) + + if !allowed_failure + assert_equal_nodes expected, actual + elsif expected == actual + puts "#{name} now passes" + end + end + + def assert_equal_nodes(left, right) + return if left == right + + if left.is_a?(Sexp) && right.is_a?(Sexp) + if left.line != right.line + assert_equal "(#{left.inspect} line=#{left.line})", "(#{right.inspect} line=#{right.line})" + elsif left.file != right.file + assert_equal "(#{left.inspect} file=#{left.file})", "(#{right.inspect} file=#{right.file})" + elsif left.length != right.length + assert_equal "(#{left.inspect} length=#{left.length})", "(#{right.inspect} length=#{right.length})" + else + left.zip(right).each { |l, r| assert_equal_nodes(l, r) } + end + else + assert_equal left, right + end + end + end +end diff --git a/test/mri/prism/snapshots/alias.txt b/test/mri/prism/snapshots/alias.txt new file mode 100644 index 00000000000..687082d85e2 --- /dev/null +++ b/test/mri/prism/snapshots/alias.txt @@ -0,0 +1,194 @@ +@ ProgramNode (location: (1,0)-(23,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(23,11)) + └── body: (length: 12) + ├── @ AliasMethodNode (location: (1,0)-(1,15)) + │ ├── new_name: + │ │ @ SymbolNode (location: (1,6)-(1,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ ├── value_loc: (1,7)-(1,10) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── old_name: + │ │ @ SymbolNode (location: (1,11)-(1,15)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,11)-(1,12) = ":" + │ │ ├── value_loc: (1,12)-(1,15) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── keyword_loc: (1,0)-(1,5) = "alias" + ├── @ AliasMethodNode (location: (3,0)-(3,21)) + │ ├── new_name: + │ │ @ SymbolNode (location: (3,6)-(3,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,6)-(3,9) = "%s[" + │ │ ├── value_loc: (3,9)-(3,12) = "abc" + │ │ ├── closing_loc: (3,12)-(3,13) = "]" + │ │ └── unescaped: "abc" + │ ├── old_name: + │ │ @ SymbolNode (location: (3,14)-(3,21)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,14)-(3,17) = "%s[" + │ │ ├── value_loc: (3,17)-(3,20) = "def" + │ │ ├── closing_loc: (3,20)-(3,21) = "]" + │ │ └── unescaped: "def" + │ └── keyword_loc: (3,0)-(3,5) = "alias" + ├── @ AliasMethodNode (location: (5,0)-(5,19)) + │ ├── new_name: + │ │ @ SymbolNode (location: (5,6)-(5,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,6)-(5,8) = ":'" + │ │ ├── value_loc: (5,8)-(5,11) = "abc" + │ │ ├── closing_loc: (5,11)-(5,12) = "'" + │ │ └── unescaped: "abc" + │ ├── old_name: + │ │ @ SymbolNode (location: (5,13)-(5,19)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,13)-(5,15) = ":'" + │ │ ├── value_loc: (5,15)-(5,18) = "def" + │ │ ├── closing_loc: (5,18)-(5,19) = "'" + │ │ └── unescaped: "def" + │ └── keyword_loc: (5,0)-(5,5) = "alias" + ├── @ AliasMethodNode (location: (7,0)-(7,23)) + │ ├── new_name: + │ │ @ InterpolatedSymbolNode (location: (7,6)-(7,16)) + │ │ ├── opening_loc: (7,6)-(7,8) = ":\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (7,8)-(7,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (7,8)-(7,11) = "abc" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "abc" + │ │ │ └── @ EmbeddedStatementsNode (location: (7,11)-(7,15)) + │ │ │ ├── opening_loc: (7,11)-(7,13) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (7,13)-(7,14)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (7,13)-(7,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (7,14)-(7,15) = "}" + │ │ └── closing_loc: (7,15)-(7,16) = "\"" + │ ├── old_name: + │ │ @ SymbolNode (location: (7,17)-(7,23)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (7,17)-(7,19) = ":'" + │ │ ├── value_loc: (7,19)-(7,22) = "def" + │ │ ├── closing_loc: (7,22)-(7,23) = "'" + │ │ └── unescaped: "def" + │ └── keyword_loc: (7,0)-(7,5) = "alias" + ├── @ AliasGlobalVariableNode (location: (9,0)-(9,11)) + │ ├── new_name: + │ │ @ GlobalVariableReadNode (location: (9,6)-(9,8)) + │ │ └── name: :$a + │ ├── old_name: + │ │ @ BackReferenceReadNode (location: (9,9)-(9,11)) + │ │ └── name: :$' + │ └── keyword_loc: (9,0)-(9,5) = "alias" + ├── @ AliasMethodNode (location: (11,0)-(11,13)) + │ ├── new_name: + │ │ @ SymbolNode (location: (11,6)-(11,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (11,6)-(11,9) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── old_name: + │ │ @ SymbolNode (location: (11,10)-(11,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (11,10)-(11,13) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── keyword_loc: (11,0)-(11,5) = "alias" + ├── @ AliasGlobalVariableNode (location: (13,0)-(13,15)) + │ ├── new_name: + │ │ @ GlobalVariableReadNode (location: (13,6)-(13,10)) + │ │ └── name: :$foo + │ ├── old_name: + │ │ @ GlobalVariableReadNode (location: (13,11)-(13,15)) + │ │ └── name: :$bar + │ └── keyword_loc: (13,0)-(13,5) = "alias" + ├── @ AliasMethodNode (location: (15,0)-(15,12)) + │ ├── new_name: + │ │ @ SymbolNode (location: (15,6)-(15,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (15,6)-(15,9) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── old_name: + │ │ @ SymbolNode (location: (15,10)-(15,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (15,10)-(15,12) = "if" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "if" + │ └── keyword_loc: (15,0)-(15,5) = "alias" + ├── @ AliasMethodNode (location: (17,0)-(17,13)) + │ ├── new_name: + │ │ @ SymbolNode (location: (17,6)-(17,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (17,6)-(17,9) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── old_name: + │ │ @ SymbolNode (location: (17,10)-(17,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (17,10)-(17,13) = "<=>" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "<=>" + │ └── keyword_loc: (17,0)-(17,5) = "alias" + ├── @ AliasMethodNode (location: (19,0)-(19,15)) + │ ├── new_name: + │ │ @ SymbolNode (location: (19,6)-(19,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (19,6)-(19,7) = ":" + │ │ ├── value_loc: (19,7)-(19,9) = "==" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "==" + │ ├── old_name: + │ │ @ SymbolNode (location: (19,10)-(19,15)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (19,10)-(19,11) = ":" + │ │ ├── value_loc: (19,11)-(19,15) = "eql?" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "eql?" + │ └── keyword_loc: (19,0)-(19,5) = "alias" + ├── @ AliasMethodNode (location: (21,0)-(21,9)) + │ ├── new_name: + │ │ @ SymbolNode (location: (21,6)-(21,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (21,6)-(21,7) = "A" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "A" + │ ├── old_name: + │ │ @ SymbolNode (location: (21,8)-(21,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (21,8)-(21,9) = "B" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "B" + │ └── keyword_loc: (21,0)-(21,5) = "alias" + └── @ AliasMethodNode (location: (23,0)-(23,11)) + ├── new_name: + │ @ SymbolNode (location: (23,6)-(23,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (23,6)-(23,7) = ":" + │ ├── value_loc: (23,7)-(23,8) = "A" + │ ├── closing_loc: ∅ + │ └── unescaped: "A" + ├── old_name: + │ @ SymbolNode (location: (23,9)-(23,11)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (23,9)-(23,10) = ":" + │ ├── value_loc: (23,10)-(23,11) = "B" + │ ├── closing_loc: ∅ + │ └── unescaped: "B" + └── keyword_loc: (23,0)-(23,5) = "alias" diff --git a/test/mri/prism/snapshots/arithmetic.txt b/test/mri/prism/snapshots/arithmetic.txt new file mode 100644 index 00000000000..c8a31c3d70e --- /dev/null +++ b/test/mri/prism/snapshots/arithmetic.txt @@ -0,0 +1,255 @@ +@ ProgramNode (location: (1,0)-(13,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,8)) + └── body: (length: 7) + ├── @ CallNode (location: (1,0)-(1,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,5)-(1,8) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (1,4)-(1,5) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,4)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (3,1)-(3,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (3,1)-(3,4) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :-@ + │ │ ├── message_loc: (3,0)-(3,1) = "-" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :* + │ ├── message_loc: (3,4)-(3,5) = "*" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,5)-(3,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,5)-(3,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,5)-(3,8) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,0)-(5,4)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,1)-(5,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (5,1)-(5,4) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+@ + │ │ ├── message_loc: (5,0)-(5,1) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :** + │ ├── message_loc: (5,4)-(5,6) = "**" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (5,6)-(5,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (5,6)-(5,9) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(7,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,0)-(7,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,4)-(7,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,4)-(7,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (7,5)-(7,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (7,5)-(7,8) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :~ + │ │ ├── message_loc: (7,4)-(7,5) = "~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (9,0)-(9,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (9,0)-(9,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (9,0)-(9,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :<< + │ │ ├── message_loc: (9,4)-(9,6) = "<<" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,7)-(9,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (9,7)-(9,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (9,7)-(9,10) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<< + │ ├── message_loc: (9,11)-(9,13) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,14)-(9,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (9,14)-(9,17)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (9,14)-(9,17) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (11,0)-(11,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (11,1)-(11,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (11,1)-(11,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :** + │ │ ├── message_loc: (11,2)-(11,4) = "**" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,4)-(11,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (11,4)-(11,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :-@ + │ ├── message_loc: (11,0)-(11,1) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (13,0)-(13,8)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (13,0)-(13,2)) + │ ├── flags: decimal + │ └── value: -1 + ├── call_operator_loc: (13,2)-(13,3) = "." + ├── name: :zero? + ├── message_loc: (13,3)-(13,8) = "zero?" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/arrays.txt b/test/mri/prism/snapshots/arrays.txt new file mode 100644 index 00000000000..1cf6b226972 --- /dev/null +++ b/test/mri/prism/snapshots/arrays.txt @@ -0,0 +1,2308 @@ +@ ProgramNode (location: (1,0)-(142,32)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(142,32)) + └── body: (length: 59) + ├── @ ArrayNode (location: (1,0)-(1,4)) + │ ├── flags: contains_splat + │ ├── elements: (length: 1) + │ │ └── @ SplatNode (location: (1,1)-(1,3)) + │ │ ├── operator_loc: (1,1)-(1,2) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (1,3)-(1,4) = "]" + ├── @ CallNode (location: (3,0)-(3,23)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (3,3)-(3,13) = "[bar, baz]" + │ ├── opening_loc: (3,3)-(3,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,4)-(3,23)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ CallNode (location: (3,4)-(3,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (3,4)-(3,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ CallNode (location: (3,9)-(3,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (3,9)-(3,12) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ ArrayNode (location: (3,16)-(3,23)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 3) + │ │ │ ├── @ IntegerNode (location: (3,16)-(3,17)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (3,19)-(3,20)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (3,22)-(3,23)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── closing_loc: (3,12)-(3,13) = "]" + │ └── block: ∅ + ├── @ ArrayNode (location: (5,0)-(5,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ KeywordHashNode (location: (5,1)-(5,12)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,1)-(5,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,1)-(5,3)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (5,1)-(5,2) = "a" + │ │ │ ├── closing_loc: (5,2)-(5,3) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ ArrayNode (location: (5,4)-(5,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (5,5)-(5,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (5,5)-(5,6) = ":" + │ │ │ │ │ ├── value_loc: (5,6)-(5,7) = "b" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ └── @ SymbolNode (location: (5,9)-(5,11)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (5,9)-(5,10) = ":" + │ │ │ │ ├── value_loc: (5,10)-(5,11) = "c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "c" + │ │ │ ├── opening_loc: (5,4)-(5,5) = "[" + │ │ │ └── closing_loc: (5,11)-(5,12) = "]" + │ │ └── operator_loc: ∅ + │ ├── opening_loc: (5,0)-(5,1) = "[" + │ └── closing_loc: (5,12)-(5,13) = "]" + ├── @ ArrayNode (location: (9,0)-(15,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 5) + │ │ ├── @ SymbolNode (location: (9,1)-(9,3)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (9,1)-(9,2) = ":" + │ │ │ ├── value_loc: (9,2)-(9,3) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ SymbolNode (location: (9,5)-(9,7)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (9,5)-(9,6) = ":" + │ │ │ ├── value_loc: (9,6)-(9,7) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── @ SymbolNode (location: (10,0)-(10,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (10,0)-(10,1) = ":" + │ │ │ ├── value_loc: (10,1)-(10,2) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── @ IntegerNode (location: (10,3)-(10,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ SymbolNode (location: (14,0)-(14,2)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (14,0)-(14,1) = ":" + │ │ ├── value_loc: (14,1)-(14,2) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── opening_loc: (9,0)-(9,1) = "[" + │ └── closing_loc: (15,0)-(15,1) = "]" + ├── @ ArrayNode (location: (18,0)-(26,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 5) + │ │ ├── @ SymbolNode (location: (18,1)-(18,3)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (18,1)-(18,2) = ":" + │ │ │ ├── value_loc: (18,2)-(18,3) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ SymbolNode (location: (18,5)-(18,7)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (18,5)-(18,6) = ":" + │ │ │ ├── value_loc: (18,6)-(18,7) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── @ SymbolNode (location: (19,0)-(19,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (19,0)-(19,1) = ":" + │ │ │ ├── value_loc: (19,1)-(19,2) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── @ IntegerNode (location: (19,3)-(19,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ SymbolNode (location: (23,0)-(23,2)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (23,0)-(23,1) = ":" + │ │ ├── value_loc: (23,1)-(23,2) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── opening_loc: (18,0)-(18,1) = "[" + │ └── closing_loc: (26,0)-(26,1) = "]" + ├── @ ArrayNode (location: (28,0)-(28,12)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ KeywordHashNode (location: (28,1)-(28,11)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (28,1)-(28,11)) + │ │ ├── key: + │ │ │ @ CallNode (location: (28,1)-(28,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (28,1)-(28,4) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ CallNode (location: (28,8)-(28,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (28,8)-(28,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (28,5)-(28,7) = "=>" + │ ├── opening_loc: (28,0)-(28,1) = "[" + │ └── closing_loc: (28,11)-(28,12) = "]" + ├── @ CallNode (location: (30,0)-(30,19)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (30,0)-(30,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (30,0)-(30,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (30,0)-(30,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (30,3)-(30,8) = "[bar]" + │ │ ├── opening_loc: (30,3)-(30,4) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (30,4)-(30,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (30,4)-(30,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (30,4)-(30,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (30,7)-(30,8) = "]" + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (30,8)-(30,13) = "[baz]" + │ ├── opening_loc: (30,8)-(30,9) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (30,9)-(30,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (30,9)-(30,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (30,9)-(30,12) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (30,16)-(30,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :qux + │ │ ├── message_loc: (30,16)-(30,19) = "qux" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (30,12)-(30,13) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (32,0)-(32,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (32,0)-(32,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (32,0)-(32,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (32,0)-(32,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (32,3)-(32,8) = "[bar]" + │ │ ├── opening_loc: (32,3)-(32,4) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (32,4)-(32,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (32,4)-(32,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (32,4)-(32,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (32,7)-(32,8) = "]" + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (32,8)-(32,13) = "[baz]" + │ ├── opening_loc: (32,8)-(32,9) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (32,9)-(32,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (32,9)-(32,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (32,9)-(32,12) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (32,12)-(32,13) = "]" + │ └── block: ∅ + ├── @ ArrayNode (location: (34,0)-(35,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (34,0)-(34,1) = "[" + │ └── closing_loc: (35,0)-(35,1) = "]" + ├── @ CallNode (location: (37,0)-(37,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (37,0)-(37,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (37,0)-(37,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (37,3)-(37,13) = "[bar, baz]" + │ ├── opening_loc: (37,3)-(37,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,4)-(37,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (37,4)-(37,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (37,4)-(37,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (37,9)-(37,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (37,9)-(37,12) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (37,12)-(37,13) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,19)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (39,0)-(39,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (39,0)-(39,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (39,3)-(39,13) = "[bar, baz]" + │ ├── opening_loc: (39,3)-(39,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (39,4)-(39,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ CallNode (location: (39,4)-(39,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (39,4)-(39,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ CallNode (location: (39,9)-(39,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (39,9)-(39,12) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (39,16)-(39,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :qux + │ │ ├── message_loc: (39,16)-(39,19) = "qux" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (39,12)-(39,13) = "]" + │ └── block: ∅ + ├── @ MultiWriteNode (location: (41,0)-(41,21)) + │ ├── lefts: (length: 2) + │ │ ├── @ IndexTargetNode (location: (41,0)-(41,6)) + │ │ │ ├── flags: attribute_write + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (41,0)-(41,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (41,0)-(41,3) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (41,3)-(41,4) = "[" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (41,4)-(41,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (41,4)-(41,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ ├── closing_loc: (41,5)-(41,6) = "]" + │ │ │ └── block: ∅ + │ │ └── @ IndexTargetNode (location: (41,8)-(41,14)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (41,8)-(41,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (41,8)-(41,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (41,11)-(41,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (41,12)-(41,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (41,12)-(41,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 0 + │ │ ├── closing_loc: (41,13)-(41,14) = "]" + │ │ └── block: ∅ + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (41,15)-(41,16) = "=" + │ └── value: + │ @ ArrayNode (location: (41,17)-(41,21)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (41,17)-(41,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (41,20)-(41,21)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── @ CallNode (location: (43,0)-(43,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (43,0)-(43,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (43,0)-(43,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (43,3)-(43,19) = "[bar[baz] = qux]" + │ ├── opening_loc: (43,3)-(43,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (43,4)-(43,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (43,4)-(43,18)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (43,4)-(43,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (43,4)-(43,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[]= + │ │ ├── message_loc: (43,7)-(43,12) = "[baz]" + │ │ ├── opening_loc: (43,7)-(43,8) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (43,8)-(43,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ CallNode (location: (43,8)-(43,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (43,8)-(43,11) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ CallNode (location: (43,15)-(43,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :qux + │ │ │ ├── message_loc: (43,15)-(43,18) = "qux" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (43,11)-(43,12) = "]" + │ │ └── block: ∅ + │ ├── closing_loc: (43,18)-(43,19) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (45,0)-(45,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (45,0)-(45,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (45,3)-(45,8) = "[bar]" + │ ├── opening_loc: (45,3)-(45,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (45,4)-(45,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (45,4)-(45,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (45,4)-(45,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (45,7)-(45,8) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (47,0)-(47,14)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (47,0)-(47,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (47,0)-(47,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (47,3)-(47,8) = "[bar]" + │ ├── opening_loc: (47,3)-(47,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (47,4)-(47,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (47,4)-(47,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (47,4)-(47,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (47,11)-(47,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (47,11)-(47,14) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (47,7)-(47,8) = "]" + │ └── block: ∅ + ├── @ ArrayNode (location: (49,0)-(49,6)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ KeywordHashNode (location: (49,1)-(49,5)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (49,1)-(49,5)) + │ │ ├── value: + │ │ │ @ HashNode (location: (49,3)-(49,5)) + │ │ │ ├── opening_loc: (49,3)-(49,4) = "{" + │ │ │ ├── elements: (length: 0) + │ │ │ └── closing_loc: (49,4)-(49,5) = "}" + │ │ └── operator_loc: (49,1)-(49,3) = "**" + │ ├── opening_loc: (49,0)-(49,1) = "[" + │ └── closing_loc: (49,5)-(49,6) = "]" + ├── @ ArrayNode (location: (51,0)-(51,6)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ KeywordHashNode (location: (51,1)-(51,5)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (51,1)-(51,5)) + │ │ ├── value: + │ │ │ @ CallNode (location: (51,3)-(51,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :kw + │ │ │ ├── message_loc: (51,3)-(51,5) = "kw" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (51,1)-(51,3) = "**" + │ ├── opening_loc: (51,0)-(51,1) = "[" + │ └── closing_loc: (51,5)-(51,6) = "]" + ├── @ ArrayNode (location: (53,0)-(53,9)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (53,1)-(53,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (53,4)-(53,8)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (53,4)-(53,8)) + │ │ ├── value: + │ │ │ @ CallNode (location: (53,6)-(53,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :kw + │ │ │ ├── message_loc: (53,6)-(53,8) = "kw" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (53,4)-(53,6) = "**" + │ ├── opening_loc: (53,0)-(53,1) = "[" + │ └── closing_loc: (53,8)-(53,9) = "]" + ├── @ ArrayNode (location: (55,0)-(55,21)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (55,1)-(55,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (55,4)-(55,20)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 3) + │ │ ├── @ AssocSplatNode (location: (55,4)-(55,8)) + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (55,6)-(55,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :kw + │ │ │ │ ├── message_loc: (55,6)-(55,8) = "kw" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (55,4)-(55,6) = "**" + │ │ ├── @ AssocSplatNode (location: (55,10)-(55,14)) + │ │ │ ├── value: + │ │ │ │ @ HashNode (location: (55,12)-(55,14)) + │ │ │ │ ├── opening_loc: (55,12)-(55,13) = "{" + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ └── closing_loc: (55,13)-(55,14) = "}" + │ │ │ └── operator_loc: (55,10)-(55,12) = "**" + │ │ └── @ AssocSplatNode (location: (55,16)-(55,20)) + │ │ ├── value: + │ │ │ @ CallNode (location: (55,18)-(55,20)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :kw + │ │ │ ├── message_loc: (55,18)-(55,20) = "kw" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (55,16)-(55,18) = "**" + │ ├── opening_loc: (55,0)-(55,1) = "[" + │ └── closing_loc: (55,20)-(55,21) = "]" + ├── @ ArrayNode (location: (57,0)-(59,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ KeywordHashNode (location: (58,2)-(58,12)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (58,2)-(58,12)) + │ │ ├── key: + │ │ │ @ CallNode (location: (58,2)-(58,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (58,2)-(58,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ CallNode (location: (58,9)-(58,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (58,9)-(58,12) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (58,6)-(58,8) = "=>" + │ ├── opening_loc: (57,0)-(57,1) = "[" + │ └── closing_loc: (59,0)-(59,1) = "]" + ├── @ ArrayNode (location: (62,0)-(62,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ SymbolNode (location: (62,3)-(62,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (62,3)-(62,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ SymbolNode (location: (62,7)-(62,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (62,7)-(62,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ SymbolNode (location: (62,11)-(62,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (62,11)-(62,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (62,0)-(62,3) = "%i#" + │ └── closing_loc: (62,16)-(62,17) = "#" + ├── @ ArrayNode (location: (64,0)-(64,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (64,3)-(64,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (64,3)-(64,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ StringNode (location: (64,7)-(64,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (64,7)-(64,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ StringNode (location: (64,11)-(64,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (64,11)-(64,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (64,0)-(64,3) = "%w#" + │ └── closing_loc: (64,16)-(64,17) = "#" + ├── @ XStringNode (location: (66,0)-(66,17)) + │ ├── flags: ∅ + │ ├── opening_loc: (66,0)-(66,3) = "%x#" + │ ├── content_loc: (66,3)-(66,16) = "one two three" + │ ├── closing_loc: (66,16)-(66,17) = "#" + │ └── unescaped: "one two three" + ├── @ ArrayNode (location: (69,0)-(69,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ SymbolNode (location: (69,3)-(69,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (69,3)-(69,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ SymbolNode (location: (69,7)-(69,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (69,7)-(69,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ SymbolNode (location: (69,11)-(69,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (69,11)-(69,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (69,0)-(69,3) = "%i@" + │ └── closing_loc: (69,16)-(69,17) = "@" + ├── @ ArrayNode (location: (71,0)-(71,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (71,3)-(71,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (71,3)-(71,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ StringNode (location: (71,7)-(71,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (71,7)-(71,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ StringNode (location: (71,11)-(71,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (71,11)-(71,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (71,0)-(71,3) = "%w@" + │ └── closing_loc: (71,16)-(71,17) = "@" + ├── @ XStringNode (location: (73,0)-(73,17)) + │ ├── flags: ∅ + │ ├── opening_loc: (73,0)-(73,3) = "%x@" + │ ├── content_loc: (73,3)-(73,16) = "one two three" + │ ├── closing_loc: (73,16)-(73,17) = "@" + │ └── unescaped: "one two three" + ├── @ ArrayNode (location: (76,0)-(76,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ SymbolNode (location: (76,3)-(76,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (76,3)-(76,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ SymbolNode (location: (76,7)-(76,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (76,7)-(76,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ SymbolNode (location: (76,11)-(76,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (76,11)-(76,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (76,0)-(76,3) = "%i{" + │ └── closing_loc: (76,16)-(76,17) = "}" + ├── @ ArrayNode (location: (78,0)-(78,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (78,3)-(78,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (78,3)-(78,6) = "one" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "one" + │ │ ├── @ StringNode (location: (78,7)-(78,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (78,7)-(78,10) = "two" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "two" + │ │ └── @ StringNode (location: (78,11)-(78,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (78,11)-(78,16) = "three" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "three" + │ ├── opening_loc: (78,0)-(78,3) = "%w{" + │ └── closing_loc: (78,16)-(78,17) = "}" + ├── @ XStringNode (location: (80,0)-(80,17)) + │ ├── flags: ∅ + │ ├── opening_loc: (80,0)-(80,3) = "%x{" + │ ├── content_loc: (80,3)-(80,16) = "one two three" + │ ├── closing_loc: (80,16)-(80,17) = "}" + │ └── unescaped: "one two three" + ├── @ ArrayNode (location: (82,0)-(82,7)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (82,3)-(82,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (82,3)-(82,6) = "\\C:" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\\C:" + │ ├── opening_loc: (82,0)-(82,3) = "%w[" + │ └── closing_loc: (82,6)-(82,7) = "]" + ├── @ CallNode (location: (84,0)-(84,13)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (84,0)-(84,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (84,0)-(84,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (84,3)-(84,9) = "[&bar]" + │ ├── opening_loc: (84,3)-(84,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (84,12)-(84,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (84,12)-(84,13)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (84,8)-(84,9) = "]" + │ └── block: + │ @ BlockArgumentNode (location: (84,4)-(84,8)) + │ ├── expression: + │ │ @ CallNode (location: (84,5)-(84,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (84,5)-(84,8) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (84,4)-(84,5) = "&" + ├── @ CallNode (location: (86,0)-(86,17)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (86,0)-(86,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (86,0)-(86,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (86,0)-(86,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (86,3)-(86,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (86,4)-(86,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (86,7)-(86,13) = "[&bar]" + │ ├── opening_loc: (86,7)-(86,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (86,16)-(86,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (86,16)-(86,17)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (86,12)-(86,13) = "]" + │ └── block: + │ @ BlockArgumentNode (location: (86,8)-(86,12)) + │ ├── expression: + │ │ @ CallNode (location: (86,9)-(86,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (86,9)-(86,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (86,8)-(86,9) = "&" + ├── @ DefNode (location: (88,0)-(90,3)) + │ ├── name: :foo + │ ├── name_loc: (88,4)-(88,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (88,8)-(88,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (88,8)-(88,9)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (88,8)-(88,9) = "&" + │ ├── body: + │ │ @ StatementsNode (location: (89,2)-(89,12)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (89,2)-(89,12)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (89,2)-(89,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (89,2)-(89,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[]= + │ │ ├── message_loc: (89,5)-(89,8) = "[&]" + │ │ ├── opening_loc: (89,5)-(89,6) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (89,11)-(89,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (89,11)-(89,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (89,7)-(89,8) = "]" + │ │ └── block: + │ │ @ BlockArgumentNode (location: (89,6)-(89,7)) + │ │ ├── expression: ∅ + │ │ └── operator_loc: (89,6)-(89,7) = "&" + │ ├── locals: [] + │ ├── def_keyword_loc: (88,0)-(88,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (88,7)-(88,8) = "(" + │ ├── rparen_loc: (88,9)-(88,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (90,0)-(90,3) = "end" + ├── @ IndexOperatorWriteNode (location: (92,0)-(92,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (92,0)-(92,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (92,0)-(92,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (92,3)-(92,4) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (92,4)-(92,5) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (92,6)-(92,8) = "+=" + │ └── value: + │ @ IntegerNode (location: (92,9)-(92,10)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (94,0)-(94,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (94,0)-(94,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (94,0)-(94,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (94,3)-(94,4) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (94,4)-(94,5) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (94,6)-(94,9) = "||=" + │ └── value: + │ @ IntegerNode (location: (94,10)-(94,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (96,0)-(96,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (96,0)-(96,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (96,0)-(96,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (96,3)-(96,4) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (96,4)-(96,5) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (96,6)-(96,9) = "&&=" + │ └── value: + │ @ IntegerNode (location: (96,10)-(96,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOperatorWriteNode (location: (98,0)-(98,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (98,0)-(98,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (98,0)-(98,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (98,0)-(98,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (98,3)-(98,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (98,4)-(98,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (98,7)-(98,8) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (98,8)-(98,9) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (98,10)-(98,12) = "+=" + │ └── value: + │ @ IntegerNode (location: (98,13)-(98,14)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (100,0)-(100,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (100,0)-(100,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (100,0)-(100,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (100,0)-(100,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (100,3)-(100,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (100,4)-(100,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (100,7)-(100,8) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (100,8)-(100,9) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (100,10)-(100,13) = "||=" + │ └── value: + │ @ IntegerNode (location: (100,14)-(100,15)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (102,0)-(102,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (102,0)-(102,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (102,0)-(102,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (102,0)-(102,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (102,3)-(102,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (102,4)-(102,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (102,7)-(102,8) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (102,8)-(102,9) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (102,10)-(102,13) = "&&=" + │ └── value: + │ @ IntegerNode (location: (102,14)-(102,15)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOperatorWriteNode (location: (104,0)-(104,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (104,0)-(104,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (104,0)-(104,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (104,3)-(104,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (104,4)-(104,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (104,4)-(104,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (104,4)-(104,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (104,7)-(104,8) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (104,9)-(104,11) = "+=" + │ └── value: + │ @ IntegerNode (location: (104,12)-(104,13)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (106,0)-(106,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (106,0)-(106,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (106,0)-(106,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (106,3)-(106,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (106,4)-(106,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (106,4)-(106,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (106,4)-(106,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (106,7)-(106,8) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (106,9)-(106,12) = "||=" + │ └── value: + │ @ IntegerNode (location: (106,13)-(106,14)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (108,0)-(108,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (108,0)-(108,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (108,0)-(108,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (108,3)-(108,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (108,4)-(108,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (108,4)-(108,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (108,4)-(108,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (108,7)-(108,8) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (108,9)-(108,12) = "&&=" + │ └── value: + │ @ IntegerNode (location: (108,13)-(108,14)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOperatorWriteNode (location: (110,0)-(110,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (110,0)-(110,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (110,0)-(110,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (110,0)-(110,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (110,3)-(110,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (110,4)-(110,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (110,7)-(110,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (110,8)-(110,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (110,8)-(110,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (110,8)-(110,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (110,11)-(110,12) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (110,13)-(110,15) = "+=" + │ └── value: + │ @ IntegerNode (location: (110,16)-(110,17)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (112,0)-(112,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (112,0)-(112,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (112,0)-(112,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (112,0)-(112,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (112,3)-(112,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (112,4)-(112,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (112,7)-(112,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (112,8)-(112,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (112,8)-(112,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (112,8)-(112,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (112,11)-(112,12) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (112,13)-(112,16) = "||=" + │ └── value: + │ @ IntegerNode (location: (112,17)-(112,18)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (114,0)-(114,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (114,0)-(114,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (114,0)-(114,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (114,0)-(114,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (114,3)-(114,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (114,4)-(114,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (114,7)-(114,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (114,8)-(114,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (114,8)-(114,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (114,8)-(114,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (114,11)-(114,12) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (114,13)-(114,16) = "&&=" + │ └── value: + │ @ IntegerNode (location: (114,17)-(114,18)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOperatorWriteNode (location: (116,0)-(116,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (116,0)-(116,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (116,0)-(116,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (116,3)-(116,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (116,4)-(116,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (116,4)-(116,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (116,4)-(116,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (116,13)-(116,14) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (116,9)-(116,13)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (116,10)-(116,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (116,10)-(116,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (116,9)-(116,10) = "&" + │ ├── operator: :+ + │ ├── operator_loc: (116,15)-(116,17) = "+=" + │ └── value: + │ @ IntegerNode (location: (116,18)-(116,19)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (118,0)-(118,20)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (118,0)-(118,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (118,0)-(118,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (118,3)-(118,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (118,4)-(118,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (118,4)-(118,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (118,4)-(118,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (118,13)-(118,14) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (118,9)-(118,13)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (118,10)-(118,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (118,10)-(118,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (118,9)-(118,10) = "&" + │ ├── operator_loc: (118,15)-(118,18) = "||=" + │ └── value: + │ @ IntegerNode (location: (118,19)-(118,20)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (120,0)-(120,20)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (120,0)-(120,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (120,0)-(120,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (120,3)-(120,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (120,4)-(120,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (120,4)-(120,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (120,4)-(120,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (120,13)-(120,14) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (120,9)-(120,13)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (120,10)-(120,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (120,10)-(120,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (120,9)-(120,10) = "&" + │ ├── operator_loc: (120,15)-(120,18) = "&&=" + │ └── value: + │ @ IntegerNode (location: (120,19)-(120,20)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOperatorWriteNode (location: (122,0)-(122,23)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (122,0)-(122,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (122,0)-(122,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (122,0)-(122,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (122,3)-(122,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (122,4)-(122,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (122,7)-(122,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (122,8)-(122,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (122,8)-(122,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (122,8)-(122,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (122,17)-(122,18) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (122,13)-(122,17)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (122,14)-(122,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (122,14)-(122,17) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (122,13)-(122,14) = "&" + │ ├── operator: :+ + │ ├── operator_loc: (122,19)-(122,21) = "+=" + │ └── value: + │ @ IntegerNode (location: (122,22)-(122,23)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexOrWriteNode (location: (124,0)-(124,24)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (124,0)-(124,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (124,0)-(124,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (124,0)-(124,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (124,3)-(124,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (124,4)-(124,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (124,7)-(124,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (124,8)-(124,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (124,8)-(124,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (124,8)-(124,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (124,17)-(124,18) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (124,13)-(124,17)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (124,14)-(124,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (124,14)-(124,17) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (124,13)-(124,14) = "&" + │ ├── operator_loc: (124,19)-(124,22) = "||=" + │ └── value: + │ @ IntegerNode (location: (124,23)-(124,24)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IndexAndWriteNode (location: (126,0)-(126,24)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (126,0)-(126,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (126,0)-(126,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (126,0)-(126,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (126,3)-(126,4) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (126,4)-(126,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (126,7)-(126,8) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (126,8)-(126,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (126,8)-(126,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (126,8)-(126,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (126,17)-(126,18) = "]" + │ ├── block: + │ │ @ BlockArgumentNode (location: (126,13)-(126,17)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (126,14)-(126,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (126,14)-(126,17) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (126,13)-(126,14) = "&" + │ ├── operator_loc: (126,19)-(126,22) = "&&=" + │ └── value: + │ @ IntegerNode (location: (126,23)-(126,24)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ DefNode (location: (128,0)-(128,19)) + │ ├── name: :f + │ ├── name_loc: (128,4)-(128,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (128,6)-(128,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (128,6)-(128,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (128,6)-(128,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (128,10)-(128,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (128,10)-(128,14)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (128,10)-(128,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (128,10)-(128,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (128,11)-(128,14) = "[*]" + │ │ ├── opening_loc: (128,11)-(128,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (128,12)-(128,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SplatNode (location: (128,12)-(128,13)) + │ │ │ ├── operator_loc: (128,12)-(128,13) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: (128,13)-(128,14) = "]" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (128,0)-(128,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (128,5)-(128,6) = "(" + │ ├── rparen_loc: (128,7)-(128,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (128,16)-(128,19) = "end" + ├── @ DefNode (location: (130,0)-(130,22)) + │ ├── name: :f + │ ├── name_loc: (130,4)-(130,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (130,6)-(130,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (130,6)-(130,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (130,6)-(130,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (130,10)-(130,17)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (130,10)-(130,17)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (130,10)-(130,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (130,10)-(130,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (130,11)-(130,17) = "[1, *]" + │ │ ├── opening_loc: (130,11)-(130,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (130,12)-(130,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (130,12)-(130,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ SplatNode (location: (130,15)-(130,16)) + │ │ │ ├── operator_loc: (130,15)-(130,16) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: (130,16)-(130,17) = "]" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (130,0)-(130,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (130,5)-(130,6) = "(" + │ ├── rparen_loc: (130,7)-(130,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (130,19)-(130,22) = "end" + ├── @ DefNode (location: (132,0)-(132,23)) + │ ├── name: :f + │ ├── name_loc: (132,4)-(132,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (132,6)-(132,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (132,6)-(132,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (132,6)-(132,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (132,10)-(132,18)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (132,10)-(132,18)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (132,10)-(132,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (132,10)-(132,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[]= + │ │ ├── message_loc: (132,11)-(132,14) = "[*]" + │ │ ├── opening_loc: (132,11)-(132,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (132,12)-(132,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ SplatNode (location: (132,12)-(132,13)) + │ │ │ │ ├── operator_loc: (132,12)-(132,13) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ └── @ IntegerNode (location: (132,17)-(132,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (132,13)-(132,14) = "]" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (132,0)-(132,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (132,5)-(132,6) = "(" + │ ├── rparen_loc: (132,7)-(132,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (132,20)-(132,23) = "end" + ├── @ DefNode (location: (134,0)-(134,26)) + │ ├── name: :f + │ ├── name_loc: (134,4)-(134,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (134,6)-(134,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (134,6)-(134,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (134,6)-(134,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (134,10)-(134,21)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (134,10)-(134,21)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (134,10)-(134,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (134,10)-(134,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[]= + │ │ ├── message_loc: (134,11)-(134,17) = "[1, *]" + │ │ ├── opening_loc: (134,11)-(134,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (134,12)-(134,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (134,12)-(134,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ SplatNode (location: (134,15)-(134,16)) + │ │ │ │ ├── operator_loc: (134,15)-(134,16) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ └── @ IntegerNode (location: (134,20)-(134,21)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (134,16)-(134,17) = "]" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (134,0)-(134,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (134,5)-(134,6) = "(" + │ ├── rparen_loc: (134,7)-(134,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (134,23)-(134,26) = "end" + ├── @ DefNode (location: (136,0)-(136,24)) + │ ├── name: :f + │ ├── name_loc: (136,4)-(136,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (136,6)-(136,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (136,6)-(136,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (136,6)-(136,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (136,10)-(136,19)) + │ │ └── body: (length: 1) + │ │ └── @ IndexOperatorWriteNode (location: (136,10)-(136,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (136,10)-(136,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (136,10)-(136,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── opening_loc: (136,11)-(136,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (136,12)-(136,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SplatNode (location: (136,12)-(136,13)) + │ │ │ ├── operator_loc: (136,12)-(136,13) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: (136,13)-(136,14) = "]" + │ │ ├── block: ∅ + │ │ ├── operator: :+ + │ │ ├── operator_loc: (136,15)-(136,17) = "+=" + │ │ └── value: + │ │ @ IntegerNode (location: (136,18)-(136,19)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── locals: [] + │ ├── def_keyword_loc: (136,0)-(136,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (136,5)-(136,6) = "(" + │ ├── rparen_loc: (136,7)-(136,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (136,21)-(136,24) = "end" + ├── @ DefNode (location: (138,0)-(138,28)) + │ ├── name: :f + │ ├── name_loc: (138,4)-(138,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (138,6)-(138,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (138,6)-(138,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (138,6)-(138,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (138,10)-(138,23)) + │ │ └── body: (length: 1) + │ │ └── @ IndexAndWriteNode (location: (138,10)-(138,23)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (138,10)-(138,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (138,10)-(138,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── opening_loc: (138,11)-(138,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (138,12)-(138,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (138,12)-(138,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ SplatNode (location: (138,15)-(138,16)) + │ │ │ ├── operator_loc: (138,15)-(138,16) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: (138,16)-(138,17) = "]" + │ │ ├── block: ∅ + │ │ ├── operator_loc: (138,18)-(138,21) = "&&=" + │ │ └── value: + │ │ @ IntegerNode (location: (138,22)-(138,23)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── locals: [] + │ ├── def_keyword_loc: (138,0)-(138,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (138,5)-(138,6) = "(" + │ ├── rparen_loc: (138,7)-(138,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (138,25)-(138,28) = "end" + ├── @ DefNode (location: (140,0)-(140,29)) + │ ├── name: :f + │ ├── name_loc: (140,4)-(140,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (140,6)-(140,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (140,6)-(140,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (140,6)-(140,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (140,0)-(140,29)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (140,10)-(140,24)) + │ │ │ ├── keyword_loc: (140,10)-(140,16) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: (140,17)-(140,19) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ IndexTargetNode (location: (140,20)-(140,24)) + │ │ │ │ ├── flags: attribute_write + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (140,20)-(140,21)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── message_loc: (140,20)-(140,21) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── opening_loc: (140,21)-(140,22) = "[" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (140,22)-(140,23)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ SplatNode (location: (140,22)-(140,23)) + │ │ │ │ │ ├── operator_loc: (140,22)-(140,23) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── closing_loc: (140,23)-(140,24) = "]" + │ │ │ │ └── block: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (140,26)-(140,29) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (140,0)-(140,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (140,5)-(140,6) = "(" + │ ├── rparen_loc: (140,7)-(140,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (140,26)-(140,29) = "end" + └── @ DefNode (location: (142,0)-(142,32)) + ├── name: :f + ├── name_loc: (142,4)-(142,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (142,6)-(142,7)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (142,6)-(142,7)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (142,6)-(142,7) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ BeginNode (location: (142,0)-(142,32)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (142,10)-(142,27)) + │ │ ├── keyword_loc: (142,10)-(142,16) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: (142,17)-(142,19) = "=>" + │ │ ├── reference: + │ │ │ @ IndexTargetNode (location: (142,20)-(142,27)) + │ │ │ ├── flags: attribute_write + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (142,20)-(142,21)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (142,20)-(142,21) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (142,21)-(142,22) = "[" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (142,22)-(142,26)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (142,22)-(142,23)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ SplatNode (location: (142,25)-(142,26)) + │ │ │ │ ├── operator_loc: (142,25)-(142,26) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── closing_loc: (142,26)-(142,27) = "]" + │ │ │ └── block: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (142,29)-(142,32) = "end" + ├── locals: [] + ├── def_keyword_loc: (142,0)-(142,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (142,5)-(142,6) = "(" + ├── rparen_loc: (142,7)-(142,8) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (142,29)-(142,32) = "end" diff --git a/test/mri/prism/snapshots/begin_ensure.txt b/test/mri/prism/snapshots/begin_ensure.txt new file mode 100644 index 00000000000..9af9b9e5736 --- /dev/null +++ b/test/mri/prism/snapshots/begin_ensure.txt @@ -0,0 +1,251 @@ +@ ProgramNode (location: (1,0)-(21,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(21,15)) + └── body: (length: 5) + ├── @ BeginNode (location: (1,0)-(5,3)) + │ ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (2,0)-(2,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,0)-(2,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (3,0)-(5,3)) + │ │ ├── ensure_keyword_loc: (3,0)-(3,6) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (4,0)-(4,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (4,0)-(4,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (4,0)-(4,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ BeginNode (location: (7,0)-(7,24)) + │ ├── begin_keyword_loc: (7,0)-(7,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (7,7)-(7,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,7)-(7,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (7,7)-(7,8) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (7,10)-(7,24)) + │ │ ├── ensure_keyword_loc: (7,10)-(7,16) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (7,18)-(7,19)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (7,18)-(7,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (7,18)-(7,19) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (7,21)-(7,24) = "end" + │ └── end_keyword_loc: (7,21)-(7,24) = "end" + ├── @ BeginNode (location: (9,0)-(11,4)) + │ ├── begin_keyword_loc: (9,0)-(9,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (9,6)-(9,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (9,6)-(9,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (9,6)-(9,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (10,1)-(11,4)) + │ │ ├── ensure_keyword_loc: (10,1)-(10,7) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (10,8)-(10,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (10,8)-(10,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (10,8)-(10,9) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (11,1)-(11,4) = "end" + │ └── end_keyword_loc: (11,1)-(11,4) = "end" + ├── @ BeginNode (location: (13,0)-(13,22)) + │ ├── begin_keyword_loc: (13,0)-(13,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (13,6)-(13,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (13,6)-(13,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (13,6)-(13,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (13,9)-(13,22)) + │ │ ├── ensure_keyword_loc: (13,9)-(13,15) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (13,16)-(13,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (13,16)-(13,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (13,16)-(13,17) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (13,19)-(13,22) = "end" + │ └── end_keyword_loc: (13,19)-(13,22) = "end" + └── @ BeginNode (location: (15,0)-(21,15)) + ├── begin_keyword_loc: (15,0)-(15,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (15,6)-(21,11)) + │ └── body: (length: 1) + │ └── @ BeginNode (location: (15,6)-(21,11)) + │ ├── begin_keyword_loc: (15,6)-(15,11) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (15,11)-(21,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (15,11)-(21,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ SymbolNode (location: (15,11)-(15,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (15,11)-(15,12) = ":" + │ │ │ ├── value_loc: (15,12)-(15,13) = "s" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "s" + │ │ ├── call_operator_loc: (15,13)-(15,14) = "." + │ │ ├── name: :l + │ │ ├── message_loc: (15,14)-(15,15) = "l" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,16)-(21,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ BeginNode (location: (15,16)-(21,7)) + │ │ │ ├── begin_keyword_loc: (15,16)-(15,21) = "begin" + │ │ │ ├── statements: ∅ + │ │ │ ├── rescue_clause: ∅ + │ │ │ ├── else_clause: ∅ + │ │ │ ├── ensure_clause: + │ │ │ │ @ EnsureNode (location: (15,22)-(21,7)) + │ │ │ │ ├── ensure_keyword_loc: (15,22)-(15,28) = "ensure" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (15,29)-(21,3)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (15,29)-(21,3)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── receiver: + │ │ │ │ │ │ @ ConstantReadNode (location: (15,29)-(15,35)) + │ │ │ │ │ │ └── name: :Module + │ │ │ │ │ ├── call_operator_loc: (15,35)-(15,36) = "." + │ │ │ │ │ ├── name: :new + │ │ │ │ │ ├── message_loc: (15,36)-(15,39) = "new" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (15,40)-(21,3)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: + │ │ │ │ │ │ @ StatementsNode (location: (16,2)-(20,5)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ BeginNode (location: (16,2)-(20,5)) + │ │ │ │ │ │ ├── begin_keyword_loc: (16,2)-(16,7) = "begin" + │ │ │ │ │ │ ├── statements: + │ │ │ │ │ │ │ @ StatementsNode (location: (17,4)-(17,9)) + │ │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ │ └── @ BreakNode (location: (17,4)-(17,9)) + │ │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ │ └── keyword_loc: (17,4)-(17,9) = "break" + │ │ │ │ │ │ ├── rescue_clause: ∅ + │ │ │ │ │ │ ├── else_clause: ∅ + │ │ │ │ │ │ ├── ensure_clause: + │ │ │ │ │ │ │ @ EnsureNode (location: (18,4)-(20,5)) + │ │ │ │ │ │ │ ├── ensure_keyword_loc: (18,4)-(18,10) = "ensure" + │ │ │ │ │ │ │ ├── statements: + │ │ │ │ │ │ │ │ @ StatementsNode (location: (18,11)-(19,7)) + │ │ │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ │ │ └── @ CallNode (location: (18,11)-(19,7)) + │ │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ │ ├── receiver: + │ │ │ │ │ │ │ │ │ @ ConstantReadNode (location: (18,11)-(18,17)) + │ │ │ │ │ │ │ │ │ └── name: :Module + │ │ │ │ │ │ │ │ ├── call_operator_loc: (18,17)-(18,18) = "." + │ │ │ │ │ │ │ │ ├── name: :new + │ │ │ │ │ │ │ │ ├── message_loc: (18,18)-(18,21) = "new" + │ │ │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ │ │ └── block: + │ │ │ │ │ │ │ │ @ BlockNode (location: (18,22)-(19,7)) + │ │ │ │ │ │ │ │ ├── locals: [] + │ │ │ │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ │ │ │ ├── opening_loc: (18,22)-(18,24) = "do" + │ │ │ │ │ │ │ │ └── closing_loc: (19,4)-(19,7) = "end" + │ │ │ │ │ │ │ └── end_keyword_loc: (20,2)-(20,5) = "end" + │ │ │ │ │ │ └── end_keyword_loc: (20,2)-(20,5) = "end" + │ │ │ │ │ ├── opening_loc: (15,40)-(15,42) = "do" + │ │ │ │ │ └── closing_loc: (21,0)-(21,3) = "end" + │ │ │ │ └── end_keyword_loc: (21,4)-(21,7) = "end" + │ │ │ └── end_keyword_loc: (21,4)-(21,7) = "end" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (21,8)-(21,11) = "end" + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (21,12)-(21,15) = "end" diff --git a/test/mri/prism/snapshots/begin_rescue.txt b/test/mri/prism/snapshots/begin_rescue.txt new file mode 100644 index 00000000000..f624f85c072 --- /dev/null +++ b/test/mri/prism/snapshots/begin_rescue.txt @@ -0,0 +1,699 @@ +@ ProgramNode (location: (1,0)-(78,3)) +├── locals: [:ex] +└── statements: + @ StatementsNode (location: (1,0)-(78,3)) + └── body: (length: 17) + ├── @ BeginNode (location: (1,0)-(1,33)) + │ ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (1,7)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,7)-(1,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,7)-(1,8) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (1,10)-(1,19)) + │ │ ├── keyword_loc: (1,10)-(1,16) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,18)-(1,19)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,18)-(1,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,18)-(1,19) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: + │ │ @ ElseNode (location: (1,21)-(1,33)) + │ │ ├── else_keyword_loc: (1,21)-(1,25) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,27)-(1,28)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,27)-(1,28)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (1,27)-(1,28) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (1,30)-(1,33) = "end" + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (1,30)-(1,33) = "end" + ├── @ BeginNode (location: (3,0)-(3,44)) + │ ├── begin_keyword_loc: (3,0)-(3,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (3,7)-(3,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,7)-(3,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,7)-(3,8) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (3,10)-(3,19)) + │ │ ├── keyword_loc: (3,10)-(3,16) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,18)-(3,19)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,18)-(3,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,18)-(3,19) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: + │ │ @ ElseNode (location: (3,21)-(3,36)) + │ │ ├── else_keyword_loc: (3,21)-(3,25) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,27)-(3,28)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,27)-(3,28)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (3,27)-(3,28) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (3,30)-(3,36) = "ensure" + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (3,30)-(3,44)) + │ │ ├── ensure_keyword_loc: (3,30)-(3,36) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,38)-(3,39)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,38)-(3,39)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (3,38)-(3,39) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (3,41)-(3,44) = "end" + │ └── end_keyword_loc: (3,41)-(3,44) = "end" + ├── @ BeginNode (location: (5,0)-(7,3)) + │ ├── begin_keyword_loc: (5,0)-(5,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (6,0)-(6,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (6,0)-(6,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (6,0)-(6,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (7,0)-(7,3) = "end" + ├── @ BeginNode (location: (9,0)-(9,13)) + │ ├── begin_keyword_loc: (9,0)-(9,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (9,7)-(9,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (9,7)-(9,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (9,7)-(9,8) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (9,10)-(9,13) = "end" + ├── @ BeginNode (location: (11,0)-(12,4)) + │ ├── begin_keyword_loc: (11,0)-(11,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (11,6)-(11,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (11,6)-(11,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (11,6)-(11,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (12,1)-(12,4) = "end" + ├── @ BeginNode (location: (14,0)-(14,12)) + │ ├── begin_keyword_loc: (14,0)-(14,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (14,6)-(14,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (14,6)-(14,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (14,6)-(14,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (14,9)-(14,12) = "end" + ├── @ BeginNode (location: (16,0)-(24,3)) + │ ├── begin_keyword_loc: (16,0)-(16,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (17,0)-(17,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (17,0)-(17,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (17,0)-(17,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (18,0)-(23,1)) + │ │ ├── keyword_loc: (18,0)-(18,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (19,0)-(19,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (19,0)-(19,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (19,0)-(19,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: + │ │ @ RescueNode (location: (20,0)-(23,1)) + │ │ ├── keyword_loc: (20,0)-(20,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (21,0)-(21,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (21,0)-(21,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (21,0)-(21,1) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: + │ │ @ RescueNode (location: (22,0)-(23,1)) + │ │ ├── keyword_loc: (22,0)-(22,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (23,0)-(23,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (23,0)-(23,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (23,0)-(23,1) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (24,0)-(24,3) = "end" + ├── @ BeginNode (location: (26,0)-(32,3)) + │ ├── begin_keyword_loc: (26,0)-(26,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (27,2)-(27,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (27,2)-(27,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (27,2)-(27,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (28,0)-(31,3)) + │ │ ├── keyword_loc: (28,0)-(28,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (28,7)-(28,16)) + │ │ │ └── name: :Exception + │ │ ├── operator_loc: (28,17)-(28,19) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (28,20)-(28,22)) + │ │ │ ├── name: :ex + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (29,2)-(29,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (29,2)-(29,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (29,2)-(29,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: + │ │ @ RescueNode (location: (30,0)-(31,3)) + │ │ ├── keyword_loc: (30,0)-(30,6) = "rescue" + │ │ ├── exceptions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (30,7)-(30,23)) + │ │ │ │ └── name: :AnotherException + │ │ │ └── @ ConstantReadNode (location: (30,25)-(30,41)) + │ │ │ └── name: :OneMoreException + │ │ ├── operator_loc: (30,42)-(30,44) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (30,45)-(30,47)) + │ │ │ ├── name: :ex + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (31,2)-(31,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (31,2)-(31,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (31,2)-(31,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (32,0)-(32,3) = "end" + ├── @ BeginNode (location: (34,0)-(40,3)) + │ ├── begin_keyword_loc: (34,0)-(34,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (35,2)-(35,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (35,2)-(35,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (35,2)-(35,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (36,0)-(37,3)) + │ │ ├── keyword_loc: (36,0)-(36,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (36,7)-(36,16)) + │ │ │ └── name: :Exception + │ │ ├── operator_loc: (36,17)-(36,19) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (36,20)-(36,22)) + │ │ │ ├── name: :ex + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (37,2)-(37,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (37,2)-(37,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (37,2)-(37,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (38,0)-(40,3)) + │ │ ├── ensure_keyword_loc: (38,0)-(38,6) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (39,2)-(39,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (39,2)-(39,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (39,2)-(39,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (40,0)-(40,3) = "end" + │ └── end_keyword_loc: (40,0)-(40,3) = "end" + ├── @ StringNode (location: (42,0)-(42,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (42,0)-(42,2) = "%!" + │ ├── content_loc: (42,2)-(42,5) = "abc" + │ ├── closing_loc: (42,5)-(42,6) = "!" + │ └── unescaped: "abc" + ├── @ BeginNode (location: (44,0)-(48,3)) + │ ├── begin_keyword_loc: (44,0)-(44,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (45,0)-(45,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (45,0)-(45,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (45,0)-(45,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (46,0)-(47,1)) + │ │ ├── keyword_loc: (46,0)-(46,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (47,0)-(47,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (47,0)-(47,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (47,0)-(47,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (48,0)-(48,3) = "end" + ├── @ BeginNode (location: (50,0)-(50,20)) + │ ├── begin_keyword_loc: (50,0)-(50,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (50,6)-(50,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (50,6)-(50,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (50,6)-(50,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (50,8)-(50,16)) + │ │ ├── keyword_loc: (50,8)-(50,14) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (50,15)-(50,16)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (50,15)-(50,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (50,15)-(50,16) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (50,17)-(50,20) = "end" + ├── @ BeginNode (location: (52,0)-(54,5)) + │ ├── begin_keyword_loc: (52,0)-(52,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (53,0)-(53,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (53,0)-(53,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (53,0)-(53,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (53,2)-(54,1)) + │ │ ├── keyword_loc: (53,2)-(53,8) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (54,0)-(54,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (54,0)-(54,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (54,0)-(54,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (54,2)-(54,5) = "end" + ├── @ BeginNode (location: (56,0)-(60,3)) + │ ├── begin_keyword_loc: (56,0)-(56,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (57,0)-(57,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (57,0)-(57,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (57,0)-(57,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (58,0)-(59,1)) + │ │ ├── keyword_loc: (58,0)-(58,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (58,7)-(58,16)) + │ │ │ └── name: :Exception + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (59,0)-(59,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (59,0)-(59,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (59,0)-(59,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (60,0)-(60,3) = "end" + ├── @ BeginNode (location: (62,0)-(66,3)) + │ ├── begin_keyword_loc: (62,0)-(62,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (63,0)-(63,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (63,0)-(63,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (63,0)-(63,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (64,0)-(65,1)) + │ │ ├── keyword_loc: (64,0)-(64,6) = "rescue" + │ │ ├── exceptions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (64,7)-(64,16)) + │ │ │ │ └── name: :Exception + │ │ │ └── @ ConstantReadNode (location: (64,18)-(64,33)) + │ │ │ └── name: :CustomException + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (65,0)-(65,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (65,0)-(65,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (65,0)-(65,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (66,0)-(66,3) = "end" + ├── @ BeginNode (location: (68,0)-(72,3)) + │ ├── begin_keyword_loc: (68,0)-(68,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (69,2)-(69,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (69,2)-(69,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (69,2)-(69,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (70,0)-(71,3)) + │ │ ├── keyword_loc: (70,0)-(70,6) = "rescue" + │ │ ├── exceptions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (70,7)-(70,16)) + │ │ │ │ └── name: :Exception + │ │ │ └── @ ConstantReadNode (location: (70,18)-(70,33)) + │ │ │ └── name: :CustomException + │ │ ├── operator_loc: (70,34)-(70,36) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (70,37)-(70,39)) + │ │ │ ├── name: :ex + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (71,2)-(71,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (71,2)-(71,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (71,2)-(71,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (72,0)-(72,3) = "end" + └── @ BeginNode (location: (74,0)-(78,3)) + ├── begin_keyword_loc: (74,0)-(74,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (75,2)-(75,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (75,2)-(75,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (75,2)-(75,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (76,0)-(77,3)) + │ ├── keyword_loc: (76,0)-(76,6) = "rescue" + │ ├── exceptions: (length: 1) + │ │ └── @ ConstantReadNode (location: (76,7)-(76,16)) + │ │ └── name: :Exception + │ ├── operator_loc: (76,17)-(76,19) = "=>" + │ ├── reference: + │ │ @ LocalVariableTargetNode (location: (76,20)-(76,22)) + │ │ ├── name: :ex + │ │ └── depth: 0 + │ ├── statements: + │ │ @ StatementsNode (location: (77,2)-(77,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (77,2)-(77,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (77,2)-(77,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (78,0)-(78,3) = "end" diff --git a/test/mri/prism/snapshots/blocks.txt b/test/mri/prism/snapshots/blocks.txt new file mode 100644 index 00000000000..0b1ec52e38b --- /dev/null +++ b/test/mri/prism/snapshots/blocks.txt @@ -0,0 +1,774 @@ +@ ProgramNode (location: (1,0)-(54,17)) +├── locals: [:fork] +└── statements: + @ StatementsNode (location: (1,0)-(54,17)) + └── body: (length: 20) + ├── @ CallNode (location: (1,0)-(1,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (1,3)-(1,8) = "[bar]" + │ ├── opening_loc: (1,3)-(1,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,4)-(1,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (1,7)-(1,8) = "]" + │ └── block: + │ @ BlockNode (location: (1,9)-(1,16)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,11)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,11)-(1,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (1,11)-(1,14) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,9)-(1,10) = "{" + │ └── closing_loc: (1,15)-(1,16) = "}" + ├── @ CallNode (location: (3,0)-(5,3)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (3,3)-(3,8) = "[bar]" + │ ├── opening_loc: (3,3)-(3,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,4)-(3,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,4)-(3,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,4)-(3,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (3,7)-(3,8) = "]" + │ └── block: + │ @ BlockNode (location: (3,9)-(5,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (4,0)-(4,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (4,0)-(4,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (4,0)-(4,3) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (3,9)-(3,11) = "do" + │ └── closing_loc: (5,0)-(5,3) = "end" + ├── @ CallNode (location: (7,0)-(7,35)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (7,0)-(7,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :x + │ │ ├── message_loc: (7,0)-(7,1) = "x" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (7,1)-(7,2) = "." + │ ├── name: :reduce + │ ├── message_loc: (7,2)-(7,8) = "reduce" + │ ├── opening_loc: (7,8)-(7,9) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,9)-(7,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (7,9)-(7,10)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── closing_loc: (7,10)-(7,11) = ")" + │ └── block: + │ @ BlockNode (location: (7,12)-(7,35)) + │ ├── locals: [:x, :memo] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (7,14)-(7,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (7,15)-(7,22)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (7,15)-(7,16)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :x + │ │ │ │ └── @ RequiredParameterNode (location: (7,18)-(7,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :memo + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (7,14)-(7,15) = "|" + │ │ └── closing_loc: (7,22)-(7,23) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (7,24)-(7,33)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableOperatorWriteNode (location: (7,24)-(7,33)) + │ │ ├── name_loc: (7,24)-(7,28) = "memo" + │ │ ├── operator_loc: (7,29)-(7,31) = "+=" + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (7,32)-(7,33)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── name: :memo + │ │ ├── operator: :+ + │ │ └── depth: 0 + │ ├── opening_loc: (7,12)-(7,13) = "{" + │ └── closing_loc: (7,34)-(7,35) = "}" + ├── @ CallNode (location: (9,0)-(9,10)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (9,0)-(9,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (9,4)-(9,10)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (9,4)-(9,6) = "do" + │ └── closing_loc: (9,7)-(9,10) = "end" + ├── @ CallNode (location: (11,0)-(11,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (11,0)-(11,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,4)-(11,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (11,4)-(11,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (11,4)-(11,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ ParenthesesNode (location: (11,9)-(11,21)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (11,10)-(11,20)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (11,10)-(11,20)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (11,10)-(11,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (11,14)-(11,20)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (11,14)-(11,16) = "do" + │ │ │ └── closing_loc: (11,17)-(11,20) = "end" + │ │ ├── opening_loc: (11,9)-(11,10) = "(" + │ │ └── closing_loc: (11,20)-(11,21) = ")" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (13,0)-(13,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (13,0)-(13,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,4)-(13,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (13,4)-(13,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (13,4)-(13,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,8)-(13,14)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (13,8)-(13,10) = "do" + │ └── closing_loc: (13,11)-(13,14) = "end" + ├── @ CallNode (location: (15,0)-(15,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (15,0)-(15,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,4)-(15,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (15,4)-(15,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (15,4)-(15,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,8)-(15,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (15,8)-(15,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (15,8)-(15,11) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (15,12)-(15,18)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (15,12)-(15,14) = "do" + │ └── closing_loc: (15,15)-(15,18) = "end" + ├── @ CallNode (location: (17,0)-(18,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (17,0)-(17,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,4)-(18,3)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (17,7)-(17,17)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (17,8)-(17,16)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (17,8)-(17,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (17,8)-(17,9) = "a" + │ │ │ │ ├── operator_loc: (17,10)-(17,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (17,12)-(17,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (17,12)-(17,13)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── message_loc: (17,12)-(17,13) = "b" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :[] + │ │ │ │ ├── message_loc: (17,13)-(17,16) = "[1]" + │ │ │ │ ├── opening_loc: (17,13)-(17,14) = "[" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (17,14)-(17,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (17,14)-(17,15)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── closing_loc: (17,15)-(17,16) = "]" + │ │ │ │ └── block: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (17,7)-(17,8) = "|" + │ │ └── closing_loc: (17,16)-(17,17) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (17,4)-(17,6) = "do" + │ └── closing_loc: (18,0)-(18,3) = "end" + ├── @ CallNode (location: (20,0)-(22,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (20,0)-(20,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (20,4)-(22,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (20,4)-(22,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (21,0)-(21,6)) + │ │ │ ├── keyword_loc: (21,0)-(21,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (22,0)-(22,3) = "end" + │ ├── opening_loc: (20,4)-(20,6) = "do" + │ └── closing_loc: (22,0)-(22,3) = "end" + ├── @ CallNode (location: (24,0)-(29,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (24,0)-(24,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (24,4)-(29,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (25,2)-(28,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (25,2)-(28,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (25,2)-(25,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (25,6)-(28,5)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (26,4)-(27,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (26,4)-(27,7)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (26,4)-(26,7) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (26,8)-(27,7)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (26,8)-(26,10) = "do" + │ │ │ └── closing_loc: (27,4)-(27,7) = "end" + │ │ ├── opening_loc: (25,6)-(25,8) = "do" + │ │ └── closing_loc: (28,2)-(28,5) = "end" + │ ├── opening_loc: (24,4)-(24,6) = "do" + │ └── closing_loc: (29,0)-(29,3) = "end" + ├── @ CallNode (location: (31,0)-(31,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (31,0)-(31,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (31,0)-(31,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (31,3)-(31,8) = "[bar]" + │ ├── opening_loc: (31,3)-(31,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,4)-(31,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (31,4)-(31,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (31,4)-(31,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (31,7)-(31,8) = "]" + │ └── block: + │ @ BlockNode (location: (31,9)-(31,16)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (31,11)-(31,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (31,11)-(31,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (31,11)-(31,14) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (31,9)-(31,10) = "{" + │ └── closing_loc: (31,15)-(31,16) = "}" + ├── @ CallNode (location: (33,0)-(33,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (33,0)-(33,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (33,4)-(33,24)) + │ ├── locals: [:x, :y, :z] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (33,6)-(33,20)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (33,7)-(33,19)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (33,7)-(33,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (33,10)-(33,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :y + │ │ │ │ ├── name_loc: (33,10)-(33,11) = "y" + │ │ │ │ ├── operator_loc: (33,12)-(33,13) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (33,14)-(33,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ RequiredKeywordParameterNode (location: (33,17)-(33,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :z + │ │ │ │ └── name_loc: (33,17)-(33,19) = "z:" + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (33,6)-(33,7) = "|" + │ │ └── closing_loc: (33,19)-(33,20) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (33,21)-(33,22)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (33,21)-(33,22)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── opening_loc: (33,4)-(33,5) = "{" + │ └── closing_loc: (33,23)-(33,24) = "}" + ├── @ CallNode (location: (35,0)-(35,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (35,0)-(35,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (35,4)-(35,11)) + │ ├── locals: [:x] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (35,6)-(35,9)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (35,7)-(35,8)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (35,7)-(35,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (35,6)-(35,7) = "|" + │ │ └── closing_loc: (35,8)-(35,9) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (35,4)-(35,5) = "{" + │ └── closing_loc: (35,10)-(35,11) = "}" + ├── @ LocalVariableWriteNode (location: (37,0)-(37,8)) + │ ├── name: :fork + │ ├── depth: 0 + │ ├── name_loc: (37,0)-(37,4) = "fork" + │ ├── value: + │ │ @ IntegerNode (location: (37,7)-(37,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (37,5)-(37,6) = "=" + ├── @ CallNode (location: (38,0)-(39,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fork + │ ├── message_loc: (38,0)-(38,4) = "fork" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (38,5)-(39,3)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (38,8)-(38,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (38,9)-(38,10)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (38,9)-(38,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (38,8)-(38,9) = "|" + │ │ └── closing_loc: (38,10)-(38,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (38,5)-(38,7) = "do" + │ └── closing_loc: (39,0)-(39,3) = "end" + ├── @ CallNode (location: (41,0)-(41,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fork + │ ├── message_loc: (41,0)-(41,4) = "fork" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (41,5)-(41,12)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (41,7)-(41,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (41,8)-(41,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (41,8)-(41,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (41,7)-(41,8) = "|" + │ │ └── closing_loc: (41,9)-(41,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (41,5)-(41,6) = "{" + │ └── closing_loc: (41,11)-(41,12) = "}" + ├── @ CallNode (location: (43,0)-(44,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :C + │ ├── message_loc: (43,0)-(43,1) = "C" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (43,2)-(44,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (43,2)-(43,4) = "do" + │ └── closing_loc: (44,0)-(44,3) = "end" + ├── @ CallNode (location: (46,0)-(46,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :C + │ ├── message_loc: (46,0)-(46,1) = "C" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (46,2)-(46,4)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (46,2)-(46,3) = "{" + │ └── closing_loc: (46,3)-(46,4) = "}" + ├── @ CallNode (location: (48,0)-(52,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (48,0)-(48,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (48,4)-(52,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (48,4)-(52,1)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :lambda + │ │ ├── message_loc: (48,4)-(48,10) = "lambda" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (48,11)-(52,1)) + │ │ ├── locals: [:a, :b] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (48,13)-(51,3)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (49,2)-(50,6)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 2) + │ │ │ │ │ ├── @ OptionalKeywordParameterNode (location: (49,2)-(49,6)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ ├── name_loc: (49,2)-(49,4) = "a:" + │ │ │ │ │ │ └── value: + │ │ │ │ │ │ @ IntegerNode (location: (49,5)-(49,6)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ └── @ OptionalKeywordParameterNode (location: (50,2)-(50,6)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── name_loc: (50,2)-(50,4) = "b:" + │ │ │ │ │ └── value: + │ │ │ │ │ @ IntegerNode (location: (50,5)-(50,6)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (48,13)-(48,14) = "|" + │ │ │ └── closing_loc: (51,2)-(51,3) = "|" + │ │ ├── body: ∅ + │ │ ├── opening_loc: (48,11)-(48,12) = "{" + │ │ └── closing_loc: (52,0)-(52,1) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (54,0)-(54,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (54,0)-(54,3) = "foo" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (54,4)-(54,17)) + ├── locals: [:bar] + ├── parameters: + │ @ BlockParametersNode (location: (54,7)-(54,13)) + │ ├── parameters: + │ │ @ ParametersNode (location: (54,8)-(54,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (54,8)-(54,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ ImplicitRestNode (location: (54,11)-(54,12)) + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (54,7)-(54,8) = "|" + │ └── closing_loc: (54,12)-(54,13) = "|" + ├── body: ∅ + ├── opening_loc: (54,4)-(54,6) = "do" + └── closing_loc: (54,14)-(54,17) = "end" diff --git a/test/mri/prism/snapshots/boolean_operators.txt b/test/mri/prism/snapshots/boolean_operators.txt new file mode 100644 index 00000000000..ace8047e18d --- /dev/null +++ b/test/mri/prism/snapshots/boolean_operators.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(5,7)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(5,7)) + └── body: (length: 3) + ├── @ LocalVariableAndWriteNode (location: (1,0)-(1,7)) + │ ├── name_loc: (1,0)-(1,1) = "a" + │ ├── operator_loc: (1,2)-(1,5) = "&&=" + │ ├── value: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── name: :a + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (3,0)-(3,6)) + │ ├── name_loc: (3,0)-(3,1) = "a" + │ ├── operator_loc: (3,2)-(3,4) = "+=" + │ ├── value: + │ │ @ CallNode (location: (3,5)-(3,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (3,5)-(3,6) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── name: :a + │ ├── operator: :+ + │ └── depth: 0 + └── @ LocalVariableOrWriteNode (location: (5,0)-(5,7)) + ├── name_loc: (5,0)-(5,1) = "a" + ├── operator_loc: (5,2)-(5,5) = "||=" + ├── value: + │ @ CallNode (location: (5,6)-(5,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (5,6)-(5,7) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── name: :a + └── depth: 0 diff --git a/test/mri/prism/snapshots/booleans.txt b/test/mri/prism/snapshots/booleans.txt new file mode 100644 index 00000000000..47319662439 --- /dev/null +++ b/test/mri/prism/snapshots/booleans.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ FalseNode (location: (1,0)-(1,5)) + └── @ TrueNode (location: (3,0)-(3,4)) diff --git a/test/mri/prism/snapshots/break.txt b/test/mri/prism/snapshots/break.txt new file mode 100644 index 00000000000..984b9f7f227 --- /dev/null +++ b/test/mri/prism/snapshots/break.txt @@ -0,0 +1,239 @@ +@ ProgramNode (location: (1,0)-(25,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(25,23)) + └── body: (length: 11) + ├── @ BreakNode (location: (1,0)-(1,5)) + │ ├── arguments: ∅ + │ └── keyword_loc: (1,0)-(1,5) = "break" + ├── @ BreakNode (location: (3,0)-(3,19)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,6)-(3,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ ParenthesesNode (location: (3,6)-(3,9)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,7)-(3,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,7)-(3,8)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (3,6)-(3,7) = "(" + │ │ │ └── closing_loc: (3,8)-(3,9) = ")" + │ │ ├── @ ParenthesesNode (location: (3,11)-(3,14)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,12)-(3,13)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,12)-(3,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: (3,11)-(3,12) = "(" + │ │ │ └── closing_loc: (3,13)-(3,14) = ")" + │ │ └── @ ParenthesesNode (location: (3,16)-(3,19)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,17)-(3,18)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,17)-(3,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: (3,16)-(3,17) = "(" + │ │ └── closing_loc: (3,18)-(3,19) = ")" + │ └── keyword_loc: (3,0)-(3,5) = "break" + ├── @ BreakNode (location: (5,0)-(5,7)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── keyword_loc: (5,0)-(5,5) = "break" + ├── @ BreakNode (location: (7,0)-(8,1)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(8,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (7,6)-(7,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (7,9)-(7,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (8,0)-(8,1)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── keyword_loc: (7,0)-(7,5) = "break" + ├── @ BreakNode (location: (10,0)-(10,13)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (10,6)-(10,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (10,6)-(10,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (10,9)-(10,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (10,12)-(10,13)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── keyword_loc: (10,0)-(10,5) = "break" + ├── @ BreakNode (location: (12,0)-(12,15)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (12,6)-(12,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ArrayNode (location: (12,6)-(12,15)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 3) + │ │ │ ├── @ IntegerNode (location: (12,7)-(12,8)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (12,10)-(12,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (12,13)-(12,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: (12,6)-(12,7) = "[" + │ │ └── closing_loc: (12,14)-(12,15) = "]" + │ └── keyword_loc: (12,0)-(12,5) = "break" + ├── @ BreakNode (location: (14,0)-(17,1)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (14,5)-(17,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (14,5)-(17,1)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (15,2)-(16,3)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (14,5)-(14,6) = "(" + │ │ └── closing_loc: (17,0)-(17,1) = ")" + │ └── keyword_loc: (14,0)-(14,5) = "break" + ├── @ BreakNode (location: (19,0)-(19,7)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,5)-(19,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (19,5)-(19,7)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (19,5)-(19,6) = "(" + │ │ └── closing_loc: (19,6)-(19,7) = ")" + │ └── keyword_loc: (19,0)-(19,5) = "break" + ├── @ BreakNode (location: (21,0)-(21,8)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,5)-(21,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (21,5)-(21,8)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (21,6)-(21,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (21,6)-(21,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (21,5)-(21,6) = "(" + │ │ └── closing_loc: (21,7)-(21,8) = ")" + │ └── keyword_loc: (21,0)-(21,5) = "break" + ├── @ CallNode (location: (23,0)-(23,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (23,0)-(23,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (23,0)-(23,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (23,4)-(23,16)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (23,6)-(23,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (23,6)-(23,14)) + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (23,12)-(23,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (23,12)-(23,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── keyword_loc: (23,6)-(23,11) = "break" + │ │ ├── opening_loc: (23,4)-(23,5) = "{" + │ │ └── closing_loc: (23,15)-(23,16) = "}" + │ ├── call_operator_loc: ∅ + │ ├── name: :== + │ ├── message_loc: (23,17)-(23,19) = "==" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,20)-(23,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (23,20)-(23,22)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (25,0)-(25,23)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (25,0)-(25,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (25,0)-(25,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (25,4)-(25,17)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (25,6)-(25,9)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (25,7)-(25,8)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (25,7)-(25,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (25,6)-(25,7) = "|" + │ │ └── closing_loc: (25,8)-(25,9) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (25,10)-(25,15)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (25,10)-(25,15)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (25,10)-(25,15) = "break" + │ ├── opening_loc: (25,4)-(25,5) = "{" + │ └── closing_loc: (25,16)-(25,17) = "}" + ├── call_operator_loc: ∅ + ├── name: :== + ├── message_loc: (25,18)-(25,20) = "==" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (25,21)-(25,23)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (25,21)-(25,23)) + │ ├── flags: decimal + │ └── value: 42 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/case.txt b/test/mri/prism/snapshots/case.txt new file mode 100644 index 00000000000..417bf9492a4 --- /dev/null +++ b/test/mri/prism/snapshots/case.txt @@ -0,0 +1,495 @@ +@ ProgramNode (location: (1,0)-(55,3)) +├── locals: [:b] +└── statements: + @ StatementsNode (location: (1,0)-(55,3)) + └── body: (length: 15) + ├── @ CaseNode (location: (1,0)-(3,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (1,5)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,5)-(1,6) = ":" + │ │ ├── value_loc: (1,6)-(1,8) = "hi" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "hi" + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (2,0)-(2,8)) + │ │ ├── keyword_loc: (2,0)-(2,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,5)-(2,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (2,5)-(2,6) = ":" + │ │ │ ├── value_loc: (2,6)-(2,8) = "hi" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "hi" + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ CaseNode (location: (5,0)-(5,58)) + │ ├── predicate: + │ │ @ TrueNode (location: (5,5)-(5,9)) + │ ├── conditions: (length: 2) + │ │ ├── @ WhenNode (location: (5,11)-(5,30)) + │ │ │ ├── keyword_loc: (5,11)-(5,15) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ TrueNode (location: (5,16)-(5,20)) + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (5,22)-(5,30)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (5,22)-(5,30)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (5,22)-(5,26) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,27)-(5,30)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (5,27)-(5,30)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (5,27)-(5,28) = ":" + │ │ │ │ ├── value_loc: (5,28)-(5,30) = "hi" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "hi" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ WhenNode (location: (5,32)-(5,53)) + │ │ ├── keyword_loc: (5,32)-(5,36) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ FalseNode (location: (5,37)-(5,42)) + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (5,44)-(5,53)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,44)-(5,53)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (5,44)-(5,48) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,49)-(5,53)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SymbolNode (location: (5,49)-(5,53)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (5,49)-(5,50) = ":" + │ │ │ ├── value_loc: (5,50)-(5,53) = "bye" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bye" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (5,0)-(5,4) = "case" + │ └── end_keyword_loc: (5,55)-(5,58) = "end" + ├── @ CaseNode (location: (7,0)-(7,20)) + │ ├── predicate: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (7,6)-(7,15)) + │ │ ├── keyword_loc: (7,6)-(7,10) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SplatNode (location: (7,11)-(7,15)) + │ │ │ ├── operator_loc: (7,11)-(7,12) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (7,12)-(7,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (7,12)-(7,15) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (7,0)-(7,4) = "case" + │ └── end_keyword_loc: (7,17)-(7,20) = "end" + ├── @ CaseNode (location: (9,0)-(13,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (9,5)-(9,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,5)-(9,6) = ":" + │ │ ├── value_loc: (9,6)-(9,8) = "hi" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "hi" + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (10,0)-(10,8)) + │ │ ├── keyword_loc: (10,0)-(10,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SymbolNode (location: (10,5)-(10,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (10,5)-(10,6) = ":" + │ │ │ ├── value_loc: (10,6)-(10,8) = "hi" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "hi" + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (11,0)-(13,3)) + │ │ ├── else_keyword_loc: (11,0)-(11,4) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (12,0)-(12,2)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (12,0)-(12,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (12,0)-(12,1) = ":" + │ │ │ ├── value_loc: (12,1)-(12,2) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── end_keyword_loc: (13,0)-(13,3) = "end" + │ ├── case_keyword_loc: (9,0)-(9,4) = "case" + │ └── end_keyword_loc: (13,0)-(13,3) = "end" + ├── @ CaseNode (location: (15,0)-(15,36)) + │ ├── predicate: + │ │ @ CallNode (location: (15,5)-(15,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :this + │ │ ├── message_loc: (15,5)-(15,9) = "this" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (15,11)-(15,31)) + │ │ ├── keyword_loc: (15,11)-(15,15) = "when" + │ │ ├── conditions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (15,16)-(15,22)) + │ │ │ │ └── name: :FooBar + │ │ │ └── @ ConstantReadNode (location: (15,24)-(15,31)) + │ │ │ └── name: :BazBonk + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (15,0)-(15,4) = "case" + │ └── end_keyword_loc: (15,33)-(15,36) = "end" + ├── @ CaseNode (location: (17,0)-(19,3)) + │ ├── predicate: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (18,0)-(18,15)) + │ │ ├── keyword_loc: (18,0)-(18,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (18,5)-(18,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (18,5)-(18,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (18,5)-(18,8) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :== + │ │ │ ├── message_loc: (18,9)-(18,11) = "==" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (18,12)-(18,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (18,12)-(18,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (18,12)-(18,15) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (17,0)-(17,4) = "case" + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ CaseNode (location: (21,0)-(25,3)) + │ ├── predicate: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (22,0)-(22,6)) + │ │ ├── keyword_loc: (22,0)-(22,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (22,5)-(22,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (22,5)-(22,6) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (23,0)-(25,3)) + │ │ ├── else_keyword_loc: (23,0)-(23,4) = "else" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (25,0)-(25,3) = "end" + │ ├── case_keyword_loc: (21,0)-(21,4) = "case" + │ └── end_keyword_loc: (25,0)-(25,3) = "end" + ├── @ CaseNode (location: (27,0)-(30,6)) + │ ├── predicate: + │ │ @ CallNode (location: (27,5)-(27,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :type + │ │ ├── message_loc: (27,5)-(27,9) = "type" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (28,3)-(28,10)) + │ │ ├── keyword_loc: (28,3)-(28,7) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SymbolNode (location: (28,8)-(28,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (28,8)-(28,9) = ":" + │ │ │ ├── value_loc: (28,9)-(28,10) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (29,5)-(30,6)) + │ │ ├── else_keyword_loc: (29,5)-(29,9) = "else" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (30,3)-(30,6) = "end" + │ ├── case_keyword_loc: (27,0)-(27,4) = "case" + │ └── end_keyword_loc: (30,3)-(30,6) = "end" + ├── @ CaseNode (location: (32,0)-(32,25)) + │ ├── predicate: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (32,14)-(32,20)) + │ │ ├── keyword_loc: (32,14)-(32,18) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ IntegerNode (location: (32,19)-(32,20)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (32,0)-(32,4) = "case" + │ └── end_keyword_loc: (32,22)-(32,25) = "end" + ├── @ CaseNode (location: (34,0)-(36,3)) + │ ├── predicate: + │ │ @ MatchPredicateNode (location: (34,5)-(34,11)) + │ │ ├── value: + │ │ │ @ IntegerNode (location: (34,5)-(34,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (34,10)-(34,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (34,7)-(34,9) = "in" + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (35,0)-(35,6)) + │ │ ├── keyword_loc: (35,0)-(35,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ IntegerNode (location: (35,5)-(35,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (34,0)-(34,4) = "case" + │ └── end_keyword_loc: (36,0)-(36,3) = "end" + ├── @ CaseNode (location: (38,0)-(38,24)) + │ ├── predicate: + │ │ @ MatchPredicateNode (location: (38,5)-(38,11)) + │ │ ├── value: + │ │ │ @ IntegerNode (location: (38,5)-(38,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (38,10)-(38,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (38,7)-(38,9) = "in" + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (38,13)-(38,19)) + │ │ ├── keyword_loc: (38,13)-(38,17) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ IntegerNode (location: (38,18)-(38,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (38,0)-(38,4) = "case" + │ └── end_keyword_loc: (38,21)-(38,24) = "end" + ├── @ CaseMatchNode (location: (40,0)-(42,3)) + │ ├── predicate: + │ │ @ MatchPredicateNode (location: (40,5)-(40,11)) + │ │ ├── value: + │ │ │ @ IntegerNode (location: (40,5)-(40,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (40,10)-(40,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (40,7)-(40,9) = "in" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (41,0)-(41,4)) + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (41,3)-(41,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (41,0)-(41,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (40,0)-(40,4) = "case" + │ └── end_keyword_loc: (42,0)-(42,3) = "end" + ├── @ CaseMatchNode (location: (44,0)-(44,22)) + │ ├── predicate: + │ │ @ MatchPredicateNode (location: (44,5)-(44,11)) + │ │ ├── value: + │ │ │ @ IntegerNode (location: (44,5)-(44,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (44,10)-(44,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (44,7)-(44,9) = "in" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (44,13)-(44,17)) + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (44,16)-(44,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (44,13)-(44,15) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (44,0)-(44,4) = "case" + │ └── end_keyword_loc: (44,19)-(44,22) = "end" + ├── @ CaseMatchNode (location: (46,0)-(49,3)) + │ ├── predicate: + │ │ @ CallNode (location: (46,5)-(46,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (46,5)-(46,6) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (47,0)-(48,3)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (47,3)-(47,15)) + │ │ │ ├── if_keyword_loc: (47,5)-(47,7) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ AndNode (location: (47,8)-(47,15)) + │ │ │ │ ├── left: + │ │ │ │ │ @ CallNode (location: (47,8)-(47,9)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :c + │ │ │ │ │ ├── message_loc: (47,8)-(47,9) = "c" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ CallNode (location: (47,14)-(47,15)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (47,14)-(47,15) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: (47,10)-(47,13) = "and" + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (47,3)-(47,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (47,3)-(47,4)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (48,2)-(48,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (48,2)-(48,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :e + │ │ │ ├── message_loc: (48,2)-(48,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── in_loc: (47,0)-(47,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (46,0)-(46,4) = "case" + │ └── end_keyword_loc: (49,0)-(49,3) = "end" + └── @ CallNode (location: (51,0)-(55,3)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (51,0)-(51,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: (51,1)-(51,2) = "." + ├── name: :then + ├── message_loc: (51,2)-(51,6) = "then" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (51,7)-(55,3)) + ├── locals: [:_1] + ├── parameters: + │ @ NumberedParametersNode (location: (51,7)-(55,3)) + │ └── maximum: 1 + ├── body: + │ @ StatementsNode (location: (52,2)-(54,5)) + │ └── body: (length: 1) + │ └── @ CaseMatchNode (location: (52,2)-(54,5)) + │ ├── predicate: + │ │ @ IntegerNode (location: (52,7)-(52,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (53,2)-(53,8)) + │ │ ├── pattern: + │ │ │ @ PinnedVariableNode (location: (53,5)-(53,8)) + │ │ │ ├── variable: + │ │ │ │ @ LocalVariableReadNode (location: (53,6)-(53,8)) + │ │ │ │ ├── name: :_1 + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (53,5)-(53,6) = "^" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (53,2)-(53,4) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (52,2)-(52,6) = "case" + │ └── end_keyword_loc: (54,2)-(54,5) = "end" + ├── opening_loc: (51,7)-(51,9) = "do" + └── closing_loc: (55,0)-(55,3) = "end" diff --git a/test/mri/prism/snapshots/classes.txt b/test/mri/prism/snapshots/classes.txt new file mode 100644 index 00000000000..4a36bd5cdc4 --- /dev/null +++ b/test/mri/prism/snapshots/classes.txt @@ -0,0 +1,365 @@ +@ ProgramNode (location: (1,0)-(35,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(35,3)) + └── body: (length: 14) + ├── @ ClassNode (location: (1,0)-(1,17)) + │ ├── locals: [:a] + │ ├── class_keyword_loc: (1,0)-(1,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,8)-(1,13)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (1,8)-(1,13)) + │ │ ├── name: :a + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,8)-(1,9) = "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (1,10)-(1,11) = "=" + │ ├── end_keyword_loc: (1,14)-(1,17) = "end" + │ └── name: :A + ├── @ ClassNode (location: (3,0)-(3,20)) + │ ├── locals: [] + │ ├── class_keyword_loc: (3,0)-(3,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (3,6)-(3,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ BeginNode (location: (3,0)-(3,20)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (3,9)-(3,20)) + │ │ │ ├── ensure_keyword_loc: (3,9)-(3,15) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (3,17)-(3,20) = "end" + │ │ └── end_keyword_loc: (3,17)-(3,20) = "end" + │ ├── end_keyword_loc: (3,17)-(3,20) = "end" + │ └── name: :A + ├── @ ClassNode (location: (5,0)-(5,34)) + │ ├── locals: [] + │ ├── class_keyword_loc: (5,0)-(5,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (5,6)-(5,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ BeginNode (location: (5,0)-(5,34)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (5,9)-(5,15)) + │ │ │ ├── keyword_loc: (5,9)-(5,15) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (5,17)-(5,29)) + │ │ │ ├── else_keyword_loc: (5,17)-(5,21) = "else" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (5,23)-(5,29) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (5,23)-(5,34)) + │ │ │ ├── ensure_keyword_loc: (5,23)-(5,29) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (5,31)-(5,34) = "end" + │ │ └── end_keyword_loc: (5,31)-(5,34) = "end" + │ ├── end_keyword_loc: (5,31)-(5,34) = "end" + │ └── name: :A + ├── @ ClassNode (location: (7,0)-(9,3)) + │ ├── locals: [:a] + │ ├── class_keyword_loc: (7,0)-(7,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (7,6)-(7,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: (7,8)-(7,9) = "<" + │ ├── superclass: + │ │ @ ConstantReadNode (location: (7,10)-(7,11)) + │ │ └── name: :B + │ ├── body: + │ │ @ StatementsNode (location: (8,0)-(8,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (8,0)-(8,5)) + │ │ ├── name: :a + │ │ ├── depth: 0 + │ │ ├── name_loc: (8,0)-(8,1) = "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (8,4)-(8,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (8,2)-(8,3) = "=" + │ ├── end_keyword_loc: (9,0)-(9,3) = "end" + │ └── name: :A + ├── @ SingletonClassNode (location: (11,0)-(12,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (11,0)-(11,5) = "class" + │ ├── operator_loc: (11,6)-(11,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (11,9)-(11,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (11,13)-(11,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (11,13)-(11,16) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (11,9)-(11,12) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ └── end_keyword_loc: (12,0)-(12,3) = "end" + ├── @ ClassNode (location: (14,0)-(14,40)) + │ ├── locals: [] + │ ├── class_keyword_loc: (14,0)-(14,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (14,6)-(14,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,9)-(14,35)) + │ │ └── body: (length: 1) + │ │ └── @ SingletonClassNode (location: (14,9)-(14,35)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (14,9)-(14,14) = "class" + │ │ ├── operator_loc: (14,15)-(14,17) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (14,18)-(14,22)) + │ │ ├── body: + │ │ │ @ BeginNode (location: (14,9)-(14,35)) + │ │ │ ├── begin_keyword_loc: ∅ + │ │ │ ├── statements: ∅ + │ │ │ ├── rescue_clause: ∅ + │ │ │ ├── else_clause: ∅ + │ │ │ ├── ensure_clause: + │ │ │ │ @ EnsureNode (location: (14,24)-(14,35)) + │ │ │ │ ├── ensure_keyword_loc: (14,24)-(14,30) = "ensure" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── end_keyword_loc: (14,32)-(14,35) = "end" + │ │ │ └── end_keyword_loc: (14,32)-(14,35) = "end" + │ │ └── end_keyword_loc: (14,32)-(14,35) = "end" + │ ├── end_keyword_loc: (14,37)-(14,40) = "end" + │ └── name: :A + ├── @ ClassNode (location: (16,0)-(16,54)) + │ ├── locals: [] + │ ├── class_keyword_loc: (16,0)-(16,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (16,6)-(16,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (16,9)-(16,49)) + │ │ └── body: (length: 1) + │ │ └── @ SingletonClassNode (location: (16,9)-(16,49)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (16,9)-(16,14) = "class" + │ │ ├── operator_loc: (16,15)-(16,17) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (16,18)-(16,22)) + │ │ ├── body: + │ │ │ @ BeginNode (location: (16,9)-(16,49)) + │ │ │ ├── begin_keyword_loc: ∅ + │ │ │ ├── statements: ∅ + │ │ │ ├── rescue_clause: + │ │ │ │ @ RescueNode (location: (16,24)-(16,30)) + │ │ │ │ ├── keyword_loc: (16,24)-(16,30) = "rescue" + │ │ │ │ ├── exceptions: (length: 0) + │ │ │ │ ├── operator_loc: ∅ + │ │ │ │ ├── reference: ∅ + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── consequent: ∅ + │ │ │ ├── else_clause: + │ │ │ │ @ ElseNode (location: (16,32)-(16,44)) + │ │ │ │ ├── else_keyword_loc: (16,32)-(16,36) = "else" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── end_keyword_loc: (16,38)-(16,44) = "ensure" + │ │ │ ├── ensure_clause: + │ │ │ │ @ EnsureNode (location: (16,38)-(16,49)) + │ │ │ │ ├── ensure_keyword_loc: (16,38)-(16,44) = "ensure" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── end_keyword_loc: (16,46)-(16,49) = "end" + │ │ │ └── end_keyword_loc: (16,46)-(16,49) = "end" + │ │ └── end_keyword_loc: (16,46)-(16,49) = "end" + │ ├── end_keyword_loc: (16,51)-(16,54) = "end" + │ └── name: :A + ├── @ SingletonClassNode (location: (18,0)-(19,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (18,0)-(18,5) = "class" + │ ├── operator_loc: (18,6)-(18,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (18,9)-(18,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (18,9)-(18,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (18,9)-(18,12) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (18,12)-(18,13) = "." + │ │ ├── name: :bar + │ │ ├── message_loc: (18,13)-(18,16) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ SingletonClassNode (location: (21,0)-(21,20)) + │ ├── locals: [] + │ ├── class_keyword_loc: (21,0)-(21,5) = "class" + │ ├── operator_loc: (21,6)-(21,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (21,9)-(21,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (21,9)-(21,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (21,9)-(21,12) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (21,12)-(21,13) = "." + │ │ ├── name: :bar + │ │ ├── message_loc: (21,13)-(21,16) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ └── end_keyword_loc: (21,17)-(21,20) = "end" + ├── @ SingletonClassNode (location: (23,0)-(24,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (23,0)-(23,5) = "class" + │ ├── operator_loc: (23,6)-(23,8) = "<<" + │ ├── expression: + │ │ @ SelfNode (location: (23,9)-(23,13)) + │ ├── body: ∅ + │ └── end_keyword_loc: (24,0)-(24,3) = "end" + ├── @ SingletonClassNode (location: (26,0)-(26,17)) + │ ├── locals: [] + │ ├── class_keyword_loc: (26,0)-(26,5) = "class" + │ ├── operator_loc: (26,6)-(26,8) = "<<" + │ ├── expression: + │ │ @ SelfNode (location: (26,9)-(26,13)) + │ ├── body: ∅ + │ └── end_keyword_loc: (26,14)-(26,17) = "end" + ├── @ SingletonClassNode (location: (28,0)-(30,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (28,0)-(28,5) = "class" + │ ├── operator_loc: (28,6)-(28,8) = "<<" + │ ├── expression: + │ │ @ SelfNode (location: (28,9)-(28,13)) + │ ├── body: + │ │ @ StatementsNode (location: (29,0)-(29,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (29,0)-(29,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (29,0)-(29,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (29,2)-(29,3) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (29,4)-(29,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (29,4)-(29,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (30,0)-(30,3) = "end" + ├── @ SingletonClassNode (location: (32,0)-(32,23)) + │ ├── locals: [] + │ ├── class_keyword_loc: (32,0)-(32,5) = "class" + │ ├── operator_loc: (32,6)-(32,8) = "<<" + │ ├── expression: + │ │ @ SelfNode (location: (32,9)-(32,13)) + │ ├── body: + │ │ @ StatementsNode (location: (32,14)-(32,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (32,14)-(32,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (32,14)-(32,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (32,16)-(32,17) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (32,18)-(32,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (32,18)-(32,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (32,20)-(32,23) = "end" + └── @ ClassNode (location: (34,0)-(35,3)) + ├── locals: [] + ├── class_keyword_loc: (34,0)-(34,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (34,6)-(34,7)) + │ └── name: :A + ├── inheritance_operator_loc: (34,8)-(34,9) = "<" + ├── superclass: + │ @ CallNode (location: (34,10)-(34,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (34,10)-(34,11)) + │ │ └── name: :B + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (34,11)-(34,14) = "[1]" + │ ├── opening_loc: (34,11)-(34,12) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (34,12)-(34,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (34,12)-(34,13)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (34,13)-(34,14) = "]" + │ └── block: ∅ + ├── body: ∅ + ├── end_keyword_loc: (35,0)-(35,3) = "end" + └── name: :A diff --git a/test/mri/prism/snapshots/command_method_call.txt b/test/mri/prism/snapshots/command_method_call.txt new file mode 100644 index 00000000000..7fd6341304c --- /dev/null +++ b/test/mri/prism/snapshots/command_method_call.txt @@ -0,0 +1,755 @@ +@ ProgramNode (location: (1,0)-(41,10)) +├── locals: [:foo, :bar] +└── statements: + @ StatementsNode (location: (1,0)-(41,10)) + └── body: (length: 21) + ├── @ CallNode (location: (1,0)-(1,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,4)-(3,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,4)-(3,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,4)-(3,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,8)-(3,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,8)-(3,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ IfNode (location: (5,0)-(5,14)) + │ ├── if_keyword_loc: (5,6)-(5,8) = "if" + │ ├── predicate: + │ │ @ CallNode (location: (5,9)-(5,14)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (5,9)-(5,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,13)-(5,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,0)-(5,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,0)-(5,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (5,0)-(5,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,4)-(5,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,4)-(5,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ UnlessNode (location: (7,0)-(7,18)) + │ ├── keyword_loc: (7,6)-(7,12) = "unless" + │ ├── predicate: + │ │ @ CallNode (location: (7,13)-(7,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (7,13)-(7,16) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,17)-(7,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,17)-(7,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (7,0)-(7,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,0)-(7,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,0)-(7,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ WhileNode (location: (9,0)-(9,17)) + │ ├── flags: ∅ + │ ├── keyword_loc: (9,6)-(9,11) = "while" + │ ├── closing_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (9,12)-(9,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (9,12)-(9,15) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,16)-(9,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (9,16)-(9,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (9,0)-(9,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (9,0)-(9,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (9,0)-(9,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,4)-(9,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (9,4)-(9,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ UntilNode (location: (11,0)-(11,17)) + │ ├── flags: ∅ + │ ├── keyword_loc: (11,6)-(11,11) = "until" + │ ├── closing_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (11,12)-(11,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (11,12)-(11,15) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,16)-(11,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (11,16)-(11,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (11,0)-(11,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (11,0)-(11,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (11,0)-(11,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,4)-(11,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (11,4)-(11,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RescueModifierNode (location: (13,0)-(13,18)) + │ ├── expression: + │ │ @ CallNode (location: (13,0)-(13,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (13,0)-(13,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,4)-(13,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (13,4)-(13,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (13,6)-(13,12) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (13,13)-(13,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (13,13)-(13,16) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,17)-(13,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (13,17)-(13,18)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (15,0)-(15,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (15,0)-(15,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (15,0)-(15,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (15,3)-(15,10) = "[bar 1]" + │ ├── opening_loc: (15,3)-(15,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,4)-(15,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (15,4)-(15,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (15,4)-(15,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,8)-(15,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (15,8)-(15,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (15,9)-(15,10) = "]" + │ └── block: ∅ + ├── @ AndNode (location: (17,0)-(17,15)) + │ ├── left: + │ │ @ CallNode (location: (17,0)-(17,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (17,0)-(17,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (17,4)-(17,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (17,4)-(17,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (17,10)-(17,15)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (17,10)-(17,13) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (17,14)-(17,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (17,14)-(17,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (17,6)-(17,9) = "and" + ├── @ OrNode (location: (19,0)-(19,14)) + │ ├── left: + │ │ @ CallNode (location: (19,0)-(19,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (19,0)-(19,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (19,4)-(19,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (19,4)-(19,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (19,9)-(19,14)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (19,9)-(19,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (19,13)-(19,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (19,13)-(19,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (19,6)-(19,8) = "or" + ├── @ CallNode (location: (21,0)-(21,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (21,4)-(21,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (21,4)-(21,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (21,8)-(21,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (21,8)-(21,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (21,0)-(21,3) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LocalVariableWriteNode (location: (23,0)-(23,17)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (23,0)-(23,3) = "foo" + │ ├── value: + │ │ @ LocalVariableWriteNode (location: (23,6)-(23,17)) + │ │ ├── name: :bar + │ │ ├── depth: 0 + │ │ ├── name_loc: (23,6)-(23,9) = "bar" + │ │ ├── value: + │ │ │ @ CallNode (location: (23,12)-(23,17)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (23,12)-(23,15) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (23,16)-(23,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (23,16)-(23,17)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (23,10)-(23,11) = "=" + │ └── operator_loc: (23,4)-(23,5) = "=" + ├── @ DefNode (location: (25,0)-(25,15)) + │ ├── name: :foo + │ ├── name_loc: (25,4)-(25,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (25,10)-(25,15)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (25,10)-(25,15)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (25,10)-(25,13) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (25,14)-(25,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (25,14)-(25,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (25,8)-(25,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ CallNode (location: (27,0)-(27,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (27,0)-(27,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: (27,1)-(27,2) = "." + │ ├── name: :foo + │ ├── message_loc: (27,2)-(27,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,6)-(27,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (27,6)-(27,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(29,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (29,0)-(29,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (29,0)-(29,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: (29,1)-(29,2) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (29,2)-(29,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (29,5)-(29,6) = "." + │ ├── name: :bar + │ ├── message_loc: (29,6)-(29,9) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (29,10)-(29,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (29,10)-(29,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(31,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (31,0)-(31,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (31,0)-(31,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ IntegerNode (location: (31,0)-(31,1)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── call_operator_loc: (31,1)-(31,2) = "." + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (31,2)-(31,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (31,5)-(31,8) = "[2]" + │ │ ├── opening_loc: (31,5)-(31,6) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (31,6)-(31,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (31,6)-(31,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: (31,7)-(31,8) = "]" + │ │ └── block: ∅ + │ ├── call_operator_loc: (31,8)-(31,9) = "." + │ ├── name: :bar + │ ├── message_loc: (31,9)-(31,12) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,13)-(31,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (31,13)-(31,14)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (33,0)-(33,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (33,0)-(33,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: (33,1)-(33,2) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (33,2)-(33,5) = "foo" + │ │ ├── opening_loc: (33,5)-(33,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (33,6)-(33,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (33,6)-(33,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: (33,7)-(33,8) = ")" + │ │ └── block: ∅ + │ ├── call_operator_loc: (33,8)-(33,9) = "." + │ ├── name: :bar + │ ├── message_loc: (33,9)-(33,12) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,13)-(33,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (33,13)-(33,14)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (35,0)-(35,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (35,0)-(35,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: (35,1)-(35,2) = "." + │ │ ├── name: :foo + │ │ ├── message_loc: (35,2)-(35,5) = "foo" + │ │ ├── opening_loc: (35,5)-(35,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (35,8)-(35,9) = ")" + │ │ └── block: + │ │ @ BlockArgumentNode (location: (35,6)-(35,8)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (35,7)-(35,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (35,6)-(35,7) = "&" + │ ├── call_operator_loc: (35,9)-(35,10) = "." + │ ├── name: :bar + │ ├── message_loc: (35,10)-(35,13) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,14)-(35,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (35,14)-(35,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ AndNode (location: (37,0)-(37,17)) + │ ├── left: + │ │ @ CallNode (location: (37,0)-(37,6)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (37,1)-(37,6)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (37,1)-(37,4) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (37,5)-(37,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (37,5)-(37,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (37,0)-(37,1) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (37,11)-(37,17)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (37,12)-(37,17)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (37,12)-(37,15) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (37,16)-(37,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (37,16)-(37,17)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (37,11)-(37,12) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (37,7)-(37,10) = "and" + ├── @ OrNode (location: (39,0)-(39,16)) + │ ├── left: + │ │ @ CallNode (location: (39,0)-(39,6)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (39,1)-(39,6)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (39,1)-(39,4) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (39,5)-(39,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (39,5)-(39,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (39,0)-(39,1) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (39,10)-(39,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (39,11)-(39,16)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (39,11)-(39,14) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (39,15)-(39,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (39,15)-(39,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (39,10)-(39,11) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (39,7)-(39,9) = "or" + └── @ CallNode (location: (41,0)-(41,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (41,4)-(41,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (41,5)-(41,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (41,5)-(41,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (41,9)-(41,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (41,9)-(41,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (41,4)-(41,5) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (41,0)-(41,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/comments.txt b/test/mri/prism/snapshots/comments.txt new file mode 100644 index 00000000000..b7088adcd50 --- /dev/null +++ b/test/mri/prism/snapshots/comments.txt @@ -0,0 +1,145 @@ +@ ProgramNode (location: (1,0)-(24,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(24,5)) + └── body: (length: 9) + ├── @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (3,0)-(3,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (5,0)-(5,1) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (6,0)-(6,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :d + │ ├── message_loc: (6,0)-(6,1) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (8,0)-(10,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (8,0)-(8,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :e + │ │ ├── message_loc: (8,0)-(8,1) = "e" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (10,2)-(10,3) = "." + │ ├── name: :f + │ ├── message_loc: (10,3)-(10,4) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (12,0)-(14,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (12,0)-(12,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (12,0)-(12,1) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (14,0)-(14,1) = "." + │ ├── name: :h + │ ├── message_loc: (14,1)-(14,2) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (16,0)-(17,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (16,0)-(16,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :i + │ │ ├── message_loc: (16,0)-(16,1) = "i" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (17,0)-(17,1) = "." + │ ├── name: :j + │ ├── message_loc: (17,1)-(17,2) = "j" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (19,0)-(20,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (19,0)-(19,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :k + │ │ ├── message_loc: (19,0)-(19,1) = "k" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (20,2)-(20,3) = "." + │ ├── name: :l + │ ├── message_loc: (20,3)-(20,4) = "l" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (22,0)-(24,5)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (22,0)-(22,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (22,0)-(22,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (24,2)-(24,4) = "&." + ├── name: :n + ├── message_loc: (24,4)-(24,5) = "n" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/constants.txt b/test/mri/prism/snapshots/constants.txt new file mode 100644 index 00000000000..59e234148a5 --- /dev/null +++ b/test/mri/prism/snapshots/constants.txt @@ -0,0 +1,1242 @@ +@ ProgramNode (location: (1,0)-(184,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(184,10)) + └── body: (length: 90) + ├── @ ConstantPathNode (location: (1,0)-(1,4)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ │ └── name: :A + │ ├── child: + │ │ @ ConstantReadNode (location: (1,3)-(1,4)) + │ │ └── name: :B + │ └── delimiter_loc: (1,1)-(1,3) = "::" + ├── @ ConstantPathNode (location: (3,0)-(3,7)) + │ ├── parent: + │ │ @ ConstantPathNode (location: (3,0)-(3,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (3,0)-(3,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (3,3)-(3,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (3,1)-(3,3) = "::" + │ ├── child: + │ │ @ ConstantReadNode (location: (3,6)-(3,7)) + │ │ └── name: :C + │ └── delimiter_loc: (3,4)-(3,6) = "::" + ├── @ ConstantPathNode (location: (5,0)-(5,4)) + │ ├── parent: + │ │ @ CallNode (location: (5,0)-(5,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (5,0)-(5,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (5,3)-(5,4)) + │ │ └── name: :B + │ └── delimiter_loc: (5,1)-(5,3) = "::" + ├── @ ConstantPathWriteNode (location: (7,0)-(7,8)) + │ ├── target: + │ │ @ ConstantPathNode (location: (7,0)-(7,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (7,0)-(7,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (7,3)-(7,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (7,1)-(7,3) = "::" + │ ├── operator_loc: (7,5)-(7,6) = "=" + │ └── value: + │ @ IntegerNode (location: (7,7)-(7,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ConstantWriteNode (location: (9,0)-(9,5)) + │ ├── name: :A + │ ├── name_loc: (9,0)-(9,1) = "A" + │ ├── value: + │ │ @ IntegerNode (location: (9,4)-(9,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (9,2)-(9,3) = "=" + ├── @ ConstantReadNode (location: (11,0)-(11,3)) + │ └── name: :ABC + ├── @ CallNode (location: (13,0)-(13,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :Foo + │ ├── message_loc: (13,0)-(13,3) = "Foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,4)-(13,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (13,4)-(13,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (15,0)-(15,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :Foo + │ ├── message_loc: (15,0)-(15,3) = "Foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,4)-(15,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (15,4)-(15,8)) + │ │ ├── operator_loc: (15,4)-(15,5) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (15,5)-(15,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (15,5)-(15,8) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (17,0)-(17,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :Foo + │ ├── message_loc: (17,0)-(17,3) = "Foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,4)-(17,9)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (17,4)-(17,9)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (17,4)-(17,9)) + │ │ ├── value: + │ │ │ @ CallNode (location: (17,6)-(17,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (17,6)-(17,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (17,4)-(17,6) = "**" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (19,0)-(19,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :Foo + │ ├── message_loc: (19,0)-(19,3) = "Foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockArgumentNode (location: (19,4)-(19,8)) + │ ├── expression: + │ │ @ CallNode (location: (19,5)-(19,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (19,5)-(19,8) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (19,4)-(19,5) = "&" + ├── @ CallNode (location: (21,0)-(21,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (21,0)-(21,3)) + │ │ └── name: :Foo + │ ├── call_operator_loc: (21,3)-(21,5) = "::" + │ ├── name: :Bar + │ ├── message_loc: (21,5)-(21,8) = "Bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,9)-(21,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (21,9)-(21,13)) + │ │ ├── operator_loc: (21,9)-(21,10) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (21,10)-(21,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (21,10)-(21,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (23,0)-(23,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (23,0)-(23,3)) + │ │ └── name: :Foo + │ ├── call_operator_loc: (23,3)-(23,5) = "::" + │ ├── name: :Bar + │ ├── message_loc: (23,5)-(23,8) = "Bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,9)-(23,14)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (23,9)-(23,14)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (23,9)-(23,14)) + │ │ ├── value: + │ │ │ @ CallNode (location: (23,11)-(23,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (23,11)-(23,14) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (23,9)-(23,11) = "**" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (25,0)-(25,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (25,0)-(25,3)) + │ │ └── name: :Foo + │ ├── call_operator_loc: (25,3)-(25,5) = "::" + │ ├── name: :Bar + │ ├── message_loc: (25,5)-(25,8) = "Bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockArgumentNode (location: (25,9)-(25,13)) + │ ├── expression: + │ │ @ CallNode (location: (25,10)-(25,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (25,10)-(25,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (25,9)-(25,10) = "&" + ├── @ CallNode (location: (27,0)-(27,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantPathNode (location: (27,0)-(27,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (27,2)-(27,3)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (27,0)-(27,2) = "::" + │ ├── call_operator_loc: (27,3)-(27,5) = "::" + │ ├── name: :foo + │ ├── message_loc: (27,5)-(27,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathWriteNode (location: (29,0)-(29,7)) + │ ├── target: + │ │ @ ConstantPathNode (location: (29,0)-(29,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (29,2)-(29,3)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (29,0)-(29,2) = "::" + │ ├── operator_loc: (29,4)-(29,5) = "=" + │ └── value: + │ @ IntegerNode (location: (29,6)-(29,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ConstantPathWriteNode (location: (31,0)-(31,10)) + │ ├── target: + │ │ @ ConstantPathNode (location: (31,0)-(31,6)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (31,0)-(31,3)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (31,2)-(31,3)) + │ │ │ │ └── name: :A + │ │ │ └── delimiter_loc: (31,0)-(31,2) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (31,5)-(31,6)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (31,3)-(31,5) = "::" + │ ├── operator_loc: (31,7)-(31,8) = "=" + │ └── value: + │ @ IntegerNode (location: (31,9)-(31,10)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ConstantPathNode (location: (33,0)-(33,6)) + │ ├── parent: + │ │ @ ConstantPathNode (location: (33,0)-(33,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (33,2)-(33,3)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (33,0)-(33,2) = "::" + │ ├── child: + │ │ @ ConstantReadNode (location: (33,5)-(33,6)) + │ │ └── name: :B + │ └── delimiter_loc: (33,3)-(33,5) = "::" + ├── @ ConstantPathNode (location: (35,0)-(35,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (35,2)-(35,3)) + │ │ └── name: :A + │ └── delimiter_loc: (35,0)-(35,2) = "::" + ├── @ CallNode (location: (37,0)-(37,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (37,0)-(37,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (37,1)-(37,3) = "::" + │ ├── name: :false + │ ├── message_loc: (37,3)-(37,8) = "false" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantPathNode (location: (39,0)-(39,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (39,0)-(39,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (39,3)-(39,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (39,1)-(39,3) = "::" + │ ├── call_operator_loc: (39,4)-(39,6) = "::" + │ ├── name: :true + │ ├── message_loc: (39,6)-(39,10) = "true" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(41,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (41,0)-(41,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (41,1)-(41,3) = "::" + │ ├── name: :& + │ ├── message_loc: (41,3)-(41,4) = "&" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (43,0)-(43,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (43,0)-(43,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (43,1)-(43,3) = "::" + │ ├── name: :` + │ ├── message_loc: (43,3)-(43,4) = "`" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (45,0)-(45,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (45,1)-(45,3) = "::" + │ ├── name: :! + │ ├── message_loc: (45,3)-(45,4) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (47,0)-(47,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (47,0)-(47,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (47,1)-(47,3) = "::" + │ ├── name: :!= + │ ├── message_loc: (47,3)-(47,5) = "!=" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (49,0)-(49,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (49,0)-(49,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (49,1)-(49,3) = "::" + │ ├── name: :^ + │ ├── message_loc: (49,3)-(49,4) = "^" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (51,0)-(51,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (51,0)-(51,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (51,1)-(51,3) = "::" + │ ├── name: :== + │ ├── message_loc: (51,3)-(51,5) = "==" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (53,0)-(53,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (53,0)-(53,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (53,1)-(53,3) = "::" + │ ├── name: :=== + │ ├── message_loc: (53,3)-(53,6) = "===" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (55,0)-(55,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (55,0)-(55,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (55,1)-(55,3) = "::" + │ ├── name: :=~ + │ ├── message_loc: (55,3)-(55,5) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (57,0)-(57,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (57,0)-(57,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (57,1)-(57,3) = "::" + │ ├── name: :> + │ ├── message_loc: (57,3)-(57,4) = ">" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (59,0)-(59,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (59,0)-(59,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (59,1)-(59,3) = "::" + │ ├── name: :>= + │ ├── message_loc: (59,3)-(59,5) = ">=" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (61,0)-(61,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (61,0)-(61,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (61,1)-(61,3) = "::" + │ ├── name: :>> + │ ├── message_loc: (61,3)-(61,5) = ">>" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (63,0)-(63,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (63,0)-(63,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (63,1)-(63,3) = "::" + │ ├── name: :<< + │ ├── message_loc: (63,3)-(63,5) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathNode (location: (65,0)-(67,1)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (65,0)-(65,1)) + │ │ └── name: :A + │ ├── child: + │ │ @ ConstantReadNode (location: (67,0)-(67,1)) + │ │ └── name: :C + │ └── delimiter_loc: (65,1)-(65,3) = "::" + ├── @ CallNode (location: (69,0)-(69,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (69,0)-(69,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (69,1)-(69,3) = "::" + │ ├── name: :alias + │ ├── message_loc: (69,3)-(69,8) = "alias" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (71,0)-(71,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (71,0)-(71,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (71,1)-(71,3) = "::" + │ ├── name: :and + │ ├── message_loc: (71,3)-(71,6) = "and" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (73,0)-(73,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (73,0)-(73,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (73,1)-(73,3) = "::" + │ ├── name: :begin + │ ├── message_loc: (73,3)-(73,8) = "begin" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathNode (location: (75,0)-(75,8)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (75,0)-(75,1)) + │ │ └── name: :A + │ ├── child: + │ │ @ ConstantReadNode (location: (75,3)-(75,8)) + │ │ └── name: :BEGIN + │ └── delimiter_loc: (75,1)-(75,3) = "::" + ├── @ CallNode (location: (77,0)-(77,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (77,0)-(77,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (77,1)-(77,3) = "::" + │ ├── name: :break + │ ├── message_loc: (77,3)-(77,8) = "break" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (79,0)-(79,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (79,0)-(79,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (79,1)-(79,3) = "::" + │ ├── name: :class + │ ├── message_loc: (79,3)-(79,8) = "class" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (81,0)-(81,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (81,0)-(81,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (81,1)-(81,3) = "::" + │ ├── name: :def + │ ├── message_loc: (81,3)-(81,6) = "def" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (83,0)-(83,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (83,0)-(83,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (83,1)-(83,3) = "::" + │ ├── name: :defined + │ ├── message_loc: (83,3)-(83,10) = "defined" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (85,0)-(85,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (85,0)-(85,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (85,1)-(85,3) = "::" + │ ├── name: :do + │ ├── message_loc: (85,3)-(85,5) = "do" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (87,0)-(87,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (87,0)-(87,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (87,1)-(87,3) = "::" + │ ├── name: :else + │ ├── message_loc: (87,3)-(87,7) = "else" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (89,0)-(89,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (89,0)-(89,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (89,1)-(89,3) = "::" + │ ├── name: :elsif + │ ├── message_loc: (89,3)-(89,8) = "elsif" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (91,0)-(91,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (91,0)-(91,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (91,1)-(91,3) = "::" + │ ├── name: :end + │ ├── message_loc: (91,3)-(91,6) = "end" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathNode (location: (93,0)-(93,6)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (93,0)-(93,1)) + │ │ └── name: :A + │ ├── child: + │ │ @ ConstantReadNode (location: (93,3)-(93,6)) + │ │ └── name: :END + │ └── delimiter_loc: (93,1)-(93,3) = "::" + ├── @ CallNode (location: (95,0)-(95,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (95,0)-(95,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (95,1)-(95,3) = "::" + │ ├── name: :ensure + │ ├── message_loc: (95,3)-(95,9) = "ensure" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (97,0)-(97,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (97,0)-(97,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (97,1)-(97,3) = "::" + │ ├── name: :false + │ ├── message_loc: (97,3)-(97,8) = "false" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (99,0)-(99,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (99,0)-(99,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (99,1)-(99,3) = "::" + │ ├── name: :for + │ ├── message_loc: (99,3)-(99,6) = "for" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (101,0)-(101,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (101,0)-(101,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (101,1)-(101,3) = "::" + │ ├── name: :if + │ ├── message_loc: (101,3)-(101,5) = "if" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (103,0)-(103,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (103,0)-(103,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (103,1)-(103,3) = "::" + │ ├── name: :in + │ ├── message_loc: (103,3)-(103,5) = "in" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (105,0)-(105,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (105,0)-(105,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (105,1)-(105,3) = "::" + │ ├── name: :next + │ ├── message_loc: (105,3)-(105,7) = "next" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (107,0)-(107,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (107,0)-(107,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (107,1)-(107,3) = "::" + │ ├── name: :nil + │ ├── message_loc: (107,3)-(107,6) = "nil" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (109,0)-(109,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (109,0)-(109,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (109,1)-(109,3) = "::" + │ ├── name: :not + │ ├── message_loc: (109,3)-(109,6) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (111,0)-(111,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (111,0)-(111,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (111,1)-(111,3) = "::" + │ ├── name: :or + │ ├── message_loc: (111,3)-(111,5) = "or" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (113,0)-(113,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (113,0)-(113,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (113,1)-(113,3) = "::" + │ ├── name: :redo + │ ├── message_loc: (113,3)-(113,7) = "redo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (115,0)-(115,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (115,0)-(115,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (115,1)-(115,3) = "::" + │ ├── name: :rescue + │ ├── message_loc: (115,3)-(115,9) = "rescue" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (117,0)-(117,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (117,0)-(117,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (117,1)-(117,3) = "::" + │ ├── name: :retry + │ ├── message_loc: (117,3)-(117,8) = "retry" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (119,0)-(119,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (119,0)-(119,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (119,1)-(119,3) = "::" + │ ├── name: :return + │ ├── message_loc: (119,3)-(119,9) = "return" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (121,0)-(121,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (121,0)-(121,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (121,1)-(121,3) = "::" + │ ├── name: :self + │ ├── message_loc: (121,3)-(121,7) = "self" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (123,0)-(123,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (123,0)-(123,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (123,1)-(123,3) = "::" + │ ├── name: :super + │ ├── message_loc: (123,3)-(123,8) = "super" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (125,0)-(125,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (125,0)-(125,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (125,1)-(125,3) = "::" + │ ├── name: :then + │ ├── message_loc: (125,3)-(125,7) = "then" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (127,0)-(127,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (127,0)-(127,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (127,1)-(127,3) = "::" + │ ├── name: :true + │ ├── message_loc: (127,3)-(127,7) = "true" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (129,0)-(129,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (129,0)-(129,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (129,1)-(129,3) = "::" + │ ├── name: :undef + │ ├── message_loc: (129,3)-(129,8) = "undef" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (131,0)-(131,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (131,0)-(131,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (131,1)-(131,3) = "::" + │ ├── name: :unless + │ ├── message_loc: (131,3)-(131,9) = "unless" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (133,0)-(133,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (133,0)-(133,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (133,1)-(133,3) = "::" + │ ├── name: :until + │ ├── message_loc: (133,3)-(133,8) = "until" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (135,0)-(135,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (135,0)-(135,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (135,1)-(135,3) = "::" + │ ├── name: :when + │ ├── message_loc: (135,3)-(135,7) = "when" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (137,0)-(137,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (137,0)-(137,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (137,1)-(137,3) = "::" + │ ├── name: :while + │ ├── message_loc: (137,3)-(137,8) = "while" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (139,0)-(139,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (139,0)-(139,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (139,1)-(139,3) = "::" + │ ├── name: :yield + │ ├── message_loc: (139,3)-(139,8) = "yield" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (141,0)-(141,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (141,0)-(141,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (141,1)-(141,3) = "::" + │ ├── name: :__ENCODING__ + │ ├── message_loc: (141,3)-(141,15) = "__ENCODING__" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (143,0)-(143,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (143,0)-(143,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (143,1)-(143,3) = "::" + │ ├── name: :__FILE__ + │ ├── message_loc: (143,3)-(143,11) = "__FILE__" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (145,0)-(145,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (145,0)-(145,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (145,1)-(145,3) = "::" + │ ├── name: :__LINE__ + │ ├── message_loc: (145,3)-(145,11) = "__LINE__" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (147,0)-(147,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (147,0)-(147,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (147,1)-(147,3) = "::" + │ ├── name: :< + │ ├── message_loc: (147,3)-(147,4) = "<" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (149,0)-(149,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (149,0)-(149,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (149,1)-(149,3) = "::" + │ ├── name: :<=> + │ ├── message_loc: (149,3)-(149,6) = "<=>" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (151,0)-(151,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (151,0)-(151,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (151,1)-(151,3) = "::" + │ ├── name: :<< + │ ├── message_loc: (151,3)-(151,5) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (153,0)-(153,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (153,0)-(153,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (153,1)-(153,3) = "::" + │ ├── name: :- + │ ├── message_loc: (153,3)-(153,4) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (155,0)-(155,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (155,0)-(155,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (155,1)-(155,3) = "::" + │ ├── name: :% + │ ├── message_loc: (155,3)-(155,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (157,0)-(157,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (157,0)-(157,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (157,1)-(157,3) = "::" + │ ├── name: :% + │ ├── message_loc: (157,3)-(157,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (157,4)-(157,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (157,4)-(157,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :i + │ │ ├── message_loc: (157,4)-(157,5) = "i" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (159,0)-(159,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (159,0)-(159,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (159,1)-(159,3) = "::" + │ ├── name: :% + │ ├── message_loc: (159,3)-(159,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (159,4)-(159,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (159,4)-(159,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :w + │ │ ├── message_loc: (159,4)-(159,5) = "w" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (161,0)-(161,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (161,0)-(161,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (161,1)-(161,3) = "::" + │ ├── name: :% + │ ├── message_loc: (161,3)-(161,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (161,4)-(161,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (161,4)-(161,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :x + │ │ ├── message_loc: (161,4)-(161,5) = "x" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (163,0)-(163,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (163,0)-(163,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (163,1)-(163,3) = "::" + │ ├── name: :% + │ ├── message_loc: (163,3)-(163,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (163,4)-(163,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ConstantReadNode (location: (163,4)-(163,5)) + │ │ └── name: :I + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (165,0)-(165,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (165,0)-(165,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (165,1)-(165,3) = "::" + │ ├── name: :% + │ ├── message_loc: (165,3)-(165,4) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (165,4)-(165,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ConstantReadNode (location: (165,4)-(165,5)) + │ │ └── name: :W + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (167,0)-(167,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (167,0)-(167,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (167,1)-(167,3) = "::" + │ ├── name: :| + │ ├── message_loc: (167,3)-(167,4) = "|" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (169,0)-(169,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (169,0)-(169,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (169,1)-(169,3) = "::" + │ ├── name: :+ + │ ├── message_loc: (169,3)-(169,4) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (171,0)-(171,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (171,0)-(171,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (171,1)-(171,3) = "::" + │ ├── name: :/ + │ ├── message_loc: (171,3)-(171,4) = "/" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (173,0)-(173,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (173,0)-(173,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (173,1)-(173,3) = "::" + │ ├── name: :* + │ ├── message_loc: (173,3)-(173,4) = "*" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (175,0)-(175,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (175,0)-(175,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (175,1)-(175,3) = "::" + │ ├── name: :** + │ ├── message_loc: (175,3)-(175,5) = "**" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (177,0)-(177,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (177,0)-(177,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (177,1)-(177,3) = "::" + │ ├── name: :~ + │ ├── message_loc: (177,3)-(177,4) = "~" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathNode (location: (179,0)-(180,1)) + │ ├── parent: + │ │ @ CallNode (location: (179,0)-(179,4)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ ConstantReadNode (location: (179,0)-(179,1)) + │ │ │ └── name: :A + │ │ ├── call_operator_loc: (179,1)-(179,3) = "::" + │ │ ├── name: :_ + │ │ ├── message_loc: (179,3)-(179,4) = "_" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (180,0)-(180,1)) + │ │ └── name: :C + │ └── delimiter_loc: (179,4)-(179,6) = "::" + └── @ RangeNode (location: (182,0)-(184,10)) + ├── flags: ∅ + ├── left: + │ @ CallNode (location: (182,0)-(182,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (182,0)-(182,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (182,1)-(182,3) = "::" + │ ├── name: :_ + │ ├── message_loc: (182,3)-(182,4) = "_" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: + │ @ CallNode (location: (184,0)-(184,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (184,0)-(184,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (184,1)-(184,3) = "::" + │ ├── name: :__END__ + │ ├── message_loc: (184,3)-(184,10) = "__END__" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (182,4)-(182,6) = ".." diff --git a/test/mri/prism/snapshots/dash_heredocs.txt b/test/mri/prism/snapshots/dash_heredocs.txt new file mode 100644 index 00000000000..9af3acf9c2e --- /dev/null +++ b/test/mri/prism/snapshots/dash_heredocs.txt @@ -0,0 +1,256 @@ +@ ProgramNode (location: (1,0)-(57,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(57,11)) + └── body: (length: 13) + ├── @ StringNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,6) = "<<-EOF" + │ ├── content_loc: (2,0)-(3,0) = " a\n" + │ ├── closing_loc: (3,0)-(4,0) = "EOF\n" + │ └── unescaped: " a\n" + ├── @ CallNode (location: (5,0)-(5,20)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ StringNode (location: (5,0)-(5,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (5,0)-(5,8) = "<<-FIRST" + │ │ ├── content_loc: (6,0)-(7,0) = " a\n" + │ │ ├── closing_loc: (7,0)-(8,0) = "FIRST\n" + │ │ └── unescaped: " a\n" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (5,9)-(5,10) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,11)-(5,20)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (5,11)-(5,20)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (5,11)-(5,20) = "<<-SECOND" + │ │ ├── content_loc: (8,0)-(9,0) = " b\n" + │ │ ├── closing_loc: (9,0)-(10,0) = "SECOND\n" + │ │ └── unescaped: " b\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ InterpolatedXStringNode (location: (11,0)-(11,8)) + │ ├── opening_loc: (11,0)-(11,8) = "<<-`EOF`" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (12,0)-(13,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (12,0)-(13,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (13,0)-(13,4)) + │ │ │ ├── opening_loc: (13,0)-(13,2) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (13,2)-(13,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (13,2)-(13,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (13,2)-(13,3) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (13,3)-(13,4) = "}" + │ │ └── @ StringNode (location: (13,4)-(14,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (13,4)-(14,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (14,0)-(15,0) = "EOF\n" + ├── @ StringNode (location: (16,0)-(16,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (16,0)-(16,6) = "<<-EOF" + │ ├── content_loc: (17,0)-(18,0) = " a\n" + │ ├── closing_loc: (18,0)-(19,0) = "EOF\n" + │ └── unescaped: " a\n" + ├── @ StringNode (location: (20,0)-(20,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (20,0)-(20,6) = "<<-EOF" + │ ├── content_loc: (21,0)-(23,0) = " a\n b\n" + │ ├── closing_loc: (23,0)-(24,0) = " EOF\n" + │ └── unescaped: " a\n b\n" + ├── @ InterpolatedStringNode (location: (25,0)-(25,8)) + │ ├── opening_loc: (25,0)-(25,8) = "<<-\"EOF\"" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (26,0)-(27,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (26,0)-(27,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (27,0)-(27,4)) + │ │ │ ├── opening_loc: (27,0)-(27,2) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (27,2)-(27,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (27,2)-(27,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (27,2)-(27,3) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (27,3)-(27,4) = "}" + │ │ └── @ StringNode (location: (27,4)-(28,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (27,4)-(28,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (28,0)-(29,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (30,0)-(30,6)) + │ ├── opening_loc: (30,0)-(30,6) = "<<-EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (31,0)-(32,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (31,0)-(32,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (32,0)-(32,4)) + │ │ │ ├── opening_loc: (32,0)-(32,2) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (32,2)-(32,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (32,2)-(32,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (32,2)-(32,3) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (32,3)-(32,4) = "}" + │ │ └── @ StringNode (location: (32,4)-(33,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (32,4)-(33,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (33,0)-(34,0) = "EOF\n" + ├── @ StringNode (location: (35,0)-(35,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (35,0)-(35,2) = "%#" + │ ├── content_loc: (35,2)-(35,5) = "abc" + │ ├── closing_loc: (35,5)-(35,6) = "#" + │ └── unescaped: "abc" + ├── @ StringNode (location: (37,0)-(37,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (37,0)-(37,6) = "<<-EOF" + │ ├── content_loc: (38,0)-(40,0) = " a\n b\n" + │ ├── closing_loc: (40,0)-(41,0) = "EOF\n" + │ └── unescaped: " a\n b\n" + ├── @ StringNode (location: (42,0)-(42,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (42,0)-(42,5) = "<<-''" + │ ├── content_loc: (43,0)-(43,0) = "" + │ ├── closing_loc: (43,0)-(44,0) = "\n" + │ └── unescaped: "" + ├── @ StringNode (location: (45,0)-(45,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (45,0)-(45,8) = "<<-'EOF'" + │ ├── content_loc: (46,0)-(47,0) = " a \#{1}\n" + │ ├── closing_loc: (47,0)-(48,0) = "EOF\n" + │ └── unescaped: " a \#{1}\n" + ├── @ CallNode (location: (49,0)-(49,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ StringNode (location: (49,0)-(49,4)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (49,0)-(49,4) = "<<-A" + │ │ ├── content_loc: (50,0)-(51,0) = " a\n" + │ │ ├── closing_loc: (51,0)-(52,0) = "A\n" + │ │ └── unescaped: " a\n" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (49,5)-(49,6) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (49,7)-(49,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (49,7)-(49,11)) + │ │ ├── opening_loc: (49,7)-(49,11) = "<<-B" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (52,0)-(53,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (52,0)-(53,2) = " b\n " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " b\n " + │ │ │ ├── @ EmbeddedStatementsNode (location: (53,2)-(54,3)) + │ │ │ │ ├── opening_loc: (53,2)-(53,4) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (53,4)-(53,5)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (53,4)-(53,5)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ └── closing_loc: (54,2)-(54,3) = "}" + │ │ │ └── @ StringNode (location: (54,3)-(55,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (54,3)-(55,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (55,0)-(56,0) = "B\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (57,0)-(57,11)) + ├── flags: ∅ + ├── receiver: + │ @ StringNode (location: (57,0)-(57,4)) + │ ├── flags: ∅ + │ ├── opening_loc: (57,0)-(57,4) = "<<-A" + │ ├── content_loc: (58,0)-(59,0) = " a\n" + │ ├── closing_loc: (59,0)-(60,0) = "A\n" + │ └── unescaped: " a\n" + ├── call_operator_loc: ∅ + ├── name: :+ + ├── message_loc: (57,5)-(57,6) = "+" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (57,7)-(57,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InterpolatedStringNode (location: (57,7)-(57,11)) + │ ├── opening_loc: (57,7)-(57,11) = "<<-B" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (60,0)-(61,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (60,0)-(61,2) = " b\n " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " b\n " + │ │ ├── @ EmbeddedStatementsNode (location: (61,2)-(62,4)) + │ │ │ ├── opening_loc: (61,2)-(61,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (62,2)-(62,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (62,2)-(62,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── closing_loc: (62,3)-(62,4) = "}" + │ │ └── @ StringNode (location: (62,4)-(63,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (62,4)-(63,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (63,0)-(64,0) = "B\n" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/defined.txt b/test/mri/prism/snapshots/defined.txt new file mode 100644 index 00000000000..53a5081811c --- /dev/null +++ b/test/mri/prism/snapshots/defined.txt @@ -0,0 +1,88 @@ +@ ProgramNode (location: (1,0)-(10,1)) +├── locals: [:x] +└── statements: + @ StatementsNode (location: (1,0)-(10,1)) + └── body: (length: 5) + ├── @ AndNode (location: (1,0)-(1,25)) + │ ├── left: + │ │ @ DefinedNode (location: (1,0)-(1,10)) + │ │ ├── lparen_loc: ∅ + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rparen_loc: ∅ + │ │ └── keyword_loc: (1,0)-(1,8) = "defined?" + │ ├── right: + │ │ @ DefinedNode (location: (1,15)-(1,25)) + │ │ ├── lparen_loc: ∅ + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,24)-(1,25)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── rparen_loc: ∅ + │ │ └── keyword_loc: (1,15)-(1,23) = "defined?" + │ └── operator_loc: (1,11)-(1,14) = "and" + ├── @ DefinedNode (location: (3,0)-(3,16)) + │ ├── lparen_loc: (3,8)-(3,9) = "(" + │ ├── value: + │ │ @ LocalVariableOperatorWriteNode (location: (3,9)-(3,15)) + │ │ ├── name_loc: (3,9)-(3,10) = "x" + │ │ ├── operator_loc: (3,11)-(3,13) = "%=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,14)-(3,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── name: :x + │ │ ├── operator: :% + │ │ └── depth: 0 + │ ├── rparen_loc: (3,15)-(3,16) = ")" + │ └── keyword_loc: (3,0)-(3,8) = "defined?" + ├── @ DefinedNode (location: (5,0)-(5,21)) + │ ├── lparen_loc: (5,8)-(5,9) = "(" + │ ├── value: + │ │ @ AndNode (location: (5,9)-(5,20)) + │ │ ├── left: + │ │ │ @ CallNode (location: (5,9)-(5,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (5,9)-(5,12) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (5,17)-(5,20)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (5,17)-(5,20) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (5,13)-(5,16) = "and" + │ ├── rparen_loc: (5,20)-(5,21) = ")" + │ └── keyword_loc: (5,0)-(5,8) = "defined?" + ├── @ DefinedNode (location: (7,0)-(7,10)) + │ ├── lparen_loc: ∅ + │ ├── value: + │ │ @ IntegerNode (location: (7,9)-(7,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── rparen_loc: ∅ + │ └── keyword_loc: (7,0)-(7,8) = "defined?" + └── @ DefinedNode (location: (9,0)-(10,1)) + ├── lparen_loc: (9,8)-(9,9) = "(" + ├── value: + │ @ StringNode (location: (9,9)-(9,14)) + │ ├── flags: ∅ + │ ├── opening_loc: (9,9)-(9,10) = "\"" + │ ├── content_loc: (9,10)-(9,13) = "foo" + │ ├── closing_loc: (9,13)-(9,14) = "\"" + │ └── unescaped: "foo" + ├── rparen_loc: (10,0)-(10,1) = ")" + └── keyword_loc: (9,0)-(9,8) = "defined?" diff --git a/test/mri/prism/snapshots/dos_endings.txt b/test/mri/prism/snapshots/dos_endings.txt new file mode 100644 index 00000000000..ed75b8a52fd --- /dev/null +++ b/test/mri/prism/snapshots/dos_endings.txt @@ -0,0 +1,108 @@ +@ ProgramNode (location: (1,0)-(17,20)) +├── locals: [:x, :a] +└── statements: + @ StatementsNode (location: (1,0)-(17,20)) + └── body: (length: 5) + ├── @ CallNode (location: (1,0)-(2,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :puts + │ ├── message_loc: (1,0)-(1,4) = "puts" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(2,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (1,5)-(2,12)) + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (1,5)-(1,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "\"" + │ │ │ │ ├── content_loc: (1,6)-(1,8) = "hi" + │ │ │ │ ├── closing_loc: (1,8)-(1,9) = "\"" + │ │ │ │ └── unescaped: "hi" + │ │ │ └── @ StringNode (location: (2,5)-(2,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (2,5)-(2,6) = "\"" + │ │ │ ├── content_loc: (2,6)-(2,11) = "there" + │ │ │ ├── closing_loc: (2,11)-(2,12) = "\"" + │ │ │ └── unescaped: "there" + │ │ └── closing_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ArrayNode (location: (4,0)-(5,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ SymbolNode (location: (4,3)-(5,1)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (4,3)-(5,1) = "a\\\r\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── opening_loc: (4,0)-(4,3) = "%I{" + │ └── closing_loc: (5,1)-(5,2) = "}" + ├── @ StringNode (location: (7,0)-(7,4)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(7,4) = "<<-E" + │ ├── content_loc: (8,0)-(11,0) = " 1 \\\r\n 2\r\n 3\r\n" + │ ├── closing_loc: (11,0)-(12,0) = "E\r\n" + │ └── unescaped: " 1 2\r\n 3\r\n" + ├── @ LocalVariableWriteNode (location: (13,0)-(15,0)) + │ ├── name: :x + │ ├── depth: 0 + │ ├── name_loc: (13,0)-(13,1) = "x" + │ ├── value: + │ │ @ StringNode (location: (13,4)-(15,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (13,4)-(14,0) = "%\r\n" + │ │ ├── content_loc: (14,0)-(14,0) = "" + │ │ ├── closing_loc: (14,0)-(15,0) = "\r\n" + │ │ └── unescaped: "" + │ └── operator_loc: (13,2)-(13,3) = "=" + └── @ LocalVariableWriteNode (location: (17,0)-(17,20)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (17,0)-(17,1) = "a" + ├── value: + │ @ CallNode (location: (17,4)-(17,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (17,4)-(17,7) = "foo" + │ ├── opening_loc: (17,7)-(17,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,8)-(17,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (17,8)-(17,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ InterpolatedStringNode (location: (17,8)-(17,14)) + │ │ │ ├── opening_loc: (17,8)-(17,14) = "<<~EOF" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (18,0)-(19,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (18,0)-(19,0) = "\r\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "\n" + │ │ │ │ └── @ StringNode (location: (19,0)-(20,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (19,0)-(20,0) = " baz\r\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "baz\r\n" + │ │ │ └── closing_loc: (20,0)-(21,0) = " EOF\r\n" + │ │ ├── call_operator_loc: (17,14)-(17,15) = "." + │ │ ├── name: :chop + │ │ ├── message_loc: (17,15)-(17,19) = "chop" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (17,19)-(17,20) = ")" + │ └── block: ∅ + └── operator_loc: (17,2)-(17,3) = "=" diff --git a/test/mri/prism/snapshots/dstring.txt b/test/mri/prism/snapshots/dstring.txt new file mode 100644 index 00000000000..ad395f8a8eb --- /dev/null +++ b/test/mri/prism/snapshots/dstring.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(29,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(29,1)) + └── body: (length: 8) + ├── @ StringNode (location: (1,0)-(2,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(2,5) = "foo\n bar" + │ ├── closing_loc: (2,5)-(2,6) = "\"" + │ └── unescaped: "foo\n bar" + ├── @ InterpolatedStringNode (location: (4,0)-(5,9)) + │ ├── opening_loc: (4,0)-(4,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (4,1)-(5,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (4,1)-(5,2) = "foo\n " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\n " + │ │ └── @ EmbeddedStatementsNode (location: (5,2)-(5,8)) + │ │ ├── opening_loc: (5,2)-(5,4) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (5,4)-(5,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (5,4)-(5,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (5,4)-(5,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (5,7)-(5,8) = "}" + │ └── closing_loc: (5,8)-(5,9) = "\"" + ├── @ InterpolatedStringNode (location: (7,0)-(9,2)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (7,0)-(8,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (7,0)-(7,1) = "\"" + │ │ │ ├── content_loc: (7,1)-(8,1) = "fo\no" + │ │ │ ├── closing_loc: (8,1)-(8,2) = "\"" + │ │ │ └── unescaped: "fo\no" + │ │ └── @ StringNode (location: (8,3)-(9,2)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (8,3)-(8,4) = "\"" + │ │ ├── content_loc: (8,4)-(9,1) = "ba\nr" + │ │ ├── closing_loc: (9,1)-(9,2) = "\"" + │ │ └── unescaped: "ba\nr" + │ └── closing_loc: ∅ + ├── @ StringNode (location: (11,0)-(13,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (11,0)-(11,1) = "\"" + │ ├── content_loc: (11,1)-(13,0) = "\nfoo\\\n" + │ ├── closing_loc: (13,0)-(13,1) = "\"" + │ └── unescaped: "\nfoo" + ├── @ StringNode (location: (15,0)-(17,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (15,0)-(15,1) = "\"" + │ ├── content_loc: (15,1)-(17,0) = "\nfoo\\\\\n" + │ ├── closing_loc: (17,0)-(17,1) = "\"" + │ └── unescaped: "\nfoo\\\n" + ├── @ StringNode (location: (19,0)-(21,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (19,0)-(19,1) = "\"" + │ ├── content_loc: (19,1)-(21,0) = "\nfoo\\\\\\\n" + │ ├── closing_loc: (21,0)-(21,1) = "\"" + │ └── unescaped: "\nfoo\\" + ├── @ StringNode (location: (23,0)-(25,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (23,0)-(23,1) = "\"" + │ ├── content_loc: (23,1)-(25,0) = "\nfoo\\\\\\\\\n" + │ ├── closing_loc: (25,0)-(25,1) = "\"" + │ └── unescaped: "\nfoo\\\\\n" + └── @ StringNode (location: (27,0)-(29,1)) + ├── flags: ∅ + ├── opening_loc: (27,0)-(27,1) = "\"" + ├── content_loc: (27,1)-(29,0) = "\nfoo\\\\\\\\\\\n" + ├── closing_loc: (29,0)-(29,1) = "\"" + └── unescaped: "\nfoo\\\\" diff --git a/test/mri/prism/snapshots/dsym_str.txt b/test/mri/prism/snapshots/dsym_str.txt new file mode 100644 index 00000000000..33a5e2da21c --- /dev/null +++ b/test/mri/prism/snapshots/dsym_str.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(2,6)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── value_loc: (1,2)-(2,5) = "foo\n bar" + ├── closing_loc: (2,5)-(2,6) = "\"" + └── unescaped: "foo\n bar" diff --git a/test/mri/prism/snapshots/embdoc_no_newline_at_end.txt b/test/mri/prism/snapshots/embdoc_no_newline_at_end.txt new file mode 100644 index 00000000000..3a21ce5559c --- /dev/null +++ b/test/mri/prism/snapshots/embdoc_no_newline_at_end.txt @@ -0,0 +1,5 @@ +@ ProgramNode (location: (1,0)-(1,0)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,0)) + └── body: (length: 0) diff --git a/test/mri/prism/snapshots/emoji_method_calls.txt b/test/mri/prism/snapshots/emoji_method_calls.txt new file mode 100644 index 00000000000..8f71181ac15 --- /dev/null +++ b/test/mri/prism/snapshots/emoji_method_calls.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,3)-(1,4) = "." + ├── name: :🌊= + ├── message_loc: (1,4)-(1,8) = "🌊" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,11)-(1,12)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,11)-(1,12)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/endless_methods.txt b/test/mri/prism/snapshots/endless_methods.txt new file mode 100644 index 00000000000..6e20c0deec6 --- /dev/null +++ b/test/mri/prism/snapshots/endless_methods.txt @@ -0,0 +1,107 @@ +@ ProgramNode (location: (1,0)-(5,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,22)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(1,11)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (1,8)-(1,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (3,0)-(3,14)) + │ ├── name: :bar + │ ├── name_loc: (3,4)-(3,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,10)-(3,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,10)-(3,14)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (3,10)-(3,11) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,12)-(3,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (3,12)-(3,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (3,12)-(3,13) = "\"" + │ │ │ ├── content_loc: (3,13)-(3,13) = "" + │ │ │ ├── closing_loc: (3,13)-(3,14) = "\"" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (3,8)-(3,9) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (5,0)-(5,22)) + ├── name: :method + ├── name_loc: (5,4)-(5,10) = "method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (5,13)-(5,22)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (5,13)-(5,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,13)-(5,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (5,15)-(5,16) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (5,19)-(5,20) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,21)-(5,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,21)-(5,22)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (5,11)-(5,12) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/endless_range_in_conditional.txt b/test/mri/prism/snapshots/endless_range_in_conditional.txt new file mode 100644 index 00000000000..1802c4faed6 --- /dev/null +++ b/test/mri/prism/snapshots/endless_range_in_conditional.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(3,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,12)) + └── body: (length: 3) + ├── @ IfNode (location: (1,0)-(1,13)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ FlipFlopNode (location: (1,3)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (1,4)-(1,6) = ".." + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (1,10)-(1,13) = "end" + ├── @ IfNode (location: (2,0)-(2,12)) + │ ├── if_keyword_loc: (2,0)-(2,2) = "if" + │ ├── predicate: + │ │ @ FlipFlopNode (location: (2,3)-(2,6)) + │ │ ├── flags: ∅ + │ │ ├── left: ∅ + │ │ ├── right: + │ │ │ @ IntegerNode (location: (2,5)-(2,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (2,3)-(2,5) = ".." + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (2,9)-(2,12) = "end" + └── @ IfNode (location: (3,0)-(3,12)) + ├── if_keyword_loc: (3,0)-(3,2) = "if" + ├── predicate: + │ @ FlipFlopNode (location: (3,3)-(3,6)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (3,3)-(3,4)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: ∅ + │ └── operator_loc: (3,4)-(3,6) = ".." + ├── then_keyword_loc: ∅ + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (3,9)-(3,12) = "end" diff --git a/test/mri/prism/snapshots/for.txt b/test/mri/prism/snapshots/for.txt new file mode 100644 index 00000000000..cc4bbc1166f --- /dev/null +++ b/test/mri/prism/snapshots/for.txt @@ -0,0 +1,188 @@ +@ ProgramNode (location: (1,0)-(19,22)) +├── locals: [:i, :j, :k] +└── statements: + @ StatementsNode (location: (1,0)-(19,22)) + └── body: (length: 6) + ├── @ ForNode (location: (1,0)-(3,3)) + │ ├── index: + │ │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── collection: + │ │ @ RangeNode (location: (1,9)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ └── operator_loc: (1,10)-(1,12) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (2,0)-(2,1)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (2,0)-(2,1)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── for_keyword_loc: (1,0)-(1,3) = "for" + │ ├── in_keyword_loc: (1,6)-(1,8) = "in" + │ ├── do_keyword_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ ForNode (location: (5,0)-(5,22)) + │ ├── index: + │ │ @ LocalVariableTargetNode (location: (5,4)-(5,5)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── collection: + │ │ @ RangeNode (location: (5,9)-(5,14)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (5,9)-(5,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (5,12)-(5,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ └── operator_loc: (5,10)-(5,12) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (5,16)-(5,17)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (5,16)-(5,17)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── for_keyword_loc: (5,0)-(5,3) = "for" + │ ├── in_keyword_loc: (5,6)-(5,8) = "in" + │ ├── do_keyword_loc: ∅ + │ └── end_keyword_loc: (5,19)-(5,22) = "end" + ├── @ ForNode (location: (7,0)-(9,3)) + │ ├── index: + │ │ @ MultiTargetNode (location: (7,4)-(7,7)) + │ │ ├── lefts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (7,4)-(7,5)) + │ │ │ │ ├── name: :i + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (7,6)-(7,7)) + │ │ │ ├── name: :j + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ ├── collection: + │ │ @ RangeNode (location: (7,11)-(7,16)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (7,11)-(7,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (7,14)-(7,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ └── operator_loc: (7,12)-(7,14) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (8,0)-(8,1)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (8,0)-(8,1)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── for_keyword_loc: (7,0)-(7,3) = "for" + │ ├── in_keyword_loc: (7,8)-(7,10) = "in" + │ ├── do_keyword_loc: ∅ + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + ├── @ ForNode (location: (11,0)-(13,3)) + │ ├── index: + │ │ @ MultiTargetNode (location: (11,4)-(11,9)) + │ │ ├── lefts: (length: 3) + │ │ │ ├── @ LocalVariableTargetNode (location: (11,4)-(11,5)) + │ │ │ │ ├── name: :i + │ │ │ │ └── depth: 0 + │ │ │ ├── @ LocalVariableTargetNode (location: (11,6)-(11,7)) + │ │ │ │ ├── name: :j + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (11,8)-(11,9)) + │ │ │ ├── name: :k + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ ├── collection: + │ │ @ RangeNode (location: (11,13)-(11,18)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (11,13)-(11,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (11,16)-(11,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ └── operator_loc: (11,14)-(11,16) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (12,0)-(12,1)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (12,0)-(12,1)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── for_keyword_loc: (11,0)-(11,3) = "for" + │ ├── in_keyword_loc: (11,10)-(11,12) = "in" + │ ├── do_keyword_loc: ∅ + │ └── end_keyword_loc: (13,0)-(13,3) = "end" + ├── @ ForNode (location: (15,0)-(17,3)) + │ ├── index: + │ │ @ LocalVariableTargetNode (location: (15,4)-(15,5)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── collection: + │ │ @ RangeNode (location: (15,9)-(15,14)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (15,9)-(15,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (15,12)-(15,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ └── operator_loc: (15,10)-(15,12) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (16,0)-(16,1)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (16,0)-(16,1)) + │ │ ├── name: :i + │ │ └── depth: 0 + │ ├── for_keyword_loc: (15,0)-(15,3) = "for" + │ ├── in_keyword_loc: (15,6)-(15,8) = "in" + │ ├── do_keyword_loc: (15,15)-(15,17) = "do" + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + └── @ ForNode (location: (19,0)-(19,22)) + ├── index: + │ @ LocalVariableTargetNode (location: (19,4)-(19,5)) + │ ├── name: :i + │ └── depth: 0 + ├── collection: + │ @ RangeNode (location: (19,9)-(19,14)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (19,9)-(19,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (19,12)-(19,14)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (19,10)-(19,12) = ".." + ├── statements: + │ @ StatementsNode (location: (19,16)-(19,17)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (19,16)-(19,17)) + │ ├── name: :i + │ └── depth: 0 + ├── for_keyword_loc: (19,0)-(19,3) = "for" + ├── in_keyword_loc: (19,6)-(19,8) = "in" + ├── do_keyword_loc: ∅ + └── end_keyword_loc: (19,19)-(19,22) = "end" diff --git a/test/mri/prism/snapshots/global_variables.txt b/test/mri/prism/snapshots/global_variables.txt new file mode 100644 index 00000000000..9f775ed80d3 --- /dev/null +++ b/test/mri/prism/snapshots/global_variables.txt @@ -0,0 +1,191 @@ +@ ProgramNode (location: (1,0)-(93,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(93,4)) + └── body: (length: 47) + ├── @ GlobalVariableReadNode (location: (1,0)-(1,16)) + │ └── name: :$global_variable + ├── @ GlobalVariableReadNode (location: (3,0)-(3,2)) + │ └── name: :$_ + ├── @ GlobalVariableReadNode (location: (5,0)-(5,3)) + │ └── name: :$-w + ├── @ GlobalVariableReadNode (location: (7,0)-(7,10)) + │ └── name: :$LOAD_PATH + ├── @ GlobalVariableReadNode (location: (9,0)-(9,6)) + │ └── name: :$stdin + ├── @ GlobalVariableReadNode (location: (11,0)-(11,7)) + │ └── name: :$stdout + ├── @ GlobalVariableReadNode (location: (13,0)-(13,7)) + │ └── name: :$stderr + ├── @ GlobalVariableReadNode (location: (15,0)-(15,2)) + │ └── name: :$! + ├── @ GlobalVariableReadNode (location: (17,0)-(17,2)) + │ └── name: :$? + ├── @ GlobalVariableReadNode (location: (19,0)-(19,2)) + │ └── name: :$~ + ├── @ BackReferenceReadNode (location: (21,0)-(21,2)) + │ └── name: :$& + ├── @ BackReferenceReadNode (location: (23,0)-(23,2)) + │ └── name: :$` + ├── @ BackReferenceReadNode (location: (25,0)-(25,2)) + │ └── name: :$' + ├── @ BackReferenceReadNode (location: (27,0)-(27,2)) + │ └── name: :$+ + ├── @ GlobalVariableReadNode (location: (29,0)-(29,2)) + │ └── name: :$: + ├── @ GlobalVariableReadNode (location: (31,0)-(31,2)) + │ └── name: :$; + ├── @ GlobalVariableReadNode (location: (33,0)-(33,2)) + │ └── name: :$, + ├── @ GlobalVariableReadNode (location: (35,0)-(35,6)) + │ └── name: :$DEBUG + ├── @ GlobalVariableReadNode (location: (37,0)-(37,9)) + │ └── name: :$FILENAME + ├── @ GlobalVariableReadNode (location: (39,0)-(39,2)) + │ └── name: :$0 + ├── @ GlobalVariableReadNode (location: (41,0)-(41,3)) + │ └── name: :$-0 + ├── @ GlobalVariableReadNode (location: (43,0)-(43,16)) + │ └── name: :$LOADED_FEATURES + ├── @ GlobalVariableReadNode (location: (45,0)-(45,8)) + │ └── name: :$VERBOSE + ├── @ GlobalVariableReadNode (location: (47,0)-(47,3)) + │ └── name: :$-K + ├── @ SymbolNode (location: (49,0)-(49,17)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (49,0)-(49,1) = ":" + │ ├── value_loc: (49,1)-(49,17) = "$global_variable" + │ ├── closing_loc: ∅ + │ └── unescaped: "$global_variable" + ├── @ SymbolNode (location: (51,0)-(51,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (51,0)-(51,1) = ":" + │ ├── value_loc: (51,1)-(51,3) = "$_" + │ ├── closing_loc: ∅ + │ └── unescaped: "$_" + ├── @ SymbolNode (location: (53,0)-(53,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (53,0)-(53,1) = ":" + │ ├── value_loc: (53,1)-(53,4) = "$-w" + │ ├── closing_loc: ∅ + │ └── unescaped: "$-w" + ├── @ SymbolNode (location: (55,0)-(55,11)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (55,0)-(55,1) = ":" + │ ├── value_loc: (55,1)-(55,11) = "$LOAD_PATH" + │ ├── closing_loc: ∅ + │ └── unescaped: "$LOAD_PATH" + ├── @ SymbolNode (location: (57,0)-(57,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (57,0)-(57,1) = ":" + │ ├── value_loc: (57,1)-(57,7) = "$stdin" + │ ├── closing_loc: ∅ + │ └── unescaped: "$stdin" + ├── @ SymbolNode (location: (59,0)-(59,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (59,0)-(59,1) = ":" + │ ├── value_loc: (59,1)-(59,8) = "$stdout" + │ ├── closing_loc: ∅ + │ └── unescaped: "$stdout" + ├── @ SymbolNode (location: (61,0)-(61,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (61,0)-(61,1) = ":" + │ ├── value_loc: (61,1)-(61,8) = "$stderr" + │ ├── closing_loc: ∅ + │ └── unescaped: "$stderr" + ├── @ SymbolNode (location: (63,0)-(63,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (63,0)-(63,1) = ":" + │ ├── value_loc: (63,1)-(63,3) = "$!" + │ ├── closing_loc: ∅ + │ └── unescaped: "$!" + ├── @ SymbolNode (location: (65,0)-(65,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (65,0)-(65,1) = ":" + │ ├── value_loc: (65,1)-(65,3) = "$?" + │ ├── closing_loc: ∅ + │ └── unescaped: "$?" + ├── @ SymbolNode (location: (67,0)-(67,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (67,0)-(67,1) = ":" + │ ├── value_loc: (67,1)-(67,3) = "$~" + │ ├── closing_loc: ∅ + │ └── unescaped: "$~" + ├── @ SymbolNode (location: (69,0)-(69,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (69,0)-(69,1) = ":" + │ ├── value_loc: (69,1)-(69,3) = "$&" + │ ├── closing_loc: ∅ + │ └── unescaped: "$&" + ├── @ SymbolNode (location: (71,0)-(71,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (71,0)-(71,1) = ":" + │ ├── value_loc: (71,1)-(71,3) = "$`" + │ ├── closing_loc: ∅ + │ └── unescaped: "$`" + ├── @ SymbolNode (location: (73,0)-(73,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (73,0)-(73,1) = ":" + │ ├── value_loc: (73,1)-(73,3) = "$'" + │ ├── closing_loc: ∅ + │ └── unescaped: "$'" + ├── @ SymbolNode (location: (75,0)-(75,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (75,0)-(75,1) = ":" + │ ├── value_loc: (75,1)-(75,3) = "$+" + │ ├── closing_loc: ∅ + │ └── unescaped: "$+" + ├── @ SymbolNode (location: (77,0)-(77,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (77,0)-(77,1) = ":" + │ ├── value_loc: (77,1)-(77,3) = "$:" + │ ├── closing_loc: ∅ + │ └── unescaped: "$:" + ├── @ SymbolNode (location: (79,0)-(79,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (79,0)-(79,1) = ":" + │ ├── value_loc: (79,1)-(79,3) = "$;" + │ ├── closing_loc: ∅ + │ └── unescaped: "$;" + ├── @ SymbolNode (location: (81,0)-(81,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (81,0)-(81,1) = ":" + │ ├── value_loc: (81,1)-(81,7) = "$DEBUG" + │ ├── closing_loc: ∅ + │ └── unescaped: "$DEBUG" + ├── @ SymbolNode (location: (83,0)-(83,10)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (83,0)-(83,1) = ":" + │ ├── value_loc: (83,1)-(83,10) = "$FILENAME" + │ ├── closing_loc: ∅ + │ └── unescaped: "$FILENAME" + ├── @ SymbolNode (location: (85,0)-(85,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (85,0)-(85,1) = ":" + │ ├── value_loc: (85,1)-(85,3) = "$0" + │ ├── closing_loc: ∅ + │ └── unescaped: "$0" + ├── @ SymbolNode (location: (87,0)-(87,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (87,0)-(87,1) = ":" + │ ├── value_loc: (87,1)-(87,4) = "$-0" + │ ├── closing_loc: ∅ + │ └── unescaped: "$-0" + ├── @ SymbolNode (location: (89,0)-(89,17)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (89,0)-(89,1) = ":" + │ ├── value_loc: (89,1)-(89,17) = "$LOADED_FEATURES" + │ ├── closing_loc: ∅ + │ └── unescaped: "$LOADED_FEATURES" + ├── @ SymbolNode (location: (91,0)-(91,9)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (91,0)-(91,1) = ":" + │ ├── value_loc: (91,1)-(91,9) = "$VERBOSE" + │ ├── closing_loc: ∅ + │ └── unescaped: "$VERBOSE" + └── @ SymbolNode (location: (93,0)-(93,4)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (93,0)-(93,1) = ":" + ├── value_loc: (93,1)-(93,4) = "$-K" + ├── closing_loc: ∅ + └── unescaped: "$-K" diff --git a/test/mri/prism/snapshots/hashes.txt b/test/mri/prism/snapshots/hashes.txt new file mode 100644 index 00000000000..7a3ac4b0eaa --- /dev/null +++ b/test/mri/prism/snapshots/hashes.txt @@ -0,0 +1,384 @@ +@ ProgramNode (location: (1,0)-(28,9)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(28,9)) + └── body: (length: 10) + ├── @ HashNode (location: (1,0)-(1,2)) + │ ├── opening_loc: (1,0)-(1,1) = "{" + │ ├── elements: (length: 0) + │ └── closing_loc: (1,1)-(1,2) = "}" + ├── @ HashNode (location: (3,0)-(4,1)) + │ ├── opening_loc: (3,0)-(3,1) = "{" + │ ├── elements: (length: 0) + │ └── closing_loc: (4,0)-(4,1) = "}" + ├── @ HashNode (location: (6,0)-(6,18)) + │ ├── opening_loc: (6,0)-(6,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (6,2)-(6,8)) + │ │ │ ├── key: + │ │ │ │ @ CallNode (location: (6,2)-(6,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (6,2)-(6,3) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (6,7)-(6,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (6,7)-(6,8) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (6,4)-(6,6) = "=>" + │ │ └── @ AssocNode (location: (6,10)-(6,16)) + │ │ ├── key: + │ │ │ @ CallNode (location: (6,10)-(6,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (6,10)-(6,11) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ CallNode (location: (6,15)-(6,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (6,15)-(6,16) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (6,12)-(6,14) = "=>" + │ └── closing_loc: (6,17)-(6,18) = "}" + ├── @ HashNode (location: (8,0)-(8,15)) + │ ├── opening_loc: (8,0)-(8,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (8,2)-(8,8)) + │ │ │ ├── key: + │ │ │ │ @ CallNode (location: (8,2)-(8,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (8,2)-(8,3) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (8,7)-(8,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (8,7)-(8,8) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (8,4)-(8,6) = "=>" + │ │ └── @ AssocSplatNode (location: (8,10)-(8,13)) + │ │ ├── value: + │ │ │ @ CallNode (location: (8,12)-(8,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (8,12)-(8,13) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (8,10)-(8,12) = "**" + │ └── closing_loc: (8,14)-(8,15) = "}" + ├── @ HashNode (location: (10,0)-(16,5)) + │ ├── opening_loc: (10,0)-(10,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (11,6)-(11,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (11,6)-(11,8)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (11,6)-(11,7) = "a" + │ │ │ │ ├── closing_loc: (11,7)-(11,8) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (11,9)-(11,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (11,9)-(11,10) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: ∅ + │ │ └── @ AssocNode (location: (12,6)-(12,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (12,6)-(12,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (12,6)-(12,7) = "c" + │ │ │ ├── closing_loc: (12,7)-(12,8) = ":" + │ │ │ └── unescaped: "c" + │ │ ├── value: + │ │ │ @ CallNode (location: (12,9)-(12,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (12,9)-(12,10) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ └── closing_loc: (16,4)-(16,5) = "}" + ├── @ HashNode (location: (18,0)-(18,25)) + │ ├── opening_loc: (18,0)-(18,1) = "{" + │ ├── elements: (length: 4) + │ │ ├── @ AssocNode (location: (18,2)-(18,6)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (18,2)-(18,4)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (18,2)-(18,3) = "a" + │ │ │ │ ├── closing_loc: (18,3)-(18,4) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (18,5)-(18,6)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (18,5)-(18,6) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: ∅ + │ │ ├── @ AssocNode (location: (18,8)-(18,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (18,8)-(18,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (18,8)-(18,9) = "c" + │ │ │ │ ├── closing_loc: (18,9)-(18,10) = ":" + │ │ │ │ └── unescaped: "c" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (18,11)-(18,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (18,11)-(18,12) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: ∅ + │ │ ├── @ AssocSplatNode (location: (18,14)-(18,17)) + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (18,16)-(18,17)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :e + │ │ │ │ ├── message_loc: (18,16)-(18,17) = "e" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (18,14)-(18,16) = "**" + │ │ └── @ AssocNode (location: (18,19)-(18,23)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (18,19)-(18,21)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (18,19)-(18,20) = "f" + │ │ │ ├── closing_loc: (18,20)-(18,21) = ":" + │ │ │ └── unescaped: "f" + │ │ ├── value: + │ │ │ @ CallNode (location: (18,22)-(18,23)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :g + │ │ │ ├── message_loc: (18,22)-(18,23) = "g" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ └── closing_loc: (18,24)-(18,25) = "}" + ├── @ HashNode (location: (20,0)-(20,12)) + │ ├── opening_loc: (20,0)-(20,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (20,2)-(20,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (20,2)-(20,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (20,2)-(20,3) = "\"" + │ │ │ ├── value_loc: (20,3)-(20,4) = "a" + │ │ │ ├── closing_loc: (20,4)-(20,6) = "\":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (20,7)-(20,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (20,8)-(20,10)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b? + │ │ │ │ ├── message_loc: (20,8)-(20,10) = "b?" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :! + │ │ │ ├── message_loc: (20,7)-(20,8) = "!" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ └── closing_loc: (20,11)-(20,12) = "}" + ├── @ LocalVariableWriteNode (location: (22,0)-(22,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (22,0)-(22,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (22,4)-(22,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (22,2)-(22,3) = "=" + ├── @ CallNode (location: (23,0)-(26,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (23,0)-(23,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (23,4)-(26,3)) + │ ├── locals: [:b] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (24,2)-(25,20)) + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableWriteNode (location: (24,2)-(24,7)) + │ │ │ ├── name: :b + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (24,2)-(24,3) = "b" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (24,6)-(24,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (24,4)-(24,5) = "=" + │ │ └── @ HashNode (location: (25,2)-(25,20)) + │ │ ├── opening_loc: (25,2)-(25,3) = "{" + │ │ ├── elements: (length: 4) + │ │ │ ├── @ AssocNode (location: (25,4)-(25,6)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (25,4)-(25,6)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (25,4)-(25,5) = "a" + │ │ │ │ │ ├── closing_loc: (25,5)-(25,6) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (25,4)-(25,6)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableReadNode (location: (25,4)-(25,6)) + │ │ │ │ │ ├── name: :a + │ │ │ │ │ └── depth: 1 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── @ AssocNode (location: (25,8)-(25,10)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (25,8)-(25,10)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (25,8)-(25,9) = "b" + │ │ │ │ │ ├── closing_loc: (25,9)-(25,10) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (25,8)-(25,10)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableReadNode (location: (25,8)-(25,10)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── @ AssocNode (location: (25,12)-(25,14)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (25,12)-(25,14)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (25,12)-(25,13) = "c" + │ │ │ │ │ ├── closing_loc: (25,13)-(25,14) = ":" + │ │ │ │ │ └── unescaped: "c" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (25,12)-(25,14)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ CallNode (location: (25,12)-(25,14)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :c + │ │ │ │ │ ├── message_loc: (25,12)-(25,13) = "c" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (25,16)-(25,18)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (25,16)-(25,18)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (25,16)-(25,17) = "D" + │ │ │ │ ├── closing_loc: (25,17)-(25,18) = ":" + │ │ │ │ └── unescaped: "D" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (25,16)-(25,18)) + │ │ │ │ └── value: + │ │ │ │ @ ConstantReadNode (location: (25,16)-(25,18)) + │ │ │ │ └── name: :D + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (25,19)-(25,20) = "}" + │ ├── opening_loc: (23,4)-(23,6) = "do" + │ └── closing_loc: (26,0)-(26,3) = "end" + └── @ HashNode (location: (28,0)-(28,9)) + ├── opening_loc: (28,0)-(28,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (28,2)-(28,7)) + │ ├── key: + │ │ @ SymbolNode (location: (28,2)-(28,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (28,2)-(28,3) = "a" + │ │ ├── closing_loc: (28,3)-(28,4) = ":" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ IntegerNode (location: (28,5)-(28,7)) + │ │ ├── flags: decimal + │ │ └── value: -1 + │ └── operator_loc: ∅ + └── closing_loc: (28,8)-(28,9) = "}" diff --git a/test/mri/prism/snapshots/heredoc.txt b/test/mri/prism/snapshots/heredoc.txt new file mode 100644 index 00000000000..3ca66dd9897 --- /dev/null +++ b/test/mri/prism/snapshots/heredoc.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,6) = "< + │ ├── message_loc: (31,2)-(31,5) = "<=>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,6)-(31,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (31,6)-(31,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (33,0)-(33,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :== + │ ├── message_loc: (33,2)-(33,4) = "==" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,5)-(33,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (33,5)-(33,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (35,0)-(35,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :=== + │ ├── message_loc: (35,2)-(35,5) = "===" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (35,6)-(35,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (37,0)-(37,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (37,0)-(37,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (37,2)-(37,4) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,5)-(37,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (37,5)-(37,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (39,0)-(39,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :> + │ ├── message_loc: (39,2)-(39,3) = ">" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (39,4)-(39,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (39,4)-(39,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(41,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (41,0)-(41,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :>= + │ ├── message_loc: (41,2)-(41,4) = ">=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (41,5)-(41,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (41,5)-(41,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (43,0)-(43,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (43,0)-(43,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :>> + │ ├── message_loc: (43,2)-(43,4) = ">>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (43,5)-(43,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (43,5)-(43,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (45,0)-(45,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :^ + │ ├── message_loc: (45,2)-(45,3) = "^" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (45,4)-(45,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (45,4)-(45,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (47,0)-(47,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (47,0)-(47,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :| + │ ├── message_loc: (47,2)-(47,3) = "|" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (47,4)-(47,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (47,4)-(47,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ AndNode (location: (49,0)-(49,6)) + │ ├── left: + │ │ @ IntegerNode (location: (49,0)-(49,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (49,5)-(49,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (49,2)-(49,4) = "&&" + ├── @ AndNode (location: (51,0)-(51,7)) + │ ├── left: + │ │ @ IntegerNode (location: (51,0)-(51,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (51,6)-(51,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (51,2)-(51,5) = "and" + ├── @ CallNode (location: (53,0)-(53,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (53,0)-(53,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :* + │ ├── message_loc: (53,2)-(53,3) = "*" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (53,4)-(53,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (53,4)-(53,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (53,4)-(53,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :** + │ │ ├── message_loc: (53,6)-(53,8) = "**" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (53,9)-(53,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (53,9)-(53,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (55,0)-(55,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (55,0)-(55,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (55,0)-(55,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :* + │ │ ├── message_loc: (55,2)-(55,3) = "*" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (55,4)-(55,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (55,4)-(55,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (55,6)-(55,7) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (55,8)-(55,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (55,8)-(55,9)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ OrNode (location: (57,0)-(57,6)) + │ ├── left: + │ │ @ IntegerNode (location: (57,0)-(57,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (57,5)-(57,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (57,2)-(57,4) = "or" + ├── @ OrNode (location: (59,0)-(59,6)) + │ ├── left: + │ │ @ IntegerNode (location: (59,0)-(59,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (59,5)-(59,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (59,2)-(59,4) = "||" + ├── @ CallNode (location: (61,0)-(61,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (61,0)-(61,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (61,2)-(61,3) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (61,4)-(61,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (61,4)-(61,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (61,4)-(61,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :* + │ │ ├── message_loc: (61,6)-(61,7) = "*" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (61,8)-(61,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (61,8)-(61,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ ParenthesesNode (location: (63,0)-(63,7)) + ├── body: + │ @ StatementsNode (location: (63,1)-(63,6)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (63,1)-(63,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (63,1)-(63,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (63,3)-(63,4) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (63,5)-(63,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (63,5)-(63,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (63,0)-(63,1) = "(" + └── closing_loc: (63,6)-(63,7) = ")" diff --git a/test/mri/prism/snapshots/keyword_method_names.txt b/test/mri/prism/snapshots/keyword_method_names.txt new file mode 100644 index 00000000000..6d59790b070 --- /dev/null +++ b/test/mri/prism/snapshots/keyword_method_names.txt @@ -0,0 +1,173 @@ +@ ProgramNode (location: (1,0)-(29,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(29,3)) + └── body: (length: 10) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :def + │ ├── name_loc: (1,4)-(1,7) = "def" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(5,3)) + │ ├── name: :ensure + │ ├── name_loc: (4,9)-(4,15) = "ensure" + │ ├── receiver: + │ │ @ SelfNode (location: (4,4)-(4,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: (4,8)-(4,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ CallNode (location: (7,0)-(10,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (7,0)-(7,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,8)-(10,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (7,8)-(10,3)) + │ │ ├── name: :foo + │ │ ├── name_loc: (7,12)-(7,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (8,2)-(9,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (8,2)-(9,5)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (8,2)-(8,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (8,6)-(9,5)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (8,6)-(8,8) = "do" + │ │ │ └── closing_loc: (9,2)-(9,5) = "end" + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (7,8)-(7,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (10,0)-(10,3) = "end" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ DefNode (location: (12,0)-(13,3)) + │ ├── name: :m + │ ├── name_loc: (12,4)-(12,5) = "m" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (12,6)-(12,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (12,6)-(12,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ NoKeywordsParameterNode (location: (12,9)-(12,14)) + │ │ │ ├── operator_loc: (12,9)-(12,11) = "**" + │ │ │ └── keyword_loc: (12,11)-(12,14) = "nil" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (12,0)-(12,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (12,5)-(12,6) = "(" + │ ├── rparen_loc: (12,14)-(12,15) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (13,0)-(13,3) = "end" + ├── @ DefNode (location: (15,0)-(16,3)) + │ ├── name: :a + │ ├── name_loc: (15,17)-(15,18) = "a" + │ ├── receiver: + │ │ @ SourceEncodingNode (location: (15,4)-(15,16)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (15,0)-(15,3) = "def" + │ ├── operator_loc: (15,16)-(15,17) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (16,0)-(16,3) = "end" + ├── @ StringNode (location: (18,0)-(18,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (18,0)-(18,2) = "%{" + │ ├── content_loc: (18,2)-(18,5) = "abc" + │ ├── closing_loc: (18,5)-(18,6) = "}" + │ └── unescaped: "abc" + ├── @ StringNode (location: (20,0)-(20,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (20,0)-(20,2) = "%\"" + │ ├── content_loc: (20,2)-(20,5) = "abc" + │ ├── closing_loc: (20,5)-(20,6) = "\"" + │ └── unescaped: "abc" + ├── @ DefNode (location: (22,0)-(23,3)) + │ ├── name: :a + │ ├── name_loc: (22,13)-(22,14) = "a" + │ ├── receiver: + │ │ @ SourceFileNode (location: (22,4)-(22,12)) + │ │ ├── flags: ∅ + │ │ └── filepath: "keyword_method_names.txt" + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: (22,12)-(22,13) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ DefNode (location: (25,0)-(26,3)) + │ ├── name: :a + │ ├── name_loc: (25,13)-(25,14) = "a" + │ ├── receiver: + │ │ @ SourceLineNode (location: (25,4)-(25,12)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: (25,12)-(25,13) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (26,0)-(26,3) = "end" + └── @ DefNode (location: (28,0)-(29,3)) + ├── name: :a + ├── name_loc: (28,9)-(28,10) = "a" + ├── receiver: + │ @ NilNode (location: (28,4)-(28,7)) + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (28,0)-(28,3) = "def" + ├── operator_loc: (28,7)-(28,9) = "::" + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (29,0)-(29,3) = "end" diff --git a/test/mri/prism/snapshots/keywords.txt b/test/mri/prism/snapshots/keywords.txt new file mode 100644 index 00000000000..8a93c38bfd3 --- /dev/null +++ b/test/mri/prism/snapshots/keywords.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(11,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,8)) + └── body: (length: 6) + ├── @ RedoNode (location: (1,0)-(1,4)) + ├── @ RetryNode (location: (3,0)-(3,5)) + ├── @ SelfNode (location: (5,0)-(5,4)) + ├── @ SourceEncodingNode (location: (7,0)-(7,12)) + ├── @ SourceFileNode (location: (9,0)-(9,8)) + │ ├── flags: ∅ + │ └── filepath: "keywords.txt" + └── @ SourceLineNode (location: (11,0)-(11,8)) diff --git a/test/mri/prism/snapshots/lambda.txt b/test/mri/prism/snapshots/lambda.txt new file mode 100644 index 00000000000..f9e82c8811a --- /dev/null +++ b/test/mri/prism/snapshots/lambda.txt @@ -0,0 +1,201 @@ +@ ProgramNode (location: (1,0)-(11,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,18)) + └── body: (length: 5) + ├── @ LambdaNode (location: (1,0)-(3,4)) + │ ├── locals: [:foo] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (3,2)-(3,3) = "{" + │ ├── closing_loc: (3,3)-(3,4) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,2)-(3,1)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (2,2)-(2,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (2,2)-(2,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :foo + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (3,0)-(3,1) = ")" + │ └── body: ∅ + ├── @ LambdaNode (location: (5,0)-(5,18)) + │ ├── locals: [:x] + │ ├── operator_loc: (5,0)-(5,2) = "->" + │ ├── opening_loc: (5,15)-(5,16) = "{" + │ ├── closing_loc: (5,17)-(5,18) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (5,2)-(5,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,3)-(5,13)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ OptionalKeywordParameterNode (location: (5,3)-(5,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :x + │ │ │ │ ├── name_loc: (5,3)-(5,5) = "x:" + │ │ │ │ └── value: + │ │ │ │ @ InterpolatedStringNode (location: (5,6)-(5,13)) + │ │ │ │ ├── opening_loc: (5,6)-(5,7) = "\"" + │ │ │ │ ├── parts: (length: 2) + │ │ │ │ │ ├── @ StringNode (location: (5,7)-(5,8)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── content_loc: (5,7)-(5,8) = "b" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "b" + │ │ │ │ │ └── @ EmbeddedStatementsNode (location: (5,8)-(5,12)) + │ │ │ │ │ ├── opening_loc: (5,8)-(5,10) = "\#{" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (5,10)-(5,11)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (5,10)-(5,11)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ ├── message_loc: (5,10)-(5,11) = "a" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── closing_loc: (5,11)-(5,12) = "}" + │ │ │ │ └── closing_loc: (5,12)-(5,13) = "\"" + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (5,2)-(5,3) = "(" + │ │ └── closing_loc: (5,13)-(5,14) = ")" + │ └── body: ∅ + ├── @ LambdaNode (location: (7,0)-(7,15)) + │ ├── locals: [:a] + │ ├── operator_loc: (7,0)-(7,2) = "->" + │ ├── opening_loc: (7,13)-(7,14) = "{" + │ ├── closing_loc: (7,14)-(7,15) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (7,2)-(7,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (7,3)-(7,11)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ OptionalKeywordParameterNode (location: (7,3)-(7,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (7,3)-(7,5) = "a:" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (7,6)-(7,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (7,6)-(7,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── message_loc: (7,6)-(7,7) = "b" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :* + │ │ │ │ ├── message_loc: (7,8)-(7,9) = "*" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (7,10)-(7,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (7,10)-(7,11)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 3 + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (7,2)-(7,3) = "(" + │ │ └── closing_loc: (7,11)-(7,12) = ")" + │ └── body: ∅ + ├── @ LambdaNode (location: (9,0)-(9,19)) + │ ├── locals: [:foo] + │ ├── operator_loc: (9,0)-(9,2) = "->" + │ ├── opening_loc: (9,13)-(9,15) = "do" + │ ├── closing_loc: (9,16)-(9,19) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (9,3)-(9,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (9,3)-(9,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (9,3)-(9,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── name_loc: (9,3)-(9,6) = "foo" + │ │ │ │ ├── operator_loc: (9,7)-(9,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (9,9)-(9,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (9,9)-(9,12) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: ∅ + └── @ LambdaNode (location: (11,0)-(11,18)) + ├── locals: [:foo] + ├── operator_loc: (11,0)-(11,2) = "->" + ├── opening_loc: (11,12)-(11,14) = "do" + ├── closing_loc: (11,15)-(11,18) = "end" + ├── parameters: + │ @ BlockParametersNode (location: (11,3)-(11,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (11,3)-(11,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (11,3)-(11,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── name_loc: (11,3)-(11,7) = "foo:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (11,8)-(11,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (11,8)-(11,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── body: ∅ diff --git a/test/mri/prism/snapshots/method_calls.txt b/test/mri/prism/snapshots/method_calls.txt new file mode 100644 index 00000000000..370686e9ea7 --- /dev/null +++ b/test/mri/prism/snapshots/method_calls.txt @@ -0,0 +1,2456 @@ +@ ProgramNode (location: (1,0)-(156,19)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(156,19)) + └── body: (length: 67) + ├── @ CallNode (location: (1,0)-(1,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :bar + │ ├── message_loc: (1,4)-(1,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,8)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,8)-(1,10) = "%{" + │ │ ├── content_loc: (1,10)-(1,13) = "baz" + │ │ ├── closing_loc: (1,13)-(1,14) = "}" + │ │ └── unescaped: "baz" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,1)-(3,2) = "." + │ ├── name: :b + │ ├── message_loc: (3,2)-(3,3) = "b" + │ ├── opening_loc: (3,3)-(3,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,4)-(3,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (3,4)-(3,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (3,4)-(3,5) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (3,7)-(3,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (3,7)-(3,8) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (3,8)-(3,9) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,0)-(5,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (5,0)-(5,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (5,1)-(5,2) = "." + │ ├── name: :b + │ ├── message_loc: (5,2)-(5,3) = "b" + │ ├── opening_loc: (5,3)-(5,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (5,4)-(5,5) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(9,7)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (7,0)-(8,6)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (7,0)-(7,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (7,0)-(7,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (8,2)-(8,3) = "." + │ │ ├── name: :bar + │ │ ├── message_loc: (8,3)-(8,6) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (9,2)-(9,4) = "&." + │ ├── name: :baz + │ ├── message_loc: (9,4)-(9,7) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (11,0)-(11,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a! + │ ├── message_loc: (11,0)-(11,2) = "a!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (13,0)-(13,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (13,0)-(13,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (13,0)-(13,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (13,1)-(13,2) = "." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (13,2)-(13,3) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (13,3)-(13,4) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (15,0)-(15,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (15,0)-(15,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (15,0)-(15,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (15,1)-(15,2) = "." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (15,2)-(15,3) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,3)-(15,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (15,3)-(15,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (15,6)-(15,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (15,9)-(15,10)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── closing_loc: (15,10)-(15,11) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (17,0)-(17,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (17,0)-(17,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (17,0)-(17,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (17,1)-(17,3) = "::" + │ ├── name: :b + │ ├── message_loc: (17,3)-(17,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (19,0)-(19,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (19,0)-(19,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (19,0)-(19,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (19,1)-(19,3) = "::" + │ ├── name: :b + │ ├── message_loc: (19,3)-(19,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,5)-(19,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (19,5)-(19,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (19,5)-(19,6) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (21,0)-(21,11)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (21,0)-(21,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (21,0)-(21,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (21,3)-(21,4) = "." + │ ├── name: :bar= + │ ├── message_loc: (21,4)-(21,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,10)-(21,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (21,10)-(21,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (23,0)-(23,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a? + │ ├── message_loc: (23,0)-(23,2) = "a?" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (25,0)-(25,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (25,0)-(25,1) = "a" + │ ├── opening_loc: (25,1)-(25,2) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (25,8)-(25,9) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (25,2)-(25,8)) + │ ├── expression: + │ │ @ CallNode (location: (25,3)-(25,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (25,3)-(25,8) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (25,2)-(25,3) = "&" + ├── @ CallNode (location: (27,0)-(27,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (27,0)-(27,1) = "a" + │ ├── opening_loc: (27,1)-(27,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,2)-(27,10)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (27,2)-(27,10)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (27,2)-(27,10)) + │ │ ├── value: + │ │ │ @ CallNode (location: (27,4)-(27,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :kwargs + │ │ │ ├── message_loc: (27,4)-(27,10) = "kwargs" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (27,2)-(27,4) = "**" + │ ├── closing_loc: (27,10)-(27,11) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(29,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (29,0)-(29,3)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (29,0)-(29,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (29,0)-(29,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (29,1)-(29,2) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (29,2)-(29,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (29,3)-(29,4) = "." + │ ├── name: :c + │ ├── message_loc: (29,4)-(29,5) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(31,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (31,0)-(31,1) = "a" + │ ├── opening_loc: (31,1)-(31,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,2)-(31,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (31,2)-(31,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (31,2)-(31,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (31,5)-(31,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (31,5)-(31,6) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (31,6)-(31,7) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (33,0)-(33,1) = "a" + │ ├── opening_loc: (33,1)-(33,2) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (33,2)-(33,3) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (35,0)-(35,1) = "a" + │ ├── opening_loc: (35,1)-(35,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,2)-(35,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (35,2)-(35,7)) + │ │ ├── operator_loc: (35,2)-(35,3) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (35,3)-(35,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (35,3)-(35,7) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (35,7)-(35,8) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (37,0)-(37,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (37,0)-(37,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,2)-(37,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (37,2)-(37,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (37,2)-(37,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (37,5)-(37,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (37,5)-(37,6) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (39,0)-(39,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (39,0)-(39,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (39,1)-(39,2) = "." + │ ├── name: :b + │ ├── message_loc: (39,2)-(39,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (39,4)-(39,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (39,4)-(39,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (39,4)-(39,5) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (39,7)-(39,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (39,7)-(39,8) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (41,0)-(41,23)) + │ ├── lefts: (length: 2) + │ │ ├── @ CallTargetNode (location: (41,0)-(41,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (41,0)-(41,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (41,0)-(41,3) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: (41,3)-(41,4) = "." + │ │ │ ├── name: :foo= + │ │ │ └── message_loc: (41,4)-(41,7) = "foo" + │ │ └── @ CallTargetNode (location: (41,9)-(41,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (41,9)-(41,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (41,9)-(41,12) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (41,12)-(41,13) = "." + │ │ ├── name: :bar= + │ │ └── message_loc: (41,13)-(41,16) = "bar" + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (41,17)-(41,18) = "=" + │ └── value: + │ @ ArrayNode (location: (41,19)-(41,23)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (41,19)-(41,20)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (41,22)-(41,23)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── @ CallNode (location: (43,0)-(43,4)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (43,0)-(43,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (43,0)-(43,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (43,1)-(43,3) = "&." + │ ├── name: :b + │ ├── message_loc: (43,3)-(43,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,5)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (45,0)-(45,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (45,0)-(45,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (45,1)-(45,3) = "&." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (45,3)-(45,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (45,4)-(45,5) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (47,0)-(47,7)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (47,0)-(47,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (47,0)-(47,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (47,1)-(47,3) = "&." + │ ├── name: :b + │ ├── message_loc: (47,3)-(47,4) = "b" + │ ├── opening_loc: (47,4)-(47,5) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (47,5)-(47,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (47,5)-(47,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (47,5)-(47,6) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (47,6)-(47,7) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (49,0)-(49,6)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (49,0)-(49,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (49,0)-(49,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (49,1)-(49,3) = "&." + │ ├── name: :b + │ ├── message_loc: (49,3)-(49,4) = "b" + │ ├── opening_loc: (49,4)-(49,5) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (49,5)-(49,6) = ")" + │ └── block: ∅ + ├── @ IfNode (location: (51,0)-(51,33)) + │ ├── if_keyword_loc: (51,11)-(51,13) = "if" + │ ├── predicate: + │ │ @ AndNode (location: (51,14)-(51,33)) + │ │ ├── left: + │ │ │ @ OrNode (location: (51,14)-(51,25)) + │ │ │ ├── left: + │ │ │ │ @ CallNode (location: (51,14)-(51,18)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar? + │ │ │ │ ├── message_loc: (51,14)-(51,18) = "bar?" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (51,22)-(51,25)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (51,22)-(51,25) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (51,19)-(51,21) = "or" + │ │ ├── right: + │ │ │ @ CallNode (location: (51,30)-(51,33)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :qux + │ │ │ ├── message_loc: (51,30)-(51,33) = "qux" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (51,26)-(51,29) = "and" + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (51,0)-(51,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (51,0)-(51,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (51,0)-(51,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (51,4)-(51,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ SymbolNode (location: (51,4)-(51,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (51,4)-(51,5) = ":" + │ │ │ │ ├── value_loc: (51,5)-(51,6) = "a" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "a" + │ │ │ └── @ SymbolNode (location: (51,8)-(51,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (51,8)-(51,9) = ":" + │ │ │ ├── value_loc: (51,9)-(51,10) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ CallNode (location: (53,0)-(56,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (53,0)-(53,3) = "foo" + │ ├── opening_loc: (53,3)-(53,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (53,4)-(55,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (53,4)-(53,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (53,4)-(53,5) = ":" + │ │ │ ├── value_loc: (53,5)-(53,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (55,2)-(55,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (55,2)-(55,3) = ":" + │ │ ├── value_loc: (55,3)-(55,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: (56,0)-(56,1) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (58,0)-(58,10)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (58,0)-(58,3) = "foo" + │ ├── opening_loc: (58,3)-(58,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (58,4)-(58,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (58,4)-(58,9)) + │ │ ├── operator_loc: (58,4)-(58,5) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (58,5)-(58,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :rest + │ │ ├── message_loc: (58,5)-(58,9) = "rest" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (58,9)-(58,10) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (60,0)-(60,39)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (60,0)-(60,3) = "foo" + │ ├── opening_loc: (60,3)-(60,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (60,4)-(60,32)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (60,4)-(60,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (60,4)-(60,5) = ":" + │ │ │ ├── value_loc: (60,5)-(60,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ KeywordHashNode (location: (60,8)-(60,32)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 2) + │ │ ├── @ AssocNode (location: (60,8)-(60,22)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (60,8)-(60,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (60,8)-(60,9) = ":" + │ │ │ │ ├── value_loc: (60,9)-(60,10) = "h" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "h" + │ │ │ ├── value: + │ │ │ │ @ ArrayNode (location: (60,14)-(60,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── elements: (length: 2) + │ │ │ │ │ ├── @ SymbolNode (location: (60,15)-(60,17)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: (60,15)-(60,16) = ":" + │ │ │ │ │ │ ├── value_loc: (60,16)-(60,17) = "x" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "x" + │ │ │ │ │ └── @ SymbolNode (location: (60,19)-(60,21)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (60,19)-(60,20) = ":" + │ │ │ │ │ ├── value_loc: (60,20)-(60,21) = "y" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "y" + │ │ │ │ ├── opening_loc: (60,14)-(60,15) = "[" + │ │ │ │ └── closing_loc: (60,21)-(60,22) = "]" + │ │ │ └── operator_loc: (60,11)-(60,13) = "=>" + │ │ └── @ AssocNode (location: (60,24)-(60,32)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (60,24)-(60,26)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (60,24)-(60,25) = ":" + │ │ │ ├── value_loc: (60,25)-(60,26) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (60,30)-(60,32)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (60,30)-(60,31) = ":" + │ │ │ ├── value_loc: (60,31)-(60,32) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── operator_loc: (60,27)-(60,29) = "=>" + │ ├── closing_loc: (60,39)-(60,40) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (60,34)-(60,39)) + │ ├── expression: + │ │ @ SymbolNode (location: (60,35)-(60,39)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (60,35)-(60,36) = ":" + │ │ ├── value_loc: (60,36)-(60,39) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── operator_loc: (60,34)-(60,35) = "&" + ├── @ CallNode (location: (62,0)-(62,49)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :hi + │ ├── message_loc: (62,0)-(62,2) = "hi" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (62,3)-(62,49)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (62,3)-(62,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 123 + │ │ └── @ HashNode (location: (62,8)-(62,49)) + │ │ ├── opening_loc: (62,8)-(62,9) = "{" + │ │ ├── elements: (length: 3) + │ │ │ ├── @ AssocNode (location: (62,10)-(62,27)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (62,10)-(62,16)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (62,10)-(62,11) = ":" + │ │ │ │ │ ├── value_loc: (62,11)-(62,16) = "there" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "there" + │ │ │ │ ├── value: + │ │ │ │ │ @ SymbolNode (location: (62,20)-(62,27)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (62,20)-(62,21) = ":" + │ │ │ │ │ ├── value_loc: (62,21)-(62,27) = "friend" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "friend" + │ │ │ │ └── operator_loc: (62,17)-(62,19) = "=>" + │ │ │ ├── @ AssocSplatNode (location: (62,29)-(62,33)) + │ │ │ │ ├── value: + │ │ │ │ │ @ HashNode (location: (62,31)-(62,33)) + │ │ │ │ │ ├── opening_loc: (62,31)-(62,32) = "{" + │ │ │ │ │ ├── elements: (length: 0) + │ │ │ │ │ └── closing_loc: (62,32)-(62,33) = "}" + │ │ │ │ └── operator_loc: (62,29)-(62,31) = "**" + │ │ │ └── @ AssocNode (location: (62,35)-(62,47)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (62,35)-(62,42)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (62,35)-(62,41) = "whatup" + │ │ │ │ ├── closing_loc: (62,41)-(62,42) = ":" + │ │ │ │ └── unescaped: "whatup" + │ │ │ ├── value: + │ │ │ │ @ SymbolNode (location: (62,43)-(62,47)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (62,43)-(62,44) = ":" + │ │ │ │ ├── value_loc: (62,44)-(62,47) = "dog" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "dog" + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (62,48)-(62,49) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (64,0)-(64,36)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (64,0)-(64,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (64,4)-(64,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (64,4)-(64,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (64,4)-(64,5) = ":" + │ │ │ ├── value_loc: (64,5)-(64,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ KeywordHashNode (location: (64,8)-(64,15)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (64,8)-(64,15)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (64,8)-(64,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (64,8)-(64,9) = "b" + │ │ │ ├── closing_loc: (64,9)-(64,10) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ TrueNode (location: (64,11)-(64,15)) + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (64,16)-(64,36)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (64,19)-(64,25)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (64,20)-(64,24)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (64,20)-(64,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (64,23)-(64,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (64,19)-(64,20) = "|" + │ │ └── closing_loc: (64,24)-(64,25) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (64,26)-(64,32)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (64,26)-(64,32)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (64,26)-(64,30) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (64,31)-(64,32)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (64,31)-(64,32)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (64,16)-(64,18) = "do" + │ └── closing_loc: (64,33)-(64,36) = "end" + ├── @ CallNode (location: (66,0)-(66,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :hi + │ ├── message_loc: (66,0)-(66,2) = "hi" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (66,3)-(66,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (66,3)-(66,17)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (66,3)-(66,17)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (66,3)-(66,9)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (66,3)-(66,8) = "there" + │ │ │ ├── closing_loc: (66,8)-(66,9) = ":" + │ │ │ └── unescaped: "there" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (66,10)-(66,17)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (66,10)-(66,11) = ":" + │ │ │ ├── value_loc: (66,11)-(66,17) = "friend" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "friend" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (68,0)-(68,40)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :hi + │ ├── message_loc: (68,0)-(68,2) = "hi" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (68,3)-(68,40)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (68,3)-(68,40)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 3) + │ │ ├── @ AssocNode (location: (68,3)-(68,20)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (68,3)-(68,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (68,3)-(68,4) = ":" + │ │ │ │ ├── value_loc: (68,4)-(68,9) = "there" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "there" + │ │ │ ├── value: + │ │ │ │ @ SymbolNode (location: (68,13)-(68,20)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (68,13)-(68,14) = ":" + │ │ │ │ ├── value_loc: (68,14)-(68,20) = "friend" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "friend" + │ │ │ └── operator_loc: (68,10)-(68,12) = "=>" + │ │ ├── @ AssocSplatNode (location: (68,22)-(68,26)) + │ │ │ ├── value: + │ │ │ │ @ HashNode (location: (68,24)-(68,26)) + │ │ │ │ ├── opening_loc: (68,24)-(68,25) = "{" + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ └── closing_loc: (68,25)-(68,26) = "}" + │ │ │ └── operator_loc: (68,22)-(68,24) = "**" + │ │ └── @ AssocNode (location: (68,28)-(68,40)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (68,28)-(68,35)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (68,28)-(68,34) = "whatup" + │ │ │ ├── closing_loc: (68,34)-(68,35) = ":" + │ │ │ └── unescaped: "whatup" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (68,36)-(68,40)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (68,36)-(68,37) = ":" + │ │ │ ├── value_loc: (68,37)-(68,40) = "dog" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "dog" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (70,0)-(70,41)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :hi + │ ├── message_loc: (70,0)-(70,2) = "hi" + │ ├── opening_loc: (70,2)-(70,3) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (70,3)-(70,40)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (70,3)-(70,40)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 3) + │ │ ├── @ AssocNode (location: (70,3)-(70,20)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (70,3)-(70,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (70,3)-(70,4) = ":" + │ │ │ │ ├── value_loc: (70,4)-(70,9) = "there" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "there" + │ │ │ ├── value: + │ │ │ │ @ SymbolNode (location: (70,13)-(70,20)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (70,13)-(70,14) = ":" + │ │ │ │ ├── value_loc: (70,14)-(70,20) = "friend" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "friend" + │ │ │ └── operator_loc: (70,10)-(70,12) = "=>" + │ │ ├── @ AssocSplatNode (location: (70,22)-(70,26)) + │ │ │ ├── value: + │ │ │ │ @ HashNode (location: (70,24)-(70,26)) + │ │ │ │ ├── opening_loc: (70,24)-(70,25) = "{" + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ └── closing_loc: (70,25)-(70,26) = "}" + │ │ │ └── operator_loc: (70,22)-(70,24) = "**" + │ │ └── @ AssocNode (location: (70,28)-(70,40)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (70,28)-(70,35)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (70,28)-(70,34) = "whatup" + │ │ │ ├── closing_loc: (70,34)-(70,35) = ":" + │ │ │ └── unescaped: "whatup" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (70,36)-(70,40)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (70,36)-(70,37) = ":" + │ │ │ ├── value_loc: (70,37)-(70,40) = "dog" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "dog" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (70,40)-(70,41) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (72,0)-(72,35)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (72,0)-(72,3) = "foo" + │ ├── opening_loc: (72,3)-(72,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (72,4)-(72,26)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ HashNode (location: (72,4)-(72,26)) + │ │ ├── opening_loc: (72,4)-(72,5) = "{" + │ │ ├── elements: (length: 2) + │ │ │ ├── @ AssocNode (location: (72,6)-(72,13)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (72,6)-(72,8)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (72,6)-(72,7) = "a" + │ │ │ │ │ ├── closing_loc: (72,7)-(72,8) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ TrueNode (location: (72,9)-(72,13)) + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (72,15)-(72,23)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (72,15)-(72,17)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (72,15)-(72,16) = "b" + │ │ │ │ ├── closing_loc: (72,16)-(72,17) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ FalseNode (location: (72,18)-(72,23)) + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (72,25)-(72,26) = "}" + │ ├── closing_loc: (72,35)-(72,36) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (72,28)-(72,35)) + │ ├── expression: + │ │ @ SymbolNode (location: (72,29)-(72,35)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (72,29)-(72,30) = ":" + │ │ ├── value_loc: (72,30)-(72,35) = "block" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "block" + │ └── operator_loc: (72,28)-(72,29) = "&" + ├── @ CallNode (location: (74,0)-(74,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :hi + │ ├── message_loc: (74,0)-(74,2) = "hi" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (74,3)-(74,20)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (74,3)-(74,20)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (74,3)-(74,20)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (74,3)-(74,9)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (74,3)-(74,4) = ":" + │ │ │ ├── value_loc: (74,4)-(74,9) = "there" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "there" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (74,13)-(74,20)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (74,13)-(74,14) = ":" + │ │ │ ├── value_loc: (74,14)-(74,20) = "friend" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "friend" + │ │ └── operator_loc: (74,10)-(74,12) = "=>" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (76,0)-(78,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (76,0)-(76,3) = "foo" + │ ├── opening_loc: (76,3)-(76,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (76,4)-(77,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (76,4)-(76,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (76,4)-(76,5) = ":" + │ │ │ ├── value_loc: (76,5)-(76,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (77,0)-(77,2)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (77,0)-(77,1) = ":" + │ │ ├── value_loc: (77,1)-(77,2) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: (78,0)-(78,1) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (80,0)-(83,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (80,0)-(80,3) = "foo" + │ ├── opening_loc: (80,3)-(80,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (81,0)-(82,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (81,0)-(81,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (81,0)-(81,1) = ":" + │ │ │ ├── value_loc: (81,1)-(81,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ KeywordHashNode (location: (82,0)-(82,5)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (82,0)-(82,5)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (82,0)-(82,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (82,0)-(82,1) = "b" + │ │ │ ├── closing_loc: (82,1)-(82,2) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (82,3)-(82,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (82,3)-(82,4) = ":" + │ │ │ ├── value_loc: (82,4)-(82,5) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (83,0)-(83,1) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (85,0)-(85,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (85,0)-(85,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockArgumentNode (location: (85,4)-(85,11)) + │ ├── expression: + │ │ @ SymbolNode (location: (85,5)-(85,11)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (85,5)-(85,6) = ":" + │ │ ├── value_loc: (85,6)-(85,11) = "block" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "block" + │ └── operator_loc: (85,4)-(85,5) = "&" + ├── @ CallNode (location: (87,0)-(87,30)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (87,0)-(87,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (87,4)-(87,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (87,4)-(87,21)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 2) + │ │ ├── @ AssocNode (location: (87,4)-(87,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (87,4)-(87,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (87,4)-(87,5) = "a" + │ │ │ │ ├── closing_loc: (87,5)-(87,6) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ TrueNode (location: (87,7)-(87,11)) + │ │ │ └── operator_loc: ∅ + │ │ └── @ AssocNode (location: (87,13)-(87,21)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (87,13)-(87,15)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (87,13)-(87,14) = "b" + │ │ │ ├── closing_loc: (87,14)-(87,15) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ FalseNode (location: (87,16)-(87,21)) + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockArgumentNode (location: (87,23)-(87,30)) + │ ├── expression: + │ │ @ SymbolNode (location: (87,24)-(87,30)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (87,24)-(87,25) = ":" + │ │ ├── value_loc: (87,25)-(87,30) = "block" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "block" + │ └── operator_loc: (87,23)-(87,24) = "&" + ├── @ CallNode (location: (89,0)-(89,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :some_func + │ ├── message_loc: (89,0)-(89,9) = "some_func" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (89,10)-(89,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (89,10)-(89,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (89,13)-(89,21)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (89,13)-(89,21)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (89,13)-(89,19)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (89,13)-(89,18) = "kwarg" + │ │ │ ├── closing_loc: (89,18)-(89,19) = ":" + │ │ │ └── unescaped: "kwarg" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (89,20)-(89,21)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (91,0)-(91,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (91,0)-(91,6)) + │ │ └── name: :Kernel + │ ├── call_operator_loc: (91,6)-(91,7) = "." + │ ├── name: :Integer + │ ├── message_loc: (91,7)-(91,14) = "Integer" + │ ├── opening_loc: (91,14)-(91,15) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (91,15)-(91,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (91,15)-(91,17)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ ├── closing_loc: (91,17)-(91,18) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (93,0)-(93,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (93,0)-(93,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :x + │ │ ├── message_loc: (93,0)-(93,1) = "x" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (93,1)-(93,2) = "." + │ ├── name: :each + │ ├── message_loc: (93,2)-(93,6) = "each" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (93,7)-(93,10)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (93,7)-(93,8) = "{" + │ └── closing_loc: (93,9)-(93,10) = "}" + ├── @ CallNode (location: (95,0)-(95,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (95,0)-(95,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (95,0)-(95,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (95,3)-(95,4) = "." + │ ├── name: :map + │ ├── message_loc: (95,4)-(95,7) = "map" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (95,8)-(95,14)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (95,10)-(95,12)) + │ │ └── body: (length: 1) + │ │ └── @ BackReferenceReadNode (location: (95,10)-(95,12)) + │ │ └── name: :$& + │ ├── opening_loc: (95,8)-(95,9) = "{" + │ └── closing_loc: (95,13)-(95,14) = "}" + ├── @ CallNode (location: (97,0)-(97,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantPathNode (location: (97,0)-(97,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (97,0)-(97,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (97,3)-(97,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (97,1)-(97,3) = "::" + │ ├── call_operator_loc: (97,4)-(97,6) = "::" + │ ├── name: :C + │ ├── message_loc: (97,6)-(97,7) = "C" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (97,8)-(97,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (97,8)-(97,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (97,8)-(97,9) = ":" + │ │ ├── value_loc: (97,9)-(97,12) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (99,0)-(99,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantPathNode (location: (99,0)-(99,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (99,0)-(99,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (99,3)-(99,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (99,1)-(99,3) = "::" + │ ├── call_operator_loc: (99,4)-(99,6) = "::" + │ ├── name: :C + │ ├── message_loc: (99,6)-(99,7) = "C" + │ ├── opening_loc: (99,7)-(99,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (99,8)-(99,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (99,8)-(99,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (99,8)-(99,9) = ":" + │ │ ├── value_loc: (99,9)-(99,12) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── closing_loc: (99,12)-(99,13) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (101,0)-(101,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantPathNode (location: (101,0)-(101,4)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (101,0)-(101,1)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (101,3)-(101,4)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (101,1)-(101,3) = "::" + │ ├── call_operator_loc: (101,4)-(101,6) = "::" + │ ├── name: :C + │ ├── message_loc: (101,6)-(101,7) = "C" + │ ├── opening_loc: (101,7)-(101,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (101,8)-(101,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (101,8)-(101,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (101,8)-(101,9) = ":" + │ │ ├── value_loc: (101,9)-(101,12) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── closing_loc: (101,12)-(101,13) = ")" + │ └── block: + │ @ BlockNode (location: (101,14)-(101,17)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (101,14)-(101,15) = "{" + │ └── closing_loc: (101,16)-(101,17) = "}" + ├── @ CallNode (location: (103,0)-(103,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (103,0)-(103,3) = "foo" + │ ├── opening_loc: (103,3)-(103,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (103,4)-(103,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (103,4)-(103,11)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (103,4)-(103,11)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (103,4)-(103,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (103,4)-(103,5) = "\"" + │ │ │ ├── value_loc: (103,5)-(103,6) = "a" + │ │ │ ├── closing_loc: (103,6)-(103,8) = "\":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (103,9)-(103,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: -1 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (103,11)-(103,12) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (105,0)-(105,28)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (105,0)-(105,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (105,4)-(105,28)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (105,4)-(105,28)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (105,4)-(105,28)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (105,4)-(105,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (105,4)-(105,7) = "bar" + │ │ │ ├── closing_loc: (105,7)-(105,8) = ":" + │ │ │ └── unescaped: "bar" + │ │ ├── value: + │ │ │ @ HashNode (location: (105,9)-(105,28)) + │ │ │ ├── opening_loc: (105,9)-(105,10) = "{" + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (105,11)-(105,26)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (105,11)-(105,15)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (105,11)-(105,14) = "baz" + │ │ │ │ │ ├── closing_loc: (105,14)-(105,15) = ":" + │ │ │ │ │ └── unescaped: "baz" + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (105,16)-(105,26)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :qux + │ │ │ │ │ ├── message_loc: (105,16)-(105,19) = "qux" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (105,20)-(105,26)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (105,20)-(105,22) = "do" + │ │ │ │ │ └── closing_loc: (105,23)-(105,26) = "end" + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── closing_loc: (105,27)-(105,28) = "}" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (107,0)-(107,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (107,0)-(107,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (107,4)-(107,24)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (107,4)-(107,24)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (107,4)-(107,24)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (107,4)-(107,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (107,4)-(107,7) = "bar" + │ │ │ ├── closing_loc: (107,7)-(107,8) = ":" + │ │ │ └── unescaped: "bar" + │ │ ├── value: + │ │ │ @ HashNode (location: (107,9)-(107,24)) + │ │ │ ├── opening_loc: (107,9)-(107,10) = "{" + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocSplatNode (location: (107,11)-(107,22)) + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (107,13)-(107,22)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :kw + │ │ │ │ │ ├── message_loc: (107,13)-(107,15) = "kw" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (107,16)-(107,22)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (107,16)-(107,18) = "do" + │ │ │ │ │ └── closing_loc: (107,19)-(107,22) = "end" + │ │ │ │ └── operator_loc: (107,11)-(107,13) = "**" + │ │ │ └── closing_loc: (107,23)-(107,24) = "}" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (109,0)-(109,36)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (109,0)-(109,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (109,4)-(109,29)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (109,4)-(109,29)) + │ │ ├── opening_loc: (109,4)-(109,5) = "\"" + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (109,5)-(109,28)) + │ │ │ ├── opening_loc: (109,5)-(109,7) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (109,7)-(109,27)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (109,7)-(109,27)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (109,7)-(109,10)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :bar + │ │ │ │ │ ├── message_loc: (109,7)-(109,10) = "bar" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── call_operator_loc: (109,10)-(109,11) = "." + │ │ │ │ ├── name: :map + │ │ │ │ ├── message_loc: (109,11)-(109,14) = "map" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (109,15)-(109,27)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (109,18)-(109,23)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ StringNode (location: (109,18)-(109,23)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (109,18)-(109,19) = "\"" + │ │ │ │ │ ├── content_loc: (109,19)-(109,22) = "baz" + │ │ │ │ │ ├── closing_loc: (109,22)-(109,23) = "\"" + │ │ │ │ │ └── unescaped: "baz" + │ │ │ │ ├── opening_loc: (109,15)-(109,17) = "do" + │ │ │ │ └── closing_loc: (109,24)-(109,27) = "end" + │ │ │ └── closing_loc: (109,27)-(109,28) = "}" + │ │ └── closing_loc: (109,28)-(109,29) = "\"" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (109,30)-(109,36)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (109,30)-(109,32) = "do" + │ └── closing_loc: (109,33)-(109,36) = "end" + ├── @ CallNode (location: (111,0)-(111,28)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (111,0)-(111,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (111,4)-(111,28)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ClassNode (location: (111,4)-(111,28)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (111,4)-(111,9) = "class" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (111,10)-(111,13)) + │ │ │ └── name: :Bar + │ │ ├── inheritance_operator_loc: ∅ + │ │ ├── superclass: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (111,14)-(111,24)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (111,14)-(111,24)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (111,14)-(111,17) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (111,18)-(111,24)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (111,18)-(111,20) = "do" + │ │ │ └── closing_loc: (111,21)-(111,24) = "end" + │ │ ├── end_keyword_loc: (111,25)-(111,28) = "end" + │ │ └── name: :Bar + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (113,0)-(113,29)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (113,0)-(113,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (113,4)-(113,29)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ModuleNode (location: (113,4)-(113,29)) + │ │ ├── locals: [] + │ │ ├── module_keyword_loc: (113,4)-(113,10) = "module" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (113,11)-(113,14)) + │ │ │ └── name: :Bar + │ │ ├── body: + │ │ │ @ StatementsNode (location: (113,15)-(113,25)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (113,15)-(113,25)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (113,15)-(113,18) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (113,19)-(113,25)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (113,19)-(113,21) = "do" + │ │ │ └── closing_loc: (113,22)-(113,25) = "end" + │ │ ├── end_keyword_loc: (113,26)-(113,29) = "end" + │ │ └── name: :Bar + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (115,0)-(115,16)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (115,0)-(115,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (115,4)-(115,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ArrayNode (location: (115,4)-(115,16)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ CallNode (location: (115,5)-(115,15)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (115,5)-(115,8) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (115,9)-(115,15)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (115,9)-(115,11) = "do" + │ │ │ └── closing_loc: (115,12)-(115,15) = "end" + │ │ ├── opening_loc: (115,4)-(115,5) = "[" + │ │ └── closing_loc: (115,15)-(115,16) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (117,0)-(117,28)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (117,0)-(117,1) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (117,2)-(117,28)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ BeginNode (location: (117,2)-(117,28)) + │ │ ├── begin_keyword_loc: (117,2)-(117,7) = "begin" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (117,8)-(117,24)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (117,8)-(117,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ IntegerNode (location: (117,8)-(117,9)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── call_operator_loc: (117,9)-(117,10) = "." + │ │ │ ├── name: :times + │ │ │ ├── message_loc: (117,10)-(117,15) = "times" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (117,16)-(117,24)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (117,19)-(117,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (117,19)-(117,20)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (117,16)-(117,18) = "do" + │ │ │ └── closing_loc: (117,21)-(117,24) = "end" + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (117,25)-(117,28) = "end" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (119,0)-(124,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (119,0)-(119,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (119,4)-(124,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (119,4)-(119,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (119,4)-(119,5) = ":" + │ │ │ ├── value_loc: (119,5)-(119,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ IfNode (location: (120,2)-(124,5)) + │ │ ├── if_keyword_loc: (120,2)-(120,4) = "if" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (120,5)-(120,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (120,5)-(120,6) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (121,4)-(123,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (121,4)-(123,7)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (121,4)-(121,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (121,8)-(123,7)) + │ │ │ ├── locals: [:a] + │ │ │ ├── parameters: + │ │ │ │ @ BlockParametersNode (location: (121,11)-(121,14)) + │ │ │ │ ├── parameters: + │ │ │ │ │ @ ParametersNode (location: (121,12)-(121,13)) + │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (121,12)-(121,13)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── locals: (length: 0) + │ │ │ │ ├── opening_loc: (121,11)-(121,12) = "|" + │ │ │ │ └── closing_loc: (121,13)-(121,14) = "|" + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (122,6)-(122,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (122,6)-(122,7)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (121,8)-(121,10) = "do" + │ │ │ └── closing_loc: (123,4)-(123,7) = "end" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: (124,2)-(124,5) = "end" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (126,0)-(135,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (126,0)-(126,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (126,4)-(135,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ SymbolNode (location: (126,4)-(126,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (126,4)-(126,5) = ":" + │ │ │ ├── value_loc: (126,5)-(126,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ WhileNode (location: (127,2)-(131,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── keyword_loc: (127,2)-(127,7) = "while" + │ │ │ ├── closing_loc: (131,2)-(131,5) = "end" + │ │ │ ├── predicate: + │ │ │ │ @ CallNode (location: (127,8)-(127,9)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :x + │ │ │ │ ├── message_loc: (127,8)-(127,9) = "x" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (128,4)-(130,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (128,4)-(130,7)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (128,4)-(128,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (128,8)-(130,7)) + │ │ │ ├── locals: [:a] + │ │ │ ├── parameters: + │ │ │ │ @ BlockParametersNode (location: (128,11)-(128,14)) + │ │ │ │ ├── parameters: + │ │ │ │ │ @ ParametersNode (location: (128,12)-(128,13)) + │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (128,12)-(128,13)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── locals: (length: 0) + │ │ │ │ ├── opening_loc: (128,11)-(128,12) = "|" + │ │ │ │ └── closing_loc: (128,13)-(128,14) = "|" + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (129,6)-(129,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (129,6)-(129,7)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (128,8)-(128,10) = "do" + │ │ │ └── closing_loc: (130,4)-(130,7) = "end" + │ │ └── @ UntilNode (location: (132,2)-(135,5)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (132,2)-(132,7) = "until" + │ │ ├── closing_loc: (135,2)-(135,5) = "end" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (132,8)-(132,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (132,8)-(132,9) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (133,4)-(134,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (133,4)-(134,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (133,4)-(133,7) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (133,8)-(134,7)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (133,8)-(133,10) = "do" + │ │ └── closing_loc: (134,4)-(134,7) = "end" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (137,0)-(137,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ HashNode (location: (137,0)-(137,2)) + │ │ ├── opening_loc: (137,0)-(137,1) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (137,1)-(137,2) = "}" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (137,3)-(137,4) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (137,5)-(137,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (137,5)-(137,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (137,5)-(137,6) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (137,7)-(137,9)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (137,7)-(137,8) = "{" + │ │ └── closing_loc: (137,8)-(137,9) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (139,0)-(139,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ HashNode (location: (139,0)-(139,2)) + │ │ ├── opening_loc: (139,0)-(139,1) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (139,1)-(139,2) = "}" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (139,3)-(139,4) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (139,5)-(139,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (139,5)-(139,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (139,5)-(139,6) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (139,7)-(139,16)) + │ │ ├── locals: [:a] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (139,9)-(139,12)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (139,10)-(139,11)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (139,10)-(139,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (139,9)-(139,10) = "|" + │ │ │ └── closing_loc: (139,11)-(139,12) = "|" + │ │ ├── body: + │ │ │ @ StatementsNode (location: (139,13)-(139,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (139,13)-(139,14)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (139,7)-(139,8) = "{" + │ │ └── closing_loc: (139,15)-(139,16) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (141,0)-(141,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (141,0)-(141,4)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (141,0)-(141,1) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (141,2)-(141,4)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (141,2)-(141,3) = "{" + │ │ └── closing_loc: (141,3)-(141,4) = "}" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (141,5)-(141,6) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (141,7)-(141,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (141,7)-(141,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (141,7)-(141,8) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (141,9)-(141,11)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (141,9)-(141,10) = "{" + │ │ └── closing_loc: (141,10)-(141,11) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (143,0)-(143,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (143,0)-(143,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :lst + │ │ ├── message_loc: (143,0)-(143,3) = "lst" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<< + │ ├── message_loc: (143,4)-(143,6) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (143,7)-(143,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (143,7)-(143,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :A + │ │ ├── message_loc: (143,7)-(143,8) = "A" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (143,9)-(143,11)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (143,9)-(143,10) = "{" + │ │ └── closing_loc: (143,10)-(143,11) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ InterpolatedStringNode (location: (145,0)-(145,17)) + │ ├── opening_loc: (145,0)-(145,1) = "\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (145,1)-(145,16)) + │ │ ├── opening_loc: (145,1)-(145,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (145,4)-(145,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (145,4)-(145,14)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :join + │ │ │ ├── message_loc: (145,4)-(145,8) = "join" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (145,9)-(145,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ ParenthesesNode (location: (145,9)-(145,14)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (145,10)-(145,13)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ StringNode (location: (145,10)-(145,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (145,10)-(145,11) = "\"" + │ │ │ │ │ ├── content_loc: (145,11)-(145,12) = " " + │ │ │ │ │ ├── closing_loc: (145,12)-(145,13) = "\"" + │ │ │ │ │ └── unescaped: " " + │ │ │ │ ├── opening_loc: (145,9)-(145,10) = "(" + │ │ │ │ └── closing_loc: (145,13)-(145,14) = ")" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (145,15)-(145,16) = "}" + │ └── closing_loc: (145,16)-(145,17) = "\"" + ├── @ InterpolatedStringNode (location: (147,0)-(147,8)) + │ ├── opening_loc: (147,0)-(147,1) = "\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (147,1)-(147,7)) + │ │ ├── opening_loc: (147,1)-(147,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (147,3)-(147,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (147,3)-(147,6)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (147,4)-(147,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (147,4)-(147,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :v + │ │ │ │ ├── message_loc: (147,4)-(147,5) = "v" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (147,3)-(147,4) = "(" + │ │ │ └── closing_loc: (147,5)-(147,6) = ")" + │ │ └── closing_loc: (147,6)-(147,7) = "}" + │ └── closing_loc: (147,7)-(147,8) = "\"" + ├── @ DefNode (location: (149,0)-(149,18)) + │ ├── name: :f + │ ├── name_loc: (149,4)-(149,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (149,6)-(149,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (149,6)-(149,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (149,6)-(149,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (149,10)-(149,13)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (149,10)-(149,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (149,10)-(149,11) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (149,12)-(149,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SplatNode (location: (149,12)-(149,13)) + │ │ │ ├── operator_loc: (149,12)-(149,13) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (149,0)-(149,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (149,5)-(149,6) = "(" + │ ├── rparen_loc: (149,7)-(149,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (149,15)-(149,18) = "end" + ├── @ CallNode (location: (151,0)-(151,16)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (151,0)-(151,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (151,4)-(151,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (151,4)-(151,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ CallNode (location: (151,7)-(151,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :Bar + │ │ ├── message_loc: (151,7)-(151,10) = "Bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (151,11)-(151,16)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (151,13)-(151,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (151,13)-(151,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (151,11)-(151,12) = "{" + │ │ └── closing_loc: (151,15)-(151,16) = "}" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LocalVariableWriteNode (location: (153,0)-(153,7)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (153,0)-(153,3) = "foo" + │ ├── value: + │ │ @ IntegerNode (location: (153,6)-(153,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (153,4)-(153,5) = "=" + ├── @ CallNode (location: (154,0)-(154,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (154,0)-(154,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (154,4)-(154,6)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (154,4)-(154,5) = "{" + │ └── closing_loc: (154,5)-(154,6) = "}" + └── @ CallNode (location: (156,0)-(156,19)) + ├── flags: ∅ + ├── receiver: + │ @ InstanceVariableReadNode (location: (156,0)-(156,2)) + │ └── name: :@a + ├── call_operator_loc: (156,2)-(156,3) = "." + ├── name: :b + ├── message_loc: (156,3)-(156,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (156,5)-(156,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (156,5)-(156,19)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (156,5)-(156,19)) + │ ├── key: + │ │ @ InterpolatedSymbolNode (location: (156,5)-(156,16)) + │ │ ├── opening_loc: (156,5)-(156,6) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (156,6)-(156,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (156,6)-(156,7) = "c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "c" + │ │ │ └── @ EmbeddedStatementsNode (location: (156,7)-(156,14)) + │ │ │ ├── opening_loc: (156,7)-(156,9) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (156,9)-(156,13)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (156,9)-(156,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :name + │ │ │ │ ├── message_loc: (156,9)-(156,13) = "name" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (156,13)-(156,14) = "}" + │ │ └── closing_loc: (156,14)-(156,16) = "\":" + │ ├── value: + │ │ @ IntegerNode (location: (156,17)-(156,19)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/methods.txt b/test/mri/prism/snapshots/methods.txt new file mode 100644 index 00000000000..ac21bbaed19 --- /dev/null +++ b/test/mri/prism/snapshots/methods.txt @@ -0,0 +1,2051 @@ +@ ProgramNode (location: (1,0)-(183,37)) +├── locals: [:a, :c, :foo] +└── statements: + @ StatementsNode (location: (1,0)-(183,37)) + └── body: (length: 69) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,18)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :bar + │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :baz + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,17)-(1,18) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,18)-(1,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(5,3)) + │ ├── name: :foo + │ ├── name_loc: (4,4)-(4,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (4,8)-(4,44)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (4,8)-(4,18)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (4,9)-(4,12)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :bar + │ │ │ │ └── @ RequiredParameterNode (location: (4,14)-(4,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :baz + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (4,8)-(4,9) = "(" + │ │ │ └── rparen_loc: (4,17)-(4,18) = ")" + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (4,20)-(4,32)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :optional + │ │ │ ├── name_loc: (4,20)-(4,28) = "optional" + │ │ │ ├── operator_loc: (4,29)-(4,30) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (4,31)-(4,32)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (4,34)-(4,44)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (4,35)-(4,38)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :bin + │ │ │ │ └── @ RequiredParameterNode (location: (4,40)-(4,43)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :bag + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (4,34)-(4,35) = "(" + │ │ │ └── rparen_loc: (4,43)-(4,44) = ")" + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar, :baz, :optional, :bin, :bag] + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (4,7)-(4,8) = "(" + │ ├── rparen_loc: (4,44)-(4,45) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (8,0)-(8,18)) + │ ├── name: :a + │ ├── name_loc: (8,4)-(8,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (8,0)-(8,18)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (8,7)-(8,18)) + │ │ │ ├── ensure_keyword_loc: (8,7)-(8,13) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (8,15)-(8,18) = "end" + │ │ └── end_keyword_loc: (8,15)-(8,18) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,15)-(8,18) = "end" + ├── @ DefNode (location: (10,0)-(11,3)) + │ ├── name: :a + │ ├── name_loc: (10,8)-(10,9) = "a" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (10,4)-(10,7)) + │ │ ├── body: + │ │ │ @ CallNode (location: (10,5)-(10,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (10,5)-(10,6) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (10,4)-(10,5) = "(" + │ │ └── closing_loc: (10,6)-(10,7) = ")" + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (10,0)-(10,3) = "def" + │ ├── operator_loc: (10,7)-(10,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ DefNode (location: (13,0)-(14,3)) + │ ├── name: :b + │ ├── name_loc: (13,9)-(13,10) = "b" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (13,4)-(13,7)) + │ │ ├── body: + │ │ │ @ CallNode (location: (13,5)-(13,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (13,5)-(13,6) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (13,4)-(13,5) = "(" + │ │ └── closing_loc: (13,6)-(13,7) = ")" + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: (13,7)-(13,9) = "::" + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ DefNode (location: (16,0)-(17,3)) + │ ├── name: :a + │ ├── name_loc: (16,10)-(16,11) = "a" + │ ├── receiver: + │ │ @ FalseNode (location: (16,4)-(16,9)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (16,0)-(16,3) = "def" + │ ├── operator_loc: (16,9)-(16,10) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ DefNode (location: (19,0)-(20,3)) + │ ├── name: :a + │ ├── name_loc: (19,4)-(19,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (19,6)-(19,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (19,6)-(19,9)) + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (19,0)-(19,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (19,5)-(19,6) = "(" + │ ├── rparen_loc: (19,9)-(19,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (20,0)-(20,3) = "end" + ├── @ DefNode (location: (22,0)-(23,3)) + │ ├── name: :a + │ ├── name_loc: (22,9)-(22,10) = "a" + │ ├── receiver: + │ │ @ GlobalVariableReadNode (location: (22,4)-(22,8)) + │ │ └── name: :$var + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: (22,8)-(22,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ DefNode (location: (25,0)-(26,3)) + │ ├── name: :b + │ ├── name_loc: (25,6)-(25,7) = "b" + │ ├── receiver: + │ │ @ CallNode (location: (25,4)-(25,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (25,4)-(25,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: (25,5)-(25,6) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (26,0)-(26,3) = "end" + ├── @ DefNode (location: (28,0)-(29,3)) + │ ├── name: :a + │ ├── name_loc: (28,9)-(28,10) = "a" + │ ├── receiver: + │ │ @ InstanceVariableReadNode (location: (28,4)-(28,8)) + │ │ └── name: :@var + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (28,0)-(28,3) = "def" + │ ├── operator_loc: (28,8)-(28,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (29,0)-(29,3) = "end" + ├── @ DefNode (location: (31,0)-(31,13)) + │ ├── name: :a + │ ├── name_loc: (31,4)-(31,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (31,6)-(31,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (31,6)-(31,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ └── name_loc: (31,6)-(31,8) = "b:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (31,0)-(31,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (31,10)-(31,13) = "end" + ├── @ StringNode (location: (33,0)-(33,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (33,0)-(33,2) = "%," + │ ├── content_loc: (33,2)-(33,5) = "abc" + │ ├── closing_loc: (33,5)-(33,6) = "," + │ └── unescaped: "abc" + ├── @ DefNode (location: (35,0)-(36,3)) + │ ├── name: :a + │ ├── name_loc: (35,4)-(35,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (35,6)-(35,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (35,6)-(35,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ └── name_loc: (35,6)-(35,8) = "b:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (35,0)-(35,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (35,5)-(35,6) = "(" + │ ├── rparen_loc: (35,8)-(35,9) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (36,0)-(36,3) = "end" + ├── @ DefNode (location: (38,0)-(39,3)) + │ ├── name: :a + │ ├── name_loc: (38,4)-(38,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (38,6)-(38,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (38,6)-(38,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (38,8)-(38,9) = "b" + │ │ │ └── operator_loc: (38,6)-(38,8) = "**" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (38,0)-(38,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (38,5)-(38,6) = "(" + │ ├── rparen_loc: (38,9)-(38,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (39,0)-(39,3) = "end" + ├── @ DefNode (location: (41,0)-(42,3)) + │ ├── name: :a + │ ├── name_loc: (41,4)-(41,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (41,6)-(41,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (41,6)-(41,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (41,6)-(41,8) = "**" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (41,0)-(41,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (41,5)-(41,6) = "(" + │ ├── rparen_loc: (41,8)-(41,9) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (42,0)-(42,3) = "end" + ├── @ LocalVariableWriteNode (location: (44,0)-(44,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (44,0)-(44,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (44,4)-(44,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (44,2)-(44,3) = "=" + ├── @ DefNode (location: (44,7)-(45,3)) + │ ├── name: :a + │ ├── name_loc: (44,11)-(44,12) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (44,7)-(44,10) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (45,0)-(45,3) = "end" + ├── @ DefNode (location: (47,0)-(48,3)) + │ ├── name: :a + │ ├── name_loc: (47,4)-(47,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (47,6)-(47,13)) + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ RequiredParameterNode (location: (47,6)-(47,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── @ RequiredParameterNode (location: (47,9)-(47,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ └── @ RequiredParameterNode (location: (47,12)-(47,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c, :d] + │ ├── def_keyword_loc: (47,0)-(47,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (48,0)-(48,3) = "end" + ├── @ DefNode (location: (50,0)-(51,3)) + │ ├── name: :a + │ ├── name_loc: (50,8)-(50,9) = "a" + │ ├── receiver: + │ │ @ NilNode (location: (50,4)-(50,7)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (50,0)-(50,3) = "def" + │ ├── operator_loc: (50,7)-(50,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (51,0)-(51,3) = "end" + ├── @ DefNode (location: (53,0)-(54,3)) + │ ├── name: :a + │ ├── name_loc: (53,4)-(53,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (53,6)-(53,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (53,6)-(53,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ └── name_loc: (53,6)-(53,8) = "b:" + │ │ │ └── @ OptionalKeywordParameterNode (location: (53,10)-(53,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (53,10)-(53,12) = "c:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (53,13)-(53,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c] + │ ├── def_keyword_loc: (53,0)-(53,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (54,0)-(54,3) = "end" + ├── @ DefNode (location: (56,0)-(57,3)) + │ ├── name: :a + │ ├── name_loc: (56,4)-(56,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (56,6)-(56,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (56,6)-(56,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ └── name_loc: (56,6)-(56,8) = "b:" + │ │ │ └── @ OptionalKeywordParameterNode (location: (56,10)-(56,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (56,10)-(56,12) = "c:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (56,13)-(56,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c] + │ ├── def_keyword_loc: (56,0)-(56,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (56,5)-(56,6) = "(" + │ ├── rparen_loc: (56,14)-(56,15) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (57,0)-(57,3) = "end" + ├── @ DefNode (location: (59,0)-(61,3)) + │ ├── name: :a + │ ├── name_loc: (59,4)-(59,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (59,6)-(60,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ OptionalKeywordParameterNode (location: (59,6)-(60,3)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (59,6)-(59,8) = "b:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (60,2)-(60,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ RequiredKeywordParameterNode (location: (60,5)-(60,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ └── name_loc: (60,5)-(60,7) = "c:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c] + │ ├── def_keyword_loc: (59,0)-(59,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (59,5)-(59,6) = "(" + │ ├── rparen_loc: (60,7)-(60,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (61,0)-(61,3) = "end" + ├── @ StringNode (location: (63,0)-(63,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (63,0)-(63,2) = "%." + │ ├── content_loc: (63,2)-(63,5) = "abc" + │ ├── closing_loc: (63,5)-(63,6) = "." + │ └── unescaped: "abc" + ├── @ DefNode (location: (65,0)-(66,3)) + │ ├── name: :a + │ ├── name_loc: (65,4)-(65,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (65,6)-(65,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (65,6)-(65,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (65,6)-(65,7) = "b" + │ │ │ │ ├── operator_loc: (65,8)-(65,9) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (65,10)-(65,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ OptionalParameterNode (location: (65,13)-(65,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (65,13)-(65,14) = "c" + │ │ │ ├── operator_loc: (65,15)-(65,16) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (65,17)-(65,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c] + │ ├── def_keyword_loc: (65,0)-(65,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (66,0)-(66,3) = "end" + ├── @ DefNode (location: (68,0)-(69,3)) + │ ├── name: :a + │ ├── name_loc: (68,4)-(68,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (68,0)-(68,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (68,5)-(68,6) = "(" + │ ├── rparen_loc: (68,6)-(68,7) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (69,0)-(69,3) = "end" + ├── @ DefNode (location: (71,0)-(72,3)) + │ ├── name: :a + │ ├── name_loc: (71,4)-(71,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (71,6)-(71,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (71,6)-(71,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (71,9)-(71,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (71,9)-(71,10) = "c" + │ │ │ ├── operator_loc: (71,11)-(71,12) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (71,13)-(71,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :c] + │ ├── def_keyword_loc: (71,0)-(71,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (72,0)-(72,3) = "end" + ├── @ DefNode (location: (74,0)-(75,3)) + │ ├── name: :a + │ ├── name_loc: (74,4)-(74,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (74,6)-(74,7)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (74,6)-(74,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (74,0)-(74,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (75,0)-(75,3) = "end" + ├── @ DefNode (location: (77,0)-(77,32)) + │ ├── name: :a + │ ├── name_loc: (77,4)-(77,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (77,0)-(77,32)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (77,7)-(77,13)) + │ │ │ ├── keyword_loc: (77,7)-(77,13) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (77,15)-(77,27)) + │ │ │ ├── else_keyword_loc: (77,15)-(77,19) = "else" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (77,21)-(77,27) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (77,21)-(77,32)) + │ │ │ ├── ensure_keyword_loc: (77,21)-(77,27) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (77,29)-(77,32) = "end" + │ │ └── end_keyword_loc: (77,29)-(77,32) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (77,0)-(77,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (77,29)-(77,32) = "end" + ├── @ DefNode (location: (79,0)-(80,3)) + │ ├── name: :a + │ ├── name_loc: (79,4)-(79,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (79,6)-(79,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (79,6)-(79,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (79,7)-(79,8) = "b" + │ │ │ └── operator_loc: (79,6)-(79,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (79,0)-(79,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (80,0)-(80,3) = "end" + ├── @ DefNode (location: (82,0)-(83,3)) + │ ├── name: :a + │ ├── name_loc: (82,4)-(82,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (82,6)-(82,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (82,6)-(82,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (82,6)-(82,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (82,0)-(82,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (82,5)-(82,6) = "(" + │ ├── rparen_loc: (82,7)-(82,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (83,0)-(83,3) = "end" + ├── @ DefNode (location: (85,0)-(87,3)) + │ ├── name: :a + │ ├── name_loc: (85,4)-(85,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (86,0)-(86,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (86,0)-(86,5)) + │ │ ├── name: :b + │ │ ├── depth: 0 + │ │ ├── name_loc: (86,0)-(86,1) = "b" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (86,4)-(86,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (86,2)-(86,3) = "=" + │ ├── locals: [:b] + │ ├── def_keyword_loc: (85,0)-(85,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (87,0)-(87,3) = "end" + ├── @ DefNode (location: (89,0)-(90,3)) + │ ├── name: :a + │ ├── name_loc: (89,9)-(89,10) = "a" + │ ├── receiver: + │ │ @ SelfNode (location: (89,4)-(89,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (89,0)-(89,3) = "def" + │ ├── operator_loc: (89,8)-(89,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (90,0)-(90,3) = "end" + ├── @ DefNode (location: (92,0)-(93,3)) + │ ├── name: :a + │ ├── name_loc: (92,9)-(92,10) = "a" + │ ├── receiver: + │ │ @ TrueNode (location: (92,4)-(92,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (92,0)-(92,3) = "def" + │ ├── operator_loc: (92,8)-(92,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (93,0)-(93,3) = "end" + ├── @ DefNode (location: (95,0)-(96,3)) + │ ├── name: :a + │ ├── name_loc: (95,4)-(95,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (95,0)-(95,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (96,0)-(96,3) = "end" + ├── @ DefNode (location: (98,0)-(101,3)) + │ ├── name: :hi + │ ├── name_loc: (98,4)-(98,6) = "hi" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (99,0)-(100,4)) + │ │ └── body: (length: 2) + │ │ ├── @ IfNode (location: (99,0)-(99,18)) + │ │ │ ├── if_keyword_loc: (99,11)-(99,13) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ TrueNode (location: (99,14)-(99,18)) + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (99,0)-(99,10)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ReturnNode (location: (99,0)-(99,10)) + │ │ │ │ ├── keyword_loc: (99,0)-(99,6) = "return" + │ │ │ │ └── arguments: + │ │ │ │ @ ArgumentsNode (location: (99,7)-(99,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (99,7)-(99,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (99,7)-(99,8) = ":" + │ │ │ │ ├── value_loc: (99,8)-(99,10) = "hi" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "hi" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ └── @ SymbolNode (location: (100,0)-(100,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (100,0)-(100,1) = ":" + │ │ ├── value_loc: (100,1)-(100,4) = "bye" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bye" + │ ├── locals: [] + │ ├── def_keyword_loc: (98,0)-(98,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (101,0)-(101,3) = "end" + ├── @ DefNode (location: (103,0)-(103,11)) + │ ├── name: :foo + │ ├── name_loc: (103,4)-(103,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (103,10)-(103,11)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (103,10)-(103,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── locals: [] + │ ├── def_keyword_loc: (103,0)-(103,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (103,8)-(103,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (104,0)-(104,11)) + │ ├── name: :bar + │ ├── name_loc: (104,4)-(104,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (104,10)-(104,11)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (104,10)-(104,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── locals: [] + │ ├── def_keyword_loc: (104,0)-(104,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (104,8)-(104,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (106,0)-(106,18)) + │ ├── name: :foo + │ ├── name_loc: (106,4)-(106,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (106,8)-(106,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (106,8)-(106,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (106,15)-(106,18)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (106,15)-(106,18)) + │ │ ├── flags: decimal + │ │ └── value: 123 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (106,0)-(106,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (106,7)-(106,8) = "(" + │ ├── rparen_loc: (106,11)-(106,12) = ")" + │ ├── equal_loc: (106,13)-(106,14) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (108,0)-(108,13)) + │ ├── name: :foo + │ ├── name_loc: (108,4)-(108,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (108,10)-(108,13)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (108,10)-(108,13)) + │ │ ├── flags: decimal + │ │ └── value: 123 + │ ├── locals: [] + │ ├── def_keyword_loc: (108,0)-(108,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (108,8)-(108,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (110,0)-(110,19)) + │ ├── name: :a + │ ├── name_loc: (110,4)-(110,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (110,6)-(110,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (110,6)-(110,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (110,6)-(110,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (110,10)-(110,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (110,10)-(110,14)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (110,10)-(110,11) = "b" + │ │ ├── opening_loc: (110,11)-(110,12) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (110,12)-(110,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SplatNode (location: (110,12)-(110,13)) + │ │ │ ├── operator_loc: (110,12)-(110,13) = "*" + │ │ │ └── expression: ∅ + │ │ ├── closing_loc: (110,13)-(110,14) = ")" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (110,0)-(110,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (110,5)-(110,6) = "(" + │ ├── rparen_loc: (110,7)-(110,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (110,16)-(110,19) = "end" + ├── @ DefNode (location: (112,0)-(112,23)) + │ ├── name: :a + │ ├── name_loc: (112,4)-(112,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (112,6)-(112,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (112,6)-(112,9)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (112,12)-(112,18)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (112,12)-(112,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (112,12)-(112,13) = "b" + │ │ ├── opening_loc: (112,13)-(112,14) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (112,14)-(112,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (112,14)-(112,17)) + │ │ ├── closing_loc: (112,17)-(112,18) = ")" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (112,0)-(112,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (112,5)-(112,6) = "(" + │ ├── rparen_loc: (112,9)-(112,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (112,20)-(112,23) = "end" + ├── @ DefNode (location: (114,0)-(114,29)) + │ ├── name: :a + │ ├── name_loc: (114,4)-(114,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (114,6)-(114,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (114,6)-(114,9)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (114,12)-(114,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (114,12)-(114,24)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (114,12)-(114,13) = "b" + │ │ ├── opening_loc: (114,13)-(114,14) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (114,14)-(114,23)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (114,14)-(114,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (114,17)-(114,18)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ ForwardingArgumentsNode (location: (114,20)-(114,23)) + │ │ ├── closing_loc: (114,23)-(114,24) = ")" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (114,0)-(114,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (114,5)-(114,6) = "(" + │ ├── rparen_loc: (114,9)-(114,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (114,26)-(114,29) = "end" + ├── @ DefNode (location: (116,0)-(117,3)) + │ ├── name: :a + │ ├── name_loc: (116,12)-(116,13) = "a" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (116,4)-(116,11)) + │ │ ├── body: + │ │ │ @ LocalVariableWriteNode (location: (116,5)-(116,10)) + │ │ │ ├── name: :c + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (116,5)-(116,6) = "c" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (116,9)-(116,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (116,9)-(116,10) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (116,7)-(116,8) = "=" + │ │ ├── opening_loc: (116,4)-(116,5) = "(" + │ │ └── closing_loc: (116,10)-(116,11) = ")" + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (116,0)-(116,3) = "def" + │ ├── operator_loc: (116,11)-(116,12) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (117,0)-(117,3) = "end" + ├── @ DefNode (location: (119,0)-(120,3)) + │ ├── name: :a + │ ├── name_loc: (119,4)-(119,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (119,6)-(119,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (119,6)-(119,8)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (119,7)-(119,8) = "b" + │ │ └── operator_loc: (119,6)-(119,7) = "&" + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (119,0)-(119,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (120,0)-(120,3) = "end" + ├── @ DefNode (location: (122,0)-(123,3)) + │ ├── name: :a + │ ├── name_loc: (122,4)-(122,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (122,6)-(122,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (122,6)-(122,7)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (122,6)-(122,7) = "&" + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (122,0)-(122,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (122,5)-(122,6) = "(" + │ ├── rparen_loc: (122,7)-(122,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (123,0)-(123,3) = "end" + ├── @ DefNode (location: (125,0)-(126,3)) + │ ├── name: :a + │ ├── name_loc: (125,10)-(125,11) = "a" + │ ├── receiver: + │ │ @ ClassVariableReadNode (location: (125,4)-(125,9)) + │ │ └── name: :@@var + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (125,0)-(125,3) = "def" + │ ├── operator_loc: (125,9)-(125,10) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (126,0)-(126,3) = "end" + ├── @ DefNode (location: (128,0)-(129,3)) + │ ├── name: :C + │ ├── name_loc: (128,12)-(128,13) = "C" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (128,4)-(128,11)) + │ │ ├── body: + │ │ │ @ LocalVariableWriteNode (location: (128,5)-(128,10)) + │ │ │ ├── name: :a + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (128,5)-(128,6) = "a" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (128,9)-(128,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (128,9)-(128,10) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (128,7)-(128,8) = "=" + │ │ ├── opening_loc: (128,4)-(128,5) = "(" + │ │ └── closing_loc: (128,10)-(128,11) = ")" + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (128,0)-(128,3) = "def" + │ ├── operator_loc: (128,11)-(128,12) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (129,0)-(129,3) = "end" + ├── @ DefNode (location: (131,0)-(131,28)) + │ ├── name: :Array_function + │ ├── name_loc: (131,9)-(131,23) = "Array_function" + │ ├── receiver: + │ │ @ SelfNode (location: (131,4)-(131,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (131,0)-(131,3) = "def" + │ ├── operator_loc: (131,8)-(131,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (131,25)-(131,28) = "end" + ├── @ ConstantWriteNode (location: (133,0)-(133,9)) + │ ├── name: :Const + │ ├── name_loc: (133,0)-(133,5) = "Const" + │ ├── value: + │ │ @ IntegerNode (location: (133,8)-(133,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (133,6)-(133,7) = "=" + ├── @ DefNode (location: (133,11)-(134,3)) + │ ├── name: :a + │ ├── name_loc: (133,21)-(133,22) = "a" + │ ├── receiver: + │ │ @ ConstantReadNode (location: (133,15)-(133,20)) + │ │ └── name: :Const + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (133,11)-(133,14) = "def" + │ ├── operator_loc: (133,20)-(133,21) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (134,0)-(134,3) = "end" + ├── @ DefNode (location: (136,0)-(136,31)) + │ ├── name: :a + │ ├── name_loc: (136,4)-(136,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (136,6)-(136,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (136,6)-(136,9)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (136,12)-(136,26)) + │ │ └── body: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (136,12)-(136,26)) + │ │ ├── opening_loc: (136,12)-(136,13) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (136,13)-(136,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (136,13)-(136,16) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ └── @ EmbeddedStatementsNode (location: (136,16)-(136,25)) + │ │ │ ├── opening_loc: (136,16)-(136,18) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (136,18)-(136,24)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (136,18)-(136,24)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (136,18)-(136,19) = "b" + │ │ │ │ ├── opening_loc: (136,19)-(136,20) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (136,20)-(136,23)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ ForwardingArgumentsNode (location: (136,20)-(136,23)) + │ │ │ │ ├── closing_loc: (136,23)-(136,24) = ")" + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (136,24)-(136,25) = "}" + │ │ └── closing_loc: (136,25)-(136,26) = "\"" + │ ├── locals: [] + │ ├── def_keyword_loc: (136,0)-(136,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (136,5)-(136,6) = "(" + │ ├── rparen_loc: (136,9)-(136,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (136,28)-(136,31) = "end" + ├── @ DefNode (location: (138,0)-(140,3)) + │ ├── name: :foo + │ ├── name_loc: (138,4)-(138,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (139,2)-(139,30)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (139,2)-(139,30)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ HashNode (location: (139,2)-(139,4)) + │ │ │ ├── opening_loc: (139,2)-(139,3) = "{" + │ │ │ ├── elements: (length: 0) + │ │ │ └── closing_loc: (139,3)-(139,4) = "}" + │ │ ├── call_operator_loc: (139,4)-(139,5) = "." + │ │ ├── name: :merge + │ │ ├── message_loc: (139,5)-(139,10) = "merge" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (139,11)-(139,30)) + │ │ │ ├── flags: contains_keyword_splat + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (139,11)-(139,30)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 3) + │ │ │ ├── @ AssocSplatNode (location: (139,11)-(139,16)) + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (139,13)-(139,16)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :bar + │ │ │ │ │ ├── message_loc: (139,13)-(139,16) = "bar" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: (139,11)-(139,13) = "**" + │ │ │ ├── @ AssocSplatNode (location: (139,18)-(139,23)) + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (139,20)-(139,23)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :baz + │ │ │ │ │ ├── message_loc: (139,20)-(139,23) = "baz" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: (139,18)-(139,20) = "**" + │ │ │ └── @ AssocSplatNode (location: (139,25)-(139,30)) + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (139,27)-(139,30)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :qux + │ │ │ │ ├── message_loc: (139,27)-(139,30) = "qux" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (139,25)-(139,27) = "**" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (138,0)-(138,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (140,0)-(140,3) = "end" + ├── @ DefNode (location: (142,0)-(143,3)) + │ ├── name: :bar + │ ├── name_loc: (142,4)-(142,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (142,8)-(142,19)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (142,8)-(142,19)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (142,8)-(142,10) = "a:" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (142,11)-(142,19)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (142,12)-(142,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (142,12)-(142,18)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (142,12)-(142,13)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (142,16)-(142,18)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (142,13)-(142,16) = "..." + │ │ │ ├── opening_loc: (142,11)-(142,12) = "(" + │ │ │ └── closing_loc: (142,18)-(142,19) = ")" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (142,0)-(142,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (142,7)-(142,8) = "(" + │ ├── rparen_loc: (142,19)-(142,20) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (143,0)-(143,3) = "end" + ├── @ DefNode (location: (145,0)-(146,3)) + │ ├── name: :bar + │ ├── name_loc: (145,4)-(145,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (145,8)-(145,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (145,8)-(145,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (145,8)-(145,10) = "a:" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (145,11)-(145,18)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (145,12)-(145,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (145,12)-(145,17)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (145,15)-(145,17)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (145,12)-(145,15) = "..." + │ │ │ ├── opening_loc: (145,11)-(145,12) = "(" + │ │ │ └── closing_loc: (145,17)-(145,18) = ")" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (145,0)-(145,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (145,7)-(145,8) = "(" + │ ├── rparen_loc: (145,18)-(145,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (146,0)-(146,3) = "end" + ├── @ DefNode (location: (148,0)-(149,3)) + │ ├── name: :bar + │ ├── name_loc: (148,4)-(148,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (148,8)-(148,17)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (148,8)-(148,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (148,8)-(148,10) = "a:" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (148,11)-(148,17)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (148,12)-(148,16)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (148,12)-(148,16)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (148,12)-(148,13)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: ∅ + │ │ │ │ └── operator_loc: (148,13)-(148,16) = "..." + │ │ │ ├── opening_loc: (148,11)-(148,12) = "(" + │ │ │ └── closing_loc: (148,16)-(148,17) = ")" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (148,0)-(148,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (148,7)-(148,8) = "(" + │ ├── rparen_loc: (148,17)-(148,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (149,0)-(149,3) = "end" + ├── @ DefNode (location: (151,0)-(152,3)) + │ ├── name: :bar + │ ├── name_loc: (151,4)-(151,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (151,8)-(151,20)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (151,8)-(151,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (151,8)-(151,9) = "a" + │ │ │ ├── operator_loc: (151,10)-(151,11) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (151,12)-(151,20)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (151,13)-(151,19)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (151,13)-(151,19)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (151,13)-(151,14)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (151,17)-(151,19)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (151,14)-(151,17) = "..." + │ │ │ ├── opening_loc: (151,12)-(151,13) = "(" + │ │ │ └── closing_loc: (151,19)-(151,20) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (151,0)-(151,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (151,7)-(151,8) = "(" + │ ├── rparen_loc: (151,20)-(151,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (152,0)-(152,3) = "end" + ├── @ DefNode (location: (154,0)-(155,3)) + │ ├── name: :bar + │ ├── name_loc: (154,4)-(154,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (154,8)-(154,19)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (154,8)-(154,19)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (154,8)-(154,9) = "a" + │ │ │ ├── operator_loc: (154,10)-(154,11) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (154,12)-(154,19)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (154,13)-(154,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (154,13)-(154,18)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (154,16)-(154,18)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (154,13)-(154,16) = "..." + │ │ │ ├── opening_loc: (154,12)-(154,13) = "(" + │ │ │ └── closing_loc: (154,18)-(154,19) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (154,0)-(154,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (154,7)-(154,8) = "(" + │ ├── rparen_loc: (154,19)-(154,20) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (155,0)-(155,3) = "end" + ├── @ DefNode (location: (157,0)-(158,3)) + │ ├── name: :bar + │ ├── name_loc: (157,4)-(157,7) = "bar" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (157,8)-(157,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (157,8)-(157,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (157,8)-(157,9) = "a" + │ │ │ ├── operator_loc: (157,10)-(157,11) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (157,12)-(157,18)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (157,13)-(157,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RangeNode (location: (157,13)-(157,17)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (157,13)-(157,14)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: ∅ + │ │ │ │ └── operator_loc: (157,14)-(157,17) = "..." + │ │ │ ├── opening_loc: (157,12)-(157,13) = "(" + │ │ │ └── closing_loc: (157,17)-(157,18) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (157,0)-(157,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (157,7)-(157,8) = "(" + │ ├── rparen_loc: (157,18)-(157,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (158,0)-(158,3) = "end" + ├── @ DefNode (location: (160,0)-(162,3)) + │ ├── name: :method + │ ├── name_loc: (160,4)-(160,10) = "method" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (160,11)-(160,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (160,11)-(160,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (161,2)-(161,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (161,2)-(161,14)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (161,2)-(161,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :item + │ │ │ ├── message_loc: (161,2)-(161,6) = "item" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :>> + │ │ ├── message_loc: (161,7)-(161,9) = ">>" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (161,10)-(161,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (161,10)-(161,14)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (161,10)-(161,11) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (161,12)-(161,14)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (161,12)-(161,13) = "{" + │ │ │ └── closing_loc: (161,13)-(161,14) = "}" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (160,0)-(160,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (160,10)-(160,11) = "(" + │ ├── rparen_loc: (160,12)-(160,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (162,0)-(162,3) = "end" + ├── @ LocalVariableWriteNode (location: (164,0)-(164,7)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (164,0)-(164,3) = "foo" + │ ├── value: + │ │ @ IntegerNode (location: (164,6)-(164,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (164,4)-(164,5) = "=" + ├── @ DefNode (location: (165,0)-(165,16)) + │ ├── name: :bar + │ ├── name_loc: (165,8)-(165,11) = "bar" + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (165,4)-(165,7)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (165,0)-(165,3) = "def" + │ ├── operator_loc: (165,7)-(165,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (165,13)-(165,16) = "end" + ├── @ DefNode (location: (167,0)-(167,18)) + │ ├── name: :f + │ ├── name_loc: (167,4)-(167,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (167,6)-(167,7)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (167,6)-(167,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (167,6)-(167,7) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (167,10)-(167,13)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (167,10)-(167,13)) + │ │ ├── flags: contains_splat + │ │ ├── elements: (length: 1) + │ │ │ └── @ SplatNode (location: (167,11)-(167,12)) + │ │ │ ├── operator_loc: (167,11)-(167,12) = "*" + │ │ │ └── expression: ∅ + │ │ ├── opening_loc: (167,10)-(167,11) = "[" + │ │ └── closing_loc: (167,12)-(167,13) = "]" + │ ├── locals: [] + │ ├── def_keyword_loc: (167,0)-(167,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (167,5)-(167,6) = "(" + │ ├── rparen_loc: (167,7)-(167,8) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (167,15)-(167,18) = "end" + ├── @ DefNode (location: (169,0)-(169,15)) + │ ├── name: :f + │ ├── name_loc: (169,4)-(169,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (169,6)-(169,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (169,6)-(169,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (169,6)-(169,8) = "x:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (169,8)-(169,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (169,9)-(169,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (169,9)-(169,10) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :-@ + │ │ │ ├── message_loc: (169,8)-(169,9) = "-" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (169,0)-(169,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (169,12)-(169,15) = "end" + ├── @ DefNode (location: (171,0)-(171,15)) + │ ├── name: :f + │ ├── name_loc: (171,4)-(171,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (171,6)-(171,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (171,6)-(171,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (171,6)-(171,8) = "x:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (171,8)-(171,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (171,9)-(171,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (171,9)-(171,10) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+@ + │ │ │ ├── message_loc: (171,8)-(171,9) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (171,0)-(171,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (171,12)-(171,15) = "end" + ├── @ DefNode (location: (173,0)-(173,15)) + │ ├── name: :f + │ ├── name_loc: (173,4)-(173,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (173,6)-(173,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (173,6)-(173,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (173,6)-(173,8) = "x:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (173,8)-(173,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (173,9)-(173,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (173,9)-(173,10) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :! + │ │ │ ├── message_loc: (173,8)-(173,9) = "!" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (173,0)-(173,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (173,12)-(173,15) = "end" + ├── @ DefNode (location: (175,0)-(175,20)) + │ ├── name: :foo + │ ├── name_loc: (175,4)-(175,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (175,8)-(175,15)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (175,8)-(175,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (175,8)-(175,10) = "x:" + │ │ │ └── value: + │ │ │ @ StringNode (location: (175,10)-(175,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (175,10)-(175,12) = "%(" + │ │ │ ├── content_loc: (175,12)-(175,14) = "xx" + │ │ │ ├── closing_loc: (175,14)-(175,15) = ")" + │ │ │ └── unescaped: "xx" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (175,0)-(175,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (175,17)-(175,20) = "end" + ├── @ DefNode (location: (177,0)-(179,3)) + │ ├── name: :foo + │ ├── name_loc: (177,4)-(177,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (177,8)-(177,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (177,8)-(177,11)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (178,2)-(178,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (178,2)-(178,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (178,2)-(178,5) = "bar" + │ │ ├── opening_loc: (178,5)-(178,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (178,7)-(178,8) = ")" + │ │ └── block: + │ │ @ BlockArgumentNode (location: (178,6)-(178,7)) + │ │ ├── expression: ∅ + │ │ └── operator_loc: (178,6)-(178,7) = "&" + │ ├── locals: [] + │ ├── def_keyword_loc: (177,0)-(177,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (177,7)-(177,8) = "(" + │ ├── rparen_loc: (177,11)-(177,12) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (179,0)-(179,3) = "end" + ├── @ DefNode (location: (181,0)-(181,42)) + │ ├── name: :foo + │ ├── name_loc: (181,4)-(181,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (181,8)-(181,37)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (181,8)-(181,37)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (181,8)-(181,11) = "bar" + │ │ │ ├── operator_loc: (181,12)-(181,13) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (181,14)-(181,37)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (181,15)-(181,36)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ DefNode (location: (181,15)-(181,33)) + │ │ │ │ │ ├── name: :baz + │ │ │ │ │ ├── name_loc: (181,19)-(181,22) = "baz" + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ @ ParametersNode (location: (181,23)-(181,26)) + │ │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (181,23)-(181,26)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :bar + │ │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ ├── body: + │ │ │ │ │ │ @ StatementsNode (location: (181,30)-(181,33)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ LocalVariableReadNode (location: (181,30)-(181,33)) + │ │ │ │ │ │ ├── name: :bar + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ ├── locals: [:bar] + │ │ │ │ │ ├── def_keyword_loc: (181,15)-(181,18) = "def" + │ │ │ │ │ ├── operator_loc: ∅ + │ │ │ │ │ ├── lparen_loc: (181,22)-(181,23) = "(" + │ │ │ │ │ ├── rparen_loc: (181,26)-(181,27) = ")" + │ │ │ │ │ ├── equal_loc: (181,28)-(181,29) = "=" + │ │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ │ └── @ IntegerNode (location: (181,35)-(181,36)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (181,14)-(181,15) = "(" + │ │ │ └── closing_loc: (181,36)-(181,37) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (181,41)-(181,42)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (181,41)-(181,42)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (181,0)-(181,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (181,7)-(181,8) = "(" + │ ├── rparen_loc: (181,37)-(181,38) = ")" + │ ├── equal_loc: (181,39)-(181,40) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (183,0)-(183,37)) + ├── name: :foo + ├── name_loc: (183,21)-(183,24) = "foo" + ├── receiver: + │ @ ParenthesesNode (location: (183,4)-(183,20)) + │ ├── body: + │ │ @ ClassNode (location: (183,5)-(183,19)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (183,5)-(183,10) = "class" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (183,11)-(183,14)) + │ │ │ └── name: :Foo + │ │ ├── inheritance_operator_loc: ∅ + │ │ ├── superclass: ∅ + │ │ ├── body: ∅ + │ │ ├── end_keyword_loc: (183,16)-(183,19) = "end" + │ │ └── name: :Foo + │ ├── opening_loc: (183,4)-(183,5) = "(" + │ └── closing_loc: (183,19)-(183,20) = ")" + ├── parameters: + │ @ ParametersNode (location: (183,25)-(183,32)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (183,25)-(183,32)) + │ │ ├── flags: ∅ + │ │ ├── name: :bar + │ │ ├── name_loc: (183,25)-(183,28) = "bar" + │ │ ├── operator_loc: (183,29)-(183,30) = "=" + │ │ └── value: + │ │ @ IntegerNode (location: (183,31)-(183,32)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (183,36)-(183,37)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (183,36)-(183,37)) + │ ├── flags: decimal + │ └── value: 2 + ├── locals: [:bar] + ├── def_keyword_loc: (183,0)-(183,3) = "def" + ├── operator_loc: (183,20)-(183,21) = "." + ├── lparen_loc: (183,24)-(183,25) = "(" + ├── rparen_loc: (183,32)-(183,33) = ")" + ├── equal_loc: (183,34)-(183,35) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/modules.txt b/test/mri/prism/snapshots/modules.txt new file mode 100644 index 00000000000..aef3875d74d --- /dev/null +++ b/test/mri/prism/snapshots/modules.txt @@ -0,0 +1,183 @@ +@ ProgramNode (location: (1,0)-(18,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(18,3)) + └── body: (length: 7) + ├── @ ModuleNode (location: (1,0)-(1,18)) + │ ├── locals: [:a] + │ ├── module_keyword_loc: (1,0)-(1,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,7)-(1,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (1,9)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (1,9)-(1,14)) + │ │ ├── name: :a + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,9)-(1,10) = "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (1,11)-(1,12) = "=" + │ ├── end_keyword_loc: (1,15)-(1,18) = "end" + │ └── name: :A + ├── @ InterpolatedStringNode (location: (3,0)-(3,18)) + │ ├── opening_loc: (3,0)-(3,3) = "%Q{" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (3,3)-(3,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,3)-(3,7) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ ├── @ EmbeddedStatementsNode (location: (3,7)-(3,13)) + │ │ │ ├── opening_loc: (3,7)-(3,9) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,9)-(3,12)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,9)-(3,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bbb + │ │ │ │ ├── message_loc: (3,9)-(3,12) = "bbb" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (3,12)-(3,13) = "}" + │ │ └── @ StringNode (location: (3,13)-(3,17)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,13)-(3,17) = " ccc" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " ccc" + │ └── closing_loc: (3,17)-(3,18) = "}" + ├── @ ModuleNode (location: (5,0)-(6,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (5,0)-(5,6) = "module" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (5,7)-(5,11)) + │ │ ├── parent: + │ │ │ @ CallNode (location: (5,7)-(5,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :m + │ │ │ ├── message_loc: (5,7)-(5,8) = "m" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (5,10)-(5,11)) + │ │ │ └── name: :M + │ │ └── delimiter_loc: (5,8)-(5,10) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (6,0)-(6,3) = "end" + │ └── name: :M + ├── @ ModuleNode (location: (8,0)-(9,19)) + │ ├── locals: [:x] + │ ├── module_keyword_loc: (8,0)-(8,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (8,7)-(8,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ BeginNode (location: (8,0)-(9,19)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (9,1)-(9,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (9,1)-(9,6)) + │ │ │ ├── name: :x + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (9,1)-(9,2) = "x" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (9,5)-(9,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (9,3)-(9,4) = "=" + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (9,8)-(9,14)) + │ │ │ ├── keyword_loc: (9,8)-(9,14) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (9,16)-(9,19) = "end" + │ ├── end_keyword_loc: (9,16)-(9,19) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (11,0)-(12,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (11,0)-(11,6) = "module" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (11,7)-(11,10)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (11,9)-(11,10)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (11,7)-(11,9) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (12,0)-(12,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (14,0)-(15,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (14,0)-(14,6) = "module" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (14,7)-(14,13)) + │ │ ├── parent: + │ │ │ @ CallNode (location: (14,7)-(14,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ ConstantReadNode (location: (14,7)-(14,8)) + │ │ │ │ └── name: :A + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :[] + │ │ │ ├── message_loc: (14,8)-(14,10) = "[]" + │ │ │ ├── opening_loc: (14,8)-(14,9) = "[" + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: (14,9)-(14,10) = "]" + │ │ │ └── block: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (14,12)-(14,13)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (14,10)-(14,12) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (15,0)-(15,3) = "end" + │ └── name: :B + └── @ ModuleNode (location: (17,0)-(18,3)) + ├── locals: [] + ├── module_keyword_loc: (17,0)-(17,6) = "module" + ├── constant_path: + │ @ ConstantPathNode (location: (17,7)-(17,14)) + │ ├── parent: + │ │ @ CallNode (location: (17,7)-(17,11)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ ConstantReadNode (location: (17,7)-(17,8)) + │ │ │ └── name: :A + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :[] + │ │ ├── message_loc: (17,8)-(17,11) = "[1]" + │ │ ├── opening_loc: (17,8)-(17,9) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (17,9)-(17,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (17,9)-(17,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (17,10)-(17,11) = "]" + │ │ └── block: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (17,13)-(17,14)) + │ │ └── name: :B + │ └── delimiter_loc: (17,11)-(17,13) = "::" + ├── body: ∅ + ├── end_keyword_loc: (18,0)-(18,3) = "end" + └── name: :B diff --git a/test/mri/prism/snapshots/multi_write.txt b/test/mri/prism/snapshots/multi_write.txt new file mode 100644 index 00000000000..d313801fdb2 --- /dev/null +++ b/test/mri/prism/snapshots/multi_write.txt @@ -0,0 +1,93 @@ +@ ProgramNode (location: (1,0)-(4,26)) +├── locals: [:foo, :bar] +└── statements: + @ StatementsNode (location: (1,0)-(4,26)) + └── body: (length: 4) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,18)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,3) = "foo" + │ ├── value: + │ │ @ RescueModifierNode (location: (1,6)-(1,18)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_loc: (1,8)-(1,14) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (1,15)-(1,18)) + │ └── operator_loc: (1,4)-(1,5) = "=" + ├── @ MultiWriteNode (location: (2,0)-(2,23)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (2,0)-(2,3)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (2,5)-(2,8)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (2,9)-(2,10) = "=" + │ └── value: + │ @ RescueModifierNode (location: (2,11)-(2,23)) + │ ├── expression: + │ │ @ IntegerNode (location: (2,11)-(2,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_loc: (2,13)-(2,19) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (2,20)-(2,23)) + ├── @ RescueModifierNode (location: (3,0)-(3,21)) + │ ├── expression: + │ │ @ LocalVariableWriteNode (location: (3,0)-(3,10)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (3,0)-(3,3) = "foo" + │ │ ├── value: + │ │ │ @ ArrayNode (location: (3,6)-(3,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ IntegerNode (location: (3,9)-(3,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ └── operator_loc: (3,4)-(3,5) = "=" + │ ├── keyword_loc: (3,11)-(3,17) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (3,18)-(3,21)) + └── @ MultiWriteNode (location: (4,0)-(4,26)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (4,0)-(4,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (4,5)-(4,8)) + │ ├── name: :bar + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (4,9)-(4,10) = "=" + └── value: + @ RescueModifierNode (location: (4,11)-(4,26)) + ├── expression: + │ @ ArrayNode (location: (4,11)-(4,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (4,11)-(4,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (4,14)-(4,15)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── keyword_loc: (4,16)-(4,22) = "rescue" + └── rescue_expression: + @ NilNode (location: (4,23)-(4,26)) diff --git a/test/mri/prism/snapshots/newline_terminated.txt b/test/mri/prism/snapshots/newline_terminated.txt new file mode 100644 index 00000000000..6a3b28dba98 --- /dev/null +++ b/test/mri/prism/snapshots/newline_terminated.txt @@ -0,0 +1,107 @@ +@ ProgramNode (location: (3,0)-(41,0)) +├── locals: [] +└── statements: + @ StatementsNode (location: (3,0)-(41,0)) + └── body: (length: 17) + ├── @ StringNode (location: (3,0)-(3,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (3,0)-(3,2) = "% " + │ ├── content_loc: (3,2)-(3,5) = "abc" + │ ├── closing_loc: (3,5)-(3,6) = " " + │ └── unescaped: "abc" + ├── @ StringNode (location: (4,0)-(4,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (4,0)-(4,2) = "%\t" + │ ├── content_loc: (4,2)-(4,5) = "abc" + │ ├── closing_loc: (4,5)-(4,6) = "\t" + │ └── unescaped: "abc" + ├── @ StringNode (location: (5,0)-(5,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (5,0)-(5,2) = "%\v" + │ ├── content_loc: (5,2)-(5,5) = "abc" + │ ├── closing_loc: (5,5)-(5,6) = "\v" + │ └── unescaped: "abc" + ├── @ StringNode (location: (6,0)-(6,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (6,0)-(6,2) = "%\r" + │ ├── content_loc: (6,2)-(6,5) = "abc" + │ ├── closing_loc: (6,5)-(6,6) = "\r" + │ └── unescaped: "abc" + ├── @ StringNode (location: (7,0)-(9,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(8,0) = "%\n" + │ ├── content_loc: (8,0)-(8,3) = "abc" + │ ├── closing_loc: (8,3)-(9,0) = "\n" + │ └── unescaped: "abc" + ├── @ StringNode (location: (10,0)-(10,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (10,0)-(10,2) = "%\u0000" + │ ├── content_loc: (10,2)-(10,5) = "abc" + │ ├── closing_loc: (10,5)-(10,6) = "\u0000" + │ └── unescaped: "abc" + ├── @ StringNode (location: (11,0)-(13,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (11,0)-(12,0) = "%\n" + │ ├── content_loc: (12,0)-(12,3) = "abc" + │ ├── closing_loc: (12,3)-(13,0) = "\n" + │ └── unescaped: "abc" + ├── @ StringNode (location: (14,0)-(16,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (14,0)-(15,0) = "%\n" + │ ├── content_loc: (15,0)-(15,4) = "\rabc" + │ ├── closing_loc: (15,4)-(16,0) = "\n" + │ └── unescaped: "\rabc" + ├── @ StringNode (location: (17,0)-(19,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (17,0)-(18,0) = "%\n" + │ ├── content_loc: (18,0)-(18,4) = "\rabc" + │ ├── closing_loc: (18,4)-(19,0) = "\n" + │ └── unescaped: "\rabc" + ├── @ StringNode (location: (20,0)-(22,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (20,0)-(21,0) = "%\n" + │ ├── content_loc: (21,0)-(21,3) = "abc" + │ ├── closing_loc: (21,3)-(22,0) = "\n" + │ └── unescaped: "abc" + ├── @ StringNode (location: (23,0)-(23,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (23,0)-(23,2) = "%\r" + │ ├── content_loc: (23,2)-(23,5) = "abc" + │ ├── closing_loc: (23,5)-(23,6) = "\r" + │ └── unescaped: "abc" + ├── @ StringNode (location: (24,0)-(26,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (24,0)-(25,0) = "%\n" + │ ├── content_loc: (25,0)-(25,3) = "abc" + │ ├── closing_loc: (25,3)-(26,0) = "\n" + │ └── unescaped: "abc" + ├── @ StringNode (location: (27,0)-(29,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (27,0)-(28,0) = "%\n" + │ ├── content_loc: (28,0)-(28,3) = "abc" + │ ├── closing_loc: (28,3)-(29,0) = "\n" + │ └── unescaped: "abc" + ├── @ StringNode (location: (30,0)-(32,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (30,0)-(31,0) = "%\n" + │ ├── content_loc: (31,0)-(31,3) = "foo" + │ ├── closing_loc: (31,3)-(32,0) = "\n" + │ └── unescaped: "foo" + ├── @ StringNode (location: (33,0)-(35,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (33,0)-(34,0) = "%q\n" + │ ├── content_loc: (34,0)-(34,3) = "foo" + │ ├── closing_loc: (34,3)-(35,0) = "\n" + │ └── unescaped: "foo" + ├── @ StringNode (location: (36,0)-(38,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (36,0)-(37,0) = "%Q\n" + │ ├── content_loc: (37,0)-(37,3) = "foo" + │ ├── closing_loc: (37,3)-(38,0) = "\n" + │ └── unescaped: "foo" + └── @ RegularExpressionNode (location: (39,0)-(41,0)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (39,0)-(40,0) = "%r\n" + ├── content_loc: (40,0)-(40,3) = "foo" + ├── closing_loc: (40,3)-(41,0) = "\n" + └── unescaped: "foo" diff --git a/test/mri/prism/snapshots/next.txt b/test/mri/prism/snapshots/next.txt new file mode 100644 index 00000000000..64ec3ebc91a --- /dev/null +++ b/test/mri/prism/snapshots/next.txt @@ -0,0 +1,149 @@ +@ ProgramNode (location: (1,0)-(24,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(24,7)) + └── body: (length: 11) + ├── @ NextNode (location: (1,0)-(1,4)) + │ ├── arguments: ∅ + │ └── keyword_loc: (1,0)-(1,4) = "next" + ├── @ NextNode (location: (3,0)-(3,18)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,5)-(3,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ ParenthesesNode (location: (3,5)-(3,8)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,6)-(3,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (3,5)-(3,6) = "(" + │ │ │ └── closing_loc: (3,7)-(3,8) = ")" + │ │ ├── @ ParenthesesNode (location: (3,10)-(3,13)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,11)-(3,12)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,11)-(3,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: (3,10)-(3,11) = "(" + │ │ │ └── closing_loc: (3,12)-(3,13) = ")" + │ │ └── @ ParenthesesNode (location: (3,15)-(3,18)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,16)-(3,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,16)-(3,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: (3,15)-(3,16) = "(" + │ │ └── closing_loc: (3,17)-(3,18) = ")" + │ └── keyword_loc: (3,0)-(3,4) = "next" + ├── @ NextNode (location: (5,0)-(5,6)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,5)-(5,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,5)-(5,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── keyword_loc: (5,0)-(5,4) = "next" + ├── @ NextNode (location: (7,0)-(8,1)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,5)-(8,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (7,5)-(7,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (7,8)-(7,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (8,0)-(8,1)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── keyword_loc: (7,0)-(7,4) = "next" + ├── @ NextNode (location: (10,0)-(10,12)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (10,5)-(10,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (10,5)-(10,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (10,8)-(10,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (10,11)-(10,12)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── keyword_loc: (10,0)-(10,4) = "next" + ├── @ NextNode (location: (12,0)-(12,14)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (12,5)-(12,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ArrayNode (location: (12,5)-(12,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 3) + │ │ │ ├── @ IntegerNode (location: (12,6)-(12,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (12,9)-(12,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (12,12)-(12,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: (12,5)-(12,6) = "[" + │ │ └── closing_loc: (12,13)-(12,14) = "]" + │ └── keyword_loc: (12,0)-(12,4) = "next" + ├── @ NextNode (location: (14,0)-(17,1)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (14,4)-(17,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (14,4)-(17,1)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (15,2)-(16,3)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (14,4)-(14,5) = "(" + │ │ └── closing_loc: (17,0)-(17,1) = ")" + │ └── keyword_loc: (14,0)-(14,4) = "next" + ├── @ NextNode (location: (19,0)-(19,4)) + │ ├── arguments: ∅ + │ └── keyword_loc: (19,0)-(19,4) = "next" + ├── @ IntegerNode (location: (20,0)-(20,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ NextNode (location: (22,0)-(22,6)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (22,4)-(22,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (22,4)-(22,6)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (22,4)-(22,5) = "(" + │ │ └── closing_loc: (22,5)-(22,6) = ")" + │ └── keyword_loc: (22,0)-(22,4) = "next" + └── @ NextNode (location: (24,0)-(24,7)) + ├── arguments: + │ @ ArgumentsNode (location: (24,4)-(24,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (24,4)-(24,7)) + │ ├── body: + │ │ @ StatementsNode (location: (24,5)-(24,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (24,5)-(24,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (24,4)-(24,5) = "(" + │ └── closing_loc: (24,6)-(24,7) = ")" + └── keyword_loc: (24,0)-(24,4) = "next" diff --git a/test/mri/prism/snapshots/nils.txt b/test/mri/prism/snapshots/nils.txt new file mode 100644 index 00000000000..f72745560fe --- /dev/null +++ b/test/mri/prism/snapshots/nils.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(12,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(12,11)) + └── body: (length: 5) + ├── @ NilNode (location: (1,0)-(1,3)) + ├── @ ParenthesesNode (location: (3,0)-(3,2)) + │ ├── body: ∅ + │ ├── opening_loc: (3,0)-(3,1) = "(" + │ └── closing_loc: (3,1)-(3,2) = ")" + ├── @ ParenthesesNode (location: (5,0)-(8,1)) + │ ├── body: ∅ + │ ├── opening_loc: (5,0)-(5,1) = "(" + │ └── closing_loc: (8,0)-(8,1) = ")" + ├── @ PostExecutionNode (location: (10,0)-(10,9)) + │ ├── statements: + │ │ @ StatementsNode (location: (10,6)-(10,7)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (10,6)-(10,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_loc: (10,0)-(10,3) = "END" + │ ├── opening_loc: (10,4)-(10,5) = "{" + │ └── closing_loc: (10,8)-(10,9) = "}" + └── @ PreExecutionNode (location: (12,0)-(12,11)) + ├── statements: + │ @ StatementsNode (location: (12,8)-(12,9)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (12,8)-(12,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── keyword_loc: (12,0)-(12,5) = "BEGIN" + ├── opening_loc: (12,6)-(12,7) = "{" + └── closing_loc: (12,10)-(12,11) = "}" diff --git a/test/mri/prism/snapshots/non_alphanumeric_methods.txt b/test/mri/prism/snapshots/non_alphanumeric_methods.txt new file mode 100644 index 00000000000..2ed66fe0e2e --- /dev/null +++ b/test/mri/prism/snapshots/non_alphanumeric_methods.txt @@ -0,0 +1,503 @@ +@ ProgramNode (location: (1,0)-(105,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(105,3)) + └── body: (length: 36) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :! + │ ├── name_loc: (1,4)-(1,5) = "!" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(5,3)) + │ ├── name: :!= + │ ├── name_loc: (4,4)-(4,6) = "!=" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (7,0)-(8,3)) + │ ├── name: :!~ + │ ├── name_loc: (7,4)-(7,6) = "!~" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,0)-(8,3) = "end" + ├── @ DefNode (location: (10,0)-(11,3)) + │ ├── name: :% + │ ├── name_loc: (10,4)-(10,5) = "%" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (10,0)-(10,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ DefNode (location: (13,0)-(14,3)) + │ ├── name: :+ + │ ├── name_loc: (13,9)-(13,10) = "+" + │ ├── receiver: + │ │ @ SelfNode (location: (13,4)-(13,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: (13,8)-(13,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ DefNode (location: (16,0)-(17,3)) + │ ├── name: :& + │ ├── name_loc: (16,4)-(16,5) = "&" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (16,0)-(16,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ DefNode (location: (19,0)-(20,3)) + │ ├── name: :* + │ ├── name_loc: (19,4)-(19,5) = "*" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (19,0)-(19,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (20,0)-(20,3) = "end" + ├── @ DefNode (location: (22,0)-(23,3)) + │ ├── name: :** + │ ├── name_loc: (22,4)-(22,6) = "**" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ StringNode (location: (25,0)-(25,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (25,0)-(25,2) = "%|" + │ ├── content_loc: (25,2)-(25,5) = "abc" + │ ├── closing_loc: (25,5)-(25,6) = "|" + │ └── unescaped: "abc" + ├── @ DefNode (location: (27,0)-(28,3)) + │ ├── name: :+ + │ ├── name_loc: (27,4)-(27,5) = "+" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (27,6)-(27,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (27,6)-(27,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (27,8)-(27,9) = "b" + │ │ │ └── operator_loc: (27,6)-(27,8) = "**" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (27,0)-(27,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (28,0)-(28,3) = "end" + ├── @ DefNode (location: (30,0)-(31,3)) + │ ├── name: :+ + │ ├── name_loc: (30,4)-(30,5) = "+" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (30,0)-(30,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (30,5)-(30,6) = "(" + │ ├── rparen_loc: (30,6)-(30,7) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (31,0)-(31,3) = "end" + ├── @ DefNode (location: (33,0)-(34,3)) + │ ├── name: :+ + │ ├── name_loc: (33,4)-(33,5) = "+" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (33,6)-(33,7)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (33,6)-(33,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (33,0)-(33,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (34,0)-(34,3) = "end" + ├── @ DefNode (location: (36,0)-(37,3)) + │ ├── name: :+ + │ ├── name_loc: (36,9)-(36,10) = "+" + │ ├── receiver: + │ │ @ SelfNode (location: (36,4)-(36,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (36,0)-(36,3) = "def" + │ ├── operator_loc: (36,8)-(36,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (37,0)-(37,3) = "end" + ├── @ DefNode (location: (39,0)-(40,3)) + │ ├── name: :+ + │ ├── name_loc: (39,4)-(39,5) = "+" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (39,0)-(39,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (40,0)-(40,3) = "end" + ├── @ DefNode (location: (42,0)-(43,3)) + │ ├── name: :+@ + │ ├── name_loc: (42,4)-(42,6) = "+@" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (42,0)-(42,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (43,0)-(43,3) = "end" + ├── @ DefNode (location: (45,0)-(46,3)) + │ ├── name: :- + │ ├── name_loc: (45,4)-(45,5) = "-" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (45,0)-(45,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (46,0)-(46,3) = "end" + ├── @ DefNode (location: (48,0)-(48,11)) + │ ├── name: :- + │ ├── name_loc: (48,6)-(48,7) = "-" + │ ├── receiver: + │ │ @ CallNode (location: (48,4)-(48,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (48,4)-(48,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (48,0)-(48,3) = "def" + │ ├── operator_loc: (48,5)-(48,6) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (48,8)-(48,11) = "end" + ├── @ DefNode (location: (50,0)-(51,3)) + │ ├── name: :-@ + │ ├── name_loc: (50,4)-(50,6) = "-@" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (50,0)-(50,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (51,0)-(51,3) = "end" + ├── @ DefNode (location: (53,0)-(54,3)) + │ ├── name: :/ + │ ├── name_loc: (53,4)-(53,5) = "/" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (53,0)-(53,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (54,0)-(54,3) = "end" + ├── @ DefNode (location: (56,0)-(57,3)) + │ ├── name: :< + │ ├── name_loc: (56,4)-(56,5) = "<" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (56,0)-(56,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (57,0)-(57,3) = "end" + ├── @ DefNode (location: (59,0)-(60,3)) + │ ├── name: :<< + │ ├── name_loc: (59,4)-(59,6) = "<<" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (59,0)-(59,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (60,0)-(60,3) = "end" + ├── @ DefNode (location: (62,0)-(63,3)) + │ ├── name: :<= + │ ├── name_loc: (62,4)-(62,6) = "<=" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (62,0)-(62,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (63,0)-(63,3) = "end" + ├── @ DefNode (location: (65,0)-(66,3)) + │ ├── name: :<=> + │ ├── name_loc: (65,4)-(65,7) = "<=>" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (65,0)-(65,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (66,0)-(66,3) = "end" + ├── @ DefNode (location: (68,0)-(69,3)) + │ ├── name: :== + │ ├── name_loc: (68,4)-(68,6) = "==" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (68,0)-(68,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (69,0)-(69,3) = "end" + ├── @ DefNode (location: (71,0)-(72,3)) + │ ├── name: :=== + │ ├── name_loc: (71,4)-(71,7) = "===" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (71,0)-(71,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (72,0)-(72,3) = "end" + ├── @ DefNode (location: (74,0)-(75,3)) + │ ├── name: :=~ + │ ├── name_loc: (74,4)-(74,6) = "=~" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (74,0)-(74,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (75,0)-(75,3) = "end" + ├── @ DefNode (location: (77,0)-(78,3)) + │ ├── name: :> + │ ├── name_loc: (77,4)-(77,5) = ">" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (77,0)-(77,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (78,0)-(78,3) = "end" + ├── @ DefNode (location: (80,0)-(81,3)) + │ ├── name: :>= + │ ├── name_loc: (80,4)-(80,6) = ">=" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (80,0)-(80,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (81,0)-(81,3) = "end" + ├── @ DefNode (location: (83,0)-(84,3)) + │ ├── name: :>> + │ ├── name_loc: (83,4)-(83,6) = ">>" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (83,0)-(83,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (84,0)-(84,3) = "end" + ├── @ DefNode (location: (86,0)-(87,3)) + │ ├── name: :[] + │ ├── name_loc: (86,4)-(86,6) = "[]" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (86,0)-(86,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (87,0)-(87,3) = "end" + ├── @ DefNode (location: (89,0)-(90,3)) + │ ├── name: :[]= + │ ├── name_loc: (89,4)-(89,7) = "[]=" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (89,0)-(89,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (90,0)-(90,3) = "end" + ├── @ DefNode (location: (92,0)-(93,3)) + │ ├── name: :^ + │ ├── name_loc: (92,4)-(92,5) = "^" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (92,0)-(92,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (93,0)-(93,3) = "end" + ├── @ DefNode (location: (95,0)-(96,3)) + │ ├── name: :` + │ ├── name_loc: (95,4)-(95,5) = "`" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (95,0)-(95,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (96,0)-(96,3) = "end" + ├── @ DefNode (location: (98,0)-(99,3)) + │ ├── name: :` + │ ├── name_loc: (98,9)-(98,10) = "`" + │ ├── receiver: + │ │ @ SelfNode (location: (98,4)-(98,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (98,0)-(98,3) = "def" + │ ├── operator_loc: (98,8)-(98,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (99,0)-(99,3) = "end" + ├── @ DefNode (location: (101,0)-(102,3)) + │ ├── name: :| + │ ├── name_loc: (101,4)-(101,5) = "|" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (101,0)-(101,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (102,0)-(102,3) = "end" + └── @ DefNode (location: (104,0)-(105,3)) + ├── name: :~ + ├── name_loc: (104,4)-(104,5) = "~" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (104,0)-(104,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (105,0)-(105,3) = "end" diff --git a/test/mri/prism/snapshots/not.txt b/test/mri/prism/snapshots/not.txt new file mode 100644 index 00000000000..fda61bb4b58 --- /dev/null +++ b/test/mri/prism/snapshots/not.txt @@ -0,0 +1,351 @@ +@ ProgramNode (location: (1,0)-(37,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(37,16)) + └── body: (length: 10) + ├── @ AndNode (location: (1,0)-(1,19)) + │ ├── left: + │ │ @ CallNode (location: (1,0)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,4)-(1,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (1,4)-(1,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (1,0)-(1,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (1,12)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,16)-(1,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,16)-(1,19) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (1,12)-(1,15) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,8)-(1,11) = "and" + ├── @ CallNode (location: (3,0)-(3,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ AndNode (location: (3,4)-(3,15)) + │ │ ├── left: + │ │ │ @ CallNode (location: (3,4)-(3,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (3,4)-(3,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (3,12)-(3,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (3,12)-(3,15) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (3,8)-(3,11) = "and" + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (3,0)-(3,3) = "not" + │ ├── opening_loc: (3,3)-(3,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (3,15)-(3,16) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,4)-(5,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (5,4)-(5,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (5,0)-(5,3) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ AndNode (location: (7,0)-(8,5)) + │ ├── left: + │ │ @ CallNode (location: (7,0)-(7,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (7,4)-(7,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (7,4)-(7,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (7,0)-(7,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (7,12)-(8,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (8,2)-(8,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (8,2)-(8,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (7,12)-(7,15) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (7,8)-(7,11) = "and" + ├── @ AndNode (location: (11,0)-(13,5)) + │ ├── left: + │ │ @ CallNode (location: (11,0)-(11,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (11,4)-(11,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (11,4)-(11,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (11,0)-(11,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (12,4)-(13,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (13,2)-(13,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (13,2)-(13,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (12,4)-(12,7) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (11,8)-(11,11) = "and" + ├── @ AndNode (location: (16,0)-(20,5)) + │ ├── left: + │ │ @ CallNode (location: (16,0)-(16,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (16,4)-(16,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (16,4)-(16,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (16,0)-(16,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (17,2)-(20,5)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (20,2)-(20,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (20,2)-(20,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (17,2)-(17,5) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (16,8)-(16,11) = "and" + ├── @ CallNode (location: (22,0)-(25,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (22,4)-(22,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (22,4)-(22,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (22,0)-(22,3) = "not" + │ ├── opening_loc: (22,3)-(22,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (25,0)-(25,1) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (27,0)-(33,3)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (30,0)-(30,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (30,0)-(30,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (27,0)-(27,3) = "not" + │ ├── opening_loc: (27,3)-(27,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (33,2)-(33,3) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ FlipFlopNode (location: (35,4)-(35,14)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ CallNode (location: (35,4)-(35,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (35,4)-(35,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (35,11)-(35,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (35,11)-(35,14) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (35,8)-(35,10) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (35,0)-(35,3) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (37,0)-(37,16)) + ├── flags: ∅ + ├── receiver: + │ @ ParenthesesNode (location: (37,4)-(37,16)) + │ ├── body: + │ │ @ StatementsNode (location: (37,5)-(37,15)) + │ │ └── body: (length: 1) + │ │ └── @ FlipFlopNode (location: (37,5)-(37,15)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ CallNode (location: (37,5)-(37,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (37,5)-(37,8) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (37,12)-(37,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (37,12)-(37,15) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (37,9)-(37,11) = ".." + │ ├── opening_loc: (37,4)-(37,5) = "(" + │ └── closing_loc: (37,15)-(37,16) = ")" + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (37,0)-(37,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/numbers.txt b/test/mri/prism/snapshots/numbers.txt new file mode 100644 index 00000000000..740f3f5a2a1 --- /dev/null +++ b/test/mri/prism/snapshots/numbers.txt @@ -0,0 +1,142 @@ +@ ProgramNode (location: (1,0)-(67,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(67,5)) + └── body: (length: 34) + ├── @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 0 + ├── @ IntegerNode (location: (3,0)-(3,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ FloatNode (location: (5,0)-(5,3)) + │ └── value: 1.0 + ├── @ IntegerNode (location: (7,0)-(7,1)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IntegerNode (location: (9,0)-(9,3)) + │ ├── flags: binary + │ └── value: 0 + ├── @ IntegerNode (location: (11,0)-(11,3)) + │ ├── flags: binary + │ └── value: 1 + ├── @ IntegerNode (location: (13,0)-(13,4)) + │ ├── flags: binary + │ └── value: 2 + ├── @ IntegerNode (location: (15,0)-(15,3)) + │ ├── flags: decimal + │ └── value: 0 + ├── @ IntegerNode (location: (17,0)-(17,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IntegerNode (location: (19,0)-(19,3)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IntegerNode (location: (21,0)-(21,2)) + │ ├── flags: octal + │ └── value: 0 + ├── @ IntegerNode (location: (23,0)-(23,2)) + │ ├── flags: octal + │ └── value: 1 + ├── @ IntegerNode (location: (25,0)-(25,2)) + │ ├── flags: octal + │ └── value: 2 + ├── @ IntegerNode (location: (27,0)-(27,3)) + │ ├── flags: octal + │ └── value: 0 + ├── @ IntegerNode (location: (29,0)-(29,3)) + │ ├── flags: octal + │ └── value: 1 + ├── @ IntegerNode (location: (31,0)-(31,3)) + │ ├── flags: octal + │ └── value: 2 + ├── @ IntegerNode (location: (33,0)-(33,3)) + │ ├── flags: hexadecimal + │ └── value: 0 + ├── @ IntegerNode (location: (35,0)-(35,3)) + │ ├── flags: hexadecimal + │ └── value: 1 + ├── @ IntegerNode (location: (37,0)-(37,3)) + │ ├── flags: hexadecimal + │ └── value: 2 + ├── @ ImaginaryNode (location: (39,0)-(39,2)) + │ └── numeric: + │ @ IntegerNode (location: (39,0)-(39,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ RationalNode (location: (41,0)-(41,2)) + │ └── numeric: + │ @ IntegerNode (location: (41,0)-(41,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IntegerNode (location: (43,0)-(43,2)) + │ ├── flags: decimal + │ └── value: -1 + ├── @ ImaginaryNode (location: (45,0)-(45,3)) + │ └── numeric: + │ @ RationalNode (location: (45,0)-(45,2)) + │ └── numeric: + │ @ IntegerNode (location: (45,0)-(45,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ RationalNode (location: (47,0)-(47,4)) + │ └── numeric: + │ @ FloatNode (location: (47,0)-(47,3)) + │ └── value: 1.2 + ├── @ ImaginaryNode (location: (49,0)-(49,5)) + │ └── numeric: + │ @ RationalNode (location: (49,0)-(49,4)) + │ └── numeric: + │ @ FloatNode (location: (49,0)-(49,3)) + │ └── value: 1.2 + ├── @ ImaginaryNode (location: (51,0)-(51,4)) + │ └── numeric: + │ @ RationalNode (location: (51,0)-(51,3)) + │ └── numeric: + │ @ IntegerNode (location: (51,0)-(51,2)) + │ ├── flags: decimal + │ └── value: -1 + ├── @ RationalNode (location: (53,0)-(53,5)) + │ └── numeric: + │ @ FloatNode (location: (53,0)-(53,4)) + │ └── value: -1.2 + ├── @ ImaginaryNode (location: (55,0)-(55,6)) + │ └── numeric: + │ @ RationalNode (location: (55,0)-(55,5)) + │ └── numeric: + │ @ FloatNode (location: (55,0)-(55,4)) + │ └── value: -1.2 + ├── @ RationalNode (location: (57,0)-(57,4)) + │ └── numeric: + │ @ IntegerNode (location: (57,0)-(57,3)) + │ ├── flags: octal + │ └── value: 1 + ├── @ ImaginaryNode (location: (59,0)-(59,4)) + │ └── numeric: + │ @ IntegerNode (location: (59,0)-(59,3)) + │ ├── flags: octal + │ └── value: 1 + ├── @ ImaginaryNode (location: (61,0)-(61,5)) + │ └── numeric: + │ @ RationalNode (location: (61,0)-(61,4)) + │ └── numeric: + │ @ IntegerNode (location: (61,0)-(61,3)) + │ ├── flags: octal + │ └── value: 1 + ├── @ RationalNode (location: (63,0)-(63,4)) + │ └── numeric: + │ @ IntegerNode (location: (63,0)-(63,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ImaginaryNode (location: (65,0)-(65,4)) + │ └── numeric: + │ @ IntegerNode (location: (65,0)-(65,3)) + │ ├── flags: decimal + │ └── value: 1 + └── @ ImaginaryNode (location: (67,0)-(67,5)) + └── numeric: + @ RationalNode (location: (67,0)-(67,4)) + └── numeric: + @ IntegerNode (location: (67,0)-(67,3)) + ├── flags: binary + └── value: 1 diff --git a/test/mri/prism/snapshots/patterns.txt b/test/mri/prism/snapshots/patterns.txt new file mode 100644 index 00000000000..5662129daed --- /dev/null +++ b/test/mri/prism/snapshots/patterns.txt @@ -0,0 +1,4921 @@ +@ ProgramNode (location: (1,0)-(217,5)) +├── locals: [:bar, :baz, :qux, :b, :a, :foo, :x] +└── statements: + @ StatementsNode (location: (1,0)-(217,5)) + └── body: (length: 180) + ├── @ MatchRequiredNode (location: (1,0)-(1,10)) + │ ├── value: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ LocalVariableTargetNode (location: (1,7)-(1,10)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ └── operator_loc: (1,4)-(1,6) = "=>" + ├── @ MatchRequiredNode (location: (2,0)-(2,8)) + │ ├── value: + │ │ @ CallNode (location: (2,0)-(2,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (2,0)-(2,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ IntegerNode (location: (2,7)-(2,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (2,4)-(2,6) = "=>" + ├── @ MatchRequiredNode (location: (3,0)-(3,10)) + │ ├── value: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FloatNode (location: (3,7)-(3,10)) + │ │ └── value: 1.0 + │ └── operator_loc: (3,4)-(3,6) = "=>" + ├── @ MatchRequiredNode (location: (4,0)-(4,9)) + │ ├── value: + │ │ @ CallNode (location: (4,0)-(4,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (4,0)-(4,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ImaginaryNode (location: (4,7)-(4,9)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (4,7)-(4,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (4,4)-(4,6) = "=>" + ├── @ MatchRequiredNode (location: (5,0)-(5,9)) + │ ├── value: + │ │ @ CallNode (location: (5,0)-(5,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (5,0)-(5,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RationalNode (location: (5,7)-(5,9)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (5,7)-(5,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (5,4)-(5,6) = "=>" + ├── @ MatchRequiredNode (location: (6,0)-(6,11)) + │ ├── value: + │ │ @ CallNode (location: (6,0)-(6,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (6,0)-(6,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (6,7)-(6,11)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (6,7)-(6,8) = ":" + │ │ ├── value_loc: (6,8)-(6,11) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ └── operator_loc: (6,4)-(6,6) = "=>" + ├── @ MatchRequiredNode (location: (7,0)-(7,14)) + │ ├── value: + │ │ @ CallNode (location: (7,0)-(7,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,0)-(7,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (7,7)-(7,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (7,7)-(7,10) = "%s[" + │ │ ├── value_loc: (7,10)-(7,13) = "foo" + │ │ ├── closing_loc: (7,13)-(7,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (7,4)-(7,6) = "=>" + ├── @ MatchRequiredNode (location: (8,0)-(8,13)) + │ ├── value: + │ │ @ CallNode (location: (8,0)-(8,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (8,0)-(8,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (8,7)-(8,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (8,7)-(8,9) = ":\"" + │ │ ├── value_loc: (8,9)-(8,12) = "foo" + │ │ ├── closing_loc: (8,12)-(8,13) = "\"" + │ │ └── unescaped: "foo" + │ └── operator_loc: (8,4)-(8,6) = "=>" + ├── @ MatchRequiredNode (location: (9,0)-(9,12)) + │ ├── value: + │ │ @ CallNode (location: (9,0)-(9,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (9,0)-(9,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RegularExpressionNode (location: (9,7)-(9,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,7)-(9,8) = "/" + │ │ ├── content_loc: (9,8)-(9,11) = "foo" + │ │ ├── closing_loc: (9,11)-(9,12) = "/" + │ │ └── unescaped: "foo" + │ └── operator_loc: (9,4)-(9,6) = "=>" + ├── @ MatchRequiredNode (location: (10,0)-(10,12)) + │ ├── value: + │ │ @ CallNode (location: (10,0)-(10,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (10,0)-(10,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ XStringNode (location: (10,7)-(10,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (10,7)-(10,8) = "`" + │ │ ├── content_loc: (10,8)-(10,11) = "foo" + │ │ ├── closing_loc: (10,11)-(10,12) = "`" + │ │ └── unescaped: "foo" + │ └── operator_loc: (10,4)-(10,6) = "=>" + ├── @ MatchRequiredNode (location: (11,0)-(11,14)) + │ ├── value: + │ │ @ CallNode (location: (11,0)-(11,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (11,0)-(11,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ XStringNode (location: (11,7)-(11,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (11,7)-(11,10) = "%x[" + │ │ ├── content_loc: (11,10)-(11,13) = "foo" + │ │ ├── closing_loc: (11,13)-(11,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (11,4)-(11,6) = "=>" + ├── @ MatchRequiredNode (location: (12,0)-(12,14)) + │ ├── value: + │ │ @ CallNode (location: (12,0)-(12,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (12,0)-(12,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (12,7)-(12,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ SymbolNode (location: (12,10)-(12,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (12,10)-(12,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (12,7)-(12,10) = "%i[" + │ │ └── closing_loc: (12,13)-(12,14) = "]" + │ └── operator_loc: (12,4)-(12,6) = "=>" + ├── @ MatchRequiredNode (location: (13,0)-(13,14)) + │ ├── value: + │ │ @ CallNode (location: (13,0)-(13,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (13,0)-(13,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (13,7)-(13,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ SymbolNode (location: (13,10)-(13,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (13,10)-(13,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (13,7)-(13,10) = "%I[" + │ │ └── closing_loc: (13,13)-(13,14) = "]" + │ └── operator_loc: (13,4)-(13,6) = "=>" + ├── @ MatchRequiredNode (location: (14,0)-(14,14)) + │ ├── value: + │ │ @ CallNode (location: (14,0)-(14,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (14,0)-(14,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (14,7)-(14,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ StringNode (location: (14,10)-(14,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (14,10)-(14,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (14,7)-(14,10) = "%w[" + │ │ └── closing_loc: (14,13)-(14,14) = "]" + │ └── operator_loc: (14,4)-(14,6) = "=>" + ├── @ MatchRequiredNode (location: (15,0)-(15,14)) + │ ├── value: + │ │ @ CallNode (location: (15,0)-(15,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (15,0)-(15,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (15,7)-(15,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ StringNode (location: (15,10)-(15,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (15,10)-(15,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (15,7)-(15,10) = "%W[" + │ │ └── closing_loc: (15,13)-(15,14) = "]" + │ └── operator_loc: (15,4)-(15,6) = "=>" + ├── @ MatchRequiredNode (location: (16,0)-(16,14)) + │ ├── value: + │ │ @ CallNode (location: (16,0)-(16,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (16,0)-(16,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (16,7)-(16,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (16,7)-(16,10) = "%q[" + │ │ ├── content_loc: (16,10)-(16,13) = "foo" + │ │ ├── closing_loc: (16,13)-(16,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (16,4)-(16,6) = "=>" + ├── @ MatchRequiredNode (location: (17,0)-(17,14)) + │ ├── value: + │ │ @ CallNode (location: (17,0)-(17,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (17,0)-(17,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (17,7)-(17,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (17,7)-(17,10) = "%Q[" + │ │ ├── content_loc: (17,10)-(17,13) = "foo" + │ │ ├── closing_loc: (17,13)-(17,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (17,4)-(17,6) = "=>" + ├── @ MatchRequiredNode (location: (18,0)-(18,12)) + │ ├── value: + │ │ @ CallNode (location: (18,0)-(18,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (18,0)-(18,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (18,7)-(18,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (18,7)-(18,8) = "\"" + │ │ ├── content_loc: (18,8)-(18,11) = "foo" + │ │ ├── closing_loc: (18,11)-(18,12) = "\"" + │ │ └── unescaped: "foo" + │ └── operator_loc: (18,4)-(18,6) = "=>" + ├── @ MatchRequiredNode (location: (19,0)-(19,10)) + │ ├── value: + │ │ @ CallNode (location: (19,0)-(19,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (19,0)-(19,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ NilNode (location: (19,7)-(19,10)) + │ └── operator_loc: (19,4)-(19,6) = "=>" + ├── @ MatchRequiredNode (location: (20,0)-(20,11)) + │ ├── value: + │ │ @ CallNode (location: (20,0)-(20,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (20,0)-(20,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SelfNode (location: (20,7)-(20,11)) + │ └── operator_loc: (20,4)-(20,6) = "=>" + ├── @ MatchRequiredNode (location: (21,0)-(21,11)) + │ ├── value: + │ │ @ CallNode (location: (21,0)-(21,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (21,0)-(21,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ TrueNode (location: (21,7)-(21,11)) + │ └── operator_loc: (21,4)-(21,6) = "=>" + ├── @ MatchRequiredNode (location: (22,0)-(22,12)) + │ ├── value: + │ │ @ CallNode (location: (22,0)-(22,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (22,0)-(22,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FalseNode (location: (22,7)-(22,12)) + │ └── operator_loc: (22,4)-(22,6) = "=>" + ├── @ MatchRequiredNode (location: (23,0)-(23,15)) + │ ├── value: + │ │ @ CallNode (location: (23,0)-(23,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (23,0)-(23,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceFileNode (location: (23,7)-(23,15)) + │ │ ├── flags: ∅ + │ │ └── filepath: "patterns.txt" + │ └── operator_loc: (23,4)-(23,6) = "=>" + ├── @ MatchRequiredNode (location: (24,0)-(24,15)) + │ ├── value: + │ │ @ CallNode (location: (24,0)-(24,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (24,0)-(24,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceLineNode (location: (24,7)-(24,15)) + │ └── operator_loc: (24,4)-(24,6) = "=>" + ├── @ MatchRequiredNode (location: (25,0)-(25,19)) + │ ├── value: + │ │ @ CallNode (location: (25,0)-(25,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (25,0)-(25,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceEncodingNode (location: (25,7)-(25,19)) + │ └── operator_loc: (25,4)-(25,6) = "=>" + ├── @ MatchRequiredNode (location: (26,0)-(26,17)) + │ ├── value: + │ │ @ CallNode (location: (26,0)-(26,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (26,0)-(26,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ LambdaNode (location: (26,7)-(26,17)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (26,7)-(26,9) = "->" + │ │ ├── opening_loc: (26,10)-(26,11) = "{" + │ │ ├── closing_loc: (26,16)-(26,17) = "}" + │ │ ├── parameters: ∅ + │ │ └── body: + │ │ @ StatementsNode (location: (26,12)-(26,15)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (26,12)-(26,15)) + │ │ ├── name: :bar + │ │ └── depth: 1 + │ └── operator_loc: (26,4)-(26,6) = "=>" + ├── @ MatchRequiredNode (location: (28,0)-(28,13)) + │ ├── value: + │ │ @ CallNode (location: (28,0)-(28,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (28,0)-(28,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (28,7)-(28,13)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (28,7)-(28,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (28,12)-(28,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (28,9)-(28,11) = ".." + │ └── operator_loc: (28,4)-(28,6) = "=>" + ├── @ MatchRequiredNode (location: (29,0)-(29,17)) + │ ├── value: + │ │ @ CallNode (location: (29,0)-(29,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (29,0)-(29,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (29,7)-(29,17)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ FloatNode (location: (29,7)-(29,10)) + │ │ │ └── value: 1.0 + │ │ ├── right: + │ │ │ @ FloatNode (location: (29,14)-(29,17)) + │ │ │ └── value: 1.0 + │ │ └── operator_loc: (29,11)-(29,13) = ".." + │ └── operator_loc: (29,4)-(29,6) = "=>" + ├── @ MatchRequiredNode (location: (30,0)-(30,15)) + │ ├── value: + │ │ @ CallNode (location: (30,0)-(30,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (30,0)-(30,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (30,7)-(30,15)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ ImaginaryNode (location: (30,7)-(30,9)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (30,7)-(30,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ ImaginaryNode (location: (30,13)-(30,15)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (30,13)-(30,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (30,10)-(30,12) = ".." + │ └── operator_loc: (30,4)-(30,6) = "=>" + ├── @ MatchRequiredNode (location: (31,0)-(31,15)) + │ ├── value: + │ │ @ CallNode (location: (31,0)-(31,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (31,0)-(31,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (31,7)-(31,15)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ RationalNode (location: (31,7)-(31,9)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (31,7)-(31,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ RationalNode (location: (31,13)-(31,15)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (31,13)-(31,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (31,10)-(31,12) = ".." + │ └── operator_loc: (31,4)-(31,6) = "=>" + ├── @ MatchRequiredNode (location: (32,0)-(32,19)) + │ ├── value: + │ │ @ CallNode (location: (32,0)-(32,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (32,0)-(32,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (32,7)-(32,19)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SymbolNode (location: (32,7)-(32,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (32,7)-(32,8) = ":" + │ │ │ ├── value_loc: (32,8)-(32,11) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ SymbolNode (location: (32,15)-(32,19)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (32,15)-(32,16) = ":" + │ │ │ ├── value_loc: (32,16)-(32,19) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (32,12)-(32,14) = ".." + │ └── operator_loc: (32,4)-(32,6) = "=>" + ├── @ MatchRequiredNode (location: (33,0)-(33,25)) + │ ├── value: + │ │ @ CallNode (location: (33,0)-(33,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (33,0)-(33,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (33,7)-(33,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SymbolNode (location: (33,7)-(33,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (33,7)-(33,10) = "%s[" + │ │ │ ├── value_loc: (33,10)-(33,13) = "foo" + │ │ │ ├── closing_loc: (33,13)-(33,14) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ SymbolNode (location: (33,18)-(33,25)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (33,18)-(33,21) = "%s[" + │ │ │ ├── value_loc: (33,21)-(33,24) = "foo" + │ │ │ ├── closing_loc: (33,24)-(33,25) = "]" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (33,15)-(33,17) = ".." + │ └── operator_loc: (33,4)-(33,6) = "=>" + ├── @ MatchRequiredNode (location: (34,0)-(34,23)) + │ ├── value: + │ │ @ CallNode (location: (34,0)-(34,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (34,0)-(34,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (34,7)-(34,23)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SymbolNode (location: (34,7)-(34,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (34,7)-(34,9) = ":\"" + │ │ │ ├── value_loc: (34,9)-(34,12) = "foo" + │ │ │ ├── closing_loc: (34,12)-(34,13) = "\"" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ SymbolNode (location: (34,17)-(34,23)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (34,17)-(34,19) = ":\"" + │ │ │ ├── value_loc: (34,19)-(34,22) = "foo" + │ │ │ ├── closing_loc: (34,22)-(34,23) = "\"" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (34,14)-(34,16) = ".." + │ └── operator_loc: (34,4)-(34,6) = "=>" + ├── @ MatchRequiredNode (location: (35,0)-(35,21)) + │ ├── value: + │ │ @ CallNode (location: (35,0)-(35,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (35,0)-(35,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (35,7)-(35,21)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ RegularExpressionNode (location: (35,7)-(35,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (35,7)-(35,8) = "/" + │ │ │ ├── content_loc: (35,8)-(35,11) = "foo" + │ │ │ ├── closing_loc: (35,11)-(35,12) = "/" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ RegularExpressionNode (location: (35,16)-(35,21)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (35,16)-(35,17) = "/" + │ │ │ ├── content_loc: (35,17)-(35,20) = "foo" + │ │ │ ├── closing_loc: (35,20)-(35,21) = "/" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (35,13)-(35,15) = ".." + │ └── operator_loc: (35,4)-(35,6) = "=>" + ├── @ MatchRequiredNode (location: (36,0)-(36,21)) + │ ├── value: + │ │ @ CallNode (location: (36,0)-(36,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (36,0)-(36,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (36,7)-(36,21)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ XStringNode (location: (36,7)-(36,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (36,7)-(36,8) = "`" + │ │ │ ├── content_loc: (36,8)-(36,11) = "foo" + │ │ │ ├── closing_loc: (36,11)-(36,12) = "`" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ XStringNode (location: (36,16)-(36,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (36,16)-(36,17) = "`" + │ │ │ ├── content_loc: (36,17)-(36,20) = "foo" + │ │ │ ├── closing_loc: (36,20)-(36,21) = "`" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (36,13)-(36,15) = ".." + │ └── operator_loc: (36,4)-(36,6) = "=>" + ├── @ MatchRequiredNode (location: (37,0)-(37,25)) + │ ├── value: + │ │ @ CallNode (location: (37,0)-(37,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (37,0)-(37,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (37,7)-(37,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ XStringNode (location: (37,7)-(37,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (37,7)-(37,10) = "%x[" + │ │ │ ├── content_loc: (37,10)-(37,13) = "foo" + │ │ │ ├── closing_loc: (37,13)-(37,14) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ XStringNode (location: (37,18)-(37,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (37,18)-(37,21) = "%x[" + │ │ │ ├── content_loc: (37,21)-(37,24) = "foo" + │ │ │ ├── closing_loc: (37,24)-(37,25) = "]" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (37,15)-(37,17) = ".." + │ └── operator_loc: (37,4)-(37,6) = "=>" + ├── @ MatchRequiredNode (location: (38,0)-(38,25)) + │ ├── value: + │ │ @ CallNode (location: (38,0)-(38,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (38,0)-(38,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (38,7)-(38,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ ArrayNode (location: (38,7)-(38,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (38,10)-(38,13)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (38,10)-(38,13) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (38,7)-(38,10) = "%i[" + │ │ │ └── closing_loc: (38,13)-(38,14) = "]" + │ │ ├── right: + │ │ │ @ ArrayNode (location: (38,18)-(38,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (38,21)-(38,24)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (38,21)-(38,24) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (38,18)-(38,21) = "%i[" + │ │ │ └── closing_loc: (38,24)-(38,25) = "]" + │ │ └── operator_loc: (38,15)-(38,17) = ".." + │ └── operator_loc: (38,4)-(38,6) = "=>" + ├── @ MatchRequiredNode (location: (39,0)-(39,25)) + │ ├── value: + │ │ @ CallNode (location: (39,0)-(39,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (39,0)-(39,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (39,7)-(39,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ ArrayNode (location: (39,7)-(39,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (39,10)-(39,13)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (39,10)-(39,13) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (39,7)-(39,10) = "%I[" + │ │ │ └── closing_loc: (39,13)-(39,14) = "]" + │ │ ├── right: + │ │ │ @ ArrayNode (location: (39,18)-(39,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (39,21)-(39,24)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (39,21)-(39,24) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (39,18)-(39,21) = "%I[" + │ │ │ └── closing_loc: (39,24)-(39,25) = "]" + │ │ └── operator_loc: (39,15)-(39,17) = ".." + │ └── operator_loc: (39,4)-(39,6) = "=>" + ├── @ MatchRequiredNode (location: (40,0)-(40,25)) + │ ├── value: + │ │ @ CallNode (location: (40,0)-(40,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (40,0)-(40,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (40,7)-(40,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ ArrayNode (location: (40,7)-(40,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (40,10)-(40,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (40,10)-(40,13) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (40,7)-(40,10) = "%w[" + │ │ │ └── closing_loc: (40,13)-(40,14) = "]" + │ │ ├── right: + │ │ │ @ ArrayNode (location: (40,18)-(40,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (40,21)-(40,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (40,21)-(40,24) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (40,18)-(40,21) = "%w[" + │ │ │ └── closing_loc: (40,24)-(40,25) = "]" + │ │ └── operator_loc: (40,15)-(40,17) = ".." + │ └── operator_loc: (40,4)-(40,6) = "=>" + ├── @ MatchRequiredNode (location: (41,0)-(41,25)) + │ ├── value: + │ │ @ CallNode (location: (41,0)-(41,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (41,0)-(41,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (41,7)-(41,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ ArrayNode (location: (41,7)-(41,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (41,10)-(41,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (41,10)-(41,13) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (41,7)-(41,10) = "%W[" + │ │ │ └── closing_loc: (41,13)-(41,14) = "]" + │ │ ├── right: + │ │ │ @ ArrayNode (location: (41,18)-(41,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (41,21)-(41,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (41,21)-(41,24) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (41,18)-(41,21) = "%W[" + │ │ │ └── closing_loc: (41,24)-(41,25) = "]" + │ │ └── operator_loc: (41,15)-(41,17) = ".." + │ └── operator_loc: (41,4)-(41,6) = "=>" + ├── @ MatchRequiredNode (location: (42,0)-(42,25)) + │ ├── value: + │ │ @ CallNode (location: (42,0)-(42,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (42,0)-(42,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (42,7)-(42,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ StringNode (location: (42,7)-(42,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (42,7)-(42,10) = "%q[" + │ │ │ ├── content_loc: (42,10)-(42,13) = "foo" + │ │ │ ├── closing_loc: (42,13)-(42,14) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ StringNode (location: (42,18)-(42,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (42,18)-(42,21) = "%q[" + │ │ │ ├── content_loc: (42,21)-(42,24) = "foo" + │ │ │ ├── closing_loc: (42,24)-(42,25) = "]" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (42,15)-(42,17) = ".." + │ └── operator_loc: (42,4)-(42,6) = "=>" + ├── @ MatchRequiredNode (location: (43,0)-(43,25)) + │ ├── value: + │ │ @ CallNode (location: (43,0)-(43,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (43,0)-(43,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (43,7)-(43,25)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ StringNode (location: (43,7)-(43,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (43,7)-(43,10) = "%Q[" + │ │ │ ├── content_loc: (43,10)-(43,13) = "foo" + │ │ │ ├── closing_loc: (43,13)-(43,14) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ StringNode (location: (43,18)-(43,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (43,18)-(43,21) = "%Q[" + │ │ │ ├── content_loc: (43,21)-(43,24) = "foo" + │ │ │ ├── closing_loc: (43,24)-(43,25) = "]" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (43,15)-(43,17) = ".." + │ └── operator_loc: (43,4)-(43,6) = "=>" + ├── @ MatchRequiredNode (location: (44,0)-(44,21)) + │ ├── value: + │ │ @ CallNode (location: (44,0)-(44,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (44,0)-(44,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (44,7)-(44,21)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ StringNode (location: (44,7)-(44,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (44,7)-(44,8) = "\"" + │ │ │ ├── content_loc: (44,8)-(44,11) = "foo" + │ │ │ ├── closing_loc: (44,11)-(44,12) = "\"" + │ │ │ └── unescaped: "foo" + │ │ ├── right: + │ │ │ @ StringNode (location: (44,16)-(44,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (44,16)-(44,17) = "\"" + │ │ │ ├── content_loc: (44,17)-(44,20) = "foo" + │ │ │ ├── closing_loc: (44,20)-(44,21) = "\"" + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (44,13)-(44,15) = ".." + │ └── operator_loc: (44,4)-(44,6) = "=>" + ├── @ MatchRequiredNode (location: (45,0)-(45,17)) + │ ├── value: + │ │ @ CallNode (location: (45,0)-(45,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (45,0)-(45,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (45,7)-(45,17)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ NilNode (location: (45,7)-(45,10)) + │ │ ├── right: + │ │ │ @ NilNode (location: (45,14)-(45,17)) + │ │ └── operator_loc: (45,11)-(45,13) = ".." + │ └── operator_loc: (45,4)-(45,6) = "=>" + ├── @ MatchRequiredNode (location: (46,0)-(46,19)) + │ ├── value: + │ │ @ CallNode (location: (46,0)-(46,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (46,0)-(46,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (46,7)-(46,19)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SelfNode (location: (46,7)-(46,11)) + │ │ ├── right: + │ │ │ @ SelfNode (location: (46,15)-(46,19)) + │ │ └── operator_loc: (46,12)-(46,14) = ".." + │ └── operator_loc: (46,4)-(46,6) = "=>" + ├── @ MatchRequiredNode (location: (47,0)-(47,19)) + │ ├── value: + │ │ @ CallNode (location: (47,0)-(47,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (47,0)-(47,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (47,7)-(47,19)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ TrueNode (location: (47,7)-(47,11)) + │ │ ├── right: + │ │ │ @ TrueNode (location: (47,15)-(47,19)) + │ │ └── operator_loc: (47,12)-(47,14) = ".." + │ └── operator_loc: (47,4)-(47,6) = "=>" + ├── @ MatchRequiredNode (location: (48,0)-(48,21)) + │ ├── value: + │ │ @ CallNode (location: (48,0)-(48,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (48,0)-(48,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (48,7)-(48,21)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ FalseNode (location: (48,7)-(48,12)) + │ │ ├── right: + │ │ │ @ FalseNode (location: (48,16)-(48,21)) + │ │ └── operator_loc: (48,13)-(48,15) = ".." + │ └── operator_loc: (48,4)-(48,6) = "=>" + ├── @ MatchRequiredNode (location: (49,0)-(49,27)) + │ ├── value: + │ │ @ CallNode (location: (49,0)-(49,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (49,0)-(49,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (49,7)-(49,27)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SourceFileNode (location: (49,7)-(49,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── filepath: "patterns.txt" + │ │ ├── right: + │ │ │ @ SourceFileNode (location: (49,19)-(49,27)) + │ │ │ ├── flags: ∅ + │ │ │ └── filepath: "patterns.txt" + │ │ └── operator_loc: (49,16)-(49,18) = ".." + │ └── operator_loc: (49,4)-(49,6) = "=>" + ├── @ MatchRequiredNode (location: (50,0)-(50,27)) + │ ├── value: + │ │ @ CallNode (location: (50,0)-(50,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (50,0)-(50,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (50,7)-(50,27)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SourceLineNode (location: (50,7)-(50,15)) + │ │ ├── right: + │ │ │ @ SourceLineNode (location: (50,19)-(50,27)) + │ │ └── operator_loc: (50,16)-(50,18) = ".." + │ └── operator_loc: (50,4)-(50,6) = "=>" + ├── @ MatchRequiredNode (location: (51,0)-(51,35)) + │ ├── value: + │ │ @ CallNode (location: (51,0)-(51,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (51,0)-(51,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (51,7)-(51,35)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ SourceEncodingNode (location: (51,7)-(51,19)) + │ │ ├── right: + │ │ │ @ SourceEncodingNode (location: (51,23)-(51,35)) + │ │ └── operator_loc: (51,20)-(51,22) = ".." + │ └── operator_loc: (51,4)-(51,6) = "=>" + ├── @ MatchRequiredNode (location: (52,0)-(52,31)) + │ ├── value: + │ │ @ CallNode (location: (52,0)-(52,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (52,0)-(52,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RangeNode (location: (52,7)-(52,31)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ LambdaNode (location: (52,7)-(52,17)) + │ │ │ ├── locals: [] + │ │ │ ├── operator_loc: (52,7)-(52,9) = "->" + │ │ │ ├── opening_loc: (52,10)-(52,11) = "{" + │ │ │ ├── closing_loc: (52,16)-(52,17) = "}" + │ │ │ ├── parameters: ∅ + │ │ │ └── body: + │ │ │ @ StatementsNode (location: (52,12)-(52,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (52,12)-(52,15)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 1 + │ │ ├── right: + │ │ │ @ LambdaNode (location: (52,21)-(52,31)) + │ │ │ ├── locals: [] + │ │ │ ├── operator_loc: (52,21)-(52,23) = "->" + │ │ │ ├── opening_loc: (52,24)-(52,25) = "{" + │ │ │ ├── closing_loc: (52,30)-(52,31) = "}" + │ │ │ ├── parameters: ∅ + │ │ │ └── body: + │ │ │ @ StatementsNode (location: (52,26)-(52,29)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (52,26)-(52,29)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 1 + │ │ └── operator_loc: (52,18)-(52,20) = ".." + │ └── operator_loc: (52,4)-(52,6) = "=>" + ├── @ LocalVariableWriteNode (location: (54,0)-(54,7)) + │ ├── name: :bar + │ ├── depth: 0 + │ ├── name_loc: (54,0)-(54,3) = "bar" + │ ├── value: + │ │ @ IntegerNode (location: (54,6)-(54,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (54,4)-(54,5) = "=" + ├── @ MatchRequiredNode (location: (54,9)-(54,20)) + │ ├── value: + │ │ @ CallNode (location: (54,9)-(54,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (54,9)-(54,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedVariableNode (location: (54,16)-(54,20)) + │ │ ├── variable: + │ │ │ @ LocalVariableReadNode (location: (54,17)-(54,20)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ └── operator_loc: (54,16)-(54,17) = "^" + │ └── operator_loc: (54,13)-(54,15) = "=>" + ├── @ MatchRequiredNode (location: (55,0)-(55,12)) + │ ├── value: + │ │ @ CallNode (location: (55,0)-(55,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (55,0)-(55,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedVariableNode (location: (55,7)-(55,12)) + │ │ ├── variable: + │ │ │ @ InstanceVariableReadNode (location: (55,8)-(55,12)) + │ │ │ └── name: :@bar + │ │ └── operator_loc: (55,7)-(55,8) = "^" + │ └── operator_loc: (55,4)-(55,6) = "=>" + ├── @ MatchRequiredNode (location: (56,0)-(56,13)) + │ ├── value: + │ │ @ CallNode (location: (56,0)-(56,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (56,0)-(56,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedVariableNode (location: (56,7)-(56,13)) + │ │ ├── variable: + │ │ │ @ ClassVariableReadNode (location: (56,8)-(56,13)) + │ │ │ └── name: :@@bar + │ │ └── operator_loc: (56,7)-(56,8) = "^" + │ └── operator_loc: (56,4)-(56,6) = "=>" + ├── @ MatchRequiredNode (location: (57,0)-(57,12)) + │ ├── value: + │ │ @ CallNode (location: (57,0)-(57,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (57,0)-(57,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedVariableNode (location: (57,7)-(57,12)) + │ │ ├── variable: + │ │ │ @ GlobalVariableReadNode (location: (57,8)-(57,12)) + │ │ │ └── name: :$bar + │ │ └── operator_loc: (57,7)-(57,8) = "^" + │ └── operator_loc: (57,4)-(57,6) = "=>" + ├── @ MatchRequiredNode (location: (59,0)-(59,11)) + │ ├── value: + │ │ @ CallNode (location: (59,0)-(59,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (59,0)-(59,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedExpressionNode (location: (59,7)-(59,11)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (59,9)-(59,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── operator_loc: (59,7)-(59,8) = "^" + │ │ ├── lparen_loc: (59,8)-(59,9) = "(" + │ │ └── rparen_loc: (59,10)-(59,11) = ")" + │ └── operator_loc: (59,4)-(59,6) = "=>" + ├── @ MatchRequiredNode (location: (60,0)-(60,13)) + │ ├── value: + │ │ @ CallNode (location: (60,0)-(60,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (60,0)-(60,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedExpressionNode (location: (60,7)-(60,13)) + │ │ ├── expression: + │ │ │ @ NilNode (location: (60,9)-(60,12)) + │ │ ├── operator_loc: (60,7)-(60,8) = "^" + │ │ ├── lparen_loc: (60,8)-(60,9) = "(" + │ │ └── rparen_loc: (60,12)-(60,13) = ")" + │ └── operator_loc: (60,4)-(60,6) = "=>" + ├── @ MatchRequiredNode (location: (61,0)-(61,23)) + │ ├── value: + │ │ @ CallNode (location: (61,0)-(61,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (61,0)-(61,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ PinnedExpressionNode (location: (61,7)-(61,23)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (61,9)-(61,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ StringNode (location: (61,9)-(61,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (61,9)-(61,10) = "\"" + │ │ │ │ ├── content_loc: (61,10)-(61,13) = "bar" + │ │ │ │ ├── closing_loc: (61,13)-(61,14) = "\"" + │ │ │ │ └── unescaped: "bar" + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (61,15)-(61,16) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (61,17)-(61,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (61,17)-(61,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (61,17)-(61,18) = "\"" + │ │ │ │ ├── content_loc: (61,18)-(61,21) = "baz" + │ │ │ │ ├── closing_loc: (61,21)-(61,22) = "\"" + │ │ │ │ └── unescaped: "baz" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── operator_loc: (61,7)-(61,8) = "^" + │ │ ├── lparen_loc: (61,8)-(61,9) = "(" + │ │ └── rparen_loc: (61,22)-(61,23) = ")" + │ └── operator_loc: (61,4)-(61,6) = "=>" + ├── @ MatchRequiredNode (location: (63,0)-(63,10)) + │ ├── value: + │ │ @ CallNode (location: (63,0)-(63,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (63,0)-(63,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ConstantReadNode (location: (63,7)-(63,10)) + │ │ └── name: :Foo + │ └── operator_loc: (63,4)-(63,6) = "=>" + ├── @ MatchRequiredNode (location: (64,0)-(64,20)) + │ ├── value: + │ │ @ CallNode (location: (64,0)-(64,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (64,0)-(64,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ConstantPathNode (location: (64,7)-(64,20)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (64,7)-(64,15)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (64,7)-(64,10)) + │ │ │ │ └── name: :Foo + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (64,12)-(64,15)) + │ │ │ │ └── name: :Bar + │ │ │ └── delimiter_loc: (64,10)-(64,12) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (64,17)-(64,20)) + │ │ │ └── name: :Baz + │ │ └── delimiter_loc: (64,15)-(64,17) = "::" + │ └── operator_loc: (64,4)-(64,6) = "=>" + ├── @ MatchRequiredNode (location: (65,0)-(65,12)) + │ ├── value: + │ │ @ CallNode (location: (65,0)-(65,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (65,0)-(65,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ConstantPathNode (location: (65,7)-(65,12)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (65,9)-(65,12)) + │ │ │ └── name: :Foo + │ │ └── delimiter_loc: (65,7)-(65,9) = "::" + │ └── operator_loc: (65,4)-(65,6) = "=>" + ├── @ MatchRequiredNode (location: (66,0)-(66,22)) + │ ├── value: + │ │ @ CallNode (location: (66,0)-(66,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (66,0)-(66,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ConstantPathNode (location: (66,7)-(66,22)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (66,7)-(66,17)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantPathNode (location: (66,7)-(66,12)) + │ │ │ │ ├── parent: ∅ + │ │ │ │ ├── child: + │ │ │ │ │ @ ConstantReadNode (location: (66,9)-(66,12)) + │ │ │ │ │ └── name: :Foo + │ │ │ │ └── delimiter_loc: (66,7)-(66,9) = "::" + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (66,14)-(66,17)) + │ │ │ │ └── name: :Bar + │ │ │ └── delimiter_loc: (66,12)-(66,14) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (66,19)-(66,22)) + │ │ │ └── name: :Baz + │ │ └── delimiter_loc: (66,17)-(66,19) = "::" + │ └── operator_loc: (66,4)-(66,6) = "=>" + ├── @ MatchRequiredNode (location: (68,0)-(68,12)) + │ ├── value: + │ │ @ CallNode (location: (68,0)-(68,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (68,0)-(68,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (68,7)-(68,12)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (68,7)-(68,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (68,10)-(68,11) = "(" + │ │ └── closing_loc: (68,11)-(68,12) = ")" + │ └── operator_loc: (68,4)-(68,6) = "=>" + ├── @ MatchRequiredNode (location: (69,0)-(69,13)) + │ ├── value: + │ │ @ CallNode (location: (69,0)-(69,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (69,0)-(69,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (69,7)-(69,13)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (69,7)-(69,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ IntegerNode (location: (69,11)-(69,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (69,10)-(69,11) = "(" + │ │ └── closing_loc: (69,12)-(69,13) = ")" + │ └── operator_loc: (69,4)-(69,6) = "=>" + ├── @ MatchRequiredNode (location: (70,0)-(70,19)) + │ ├── value: + │ │ @ CallNode (location: (70,0)-(70,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (70,0)-(70,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (70,7)-(70,19)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (70,7)-(70,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ IntegerNode (location: (70,11)-(70,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (70,14)-(70,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (70,17)-(70,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (70,10)-(70,11) = "(" + │ │ └── closing_loc: (70,18)-(70,19) = ")" + │ └── operator_loc: (70,4)-(70,6) = "=>" + ├── @ MatchRequiredNode (location: (71,0)-(71,15)) + │ ├── value: + │ │ @ CallNode (location: (71,0)-(71,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (71,0)-(71,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (71,7)-(71,15)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (71,7)-(71,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (71,11)-(71,14)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (71,10)-(71,11) = "(" + │ │ └── closing_loc: (71,14)-(71,15) = ")" + │ └── operator_loc: (71,4)-(71,6) = "=>" + ├── @ MatchRequiredNode (location: (72,0)-(72,21)) + │ ├── value: + │ │ @ CallNode (location: (72,0)-(72,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (72,0)-(72,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (72,7)-(72,21)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (72,7)-(72,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (72,11)-(72,15)) + │ │ │ ├── operator_loc: (72,11)-(72,12) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (72,12)-(72,15)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (72,17)-(72,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (72,10)-(72,11) = "(" + │ │ └── closing_loc: (72,20)-(72,21) = ")" + │ └── operator_loc: (72,4)-(72,6) = "=>" + ├── @ MatchRequiredNode (location: (73,0)-(73,21)) + │ ├── value: + │ │ @ CallNode (location: (73,0)-(73,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (73,0)-(73,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (73,7)-(73,21)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (73,7)-(73,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (73,11)-(73,14)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (73,16)-(73,20)) + │ │ │ ├── operator_loc: (73,16)-(73,17) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (73,17)-(73,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (73,10)-(73,11) = "(" + │ │ └── closing_loc: (73,20)-(73,21) = ")" + │ └── operator_loc: (73,4)-(73,6) = "=>" + ├── @ MatchRequiredNode (location: (74,0)-(74,27)) + │ ├── value: + │ │ @ CallNode (location: (74,0)-(74,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (74,0)-(74,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FindPatternNode (location: (74,7)-(74,27)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (74,7)-(74,10)) + │ │ │ └── name: :Foo + │ │ ├── left: + │ │ │ @ SplatNode (location: (74,11)-(74,15)) + │ │ │ ├── operator_loc: (74,11)-(74,12) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (74,12)-(74,15)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (74,17)-(74,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (74,22)-(74,26)) + │ │ │ ├── operator_loc: (74,22)-(74,23) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (74,23)-(74,26)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (74,10)-(74,11) = "(" + │ │ └── closing_loc: (74,26)-(74,27) = ")" + │ └── operator_loc: (74,4)-(74,6) = "=>" + ├── @ MatchRequiredNode (location: (76,0)-(76,12)) + │ ├── value: + │ │ @ CallNode (location: (76,0)-(76,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (76,0)-(76,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (76,7)-(76,12)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (76,7)-(76,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (76,10)-(76,11) = "[" + │ │ └── closing_loc: (76,11)-(76,12) = "]" + │ └── operator_loc: (76,4)-(76,6) = "=>" + ├── @ MatchRequiredNode (location: (77,0)-(77,13)) + │ ├── value: + │ │ @ CallNode (location: (77,0)-(77,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (77,0)-(77,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (77,7)-(77,13)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (77,7)-(77,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ IntegerNode (location: (77,11)-(77,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (77,10)-(77,11) = "[" + │ │ └── closing_loc: (77,12)-(77,13) = "]" + │ └── operator_loc: (77,4)-(77,6) = "=>" + ├── @ MatchRequiredNode (location: (78,0)-(78,19)) + │ ├── value: + │ │ @ CallNode (location: (78,0)-(78,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (78,0)-(78,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (78,7)-(78,19)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (78,7)-(78,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ IntegerNode (location: (78,11)-(78,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (78,14)-(78,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (78,17)-(78,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (78,10)-(78,11) = "[" + │ │ └── closing_loc: (78,18)-(78,19) = "]" + │ └── operator_loc: (78,4)-(78,6) = "=>" + ├── @ MatchRequiredNode (location: (79,0)-(79,17)) + │ ├── value: + │ │ @ CallNode (location: (79,0)-(79,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (79,0)-(79,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (79,7)-(79,17)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (79,7)-(79,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ ArrayPatternNode (location: (79,11)-(79,16)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (79,11)-(79,14)) + │ │ │ │ └── name: :Foo + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (79,14)-(79,15) = "[" + │ │ │ └── closing_loc: (79,15)-(79,16) = "]" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (79,10)-(79,11) = "[" + │ │ └── closing_loc: (79,16)-(79,17) = "]" + │ └── operator_loc: (79,4)-(79,6) = "=>" + ├── @ MatchRequiredNode (location: (80,0)-(80,15)) + │ ├── value: + │ │ @ CallNode (location: (80,0)-(80,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (80,0)-(80,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (80,7)-(80,15)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (80,7)-(80,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (80,11)-(80,14)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (80,10)-(80,11) = "[" + │ │ └── closing_loc: (80,14)-(80,15) = "]" + │ └── operator_loc: (80,4)-(80,6) = "=>" + ├── @ MatchRequiredNode (location: (81,0)-(81,21)) + │ ├── value: + │ │ @ CallNode (location: (81,0)-(81,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (81,0)-(81,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (81,7)-(81,21)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (81,7)-(81,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (81,11)-(81,15)) + │ │ │ ├── operator_loc: (81,11)-(81,12) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (81,12)-(81,15)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (81,17)-(81,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (81,10)-(81,11) = "[" + │ │ └── closing_loc: (81,20)-(81,21) = "]" + │ └── operator_loc: (81,4)-(81,6) = "=>" + ├── @ MatchRequiredNode (location: (82,0)-(82,21)) + │ ├── value: + │ │ @ CallNode (location: (82,0)-(82,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (82,0)-(82,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (82,7)-(82,21)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (82,7)-(82,10)) + │ │ │ └── name: :Foo + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (82,11)-(82,14)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (82,16)-(82,20)) + │ │ │ ├── operator_loc: (82,16)-(82,17) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (82,17)-(82,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (82,10)-(82,11) = "[" + │ │ └── closing_loc: (82,20)-(82,21) = "]" + │ └── operator_loc: (82,4)-(82,6) = "=>" + ├── @ MatchRequiredNode (location: (83,0)-(83,27)) + │ ├── value: + │ │ @ CallNode (location: (83,0)-(83,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (83,0)-(83,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FindPatternNode (location: (83,7)-(83,27)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (83,7)-(83,10)) + │ │ │ └── name: :Foo + │ │ ├── left: + │ │ │ @ SplatNode (location: (83,11)-(83,15)) + │ │ │ ├── operator_loc: (83,11)-(83,12) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (83,12)-(83,15)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (83,17)-(83,20)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (83,22)-(83,26)) + │ │ │ ├── operator_loc: (83,22)-(83,23) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (83,23)-(83,26)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (83,10)-(83,11) = "[" + │ │ └── closing_loc: (83,26)-(83,27) = "]" + │ └── operator_loc: (83,4)-(83,6) = "=>" + ├── @ MatchRequiredNode (location: (85,0)-(85,11)) + │ ├── value: + │ │ @ CallNode (location: (85,0)-(85,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (85,0)-(85,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (85,7)-(85,11)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (85,7)-(85,11)) + │ │ │ ├── operator_loc: (85,7)-(85,8) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (85,8)-(85,11)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (85,4)-(85,6) = "=>" + ├── @ MatchRequiredNode (location: (86,0)-(86,21)) + │ ├── value: + │ │ @ CallNode (location: (86,0)-(86,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (86,0)-(86,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (86,7)-(86,21)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (86,7)-(86,11)) + │ │ │ ├── operator_loc: (86,7)-(86,8) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (86,8)-(86,11)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (86,13)-(86,16)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (86,18)-(86,21)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (86,4)-(86,6) = "=>" + ├── @ MatchRequiredNode (location: (87,0)-(87,21)) + │ ├── value: + │ │ @ CallNode (location: (87,0)-(87,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (87,0)-(87,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (87,7)-(87,21)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (87,7)-(87,10)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (87,12)-(87,16)) + │ │ │ ├── operator_loc: (87,12)-(87,13) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (87,13)-(87,16)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (87,18)-(87,21)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (87,4)-(87,6) = "=>" + ├── @ MatchRequiredNode (location: (88,0)-(88,21)) + │ ├── value: + │ │ @ CallNode (location: (88,0)-(88,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (88,0)-(88,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (88,7)-(88,21)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (88,7)-(88,10)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (88,12)-(88,15)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (88,17)-(88,21)) + │ │ │ ├── operator_loc: (88,17)-(88,18) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (88,18)-(88,21)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (88,4)-(88,6) = "=>" + ├── @ MatchRequiredNode (location: (89,0)-(89,22)) + │ ├── value: + │ │ @ CallNode (location: (89,0)-(89,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (89,0)-(89,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FindPatternNode (location: (89,7)-(89,22)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (89,7)-(89,11)) + │ │ │ ├── operator_loc: (89,7)-(89,8) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (89,8)-(89,11)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (89,13)-(89,16)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (89,18)-(89,22)) + │ │ │ ├── operator_loc: (89,18)-(89,19) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (89,19)-(89,22)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (89,4)-(89,6) = "=>" + ├── @ MatchRequiredNode (location: (91,0)-(91,11)) + │ ├── value: + │ │ @ CallNode (location: (91,0)-(91,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (91,0)-(91,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (91,7)-(91,11)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (91,7)-(91,10)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ ImplicitRestNode (location: (91,10)-(91,11)) + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (91,4)-(91,6) = "=>" + ├── @ MatchRequiredNode (location: (95,0)-(95,9)) + │ ├── value: + │ │ @ CallNode (location: (95,0)-(95,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (95,0)-(95,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (95,7)-(95,9)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (95,7)-(95,8) = "[" + │ │ └── closing_loc: (95,8)-(95,9) = "]" + │ └── operator_loc: (95,4)-(95,6) = "=>" + ├── @ MatchRequiredNode (location: (96,0)-(96,17)) + │ ├── value: + │ │ @ CallNode (location: (96,0)-(96,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (96,0)-(96,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (96,7)-(96,17)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ ArrayPatternNode (location: (96,8)-(96,16)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ ArrayPatternNode (location: (96,9)-(96,15)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ ArrayPatternNode (location: (96,10)-(96,14)) + │ │ │ │ │ ├── constant: ∅ + │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ └── @ ArrayPatternNode (location: (96,11)-(96,13)) + │ │ │ │ │ │ ├── constant: ∅ + │ │ │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ ├── opening_loc: (96,11)-(96,12) = "[" + │ │ │ │ │ │ └── closing_loc: (96,12)-(96,13) = "]" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── opening_loc: (96,10)-(96,11) = "[" + │ │ │ │ │ └── closing_loc: (96,13)-(96,14) = "]" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (96,9)-(96,10) = "[" + │ │ │ │ └── closing_loc: (96,14)-(96,15) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (96,8)-(96,9) = "[" + │ │ │ └── closing_loc: (96,15)-(96,16) = "]" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (96,7)-(96,8) = "[" + │ │ └── closing_loc: (96,16)-(96,17) = "]" + │ └── operator_loc: (96,4)-(96,6) = "=>" + ├── @ MatchRequiredNode (location: (98,0)-(98,13)) + │ ├── value: + │ │ @ CallNode (location: (98,0)-(98,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (98,0)-(98,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (98,7)-(98,13)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (98,8)-(98,12)) + │ │ │ ├── operator_loc: (98,8)-(98,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (98,9)-(98,12)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (98,7)-(98,8) = "[" + │ │ └── closing_loc: (98,12)-(98,13) = "]" + │ └── operator_loc: (98,4)-(98,6) = "=>" + ├── @ MatchRequiredNode (location: (99,0)-(99,23)) + │ ├── value: + │ │ @ CallNode (location: (99,0)-(99,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (99,0)-(99,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (99,7)-(99,23)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (99,8)-(99,12)) + │ │ │ ├── operator_loc: (99,8)-(99,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (99,9)-(99,12)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (99,14)-(99,17)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (99,19)-(99,22)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (99,7)-(99,8) = "[" + │ │ └── closing_loc: (99,22)-(99,23) = "]" + │ └── operator_loc: (99,4)-(99,6) = "=>" + ├── @ MatchRequiredNode (location: (100,0)-(100,23)) + │ ├── value: + │ │ @ CallNode (location: (100,0)-(100,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (100,0)-(100,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (100,7)-(100,23)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (100,8)-(100,11)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (100,13)-(100,17)) + │ │ │ ├── operator_loc: (100,13)-(100,14) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (100,14)-(100,17)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (100,19)-(100,22)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (100,7)-(100,8) = "[" + │ │ └── closing_loc: (100,22)-(100,23) = "]" + │ └── operator_loc: (100,4)-(100,6) = "=>" + ├── @ MatchRequiredNode (location: (101,0)-(101,23)) + │ ├── value: + │ │ @ CallNode (location: (101,0)-(101,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (101,0)-(101,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (101,7)-(101,23)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (101,8)-(101,11)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (101,13)-(101,16)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (101,18)-(101,22)) + │ │ │ ├── operator_loc: (101,18)-(101,19) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (101,19)-(101,22)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (101,7)-(101,8) = "[" + │ │ └── closing_loc: (101,22)-(101,23) = "]" + │ └── operator_loc: (101,4)-(101,6) = "=>" + ├── @ MatchRequiredNode (location: (102,0)-(102,24)) + │ ├── value: + │ │ @ CallNode (location: (102,0)-(102,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (102,0)-(102,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FindPatternNode (location: (102,7)-(102,24)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (102,8)-(102,12)) + │ │ │ ├── operator_loc: (102,8)-(102,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (102,9)-(102,12)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (102,14)-(102,17)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (102,19)-(102,23)) + │ │ │ ├── operator_loc: (102,19)-(102,20) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (102,20)-(102,23)) + │ │ │ ├── name: :qux + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (102,7)-(102,8) = "[" + │ │ └── closing_loc: (102,23)-(102,24) = "]" + │ └── operator_loc: (102,4)-(102,6) = "=>" + ├── @ MatchPredicateNode (location: (104,0)-(104,10)) + │ ├── value: + │ │ @ CallNode (location: (104,0)-(104,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (104,0)-(104,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ LocalVariableTargetNode (location: (104,7)-(104,10)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ └── operator_loc: (104,4)-(104,6) = "in" + ├── @ MatchPredicateNode (location: (105,0)-(105,8)) + │ ├── value: + │ │ @ CallNode (location: (105,0)-(105,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (105,0)-(105,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ IntegerNode (location: (105,7)-(105,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (105,4)-(105,6) = "in" + ├── @ MatchPredicateNode (location: (106,0)-(106,10)) + │ ├── value: + │ │ @ CallNode (location: (106,0)-(106,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (106,0)-(106,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FloatNode (location: (106,7)-(106,10)) + │ │ └── value: 1.0 + │ └── operator_loc: (106,4)-(106,6) = "in" + ├── @ MatchPredicateNode (location: (107,0)-(107,9)) + │ ├── value: + │ │ @ CallNode (location: (107,0)-(107,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (107,0)-(107,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ImaginaryNode (location: (107,7)-(107,9)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (107,7)-(107,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (107,4)-(107,6) = "in" + ├── @ MatchPredicateNode (location: (108,0)-(108,9)) + │ ├── value: + │ │ @ CallNode (location: (108,0)-(108,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (108,0)-(108,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RationalNode (location: (108,7)-(108,9)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (108,7)-(108,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (108,4)-(108,6) = "in" + ├── @ MatchPredicateNode (location: (109,0)-(109,11)) + │ ├── value: + │ │ @ CallNode (location: (109,0)-(109,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (109,0)-(109,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (109,7)-(109,11)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (109,7)-(109,8) = ":" + │ │ ├── value_loc: (109,8)-(109,11) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ └── operator_loc: (109,4)-(109,6) = "in" + ├── @ MatchPredicateNode (location: (110,0)-(110,14)) + │ ├── value: + │ │ @ CallNode (location: (110,0)-(110,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (110,0)-(110,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (110,7)-(110,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (110,7)-(110,10) = "%s[" + │ │ ├── value_loc: (110,10)-(110,13) = "foo" + │ │ ├── closing_loc: (110,13)-(110,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (110,4)-(110,6) = "in" + ├── @ MatchPredicateNode (location: (111,0)-(111,13)) + │ ├── value: + │ │ @ CallNode (location: (111,0)-(111,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (111,0)-(111,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SymbolNode (location: (111,7)-(111,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (111,7)-(111,9) = ":\"" + │ │ ├── value_loc: (111,9)-(111,12) = "foo" + │ │ ├── closing_loc: (111,12)-(111,13) = "\"" + │ │ └── unescaped: "foo" + │ └── operator_loc: (111,4)-(111,6) = "in" + ├── @ MatchPredicateNode (location: (112,0)-(112,12)) + │ ├── value: + │ │ @ CallNode (location: (112,0)-(112,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (112,0)-(112,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ RegularExpressionNode (location: (112,7)-(112,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (112,7)-(112,8) = "/" + │ │ ├── content_loc: (112,8)-(112,11) = "foo" + │ │ ├── closing_loc: (112,11)-(112,12) = "/" + │ │ └── unescaped: "foo" + │ └── operator_loc: (112,4)-(112,6) = "in" + ├── @ MatchPredicateNode (location: (113,0)-(113,12)) + │ ├── value: + │ │ @ CallNode (location: (113,0)-(113,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (113,0)-(113,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ XStringNode (location: (113,7)-(113,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (113,7)-(113,8) = "`" + │ │ ├── content_loc: (113,8)-(113,11) = "foo" + │ │ ├── closing_loc: (113,11)-(113,12) = "`" + │ │ └── unescaped: "foo" + │ └── operator_loc: (113,4)-(113,6) = "in" + ├── @ MatchPredicateNode (location: (114,0)-(114,14)) + │ ├── value: + │ │ @ CallNode (location: (114,0)-(114,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (114,0)-(114,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ XStringNode (location: (114,7)-(114,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (114,7)-(114,10) = "%x[" + │ │ ├── content_loc: (114,10)-(114,13) = "foo" + │ │ ├── closing_loc: (114,13)-(114,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (114,4)-(114,6) = "in" + ├── @ MatchPredicateNode (location: (115,0)-(115,14)) + │ ├── value: + │ │ @ CallNode (location: (115,0)-(115,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (115,0)-(115,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (115,7)-(115,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ SymbolNode (location: (115,10)-(115,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (115,10)-(115,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (115,7)-(115,10) = "%i[" + │ │ └── closing_loc: (115,13)-(115,14) = "]" + │ └── operator_loc: (115,4)-(115,6) = "in" + ├── @ MatchPredicateNode (location: (116,0)-(116,14)) + │ ├── value: + │ │ @ CallNode (location: (116,0)-(116,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (116,0)-(116,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (116,7)-(116,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ SymbolNode (location: (116,10)-(116,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (116,10)-(116,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (116,7)-(116,10) = "%I[" + │ │ └── closing_loc: (116,13)-(116,14) = "]" + │ └── operator_loc: (116,4)-(116,6) = "in" + ├── @ MatchPredicateNode (location: (117,0)-(117,14)) + │ ├── value: + │ │ @ CallNode (location: (117,0)-(117,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (117,0)-(117,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (117,7)-(117,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ StringNode (location: (117,10)-(117,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (117,10)-(117,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (117,7)-(117,10) = "%w[" + │ │ └── closing_loc: (117,13)-(117,14) = "]" + │ └── operator_loc: (117,4)-(117,6) = "in" + ├── @ MatchPredicateNode (location: (118,0)-(118,14)) + │ ├── value: + │ │ @ CallNode (location: (118,0)-(118,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (118,0)-(118,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayNode (location: (118,7)-(118,14)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ StringNode (location: (118,10)-(118,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (118,10)-(118,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── opening_loc: (118,7)-(118,10) = "%W[" + │ │ └── closing_loc: (118,13)-(118,14) = "]" + │ └── operator_loc: (118,4)-(118,6) = "in" + ├── @ MatchPredicateNode (location: (119,0)-(119,14)) + │ ├── value: + │ │ @ CallNode (location: (119,0)-(119,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (119,0)-(119,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (119,7)-(119,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (119,7)-(119,10) = "%q[" + │ │ ├── content_loc: (119,10)-(119,13) = "foo" + │ │ ├── closing_loc: (119,13)-(119,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (119,4)-(119,6) = "in" + ├── @ MatchPredicateNode (location: (120,0)-(120,14)) + │ ├── value: + │ │ @ CallNode (location: (120,0)-(120,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (120,0)-(120,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (120,7)-(120,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (120,7)-(120,10) = "%Q[" + │ │ ├── content_loc: (120,10)-(120,13) = "foo" + │ │ ├── closing_loc: (120,13)-(120,14) = "]" + │ │ └── unescaped: "foo" + │ └── operator_loc: (120,4)-(120,6) = "in" + ├── @ MatchPredicateNode (location: (121,0)-(121,12)) + │ ├── value: + │ │ @ CallNode (location: (121,0)-(121,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (121,0)-(121,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ StringNode (location: (121,7)-(121,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (121,7)-(121,8) = "\"" + │ │ ├── content_loc: (121,8)-(121,11) = "foo" + │ │ ├── closing_loc: (121,11)-(121,12) = "\"" + │ │ └── unescaped: "foo" + │ └── operator_loc: (121,4)-(121,6) = "in" + ├── @ MatchPredicateNode (location: (122,0)-(122,10)) + │ ├── value: + │ │ @ CallNode (location: (122,0)-(122,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (122,0)-(122,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ NilNode (location: (122,7)-(122,10)) + │ └── operator_loc: (122,4)-(122,6) = "in" + ├── @ MatchPredicateNode (location: (123,0)-(123,11)) + │ ├── value: + │ │ @ CallNode (location: (123,0)-(123,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (123,0)-(123,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SelfNode (location: (123,7)-(123,11)) + │ └── operator_loc: (123,4)-(123,6) = "in" + ├── @ MatchPredicateNode (location: (124,0)-(124,11)) + │ ├── value: + │ │ @ CallNode (location: (124,0)-(124,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (124,0)-(124,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ TrueNode (location: (124,7)-(124,11)) + │ └── operator_loc: (124,4)-(124,6) = "in" + ├── @ MatchPredicateNode (location: (125,0)-(125,12)) + │ ├── value: + │ │ @ CallNode (location: (125,0)-(125,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (125,0)-(125,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ FalseNode (location: (125,7)-(125,12)) + │ └── operator_loc: (125,4)-(125,6) = "in" + ├── @ MatchPredicateNode (location: (126,0)-(126,15)) + │ ├── value: + │ │ @ CallNode (location: (126,0)-(126,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (126,0)-(126,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceFileNode (location: (126,7)-(126,15)) + │ │ ├── flags: ∅ + │ │ └── filepath: "patterns.txt" + │ └── operator_loc: (126,4)-(126,6) = "in" + ├── @ MatchPredicateNode (location: (127,0)-(127,15)) + │ ├── value: + │ │ @ CallNode (location: (127,0)-(127,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (127,0)-(127,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceLineNode (location: (127,7)-(127,15)) + │ └── operator_loc: (127,4)-(127,6) = "in" + ├── @ MatchPredicateNode (location: (128,0)-(128,19)) + │ ├── value: + │ │ @ CallNode (location: (128,0)-(128,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (128,0)-(128,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ SourceEncodingNode (location: (128,7)-(128,19)) + │ └── operator_loc: (128,4)-(128,6) = "in" + ├── @ MatchPredicateNode (location: (129,0)-(129,17)) + │ ├── value: + │ │ @ CallNode (location: (129,0)-(129,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (129,0)-(129,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ LambdaNode (location: (129,7)-(129,17)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (129,7)-(129,9) = "->" + │ │ ├── opening_loc: (129,10)-(129,11) = "{" + │ │ ├── closing_loc: (129,16)-(129,17) = "}" + │ │ ├── parameters: ∅ + │ │ └── body: + │ │ @ StatementsNode (location: (129,12)-(129,15)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (129,12)-(129,15)) + │ │ ├── name: :bar + │ │ └── depth: 1 + │ └── operator_loc: (129,4)-(129,6) = "in" + ├── @ MatchPredicateNode (location: (131,0)-(131,11)) + │ ├── value: + │ │ @ CallNode (location: (131,0)-(131,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (131,0)-(131,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (131,7)-(131,11)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (131,7)-(131,10)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ ImplicitRestNode (location: (131,10)-(131,11)) + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (131,4)-(131,6) = "in" + ├── @ CaseMatchNode (location: (135,0)-(135,25)) + │ ├── predicate: + │ │ @ CallNode (location: (135,5)-(135,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (135,5)-(135,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (135,10)-(135,21)) + │ │ ├── pattern: + │ │ │ @ LocalVariableTargetNode (location: (135,13)-(135,16)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (135,10)-(135,12) = "in" + │ │ └── then_loc: (135,17)-(135,21) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (135,0)-(135,4) = "case" + │ └── end_keyword_loc: (135,22)-(135,25) = "end" + ├── @ CaseMatchNode (location: (136,0)-(136,23)) + │ ├── predicate: + │ │ @ CallNode (location: (136,5)-(136,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (136,5)-(136,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (136,10)-(136,19)) + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (136,13)-(136,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (136,10)-(136,12) = "in" + │ │ └── then_loc: (136,15)-(136,19) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (136,0)-(136,4) = "case" + │ └── end_keyword_loc: (136,20)-(136,23) = "end" + ├── @ CaseMatchNode (location: (137,0)-(137,25)) + │ ├── predicate: + │ │ @ CallNode (location: (137,5)-(137,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (137,5)-(137,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (137,10)-(137,21)) + │ │ ├── pattern: + │ │ │ @ FloatNode (location: (137,13)-(137,16)) + │ │ │ └── value: 1.0 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (137,10)-(137,12) = "in" + │ │ └── then_loc: (137,17)-(137,21) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (137,0)-(137,4) = "case" + │ └── end_keyword_loc: (137,22)-(137,25) = "end" + ├── @ CaseMatchNode (location: (138,0)-(138,24)) + │ ├── predicate: + │ │ @ CallNode (location: (138,5)-(138,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (138,5)-(138,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (138,10)-(138,20)) + │ │ ├── pattern: + │ │ │ @ ImaginaryNode (location: (138,13)-(138,15)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (138,13)-(138,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (138,10)-(138,12) = "in" + │ │ └── then_loc: (138,16)-(138,20) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (138,0)-(138,4) = "case" + │ └── end_keyword_loc: (138,21)-(138,24) = "end" + ├── @ CaseMatchNode (location: (139,0)-(139,24)) + │ ├── predicate: + │ │ @ CallNode (location: (139,5)-(139,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (139,5)-(139,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (139,10)-(139,20)) + │ │ ├── pattern: + │ │ │ @ RationalNode (location: (139,13)-(139,15)) + │ │ │ └── numeric: + │ │ │ @ IntegerNode (location: (139,13)-(139,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (139,10)-(139,12) = "in" + │ │ └── then_loc: (139,16)-(139,20) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (139,0)-(139,4) = "case" + │ └── end_keyword_loc: (139,21)-(139,24) = "end" + ├── @ CaseMatchNode (location: (140,0)-(140,26)) + │ ├── predicate: + │ │ @ CallNode (location: (140,5)-(140,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (140,5)-(140,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (140,10)-(140,22)) + │ │ ├── pattern: + │ │ │ @ SymbolNode (location: (140,13)-(140,17)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (140,13)-(140,14) = ":" + │ │ │ ├── value_loc: (140,14)-(140,17) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (140,10)-(140,12) = "in" + │ │ └── then_loc: (140,18)-(140,22) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (140,0)-(140,4) = "case" + │ └── end_keyword_loc: (140,23)-(140,26) = "end" + ├── @ CaseMatchNode (location: (141,0)-(141,29)) + │ ├── predicate: + │ │ @ CallNode (location: (141,5)-(141,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (141,5)-(141,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (141,10)-(141,25)) + │ │ ├── pattern: + │ │ │ @ SymbolNode (location: (141,13)-(141,20)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (141,13)-(141,16) = "%s[" + │ │ │ ├── value_loc: (141,16)-(141,19) = "foo" + │ │ │ ├── closing_loc: (141,19)-(141,20) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (141,10)-(141,12) = "in" + │ │ └── then_loc: (141,21)-(141,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (141,0)-(141,4) = "case" + │ └── end_keyword_loc: (141,26)-(141,29) = "end" + ├── @ CaseMatchNode (location: (142,0)-(142,28)) + │ ├── predicate: + │ │ @ CallNode (location: (142,5)-(142,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (142,5)-(142,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (142,10)-(142,24)) + │ │ ├── pattern: + │ │ │ @ SymbolNode (location: (142,13)-(142,19)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (142,13)-(142,15) = ":\"" + │ │ │ ├── value_loc: (142,15)-(142,18) = "foo" + │ │ │ ├── closing_loc: (142,18)-(142,19) = "\"" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (142,10)-(142,12) = "in" + │ │ └── then_loc: (142,20)-(142,24) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (142,0)-(142,4) = "case" + │ └── end_keyword_loc: (142,25)-(142,28) = "end" + ├── @ CaseMatchNode (location: (143,0)-(143,27)) + │ ├── predicate: + │ │ @ CallNode (location: (143,5)-(143,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (143,5)-(143,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (143,10)-(143,23)) + │ │ ├── pattern: + │ │ │ @ RegularExpressionNode (location: (143,13)-(143,18)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (143,13)-(143,14) = "/" + │ │ │ ├── content_loc: (143,14)-(143,17) = "foo" + │ │ │ ├── closing_loc: (143,17)-(143,18) = "/" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (143,10)-(143,12) = "in" + │ │ └── then_loc: (143,19)-(143,23) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (143,0)-(143,4) = "case" + │ └── end_keyword_loc: (143,24)-(143,27) = "end" + ├── @ CaseMatchNode (location: (144,0)-(144,27)) + │ ├── predicate: + │ │ @ CallNode (location: (144,5)-(144,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (144,5)-(144,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (144,10)-(144,23)) + │ │ ├── pattern: + │ │ │ @ XStringNode (location: (144,13)-(144,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (144,13)-(144,14) = "`" + │ │ │ ├── content_loc: (144,14)-(144,17) = "foo" + │ │ │ ├── closing_loc: (144,17)-(144,18) = "`" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (144,10)-(144,12) = "in" + │ │ └── then_loc: (144,19)-(144,23) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (144,0)-(144,4) = "case" + │ └── end_keyword_loc: (144,24)-(144,27) = "end" + ├── @ CaseMatchNode (location: (145,0)-(145,29)) + │ ├── predicate: + │ │ @ CallNode (location: (145,5)-(145,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (145,5)-(145,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (145,10)-(145,25)) + │ │ ├── pattern: + │ │ │ @ XStringNode (location: (145,13)-(145,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (145,13)-(145,16) = "%x[" + │ │ │ ├── content_loc: (145,16)-(145,19) = "foo" + │ │ │ ├── closing_loc: (145,19)-(145,20) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (145,10)-(145,12) = "in" + │ │ └── then_loc: (145,21)-(145,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (145,0)-(145,4) = "case" + │ └── end_keyword_loc: (145,26)-(145,29) = "end" + ├── @ CaseMatchNode (location: (146,0)-(146,29)) + │ ├── predicate: + │ │ @ CallNode (location: (146,5)-(146,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (146,5)-(146,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (146,10)-(146,25)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (146,13)-(146,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (146,16)-(146,19)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (146,16)-(146,19) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (146,13)-(146,16) = "%i[" + │ │ │ └── closing_loc: (146,19)-(146,20) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (146,10)-(146,12) = "in" + │ │ └── then_loc: (146,21)-(146,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (146,0)-(146,4) = "case" + │ └── end_keyword_loc: (146,26)-(146,29) = "end" + ├── @ CaseMatchNode (location: (147,0)-(147,29)) + │ ├── predicate: + │ │ @ CallNode (location: (147,5)-(147,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (147,5)-(147,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (147,10)-(147,25)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (147,13)-(147,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (147,16)-(147,19)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (147,16)-(147,19) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (147,13)-(147,16) = "%I[" + │ │ │ └── closing_loc: (147,19)-(147,20) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (147,10)-(147,12) = "in" + │ │ └── then_loc: (147,21)-(147,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (147,0)-(147,4) = "case" + │ └── end_keyword_loc: (147,26)-(147,29) = "end" + ├── @ CaseMatchNode (location: (148,0)-(148,29)) + │ ├── predicate: + │ │ @ CallNode (location: (148,5)-(148,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (148,5)-(148,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (148,10)-(148,25)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (148,13)-(148,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (148,16)-(148,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (148,16)-(148,19) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (148,13)-(148,16) = "%w[" + │ │ │ └── closing_loc: (148,19)-(148,20) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (148,10)-(148,12) = "in" + │ │ └── then_loc: (148,21)-(148,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (148,0)-(148,4) = "case" + │ └── end_keyword_loc: (148,26)-(148,29) = "end" + ├── @ CaseMatchNode (location: (149,0)-(149,29)) + │ ├── predicate: + │ │ @ CallNode (location: (149,5)-(149,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (149,5)-(149,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (149,10)-(149,25)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (149,13)-(149,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ StringNode (location: (149,16)-(149,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (149,16)-(149,19) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── opening_loc: (149,13)-(149,16) = "%W[" + │ │ │ └── closing_loc: (149,19)-(149,20) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (149,10)-(149,12) = "in" + │ │ └── then_loc: (149,21)-(149,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (149,0)-(149,4) = "case" + │ └── end_keyword_loc: (149,26)-(149,29) = "end" + ├── @ CaseMatchNode (location: (150,0)-(150,29)) + │ ├── predicate: + │ │ @ CallNode (location: (150,5)-(150,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (150,5)-(150,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (150,10)-(150,25)) + │ │ ├── pattern: + │ │ │ @ StringNode (location: (150,13)-(150,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (150,13)-(150,16) = "%q[" + │ │ │ ├── content_loc: (150,16)-(150,19) = "foo" + │ │ │ ├── closing_loc: (150,19)-(150,20) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (150,10)-(150,12) = "in" + │ │ └── then_loc: (150,21)-(150,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (150,0)-(150,4) = "case" + │ └── end_keyword_loc: (150,26)-(150,29) = "end" + ├── @ CaseMatchNode (location: (151,0)-(151,29)) + │ ├── predicate: + │ │ @ CallNode (location: (151,5)-(151,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (151,5)-(151,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (151,10)-(151,25)) + │ │ ├── pattern: + │ │ │ @ StringNode (location: (151,13)-(151,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (151,13)-(151,16) = "%Q[" + │ │ │ ├── content_loc: (151,16)-(151,19) = "foo" + │ │ │ ├── closing_loc: (151,19)-(151,20) = "]" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (151,10)-(151,12) = "in" + │ │ └── then_loc: (151,21)-(151,25) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (151,0)-(151,4) = "case" + │ └── end_keyword_loc: (151,26)-(151,29) = "end" + ├── @ CaseMatchNode (location: (152,0)-(152,27)) + │ ├── predicate: + │ │ @ CallNode (location: (152,5)-(152,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (152,5)-(152,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (152,10)-(152,23)) + │ │ ├── pattern: + │ │ │ @ StringNode (location: (152,13)-(152,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (152,13)-(152,14) = "\"" + │ │ │ ├── content_loc: (152,14)-(152,17) = "foo" + │ │ │ ├── closing_loc: (152,17)-(152,18) = "\"" + │ │ │ └── unescaped: "foo" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (152,10)-(152,12) = "in" + │ │ └── then_loc: (152,19)-(152,23) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (152,0)-(152,4) = "case" + │ └── end_keyword_loc: (152,24)-(152,27) = "end" + ├── @ CaseMatchNode (location: (153,0)-(153,25)) + │ ├── predicate: + │ │ @ CallNode (location: (153,5)-(153,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (153,5)-(153,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (153,10)-(153,21)) + │ │ ├── pattern: + │ │ │ @ NilNode (location: (153,13)-(153,16)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (153,10)-(153,12) = "in" + │ │ └── then_loc: (153,17)-(153,21) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (153,0)-(153,4) = "case" + │ └── end_keyword_loc: (153,22)-(153,25) = "end" + ├── @ CaseMatchNode (location: (154,0)-(154,26)) + │ ├── predicate: + │ │ @ CallNode (location: (154,5)-(154,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (154,5)-(154,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (154,10)-(154,22)) + │ │ ├── pattern: + │ │ │ @ SelfNode (location: (154,13)-(154,17)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (154,10)-(154,12) = "in" + │ │ └── then_loc: (154,18)-(154,22) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (154,0)-(154,4) = "case" + │ └── end_keyword_loc: (154,23)-(154,26) = "end" + ├── @ CaseMatchNode (location: (155,0)-(155,26)) + │ ├── predicate: + │ │ @ CallNode (location: (155,5)-(155,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (155,5)-(155,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (155,10)-(155,22)) + │ │ ├── pattern: + │ │ │ @ TrueNode (location: (155,13)-(155,17)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (155,10)-(155,12) = "in" + │ │ └── then_loc: (155,18)-(155,22) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (155,0)-(155,4) = "case" + │ └── end_keyword_loc: (155,23)-(155,26) = "end" + ├── @ CaseMatchNode (location: (156,0)-(156,27)) + │ ├── predicate: + │ │ @ CallNode (location: (156,5)-(156,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (156,5)-(156,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (156,10)-(156,23)) + │ │ ├── pattern: + │ │ │ @ FalseNode (location: (156,13)-(156,18)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (156,10)-(156,12) = "in" + │ │ └── then_loc: (156,19)-(156,23) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (156,0)-(156,4) = "case" + │ └── end_keyword_loc: (156,24)-(156,27) = "end" + ├── @ CaseMatchNode (location: (157,0)-(157,30)) + │ ├── predicate: + │ │ @ CallNode (location: (157,5)-(157,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (157,5)-(157,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (157,10)-(157,26)) + │ │ ├── pattern: + │ │ │ @ SourceFileNode (location: (157,13)-(157,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── filepath: "patterns.txt" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (157,10)-(157,12) = "in" + │ │ └── then_loc: (157,22)-(157,26) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (157,0)-(157,4) = "case" + │ └── end_keyword_loc: (157,27)-(157,30) = "end" + ├── @ CaseMatchNode (location: (158,0)-(158,30)) + │ ├── predicate: + │ │ @ CallNode (location: (158,5)-(158,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (158,5)-(158,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (158,10)-(158,26)) + │ │ ├── pattern: + │ │ │ @ SourceLineNode (location: (158,13)-(158,21)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (158,10)-(158,12) = "in" + │ │ └── then_loc: (158,22)-(158,26) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (158,0)-(158,4) = "case" + │ └── end_keyword_loc: (158,27)-(158,30) = "end" + ├── @ CaseMatchNode (location: (159,0)-(159,34)) + │ ├── predicate: + │ │ @ CallNode (location: (159,5)-(159,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (159,5)-(159,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (159,10)-(159,30)) + │ │ ├── pattern: + │ │ │ @ SourceEncodingNode (location: (159,13)-(159,25)) + │ │ ├── statements: ∅ + │ │ ├── in_loc: (159,10)-(159,12) = "in" + │ │ └── then_loc: (159,26)-(159,30) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (159,0)-(159,4) = "case" + │ └── end_keyword_loc: (159,31)-(159,34) = "end" + ├── @ CaseMatchNode (location: (160,0)-(160,32)) + │ ├── predicate: + │ │ @ CallNode (location: (160,5)-(160,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (160,5)-(160,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (160,10)-(160,28)) + │ │ ├── pattern: + │ │ │ @ LambdaNode (location: (160,13)-(160,23)) + │ │ │ ├── locals: [] + │ │ │ ├── operator_loc: (160,13)-(160,15) = "->" + │ │ │ ├── opening_loc: (160,16)-(160,17) = "{" + │ │ │ ├── closing_loc: (160,22)-(160,23) = "}" + │ │ │ ├── parameters: ∅ + │ │ │ └── body: + │ │ │ @ StatementsNode (location: (160,18)-(160,21)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (160,18)-(160,21)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 1 + │ │ ├── statements: ∅ + │ │ ├── in_loc: (160,10)-(160,12) = "in" + │ │ └── then_loc: (160,24)-(160,28) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (160,0)-(160,4) = "case" + │ └── end_keyword_loc: (160,29)-(160,32) = "end" + ├── @ CaseMatchNode (location: (162,0)-(162,32)) + │ ├── predicate: + │ │ @ CallNode (location: (162,5)-(162,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (162,5)-(162,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (162,10)-(162,28)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (162,13)-(162,23)) + │ │ │ ├── if_keyword_loc: (162,17)-(162,19) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (162,20)-(162,23)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (162,13)-(162,16)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (162,13)-(162,16)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (162,10)-(162,12) = "in" + │ │ └── then_loc: (162,24)-(162,28) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (162,0)-(162,4) = "case" + │ └── end_keyword_loc: (162,29)-(162,32) = "end" + ├── @ CaseMatchNode (location: (163,0)-(163,30)) + │ ├── predicate: + │ │ @ CallNode (location: (163,5)-(163,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (163,5)-(163,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (163,10)-(163,26)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (163,13)-(163,21)) + │ │ │ ├── if_keyword_loc: (163,15)-(163,17) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (163,18)-(163,21)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (163,13)-(163,14)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (163,13)-(163,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (163,10)-(163,12) = "in" + │ │ └── then_loc: (163,22)-(163,26) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (163,0)-(163,4) = "case" + │ └── end_keyword_loc: (163,27)-(163,30) = "end" + ├── @ CaseMatchNode (location: (164,0)-(164,32)) + │ ├── predicate: + │ │ @ CallNode (location: (164,5)-(164,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (164,5)-(164,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (164,10)-(164,28)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (164,13)-(164,23)) + │ │ │ ├── if_keyword_loc: (164,17)-(164,19) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (164,20)-(164,23)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (164,13)-(164,16)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ FloatNode (location: (164,13)-(164,16)) + │ │ │ │ └── value: 1.0 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (164,10)-(164,12) = "in" + │ │ └── then_loc: (164,24)-(164,28) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (164,0)-(164,4) = "case" + │ └── end_keyword_loc: (164,29)-(164,32) = "end" + ├── @ CaseMatchNode (location: (165,0)-(165,31)) + │ ├── predicate: + │ │ @ CallNode (location: (165,5)-(165,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (165,5)-(165,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (165,10)-(165,27)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (165,13)-(165,22)) + │ │ │ ├── if_keyword_loc: (165,16)-(165,18) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (165,19)-(165,22)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (165,13)-(165,15)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ImaginaryNode (location: (165,13)-(165,15)) + │ │ │ │ └── numeric: + │ │ │ │ @ IntegerNode (location: (165,13)-(165,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (165,10)-(165,12) = "in" + │ │ └── then_loc: (165,23)-(165,27) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (165,0)-(165,4) = "case" + │ └── end_keyword_loc: (165,28)-(165,31) = "end" + ├── @ CaseMatchNode (location: (166,0)-(166,31)) + │ ├── predicate: + │ │ @ CallNode (location: (166,5)-(166,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (166,5)-(166,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (166,10)-(166,27)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (166,13)-(166,22)) + │ │ │ ├── if_keyword_loc: (166,16)-(166,18) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (166,19)-(166,22)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (166,13)-(166,15)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RationalNode (location: (166,13)-(166,15)) + │ │ │ │ └── numeric: + │ │ │ │ @ IntegerNode (location: (166,13)-(166,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (166,10)-(166,12) = "in" + │ │ └── then_loc: (166,23)-(166,27) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (166,0)-(166,4) = "case" + │ └── end_keyword_loc: (166,28)-(166,31) = "end" + ├── @ CaseMatchNode (location: (167,0)-(167,33)) + │ ├── predicate: + │ │ @ CallNode (location: (167,5)-(167,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (167,5)-(167,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (167,10)-(167,29)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (167,13)-(167,24)) + │ │ │ ├── if_keyword_loc: (167,18)-(167,20) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (167,21)-(167,24)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (167,13)-(167,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (167,13)-(167,17)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (167,13)-(167,14) = ":" + │ │ │ │ ├── value_loc: (167,14)-(167,17) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (167,10)-(167,12) = "in" + │ │ └── then_loc: (167,25)-(167,29) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (167,0)-(167,4) = "case" + │ └── end_keyword_loc: (167,30)-(167,33) = "end" + ├── @ CaseMatchNode (location: (168,0)-(168,36)) + │ ├── predicate: + │ │ @ CallNode (location: (168,5)-(168,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (168,5)-(168,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (168,10)-(168,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (168,13)-(168,27)) + │ │ │ ├── if_keyword_loc: (168,21)-(168,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (168,24)-(168,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (168,13)-(168,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (168,13)-(168,20)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (168,13)-(168,16) = "%s[" + │ │ │ │ ├── value_loc: (168,16)-(168,19) = "foo" + │ │ │ │ ├── closing_loc: (168,19)-(168,20) = "]" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (168,10)-(168,12) = "in" + │ │ └── then_loc: (168,28)-(168,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (168,0)-(168,4) = "case" + │ └── end_keyword_loc: (168,33)-(168,36) = "end" + ├── @ CaseMatchNode (location: (169,0)-(169,35)) + │ ├── predicate: + │ │ @ CallNode (location: (169,5)-(169,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (169,5)-(169,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (169,10)-(169,31)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (169,13)-(169,26)) + │ │ │ ├── if_keyword_loc: (169,20)-(169,22) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (169,23)-(169,26)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (169,13)-(169,19)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (169,13)-(169,19)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (169,13)-(169,15) = ":\"" + │ │ │ │ ├── value_loc: (169,15)-(169,18) = "foo" + │ │ │ │ ├── closing_loc: (169,18)-(169,19) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (169,10)-(169,12) = "in" + │ │ └── then_loc: (169,27)-(169,31) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (169,0)-(169,4) = "case" + │ └── end_keyword_loc: (169,32)-(169,35) = "end" + ├── @ CaseMatchNode (location: (170,0)-(170,34)) + │ ├── predicate: + │ │ @ CallNode (location: (170,5)-(170,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (170,5)-(170,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (170,10)-(170,30)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (170,13)-(170,25)) + │ │ │ ├── if_keyword_loc: (170,19)-(170,21) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (170,22)-(170,25)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (170,13)-(170,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ RegularExpressionNode (location: (170,13)-(170,18)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (170,13)-(170,14) = "/" + │ │ │ │ ├── content_loc: (170,14)-(170,17) = "foo" + │ │ │ │ ├── closing_loc: (170,17)-(170,18) = "/" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (170,10)-(170,12) = "in" + │ │ └── then_loc: (170,26)-(170,30) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (170,0)-(170,4) = "case" + │ └── end_keyword_loc: (170,31)-(170,34) = "end" + ├── @ CaseMatchNode (location: (171,0)-(171,34)) + │ ├── predicate: + │ │ @ CallNode (location: (171,5)-(171,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (171,5)-(171,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (171,10)-(171,30)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (171,13)-(171,25)) + │ │ │ ├── if_keyword_loc: (171,19)-(171,21) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (171,22)-(171,25)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (171,13)-(171,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ XStringNode (location: (171,13)-(171,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (171,13)-(171,14) = "`" + │ │ │ │ ├── content_loc: (171,14)-(171,17) = "foo" + │ │ │ │ ├── closing_loc: (171,17)-(171,18) = "`" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (171,10)-(171,12) = "in" + │ │ └── then_loc: (171,26)-(171,30) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (171,0)-(171,4) = "case" + │ └── end_keyword_loc: (171,31)-(171,34) = "end" + ├── @ CaseMatchNode (location: (172,0)-(172,36)) + │ ├── predicate: + │ │ @ CallNode (location: (172,5)-(172,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (172,5)-(172,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (172,10)-(172,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (172,13)-(172,27)) + │ │ │ ├── if_keyword_loc: (172,21)-(172,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (172,24)-(172,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (172,13)-(172,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ XStringNode (location: (172,13)-(172,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (172,13)-(172,16) = "%x[" + │ │ │ │ ├── content_loc: (172,16)-(172,19) = "foo" + │ │ │ │ ├── closing_loc: (172,19)-(172,20) = "]" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (172,10)-(172,12) = "in" + │ │ └── then_loc: (172,28)-(172,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (172,0)-(172,4) = "case" + │ └── end_keyword_loc: (172,33)-(172,36) = "end" + ├── @ CaseMatchNode (location: (173,0)-(173,36)) + │ ├── predicate: + │ │ @ CallNode (location: (173,5)-(173,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (173,5)-(173,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (173,10)-(173,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (173,13)-(173,27)) + │ │ │ ├── if_keyword_loc: (173,21)-(173,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (173,24)-(173,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (173,13)-(173,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ArrayNode (location: (173,13)-(173,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (173,16)-(173,19)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (173,16)-(173,19) = "foo" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "foo" + │ │ │ │ ├── opening_loc: (173,13)-(173,16) = "%i[" + │ │ │ │ └── closing_loc: (173,19)-(173,20) = "]" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (173,10)-(173,12) = "in" + │ │ └── then_loc: (173,28)-(173,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (173,0)-(173,4) = "case" + │ └── end_keyword_loc: (173,33)-(173,36) = "end" + ├── @ CaseMatchNode (location: (174,0)-(174,36)) + │ ├── predicate: + │ │ @ CallNode (location: (174,5)-(174,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (174,5)-(174,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (174,10)-(174,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (174,13)-(174,27)) + │ │ │ ├── if_keyword_loc: (174,21)-(174,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (174,24)-(174,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (174,13)-(174,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ArrayNode (location: (174,13)-(174,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (174,16)-(174,19)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (174,16)-(174,19) = "foo" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "foo" + │ │ │ │ ├── opening_loc: (174,13)-(174,16) = "%I[" + │ │ │ │ └── closing_loc: (174,19)-(174,20) = "]" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (174,10)-(174,12) = "in" + │ │ └── then_loc: (174,28)-(174,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (174,0)-(174,4) = "case" + │ └── end_keyword_loc: (174,33)-(174,36) = "end" + ├── @ CaseMatchNode (location: (175,0)-(175,36)) + │ ├── predicate: + │ │ @ CallNode (location: (175,5)-(175,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (175,5)-(175,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (175,10)-(175,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (175,13)-(175,27)) + │ │ │ ├── if_keyword_loc: (175,21)-(175,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (175,24)-(175,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (175,13)-(175,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ArrayNode (location: (175,13)-(175,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ StringNode (location: (175,16)-(175,19)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (175,16)-(175,19) = "foo" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "foo" + │ │ │ │ ├── opening_loc: (175,13)-(175,16) = "%w[" + │ │ │ │ └── closing_loc: (175,19)-(175,20) = "]" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (175,10)-(175,12) = "in" + │ │ └── then_loc: (175,28)-(175,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (175,0)-(175,4) = "case" + │ └── end_keyword_loc: (175,33)-(175,36) = "end" + ├── @ CaseMatchNode (location: (176,0)-(176,36)) + │ ├── predicate: + │ │ @ CallNode (location: (176,5)-(176,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (176,5)-(176,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (176,10)-(176,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (176,13)-(176,27)) + │ │ │ ├── if_keyword_loc: (176,21)-(176,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (176,24)-(176,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (176,13)-(176,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ArrayNode (location: (176,13)-(176,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ StringNode (location: (176,16)-(176,19)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (176,16)-(176,19) = "foo" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "foo" + │ │ │ │ ├── opening_loc: (176,13)-(176,16) = "%W[" + │ │ │ │ └── closing_loc: (176,19)-(176,20) = "]" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (176,10)-(176,12) = "in" + │ │ └── then_loc: (176,28)-(176,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (176,0)-(176,4) = "case" + │ └── end_keyword_loc: (176,33)-(176,36) = "end" + ├── @ CaseMatchNode (location: (177,0)-(177,36)) + │ ├── predicate: + │ │ @ CallNode (location: (177,5)-(177,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (177,5)-(177,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (177,10)-(177,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (177,13)-(177,27)) + │ │ │ ├── if_keyword_loc: (177,21)-(177,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (177,24)-(177,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (177,13)-(177,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (177,13)-(177,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (177,13)-(177,16) = "%q[" + │ │ │ │ ├── content_loc: (177,16)-(177,19) = "foo" + │ │ │ │ ├── closing_loc: (177,19)-(177,20) = "]" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (177,10)-(177,12) = "in" + │ │ └── then_loc: (177,28)-(177,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (177,0)-(177,4) = "case" + │ └── end_keyword_loc: (177,33)-(177,36) = "end" + ├── @ CaseMatchNode (location: (178,0)-(178,36)) + │ ├── predicate: + │ │ @ CallNode (location: (178,5)-(178,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (178,5)-(178,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (178,10)-(178,32)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (178,13)-(178,27)) + │ │ │ ├── if_keyword_loc: (178,21)-(178,23) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (178,24)-(178,27)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (178,13)-(178,20)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (178,13)-(178,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (178,13)-(178,16) = "%Q[" + │ │ │ │ ├── content_loc: (178,16)-(178,19) = "foo" + │ │ │ │ ├── closing_loc: (178,19)-(178,20) = "]" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (178,10)-(178,12) = "in" + │ │ └── then_loc: (178,28)-(178,32) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (178,0)-(178,4) = "case" + │ └── end_keyword_loc: (178,33)-(178,36) = "end" + ├── @ CaseMatchNode (location: (179,0)-(179,34)) + │ ├── predicate: + │ │ @ CallNode (location: (179,5)-(179,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (179,5)-(179,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (179,10)-(179,30)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (179,13)-(179,25)) + │ │ │ ├── if_keyword_loc: (179,19)-(179,21) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (179,22)-(179,25)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (179,13)-(179,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (179,13)-(179,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (179,13)-(179,14) = "\"" + │ │ │ │ ├── content_loc: (179,14)-(179,17) = "foo" + │ │ │ │ ├── closing_loc: (179,17)-(179,18) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (179,10)-(179,12) = "in" + │ │ └── then_loc: (179,26)-(179,30) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (179,0)-(179,4) = "case" + │ └── end_keyword_loc: (179,31)-(179,34) = "end" + ├── @ CaseMatchNode (location: (180,0)-(180,32)) + │ ├── predicate: + │ │ @ CallNode (location: (180,5)-(180,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (180,5)-(180,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (180,10)-(180,28)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (180,13)-(180,23)) + │ │ │ ├── if_keyword_loc: (180,17)-(180,19) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (180,20)-(180,23)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (180,13)-(180,16)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ NilNode (location: (180,13)-(180,16)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (180,10)-(180,12) = "in" + │ │ └── then_loc: (180,24)-(180,28) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (180,0)-(180,4) = "case" + │ └── end_keyword_loc: (180,29)-(180,32) = "end" + ├── @ CaseMatchNode (location: (181,0)-(181,33)) + │ ├── predicate: + │ │ @ CallNode (location: (181,5)-(181,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (181,5)-(181,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (181,10)-(181,29)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (181,13)-(181,24)) + │ │ │ ├── if_keyword_loc: (181,18)-(181,20) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (181,21)-(181,24)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (181,13)-(181,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SelfNode (location: (181,13)-(181,17)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (181,10)-(181,12) = "in" + │ │ └── then_loc: (181,25)-(181,29) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (181,0)-(181,4) = "case" + │ └── end_keyword_loc: (181,30)-(181,33) = "end" + ├── @ CaseMatchNode (location: (182,0)-(182,33)) + │ ├── predicate: + │ │ @ CallNode (location: (182,5)-(182,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (182,5)-(182,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (182,10)-(182,29)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (182,13)-(182,24)) + │ │ │ ├── if_keyword_loc: (182,18)-(182,20) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (182,21)-(182,24)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (182,13)-(182,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (182,13)-(182,17)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (182,10)-(182,12) = "in" + │ │ └── then_loc: (182,25)-(182,29) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (182,0)-(182,4) = "case" + │ └── end_keyword_loc: (182,30)-(182,33) = "end" + ├── @ CaseMatchNode (location: (183,0)-(183,34)) + │ ├── predicate: + │ │ @ CallNode (location: (183,5)-(183,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (183,5)-(183,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (183,10)-(183,30)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (183,13)-(183,25)) + │ │ │ ├── if_keyword_loc: (183,19)-(183,21) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (183,22)-(183,25)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (183,13)-(183,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ FalseNode (location: (183,13)-(183,18)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (183,10)-(183,12) = "in" + │ │ └── then_loc: (183,26)-(183,30) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (183,0)-(183,4) = "case" + │ └── end_keyword_loc: (183,31)-(183,34) = "end" + ├── @ CaseMatchNode (location: (184,0)-(184,37)) + │ ├── predicate: + │ │ @ CallNode (location: (184,5)-(184,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (184,5)-(184,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (184,10)-(184,33)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (184,13)-(184,28)) + │ │ │ ├── if_keyword_loc: (184,22)-(184,24) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (184,25)-(184,28)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (184,13)-(184,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SourceFileNode (location: (184,13)-(184,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── filepath: "patterns.txt" + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (184,10)-(184,12) = "in" + │ │ └── then_loc: (184,29)-(184,33) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (184,0)-(184,4) = "case" + │ └── end_keyword_loc: (184,34)-(184,37) = "end" + ├── @ CaseMatchNode (location: (185,0)-(185,37)) + │ ├── predicate: + │ │ @ CallNode (location: (185,5)-(185,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (185,5)-(185,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (185,10)-(185,33)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (185,13)-(185,28)) + │ │ │ ├── if_keyword_loc: (185,22)-(185,24) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (185,25)-(185,28)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (185,13)-(185,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SourceLineNode (location: (185,13)-(185,21)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (185,10)-(185,12) = "in" + │ │ └── then_loc: (185,29)-(185,33) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (185,0)-(185,4) = "case" + │ └── end_keyword_loc: (185,34)-(185,37) = "end" + ├── @ CaseMatchNode (location: (186,0)-(186,41)) + │ ├── predicate: + │ │ @ CallNode (location: (186,5)-(186,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (186,5)-(186,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (186,10)-(186,37)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (186,13)-(186,32)) + │ │ │ ├── if_keyword_loc: (186,26)-(186,28) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (186,29)-(186,32)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (186,13)-(186,25)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SourceEncodingNode (location: (186,13)-(186,25)) + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (186,10)-(186,12) = "in" + │ │ └── then_loc: (186,33)-(186,37) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (186,0)-(186,4) = "case" + │ └── end_keyword_loc: (186,38)-(186,41) = "end" + ├── @ CaseMatchNode (location: (187,0)-(187,39)) + │ ├── predicate: + │ │ @ CallNode (location: (187,5)-(187,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (187,5)-(187,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (187,10)-(187,35)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (187,13)-(187,30)) + │ │ │ ├── if_keyword_loc: (187,24)-(187,26) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (187,27)-(187,30)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 0 + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (187,13)-(187,23)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LambdaNode (location: (187,13)-(187,23)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── operator_loc: (187,13)-(187,15) = "->" + │ │ │ │ ├── opening_loc: (187,16)-(187,17) = "{" + │ │ │ │ ├── closing_loc: (187,22)-(187,23) = "}" + │ │ │ │ ├── parameters: ∅ + │ │ │ │ └── body: + │ │ │ │ @ StatementsNode (location: (187,18)-(187,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (187,18)-(187,21)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 1 + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (187,10)-(187,12) = "in" + │ │ └── then_loc: (187,31)-(187,35) = "then" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (187,0)-(187,4) = "case" + │ └── end_keyword_loc: (187,36)-(187,39) = "end" + ├── @ IfNode (location: (189,0)-(190,3)) + │ ├── if_keyword_loc: (189,0)-(189,2) = "if" + │ ├── predicate: + │ │ @ MatchPredicateNode (location: (189,3)-(189,10)) + │ │ ├── value: + │ │ │ @ CallNode (location: (189,3)-(189,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (189,3)-(189,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (189,8)-(189,10)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (189,8)-(189,9) = "[" + │ │ │ └── closing_loc: (189,9)-(189,10) = "]" + │ │ └── operator_loc: (189,5)-(189,7) = "in" + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (190,0)-(190,3) = "end" + ├── @ MatchRequiredNode (location: (192,0)-(194,1)) + │ ├── value: + │ │ @ CallNode (location: (192,0)-(192,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (192,0)-(192,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (192,5)-(194,1)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (193,2)-(193,3)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (192,5)-(192,6) = "[" + │ │ └── closing_loc: (194,0)-(194,1) = "]" + │ └── operator_loc: (192,2)-(192,4) = "=>" + ├── @ MatchPredicateNode (location: (196,0)-(200,1)) + │ ├── value: + │ │ @ CallNode (location: (196,0)-(196,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (196,0)-(196,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ HashPatternNode (location: (196,7)-(200,1)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (196,7)-(196,8)) + │ │ │ └── name: :A + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (197,2)-(199,3)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (197,2)-(197,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (197,2)-(197,5) = "bar" + │ │ │ │ ├── closing_loc: (197,5)-(197,6) = ":" + │ │ │ │ └── unescaped: "bar" + │ │ │ ├── value: + │ │ │ │ @ HashPatternNode (location: (197,7)-(199,3)) + │ │ │ │ ├── constant: + │ │ │ │ │ @ ConstantReadNode (location: (197,7)-(197,8)) + │ │ │ │ │ └── name: :B + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (198,4)-(198,12)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (198,4)-(198,10)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (198,4)-(198,9) = "value" + │ │ │ │ │ │ ├── closing_loc: (198,9)-(198,10) = ":" + │ │ │ │ │ │ └── unescaped: "value" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (198,11)-(198,12)) + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (197,8)-(197,9) = "[" + │ │ │ │ └── closing_loc: (199,2)-(199,3) = "]" + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (196,8)-(196,9) = "[" + │ │ └── closing_loc: (200,0)-(200,1) = "]" + │ └── operator_loc: (196,4)-(196,6) = "in" + ├── @ MatchPredicateNode (location: (202,0)-(202,17)) + │ ├── value: + │ │ @ CallNode (location: (202,0)-(202,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (202,0)-(202,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ CapturePatternNode (location: (202,7)-(202,17)) + │ │ ├── value: + │ │ │ @ LocalVariableTargetNode (location: (202,7)-(202,10)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── target: + │ │ │ @ LocalVariableTargetNode (location: (202,14)-(202,17)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ └── operator_loc: (202,11)-(202,13) = "=>" + │ └── operator_loc: (202,4)-(202,6) = "in" + ├── @ MatchRequiredNode (location: (203,0)-(203,17)) + │ ├── value: + │ │ @ CallNode (location: (203,0)-(203,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (203,0)-(203,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── pattern: + │ │ @ CapturePatternNode (location: (203,7)-(203,17)) + │ │ ├── value: + │ │ │ @ LocalVariableTargetNode (location: (203,7)-(203,10)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── target: + │ │ │ @ LocalVariableTargetNode (location: (203,14)-(203,17)) + │ │ │ ├── name: :baz + │ │ │ └── depth: 0 + │ │ └── operator_loc: (203,11)-(203,13) = "=>" + │ └── operator_loc: (203,4)-(203,6) = "=>" + ├── @ MultiWriteNode (location: (205,0)-(205,20)) + │ ├── lefts: (length: 3) + │ │ ├── @ LocalVariableTargetNode (location: (205,0)-(205,3)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── @ LocalVariableTargetNode (location: (205,5)-(205,8)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (205,10)-(205,13)) + │ │ ├── name: :baz + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (205,14)-(205,15) = "=" + │ └── value: + │ @ ArrayNode (location: (205,16)-(205,20)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (205,16)-(205,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (205,19)-(205,20)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── @ CallNode (location: (206,0)-(208,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (206,0)-(206,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (206,4)-(208,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (207,2)-(207,29)) + │ │ └── body: (length: 1) + │ │ └── @ MatchRequiredNode (location: (207,2)-(207,29)) + │ │ ├── value: + │ │ │ @ ArrayNode (location: (207,2)-(207,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (207,3)-(207,4)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ IntegerNode (location: (207,6)-(207,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: (207,2)-(207,3) = "[" + │ │ │ └── closing_loc: (207,7)-(207,8) = "]" + │ │ ├── pattern: + │ │ │ @ CapturePatternNode (location: (207,12)-(207,29)) + │ │ │ ├── value: + │ │ │ │ @ ArrayPatternNode (location: (207,12)-(207,22)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ LocalVariableTargetNode (location: (207,13)-(207,16)) + │ │ │ │ │ │ ├── name: :foo + │ │ │ │ │ │ └── depth: 1 + │ │ │ │ │ └── @ LocalVariableTargetNode (location: (207,18)-(207,21)) + │ │ │ │ │ ├── name: :bar + │ │ │ │ │ └── depth: 1 + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (207,12)-(207,13) = "[" + │ │ │ │ └── closing_loc: (207,21)-(207,22) = "]" + │ │ │ ├── target: + │ │ │ │ @ LocalVariableTargetNode (location: (207,26)-(207,29)) + │ │ │ │ ├── name: :baz + │ │ │ │ └── depth: 1 + │ │ │ └── operator_loc: (207,23)-(207,25) = "=>" + │ │ └── operator_loc: (207,9)-(207,11) = "=>" + │ ├── opening_loc: (206,4)-(206,6) = "do" + │ └── closing_loc: (208,0)-(208,3) = "end" + ├── @ MatchRequiredNode (location: (210,0)-(210,19)) + │ ├── value: + │ │ @ LocalVariableReadNode (location: (210,0)-(210,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (210,7)-(210,19)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (210,7)-(210,13)) + │ │ │ └── name: :Object + │ │ ├── requireds: (length: 1) + │ │ │ └── @ HashPatternNode (location: (210,14)-(210,18)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (210,15)-(210,17)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (210,15)-(210,17)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (210,15)-(210,16) = "x" + │ │ │ │ │ ├── closing_loc: (210,16)-(210,17) = ":" + │ │ │ │ │ └── unescaped: "x" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (210,15)-(210,16)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (210,15)-(210,16)) + │ │ │ │ │ ├── name: :x + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── opening_loc: (210,14)-(210,15) = "{" + │ │ │ └── closing_loc: (210,17)-(210,18) = "}" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (210,13)-(210,14) = "[" + │ │ └── closing_loc: (210,18)-(210,19) = "]" + │ └── operator_loc: (210,4)-(210,6) = "=>" + ├── @ CallNode (location: (212,0)-(212,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (212,0)-(212,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: (212,1)-(212,2) = "." + │ ├── name: :then + │ ├── message_loc: (212,2)-(212,6) = "then" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (212,7)-(212,19)) + │ ├── locals: [:_1] + │ ├── parameters: + │ │ @ NumberedParametersNode (location: (212,7)-(212,19)) + │ │ └── maximum: 1 + │ ├── body: + │ │ @ StatementsNode (location: (212,9)-(212,17)) + │ │ └── body: (length: 1) + │ │ └── @ MatchPredicateNode (location: (212,9)-(212,17)) + │ │ ├── value: + │ │ │ @ IntegerNode (location: (212,9)-(212,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── pattern: + │ │ │ @ PinnedVariableNode (location: (212,14)-(212,17)) + │ │ │ ├── variable: + │ │ │ │ @ LocalVariableReadNode (location: (212,15)-(212,17)) + │ │ │ │ ├── name: :_1 + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (212,14)-(212,15) = "^" + │ │ └── operator_loc: (212,11)-(212,13) = "in" + │ ├── opening_loc: (212,7)-(212,8) = "{" + │ └── closing_loc: (212,18)-(212,19) = "}" + └── @ MultiWriteNode (location: (214,0)-(217,5)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (215,2)-(215,3)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (216,2)-(216,3)) + │ ├── name: :b + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: (214,0)-(214,1) = "(" + ├── rparen_loc: (217,0)-(217,1) = ")" + ├── operator_loc: (217,2)-(217,3) = "=" + └── value: + @ CallNode (location: (217,4)-(217,5)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (217,4)-(217,5) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/procs.txt b/test/mri/prism/snapshots/procs.txt new file mode 100644 index 00000000000..1329ae6a5f2 --- /dev/null +++ b/test/mri/prism/snapshots/procs.txt @@ -0,0 +1,403 @@ +@ ProgramNode (location: (1,0)-(27,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(27,19)) + └── body: (length: 10) + ├── @ LambdaNode (location: (1,0)-(1,21)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,16)-(1,17) = "{" + │ ├── closing_loc: (1,20)-(1,21) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,3)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,4)-(1,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 3) + │ │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ └── @ BlockLocalVariableNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── opening_loc: (1,3)-(1,4) = "(" + │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ └── body: + │ @ StatementsNode (location: (1,18)-(1,19)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,18)-(1,19)) + │ ├── name: :b + │ └── depth: 0 + ├── @ LambdaNode (location: (3,0)-(5,3)) + │ ├── locals: [] + │ ├── operator_loc: (3,0)-(3,2) = "->" + │ ├── opening_loc: (3,3)-(3,5) = "do" + │ ├── closing_loc: (5,0)-(5,3) = "end" + │ ├── parameters: ∅ + │ └── body: + │ @ BeginNode (location: (3,3)-(5,3)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (4,0)-(5,3)) + │ │ ├── ensure_keyword_loc: (4,0)-(4,6) = "ensure" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ LambdaNode (location: (7,0)-(11,3)) + │ ├── locals: [] + │ ├── operator_loc: (7,0)-(7,2) = "->" + │ ├── opening_loc: (7,3)-(7,5) = "do" + │ ├── closing_loc: (11,0)-(11,3) = "end" + │ ├── parameters: ∅ + │ └── body: + │ @ BeginNode (location: (7,3)-(11,3)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (8,0)-(8,6)) + │ │ ├── keyword_loc: (8,0)-(8,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: + │ │ @ ElseNode (location: (9,0)-(10,6)) + │ │ ├── else_keyword_loc: (9,0)-(9,4) = "else" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (10,0)-(10,6) = "ensure" + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (10,0)-(11,3)) + │ │ ├── ensure_keyword_loc: (10,0)-(10,6) = "ensure" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (11,0)-(11,3) = "end" + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ LambdaNode (location: (13,0)-(13,10)) + │ ├── locals: [] + │ ├── operator_loc: (13,0)-(13,2) = "->" + │ ├── opening_loc: (13,3)-(13,4) = "{" + │ ├── closing_loc: (13,9)-(13,10) = "}" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (13,5)-(13,8)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (13,5)-(13,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (13,5)-(13,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LambdaNode (location: (15,0)-(15,15)) + │ ├── locals: [] + │ ├── operator_loc: (15,0)-(15,2) = "->" + │ ├── opening_loc: (15,3)-(15,5) = "do" + │ ├── closing_loc: (15,12)-(15,15) = "end" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (15,7)-(15,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (15,7)-(15,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (15,7)-(15,10) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LambdaNode (location: (17,0)-(17,29)) + │ ├── locals: [:a, :b, :c, :d, :e] + │ ├── operator_loc: (17,0)-(17,2) = "->" + │ ├── opening_loc: (17,24)-(17,25) = "{" + │ ├── closing_loc: (17,28)-(17,29) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (17,3)-(17,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (17,3)-(17,23)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (17,3)-(17,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (17,6)-(17,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (17,6)-(17,7) = "b" + │ │ │ │ ├── operator_loc: (17,8)-(17,9) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (17,10)-(17,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 2) + │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (17,13)-(17,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :c + │ │ │ │ │ └── name_loc: (17,13)-(17,15) = "c:" + │ │ │ │ └── @ RequiredKeywordParameterNode (location: (17,17)-(17,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ └── name_loc: (17,17)-(17,19) = "d:" + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (17,21)-(17,23)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :e + │ │ │ ├── name_loc: (17,22)-(17,23) = "e" + │ │ │ └── operator_loc: (17,21)-(17,22) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: + │ @ StatementsNode (location: (17,26)-(17,27)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (17,26)-(17,27)) + │ ├── name: :a + │ └── depth: 0 + ├── @ LambdaNode (location: (19,0)-(19,40)) + │ ├── locals: [:a, :b, :c, :d, :e, :f, :g] + │ ├── operator_loc: (19,0)-(19,2) = "->" + │ ├── opening_loc: (19,35)-(19,36) = "{" + │ ├── closing_loc: (19,39)-(19,40) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (19,3)-(19,34)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (19,4)-(19,33)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,4)-(19,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (19,7)-(19,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (19,7)-(19,8) = "b" + │ │ │ │ ├── operator_loc: (19,9)-(19,10) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (19,11)-(19,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (19,14)-(19,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (19,15)-(19,16) = "c" + │ │ │ │ └── operator_loc: (19,14)-(19,15) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 2) + │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (19,18)-(19,20)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ └── name_loc: (19,18)-(19,20) = "d:" + │ │ │ │ └── @ RequiredKeywordParameterNode (location: (19,22)-(19,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :e + │ │ │ │ └── name_loc: (19,22)-(19,24) = "e:" + │ │ │ ├── keyword_rest: + │ │ │ │ @ KeywordRestParameterNode (location: (19,26)-(19,29)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :f + │ │ │ │ ├── name_loc: (19,28)-(19,29) = "f" + │ │ │ │ └── operator_loc: (19,26)-(19,28) = "**" + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (19,31)-(19,33)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :g + │ │ │ ├── name_loc: (19,32)-(19,33) = "g" + │ │ │ └── operator_loc: (19,31)-(19,32) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (19,3)-(19,4) = "(" + │ │ └── closing_loc: (19,33)-(19,34) = ")" + │ └── body: + │ @ StatementsNode (location: (19,37)-(19,38)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (19,37)-(19,38)) + │ ├── name: :a + │ └── depth: 0 + ├── @ LambdaNode (location: (21,0)-(23,3)) + │ ├── locals: [:a, :b, :c, :d, :e, :f, :g] + │ ├── operator_loc: (21,0)-(21,2) = "->" + │ ├── opening_loc: (21,35)-(21,37) = "do" + │ ├── closing_loc: (23,0)-(23,3) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (21,3)-(21,34)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (21,4)-(21,33)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (21,4)-(21,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (21,7)-(21,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (21,7)-(21,8) = "b" + │ │ │ │ ├── operator_loc: (21,9)-(21,10) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (21,11)-(21,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (21,14)-(21,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (21,15)-(21,16) = "c" + │ │ │ │ └── operator_loc: (21,14)-(21,15) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 2) + │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (21,18)-(21,20)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ └── name_loc: (21,18)-(21,20) = "d:" + │ │ │ │ └── @ RequiredKeywordParameterNode (location: (21,22)-(21,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :e + │ │ │ │ └── name_loc: (21,22)-(21,24) = "e:" + │ │ │ ├── keyword_rest: + │ │ │ │ @ KeywordRestParameterNode (location: (21,26)-(21,29)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :f + │ │ │ │ ├── name_loc: (21,28)-(21,29) = "f" + │ │ │ │ └── operator_loc: (21,26)-(21,28) = "**" + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (21,31)-(21,33)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :g + │ │ │ ├── name_loc: (21,32)-(21,33) = "g" + │ │ │ └── operator_loc: (21,31)-(21,32) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (21,3)-(21,4) = "(" + │ │ └── closing_loc: (21,33)-(21,34) = ")" + │ └── body: + │ @ StatementsNode (location: (22,2)-(22,3)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (22,2)-(22,3)) + │ ├── name: :a + │ └── depth: 0 + ├── @ LambdaNode (location: (25,0)-(25,25)) + │ ├── locals: [:a] + │ ├── operator_loc: (25,0)-(25,2) = "->" + │ ├── opening_loc: (25,7)-(25,8) = "{" + │ ├── closing_loc: (25,24)-(25,25) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (25,3)-(25,6)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (25,4)-(25,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (25,4)-(25,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (25,3)-(25,4) = "(" + │ │ └── closing_loc: (25,5)-(25,6) = ")" + │ └── body: + │ @ StatementsNode (location: (25,9)-(25,23)) + │ └── body: (length: 1) + │ └── @ LambdaNode (location: (25,9)-(25,23)) + │ ├── locals: [:b] + │ ├── operator_loc: (25,9)-(25,11) = "->" + │ ├── opening_loc: (25,14)-(25,15) = "{" + │ ├── closing_loc: (25,22)-(25,23) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (25,12)-(25,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (25,12)-(25,13)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (25,12)-(25,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: + │ @ StatementsNode (location: (25,16)-(25,21)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (25,16)-(25,21)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (25,16)-(25,17)) + │ │ ├── name: :a + │ │ └── depth: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :* + │ ├── message_loc: (25,18)-(25,19) = "*" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (25,20)-(25,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (25,20)-(25,21)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ LambdaNode (location: (27,0)-(27,19)) + ├── locals: [:a, :b, :c] + ├── operator_loc: (27,0)-(27,2) = "->" + ├── opening_loc: (27,16)-(27,17) = "{" + ├── closing_loc: (27,18)-(27,19) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (27,3)-(27,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (27,4)-(27,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (27,4)-(27,10)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (27,5)-(27,6)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (27,8)-(27,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (27,4)-(27,5) = "(" + │ │ │ └── rparen_loc: (27,9)-(27,10) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (27,12)-(27,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (27,13)-(27,14) = "c" + │ │ │ └── operator_loc: (27,12)-(27,13) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (27,3)-(27,4) = "(" + │ └── closing_loc: (27,14)-(27,15) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/range_begin_open_exclusive.txt b/test/mri/prism/snapshots/range_begin_open_exclusive.txt new file mode 100644 index 00000000000..a630b01ef19 --- /dev/null +++ b/test/mri/prism/snapshots/range_begin_open_exclusive.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,4)) + ├── flags: exclude_end + ├── left: ∅ + ├── right: + │ @ IntegerNode (location: (1,3)-(1,4)) + │ ├── flags: decimal + │ └── value: 2 + └── operator_loc: (1,0)-(1,3) = "..." diff --git a/test/mri/prism/snapshots/range_begin_open_inclusive.txt b/test/mri/prism/snapshots/range_begin_open_inclusive.txt new file mode 100644 index 00000000000..dc8ef0d2dbc --- /dev/null +++ b/test/mri/prism/snapshots/range_begin_open_inclusive.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,3)) + ├── flags: ∅ + ├── left: ∅ + ├── right: + │ @ IntegerNode (location: (1,2)-(1,3)) + │ ├── flags: decimal + │ └── value: 2 + └── operator_loc: (1,0)-(1,2) = ".." diff --git a/test/mri/prism/snapshots/range_end_open_exclusive.txt b/test/mri/prism/snapshots/range_end_open_exclusive.txt new file mode 100644 index 00000000000..17a75f89456 --- /dev/null +++ b/test/mri/prism/snapshots/range_end_open_exclusive.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,4)) + ├── flags: exclude_end + ├── left: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 2 + ├── right: ∅ + └── operator_loc: (1,1)-(1,4) = "..." diff --git a/test/mri/prism/snapshots/range_end_open_inclusive.txt b/test/mri/prism/snapshots/range_end_open_inclusive.txt new file mode 100644 index 00000000000..b49272d8cd1 --- /dev/null +++ b/test/mri/prism/snapshots/range_end_open_inclusive.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,3)) + ├── flags: ∅ + ├── left: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 2 + ├── right: ∅ + └── operator_loc: (1,1)-(1,3) = ".." diff --git a/test/mri/prism/snapshots/ranges.txt b/test/mri/prism/snapshots/ranges.txt new file mode 100644 index 00000000000..2fffe805376 --- /dev/null +++ b/test/mri/prism/snapshots/ranges.txt @@ -0,0 +1,533 @@ +@ ProgramNode (location: (1,0)-(49,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(49,7)) + └── body: (length: 25) + ├── @ ParenthesesNode (location: (1,0)-(1,6)) + │ ├── body: + │ │ @ StatementsNode (location: (1,1)-(1,5)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (1,1)-(1,5)) + │ │ ├── flags: exclude_end + │ │ ├── left: ∅ + │ │ ├── right: + │ │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (1,1)-(1,4) = "..." + │ ├── opening_loc: (1,0)-(1,1) = "(" + │ └── closing_loc: (1,5)-(1,6) = ")" + ├── @ ParenthesesNode (location: (3,0)-(3,5)) + │ ├── body: + │ │ @ StatementsNode (location: (3,1)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (3,1)-(3,4)) + │ │ ├── flags: ∅ + │ │ ├── left: ∅ + │ │ ├── right: + │ │ │ @ IntegerNode (location: (3,3)-(3,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (3,1)-(3,3) = ".." + │ ├── opening_loc: (3,0)-(3,1) = "(" + │ └── closing_loc: (3,4)-(3,5) = ")" + ├── @ RangeNode (location: (5,0)-(5,5)) + │ ├── flags: exclude_end + │ ├── left: + │ │ @ IntegerNode (location: (5,0)-(5,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (5,4)-(5,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (5,1)-(5,4) = "..." + ├── @ CallNode (location: (7,0)-(7,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (7,0)-(7,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,0)-(7,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (7,3)-(7,9) = "[...2]" + │ ├── opening_loc: (7,3)-(7,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,4)-(7,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ RangeNode (location: (7,4)-(7,8)) + │ │ ├── flags: exclude_end + │ │ ├── left: ∅ + │ │ ├── right: + │ │ │ @ IntegerNode (location: (7,7)-(7,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (7,4)-(7,7) = "..." + │ ├── closing_loc: (7,8)-(7,9) = "]" + │ └── block: ∅ + ├── @ HashNode (location: (9,0)-(9,15)) + │ ├── opening_loc: (9,0)-(9,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (9,2)-(9,13)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (9,2)-(9,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (9,2)-(9,5) = "foo" + │ │ │ ├── closing_loc: (9,5)-(9,6) = ":" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ RangeNode (location: (9,7)-(9,13)) + │ │ │ ├── flags: exclude_end + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (9,10)-(9,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (9,10)-(9,13) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (9,7)-(9,10) = "..." + │ │ └── operator_loc: ∅ + │ └── closing_loc: (9,14)-(9,15) = "}" + ├── @ ParenthesesNode (location: (11,0)-(11,6)) + │ ├── body: + │ │ @ StatementsNode (location: (11,1)-(11,5)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (11,1)-(11,5)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ IntegerNode (location: (11,1)-(11,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (11,2)-(11,5) = "..." + │ ├── opening_loc: (11,0)-(11,1) = "(" + │ └── closing_loc: (11,5)-(11,6) = ")" + ├── @ RangeNode (location: (13,0)-(13,4)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (13,0)-(13,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (13,3)-(13,4)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (13,1)-(13,3) = ".." + ├── @ HashNode (location: (15,0)-(15,14)) + │ ├── opening_loc: (15,0)-(15,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (15,2)-(15,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (15,2)-(15,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (15,2)-(15,5) = "foo" + │ │ │ ├── closing_loc: (15,5)-(15,6) = ":" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ RangeNode (location: (15,7)-(15,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (15,9)-(15,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (15,9)-(15,12) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (15,7)-(15,9) = ".." + │ │ └── operator_loc: ∅ + │ └── closing_loc: (15,13)-(15,14) = "}" + ├── @ ParenthesesNode (location: (17,0)-(17,5)) + │ ├── body: + │ │ @ StatementsNode (location: (17,1)-(17,4)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (17,1)-(17,4)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (17,1)-(17,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (17,2)-(17,4) = ".." + │ ├── opening_loc: (17,0)-(17,1) = "(" + │ └── closing_loc: (17,4)-(17,5) = ")" + ├── @ RangeNode (location: (19,0)-(19,8)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (19,0)-(19,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ RangeNode (location: (19,5)-(19,8)) + │ │ ├── flags: ∅ + │ │ ├── left: ∅ + │ │ ├── right: + │ │ │ @ IntegerNode (location: (19,7)-(19,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (19,5)-(19,7) = ".." + │ └── operator_loc: (19,2)-(19,4) = ".." + ├── @ AndNode (location: (21,0)-(21,8)) + │ ├── left: + │ │ @ RangeNode (location: (21,0)-(21,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (21,0)-(21,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (21,1)-(21,3) = ".." + │ ├── right: + │ │ @ IntegerNode (location: (21,7)-(21,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (21,4)-(21,6) = "&&" + ├── @ CallNode (location: (23,0)-(23,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (23,0)-(23,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (23,0)-(23,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (23,1)-(23,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :== + │ ├── message_loc: (23,4)-(23,6) = "==" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,7)-(23,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (23,7)-(23,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (25,0)-(25,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (25,0)-(25,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (25,0)-(25,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (25,1)-(25,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :!= + │ ├── message_loc: (25,4)-(25,6) = "!=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (25,7)-(25,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (25,7)-(25,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (27,0)-(27,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (27,0)-(27,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (27,0)-(27,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (27,1)-(27,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :=== + │ ├── message_loc: (27,4)-(27,7) = "===" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,8)-(27,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (27,8)-(27,9)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(29,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (29,0)-(29,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (29,0)-(29,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (29,1)-(29,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :<=> + │ ├── message_loc: (29,4)-(29,7) = "<=>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (29,8)-(29,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (29,8)-(29,9)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(31,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (31,0)-(31,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (31,0)-(31,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (31,1)-(31,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (31,4)-(31,6) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,7)-(31,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (31,7)-(31,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (33,0)-(33,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (33,0)-(33,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (33,1)-(33,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :!~ + │ ├── message_loc: (33,4)-(33,6) = "!~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,7)-(33,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (33,7)-(33,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (35,0)-(35,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (35,0)-(35,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (35,1)-(35,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :< + │ ├── message_loc: (35,4)-(35,5) = "<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (35,6)-(35,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (37,0)-(37,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (37,0)-(37,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (37,0)-(37,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (37,1)-(37,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :> + │ ├── message_loc: (37,4)-(37,5) = ">" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,6)-(37,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (37,6)-(37,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (39,0)-(39,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (39,0)-(39,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (39,1)-(39,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :<= + │ ├── message_loc: (39,4)-(39,6) = "<=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (39,7)-(39,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (39,7)-(39,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(41,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (41,0)-(41,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (41,0)-(41,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (41,1)-(41,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :>= + │ ├── message_loc: (41,4)-(41,6) = ">=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (41,7)-(41,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (41,7)-(41,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (43,0)-(43,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (43,0)-(43,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (43,0)-(43,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (43,1)-(43,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :<< + │ ├── message_loc: (43,4)-(43,6) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (43,7)-(43,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (43,7)-(43,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RangeNode (location: (45,0)-(45,3)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (45,0)-(45,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (45,1)-(45,3) = ".." + │ ├── call_operator_loc: ∅ + │ ├── name: :>> + │ ├── message_loc: (45,4)-(45,6) = ">>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (45,7)-(45,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (45,7)-(45,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RangeNode (location: (47,0)-(47,7)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (47,0)-(47,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ CallNode (location: (47,4)-(47,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (47,6)-(47,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+@ + │ │ ├── message_loc: (47,4)-(47,5) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (47,1)-(47,3) = ".." + └── @ RangeNode (location: (49,0)-(49,7)) + ├── flags: ∅ + ├── left: + │ @ IntegerNode (location: (49,0)-(49,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── right: + │ @ CallNode (location: (49,4)-(49,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (49,6)-(49,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── call_operator_loc: ∅ + │ ├── name: :-@ + │ ├── message_loc: (49,4)-(49,5) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (49,1)-(49,3) = ".." diff --git a/test/mri/prism/snapshots/regex.txt b/test/mri/prism/snapshots/regex.txt new file mode 100644 index 00000000000..9e19bbb18d2 --- /dev/null +++ b/test/mri/prism/snapshots/regex.txt @@ -0,0 +1,371 @@ +@ ProgramNode (location: (1,0)-(40,24)) +├── locals: [:foo, :ab, :abc, :a] +└── statements: + @ StatementsNode (location: (1,0)-(40,24)) + └── body: (length: 21) + ├── @ CallNode (location: (1,0)-(1,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,4)-(1,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,4)-(1,5) = "/" + │ │ ├── content_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: (1,8)-(1,9) = "/" + │ │ └── unescaped: "bar" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RegularExpressionNode (location: (3,0)-(3,8)) + │ ├── flags: ignore_case, forced_us_ascii_encoding + │ ├── opening_loc: (3,0)-(3,3) = "%r{" + │ ├── content_loc: (3,3)-(3,6) = "abc" + │ ├── closing_loc: (3,6)-(3,8) = "}i" + │ └── unescaped: "abc" + ├── @ RegularExpressionNode (location: (5,0)-(5,5)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (5,0)-(5,1) = "/" + │ ├── content_loc: (5,1)-(5,4) = "a\\b" + │ ├── closing_loc: (5,4)-(5,5) = "/" + │ └── unescaped: "a\\b" + ├── @ InterpolatedRegularExpressionNode (location: (7,0)-(7,11)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(7,1) = "/" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (7,1)-(7,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (7,1)-(7,5) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ └── @ EmbeddedVariableNode (location: (7,5)-(7,10)) + │ │ ├── operator_loc: (7,5)-(7,6) = "#" + │ │ └── variable: + │ │ @ GlobalVariableReadNode (location: (7,6)-(7,10)) + │ │ └── name: :$bbb + │ └── closing_loc: (7,10)-(7,11) = "/" + ├── @ InterpolatedRegularExpressionNode (location: (9,0)-(9,16)) + │ ├── flags: ∅ + │ ├── opening_loc: (9,0)-(9,1) = "/" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (9,1)-(9,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (9,1)-(9,5) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ ├── @ EmbeddedStatementsNode (location: (9,5)-(9,11)) + │ │ │ ├── opening_loc: (9,5)-(9,7) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (9,7)-(9,10)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (9,7)-(9,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bbb + │ │ │ │ ├── message_loc: (9,7)-(9,10) = "bbb" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (9,10)-(9,11) = "}" + │ │ └── @ StringNode (location: (9,11)-(9,15)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (9,11)-(9,15) = " ccc" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " ccc" + │ └── closing_loc: (9,15)-(9,16) = "/" + ├── @ ArrayNode (location: (11,0)-(11,27)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ MatchWriteNode (location: (11,1)-(11,21)) + │ │ │ ├── call: + │ │ │ │ @ CallNode (location: (11,1)-(11,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ RegularExpressionNode (location: (11,1)-(11,14)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (11,1)-(11,2) = "/" + │ │ │ │ │ ├── content_loc: (11,2)-(11,13) = "(?bar)" + │ │ │ │ │ ├── closing_loc: (11,13)-(11,14) = "/" + │ │ │ │ │ └── unescaped: "(?bar)" + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :=~ + │ │ │ │ ├── message_loc: (11,15)-(11,17) = "=~" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (11,18)-(11,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (11,18)-(11,21)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :baz + │ │ │ │ │ ├── message_loc: (11,18)-(11,21) = "baz" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── targets: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (11,5)-(11,8)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (11,23)-(11,26)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── opening_loc: (11,0)-(11,1) = "[" + │ └── closing_loc: (11,26)-(11,27) = "]" + ├── @ RegularExpressionNode (location: (13,0)-(13,6)) + │ ├── flags: ignore_case, forced_us_ascii_encoding + │ ├── opening_loc: (13,0)-(13,1) = "/" + │ ├── content_loc: (13,1)-(13,4) = "abc" + │ ├── closing_loc: (13,4)-(13,6) = "/i" + │ └── unescaped: "abc" + ├── @ RegularExpressionNode (location: (15,0)-(15,26)) + │ ├── flags: ignore_case, forced_us_ascii_encoding + │ ├── opening_loc: (15,0)-(15,3) = "%r/" + │ ├── content_loc: (15,3)-(15,24) = "[a-z$._?][\\w$.?\#@~]*:" + │ ├── closing_loc: (15,24)-(15,26) = "/i" + │ └── unescaped: "[a-z$._?][\\w$.?\#@~]*:" + ├── @ RegularExpressionNode (location: (17,0)-(17,37)) + │ ├── flags: ignore_case, forced_us_ascii_encoding + │ ├── opening_loc: (17,0)-(17,3) = "%r/" + │ ├── content_loc: (17,3)-(17,35) = "([a-z$._?][\\w$.?\#@~]*)(\\s+)(equ)" + │ ├── closing_loc: (17,35)-(17,37) = "/i" + │ └── unescaped: "([a-z$._?][\\w$.?\#@~]*)(\\s+)(equ)" + ├── @ RegularExpressionNode (location: (19,0)-(19,25)) + │ ├── flags: ignore_case, forced_us_ascii_encoding + │ ├── opening_loc: (19,0)-(19,3) = "%r/" + │ ├── content_loc: (19,3)-(19,23) = "[a-z$._?][\\w$.?\#@~]*" + │ ├── closing_loc: (19,23)-(19,25) = "/i" + │ └── unescaped: "[a-z$._?][\\w$.?\#@~]*" + ├── @ RegularExpressionNode (location: (21,0)-(24,1)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (21,0)-(21,3) = "%r(" + │ ├── content_loc: (21,3)-(24,0) = "\n(?:[\\w\#$%_']|\\(\\)|\\(,\\)|\\[\\]|[0-9])*\n (?:[\\w\#$%_']+)\n" + │ ├── closing_loc: (24,0)-(24,1) = ")" + │ └── unescaped: "\n(?:[\\w\#$%_']|\\(\\)|\\(,\\)|\\[\\]|[0-9])*\n (?:[\\w\#$%_']+)\n" + ├── @ CallNode (location: (26,0)-(26,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RegularExpressionNode (location: (26,0)-(26,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (26,0)-(26,1) = "/" + │ │ ├── content_loc: (26,1)-(26,7) = "(?#\\))" + │ │ ├── closing_loc: (26,7)-(26,8) = "/" + │ │ └── unescaped: "(?#\\))" + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (26,9)-(26,11) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (26,12)-(26,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (26,12)-(26,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (26,12)-(26,13) = "\"" + │ │ ├── content_loc: (26,13)-(26,15) = "hi" + │ │ ├── closing_loc: (26,15)-(26,16) = "\"" + │ │ └── unescaped: "hi" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RegularExpressionNode (location: (28,0)-(28,9)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (28,0)-(28,3) = "%r#" + │ ├── content_loc: (28,3)-(28,8) = "pound" + │ ├── closing_loc: (28,8)-(28,9) = "#" + │ └── unescaped: "pound" + ├── @ InterpolatedRegularExpressionNode (location: (30,0)-(30,13)) + │ ├── flags: once + │ ├── opening_loc: (30,0)-(30,1) = "/" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (30,1)-(30,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (30,1)-(30,5) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ └── @ EmbeddedStatementsNode (location: (30,5)-(30,11)) + │ │ ├── opening_loc: (30,5)-(30,7) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (30,7)-(30,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (30,7)-(30,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bbb + │ │ │ ├── message_loc: (30,7)-(30,10) = "bbb" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (30,10)-(30,11) = "}" + │ └── closing_loc: (30,11)-(30,13) = "/o" + ├── @ MatchWriteNode (location: (32,0)-(33,10)) + │ ├── call: + │ │ @ CallNode (location: (32,0)-(33,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ RegularExpressionNode (location: (32,0)-(33,4)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (32,0)-(32,1) = "/" + │ │ │ ├── content_loc: (32,1)-(33,3) = "(?)" + │ │ │ ├── closing_loc: (33,3)-(33,4) = "/" + │ │ │ └── unescaped: "(?)" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (33,5)-(33,7) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (33,8)-(33,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (33,8)-(33,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (33,8)-(33,9) = "\"" + │ │ │ ├── content_loc: (33,9)-(33,9) = "" + │ │ │ ├── closing_loc: (33,9)-(33,10) = "\"" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (32,0)-(33,4)) + │ ├── name: :ab + │ └── depth: 0 + ├── @ LocalVariableReadNode (location: (33,12)-(33,14)) + │ ├── name: :ab + │ └── depth: 0 + ├── @ MatchWriteNode (location: (35,0)-(35,24)) + │ ├── call: + │ │ @ CallNode (location: (35,0)-(35,24)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ RegularExpressionNode (location: (35,0)-(35,18)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (35,0)-(35,1) = "/" + │ │ │ ├── content_loc: (35,1)-(35,17) = "(?)(?)" + │ │ │ ├── closing_loc: (35,17)-(35,18) = "/" + │ │ │ └── unescaped: "(?)(?)" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (35,19)-(35,21) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (35,22)-(35,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (35,22)-(35,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (35,22)-(35,23) = "\"" + │ │ │ ├── content_loc: (35,23)-(35,23) = "" + │ │ │ ├── closing_loc: (35,23)-(35,24) = "\"" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (35,4)-(35,7)) + │ ├── name: :abc + │ └── depth: 0 + ├── @ LocalVariableReadNode (location: (35,26)-(35,29)) + │ ├── name: :abc + │ └── depth: 0 + ├── @ CallNode (location: (37,0)-(37,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RegularExpressionNode (location: (37,0)-(37,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (37,0)-(37,1) = "/" + │ │ ├── content_loc: (37,1)-(37,9) = "(?)" + │ │ ├── closing_loc: (37,9)-(37,10) = "/" + │ │ └── unescaped: "(?)" + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (37,11)-(37,13) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,14)-(37,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (37,14)-(37,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (37,14)-(37,15) = "\"" + │ │ ├── content_loc: (37,15)-(37,15) = "" + │ │ ├── closing_loc: (37,15)-(37,16) = "\"" + │ │ └── unescaped: "" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LocalVariableWriteNode (location: (39,0)-(39,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (39,0)-(39,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (39,4)-(39,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (39,2)-(39,3) = "=" + └── @ CallNode (location: (40,0)-(40,24)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (40,0)-(40,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (40,4)-(40,24)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (40,6)-(40,22)) + │ └── body: (length: 1) + │ └── @ MatchWriteNode (location: (40,6)-(40,22)) + │ ├── call: + │ │ @ CallNode (location: (40,6)-(40,22)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ RegularExpressionNode (location: (40,6)-(40,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (40,6)-(40,7) = "/" + │ │ │ ├── content_loc: (40,7)-(40,13) = "(?)" + │ │ │ ├── closing_loc: (40,13)-(40,14) = "/" + │ │ │ └── unescaped: "(?)" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (40,15)-(40,17) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (40,18)-(40,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (40,18)-(40,22)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :to_s + │ │ │ ├── message_loc: (40,18)-(40,22) = "to_s" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (40,10)-(40,11)) + │ ├── name: :a + │ └── depth: 1 + ├── opening_loc: (40,4)-(40,5) = "{" + └── closing_loc: (40,23)-(40,24) = "}" diff --git a/test/mri/prism/snapshots/regex_char_width.txt b/test/mri/prism/snapshots/regex_char_width.txt new file mode 100644 index 00000000000..6bf2169b2f3 --- /dev/null +++ b/test/mri/prism/snapshots/regex_char_width.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (2,0)-(3,6)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (2,0)-(3,6)) + └── body: (length: 2) + ├── @ MatchWriteNode (location: (2,0)-(2,36)) + │ ├── call: + │ │ @ CallNode (location: (2,0)-(2,36)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ RegularExpressionNode (location: (2,0)-(2,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (2,0)-(2,1) = "/" + │ │ │ ├── content_loc: (2,1)-(2,21) = "\x{E285}\xA7(?.)\x{E285}\xA9(?.)" + │ │ │ ├── closing_loc: (2,21)-(2,22) = "/" + │ │ │ └── unescaped: "\x{E285}\xA7(?.)\x{E285}\xA9(?.)" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (2,23)-(2,25) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,26)-(2,36)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (2,26)-(2,36)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (2,26)-(2,27) = "'" + │ │ │ ├── content_loc: (2,27)-(2,35) = "\x{E285}\xA7a\x{E285}\xA9b" + │ │ │ ├── closing_loc: (2,35)-(2,36) = "'" + │ │ │ └── unescaped: "\x{E285}\xA7a\x{E285}\xA9b" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (2,7)-(2,8)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (2,17)-(2,18)) + │ ├── name: :b + │ └── depth: 0 + └── @ ArrayNode (location: (3,0)-(3,6)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ LocalVariableReadNode (location: (3,1)-(3,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableReadNode (location: (3,4)-(3,5)) + │ ├── name: :b + │ └── depth: 0 + ├── opening_loc: (3,0)-(3,1) = "[" + └── closing_loc: (3,5)-(3,6) = "]" diff --git a/test/mri/prism/snapshots/repeat_parameters.txt b/test/mri/prism/snapshots/repeat_parameters.txt new file mode 100644 index 00000000000..fd98294ce61 --- /dev/null +++ b/test/mri/prism/snapshots/repeat_parameters.txt @@ -0,0 +1,473 @@ +@ ProgramNode (location: (1,0)-(38,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(38,3)) + └── body: (length: 13) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,12)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_ + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(5,3)) + │ ├── name: :foo + │ ├── name_loc: (4,4)-(4,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (4,8)-(4,15)) + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ RequiredParameterNode (location: (4,8)-(4,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (4,11)-(4,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ └── @ RequiredParameterNode (location: (4,14)-(4,15)) + │ │ │ ├── flags: repeated_parameter + │ │ │ └── name: :_ + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_] + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (4,7)-(4,8) = "(" + │ ├── rparen_loc: (4,15)-(4,16) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (7,0)-(8,3)) + │ ├── name: :foo + │ ├── name_loc: (7,4)-(7,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (7,8)-(7,19)) + │ │ ├── requireds: (length: 4) + │ │ │ ├── @ RequiredParameterNode (location: (7,8)-(7,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (7,11)-(7,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (7,14)-(7,15)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_ + │ │ │ └── @ RequiredParameterNode (location: (7,17)-(7,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_, :_b] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (7,7)-(7,8) = "(" + │ ├── rparen_loc: (7,19)-(7,20) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,0)-(8,3) = "end" + ├── @ DefNode (location: (10,0)-(11,3)) + │ ├── name: :foo + │ ├── name_loc: (10,4)-(10,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (10,8)-(10,23)) + │ │ ├── requireds: (length: 5) + │ │ │ ├── @ RequiredParameterNode (location: (10,8)-(10,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (10,11)-(10,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (10,14)-(10,15)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (10,17)-(10,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_b + │ │ │ └── @ RequiredParameterNode (location: (10,21)-(10,23)) + │ │ │ ├── flags: repeated_parameter + │ │ │ └── name: :_b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_, :_b] + │ ├── def_keyword_loc: (10,0)-(10,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (10,7)-(10,8) = "(" + │ ├── rparen_loc: (10,23)-(10,24) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ DefNode (location: (13,0)-(14,3)) + │ ├── name: :foo + │ ├── name_loc: (13,4)-(13,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (13,8)-(13,35)) + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ MultiTargetNode (location: (13,11)-(13,22)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (13,12)-(13,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (13,15)-(13,18)) + │ │ │ │ │ ├── operator_loc: (13,15)-(13,16) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (13,16)-(13,18)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :_c + │ │ │ │ ├── rights: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (13,20)-(13,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :d + │ │ │ │ ├── lparen_loc: (13,11)-(13,12) = "(" + │ │ │ │ └── rparen_loc: (13,21)-(13,22) = ")" + │ │ │ └── @ MultiTargetNode (location: (13,24)-(13,35)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,25)-(13,26)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :e + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (13,28)-(13,31)) + │ │ │ │ ├── operator_loc: (13,28)-(13,29) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (13,29)-(13,31)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_c + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,33)-(13,34)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :f + │ │ │ ├── lparen_loc: (13,24)-(13,25) = "(" + │ │ │ └── rparen_loc: (13,34)-(13,35) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :b, :_c, :d, :e, :f] + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (13,7)-(13,8) = "(" + │ ├── rparen_loc: (13,35)-(13,36) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ DefNode (location: (16,0)-(17,3)) + │ ├── name: :foo + │ ├── name_loc: (16,4)-(16,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (16,8)-(16,20)) + │ │ ├── requireds: (length: 4) + │ │ │ ├── @ RequiredParameterNode (location: (16,8)-(16,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_a + │ │ │ ├── @ RequiredParameterNode (location: (16,12)-(16,14)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_a + │ │ │ ├── @ RequiredParameterNode (location: (16,16)-(16,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ └── @ RequiredParameterNode (location: (16,19)-(16,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a, :b, :c] + │ ├── def_keyword_loc: (16,0)-(16,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (16,7)-(16,8) = "(" + │ ├── rparen_loc: (16,20)-(16,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ DefNode (location: (19,0)-(20,3)) + │ ├── name: :foo + │ ├── name_loc: (19,4)-(19,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (19,8)-(19,32)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ MultiTargetNode (location: (19,8)-(19,19)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (19,9)-(19,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (19,12)-(19,15)) + │ │ │ │ │ ├── operator_loc: (19,12)-(19,13) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (19,13)-(19,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :_b + │ │ │ │ ├── rights: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (19,17)-(19,18)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :c + │ │ │ │ ├── lparen_loc: (19,8)-(19,9) = "(" + │ │ │ │ └── rparen_loc: (19,18)-(19,19) = ")" + │ │ │ └── @ MultiTargetNode (location: (19,21)-(19,32)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,22)-(19,23)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :d + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (19,25)-(19,28)) + │ │ │ │ ├── operator_loc: (19,25)-(19,26) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (19,26)-(19,28)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,30)-(19,31)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :e + │ │ │ ├── lparen_loc: (19,21)-(19,22) = "(" + │ │ │ └── rparen_loc: (19,31)-(19,32) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_b, :c, :d, :e] + │ ├── def_keyword_loc: (19,0)-(19,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (19,7)-(19,8) = "(" + │ ├── rparen_loc: (19,32)-(19,33) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (20,0)-(20,3) = "end" + ├── @ DefNode (location: (22,0)-(23,3)) + │ ├── name: :foo + │ ├── name_loc: (22,4)-(22,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (22,8)-(22,22)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (22,8)-(22,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ ├── name_loc: (22,8)-(22,10) = "_a" + │ │ │ │ ├── operator_loc: (22,11)-(22,12) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (22,13)-(22,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ OptionalParameterNode (location: (22,16)-(22,22)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (22,16)-(22,18) = "_a" + │ │ │ ├── operator_loc: (22,19)-(22,20) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (22,21)-(22,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (22,7)-(22,8) = "(" + │ ├── rparen_loc: (22,22)-(22,23) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ DefNode (location: (25,0)-(26,3)) + │ ├── name: :foo + │ ├── name_loc: (25,4)-(25,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (25,8)-(25,16)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (25,8)-(25,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ └── name_loc: (25,8)-(25,11) = "_a:" + │ │ │ └── @ RequiredKeywordParameterNode (location: (25,13)-(25,16)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ └── name_loc: (25,13)-(25,16) = "_a:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (25,7)-(25,8) = "(" + │ ├── rparen_loc: (25,16)-(25,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (26,0)-(26,3) = "end" + ├── @ DefNode (location: (28,0)-(29,3)) + │ ├── name: :foo + │ ├── name_loc: (28,4)-(28,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (28,8)-(28,20)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ OptionalKeywordParameterNode (location: (28,8)-(28,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ ├── name_loc: (28,8)-(28,11) = "_a:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (28,12)-(28,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ OptionalKeywordParameterNode (location: (28,15)-(28,20)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (28,15)-(28,18) = "_a:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (28,19)-(28,20)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── def_keyword_loc: (28,0)-(28,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (28,7)-(28,8) = "(" + │ ├── rparen_loc: (28,20)-(28,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (29,0)-(29,3) = "end" + ├── @ DefNode (location: (31,0)-(32,3)) + │ ├── name: :foo + │ ├── name_loc: (31,4)-(31,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (31,8)-(31,16)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (31,8)-(31,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (31,12)-(31,16)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (31,14)-(31,16) = "_a" + │ │ │ └── operator_loc: (31,12)-(31,14) = "**" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── def_keyword_loc: (31,0)-(31,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (31,7)-(31,8) = "(" + │ ├── rparen_loc: (31,16)-(31,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (32,0)-(32,3) = "end" + ├── @ DefNode (location: (34,0)-(35,3)) + │ ├── name: :foo + │ ├── name_loc: (34,4)-(34,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (34,8)-(34,15)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (34,8)-(34,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (34,12)-(34,15)) + │ │ ├── flags: repeated_parameter + │ │ ├── name: :_a + │ │ ├── name_loc: (34,13)-(34,15) = "_a" + │ │ └── operator_loc: (34,12)-(34,13) = "&" + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── def_keyword_loc: (34,0)-(34,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (34,7)-(34,8) = "(" + │ ├── rparen_loc: (34,15)-(34,16) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (35,0)-(35,3) = "end" + └── @ DefNode (location: (37,0)-(38,3)) + ├── name: :foo + ├── name_loc: (37,4)-(37,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (37,8)-(37,15)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (37,8)-(37,10)) + │ │ ├── flags: ∅ + │ │ └── name: :_a + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (37,12)-(37,15)) + │ │ ├── flags: repeated_parameter + │ │ ├── name: :_a + │ │ ├── name_loc: (37,13)-(37,15) = "_a" + │ │ └── operator_loc: (37,12)-(37,13) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:_a] + ├── def_keyword_loc: (37,0)-(37,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (37,7)-(37,8) = "(" + ├── rparen_loc: (37,15)-(37,16) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (38,0)-(38,3) = "end" diff --git a/test/mri/prism/snapshots/rescue.txt b/test/mri/prism/snapshots/rescue.txt new file mode 100644 index 00000000000..d987c496173 --- /dev/null +++ b/test/mri/prism/snapshots/rescue.txt @@ -0,0 +1,491 @@ +@ ProgramNode (location: (1,0)-(35,18)) +├── locals: [:a, :z] +└── statements: + @ StatementsNode (location: (1,0)-(35,18)) + └── body: (length: 14) + ├── @ RescueModifierNode (location: (1,0)-(1,14)) + │ ├── expression: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,4)-(1,10) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (1,11)-(1,14)) + ├── @ RescueModifierNode (location: (3,0)-(4,3)) + │ ├── expression: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (3,4)-(3,10) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (4,0)-(4,3)) + ├── @ RescueModifierNode (location: (6,0)-(6,16)) + │ ├── expression: + │ │ @ BreakNode (location: (6,0)-(6,5)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (6,0)-(6,5) = "break" + │ ├── keyword_loc: (6,6)-(6,12) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (6,13)-(6,16)) + ├── @ RescueModifierNode (location: (8,0)-(8,15)) + │ ├── expression: + │ │ @ NextNode (location: (8,0)-(8,4)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (8,0)-(8,4) = "next" + │ ├── keyword_loc: (8,5)-(8,11) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (8,12)-(8,15)) + ├── @ RescueModifierNode (location: (10,0)-(10,17)) + │ ├── expression: + │ │ @ ReturnNode (location: (10,0)-(10,6)) + │ │ ├── keyword_loc: (10,0)-(10,6) = "return" + │ │ └── arguments: ∅ + │ ├── keyword_loc: (10,7)-(10,13) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (10,14)-(10,17)) + ├── @ RescueModifierNode (location: (12,0)-(12,19)) + │ ├── expression: + │ │ @ CallNode (location: (12,0)-(12,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (12,0)-(12,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (12,4)-(12,10) = "rescue" + │ └── rescue_expression: + │ @ OrNode (location: (12,11)-(12,19)) + │ ├── left: + │ │ @ NilNode (location: (12,11)-(12,14)) + │ ├── right: + │ │ @ IntegerNode (location: (12,18)-(12,19)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (12,15)-(12,17) = "||" + ├── @ RescueModifierNode (location: (14,0)-(14,22)) + │ ├── expression: + │ │ @ CallNode (location: (14,0)-(14,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (14,0)-(14,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (14,4)-(14,10) = "rescue" + │ └── rescue_expression: + │ @ IfNode (location: (14,11)-(14,22)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ NilNode (location: (14,11)-(14,14)) + │ ├── then_keyword_loc: (14,15)-(14,16) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (14,17)-(14,18)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (14,17)-(14,18)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── consequent: + │ │ @ ElseNode (location: (14,19)-(14,22)) + │ │ ├── else_keyword_loc: (14,19)-(14,20) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (14,21)-(14,22)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (14,21)-(14,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ BeginNode (location: (16,0)-(16,24)) + │ ├── begin_keyword_loc: (16,0)-(16,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (16,7)-(16,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (16,7)-(16,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (16,7)-(16,8) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (16,10)-(16,19)) + │ │ ├── keyword_loc: (16,10)-(16,16) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ SplatNode (location: (16,17)-(16,19)) + │ │ │ ├── operator_loc: (16,17)-(16,18) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (16,18)-(16,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (16,18)-(16,19) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (16,21)-(16,24) = "end" + ├── @ CallNode (location: (18,0)-(20,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (18,0)-(18,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (18,4)-(20,3)) + │ ├── locals: [:x] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (18,7)-(18,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (18,8)-(18,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (18,8)-(18,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (18,7)-(18,8) = "|" + │ │ └── closing_loc: (18,9)-(18,10) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (19,2)-(19,40)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (19,2)-(19,40)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (19,2)-(19,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (19,2)-(19,5) = "bar" + │ │ │ ├── opening_loc: (19,5)-(19,6) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (19,6)-(19,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (19,6)-(19,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :y + │ │ │ │ ├── message_loc: (19,6)-(19,7) = "y" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (19,9)-(19,15) = "rescue" + │ │ └── rescue_expression: + │ │ @ CallNode (location: (19,16)-(19,40)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :ArgumentError + │ │ ├── message_loc: (19,16)-(19,29) = "ArgumentError" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (19,30)-(19,40)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (19,30)-(19,40)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :fail + │ │ │ ├── message_loc: (19,30)-(19,34) = "fail" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (19,35)-(19,40)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (19,35)-(19,40)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (19,35)-(19,36) = "\"" + │ │ │ │ ├── content_loc: (19,36)-(19,39) = "baz" + │ │ │ │ ├── closing_loc: (19,39)-(19,40) = "\"" + │ │ │ │ └── unescaped: "baz" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (18,4)-(18,6) = "do" + │ └── closing_loc: (20,0)-(20,3) = "end" + ├── @ IfNode (location: (22,0)-(24,3)) + │ ├── if_keyword_loc: (22,0)-(22,2) = "if" + │ ├── predicate: + │ │ @ LocalVariableWriteNode (location: (22,3)-(22,21)) + │ │ ├── name: :a + │ │ ├── depth: 0 + │ │ ├── name_loc: (22,3)-(22,4) = "a" + │ │ ├── value: + │ │ │ @ RescueModifierNode (location: (22,7)-(22,21)) + │ │ │ ├── expression: + │ │ │ │ @ CallNode (location: (22,7)-(22,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (22,7)-(22,10) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── keyword_loc: (22,11)-(22,17) = "rescue" + │ │ │ └── rescue_expression: + │ │ │ @ NilNode (location: (22,18)-(22,21)) + │ │ └── operator_loc: (22,5)-(22,6) = "=" + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (23,2)-(23,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (23,2)-(23,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (23,2)-(23,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (24,0)-(24,3) = "end" + ├── @ DefNode (location: (26,0)-(26,44)) + │ ├── name: :some_method + │ ├── name_loc: (26,4)-(26,15) = "some_method" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (26,18)-(26,44)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (26,18)-(26,44)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (26,18)-(26,33)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :other_method + │ │ │ ├── message_loc: (26,18)-(26,30) = "other_method" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (26,31)-(26,33)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (26,31)-(26,33)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (26,34)-(26,40) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (26,41)-(26,44)) + │ ├── locals: [] + │ ├── def_keyword_loc: (26,0)-(26,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (26,16)-(26,17) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (28,0)-(31,3)) + │ ├── name: :a + │ ├── name_loc: (28,4)-(28,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (28,0)-(31,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (29,2)-(29,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (29,2)-(29,6)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (29,2)-(29,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (29,4)-(29,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ KeywordHashNode (location: (29,4)-(29,6)) + │ │ │ │ ├── flags: symbol_keys + │ │ │ │ └── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (29,4)-(29,6)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (29,4)-(29,6)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (29,4)-(29,5) = "b" + │ │ │ │ │ ├── closing_loc: (29,5)-(29,6) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (29,4)-(29,6)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ CallNode (location: (29,4)-(29,6)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── message_loc: (29,4)-(29,5) = "b" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (30,0)-(30,6)) + │ │ │ ├── keyword_loc: (30,0)-(30,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (31,0)-(31,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (28,0)-(28,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (31,0)-(31,3) = "end" + ├── @ RescueModifierNode (location: (33,0)-(33,21)) + │ ├── expression: + │ │ @ IfNode (location: (33,0)-(33,10)) + │ │ ├── if_keyword_loc: (33,4)-(33,6) = "if" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (33,7)-(33,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (33,7)-(33,10) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (33,0)-(33,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (33,0)-(33,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (33,0)-(33,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── keyword_loc: (33,11)-(33,17) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (33,18)-(33,21)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :baz + │ ├── message_loc: (33,18)-(33,21) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ LocalVariableWriteNode (location: (35,0)-(35,18)) + ├── name: :z + ├── depth: 0 + ├── name_loc: (35,0)-(35,1) = "z" + ├── value: + │ @ RescueModifierNode (location: (35,4)-(35,18)) + │ ├── expression: + │ │ @ CallNode (location: (35,4)-(35,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :x + │ │ ├── message_loc: (35,4)-(35,5) = "x" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (35,6)-(35,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :y + │ │ │ ├── message_loc: (35,6)-(35,7) = "y" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (35,8)-(35,14) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (35,15)-(35,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (35,15)-(35,16) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,17)-(35,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (35,17)-(35,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (35,17)-(35,18) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (35,2)-(35,3) = "=" diff --git a/test/mri/prism/snapshots/return.txt b/test/mri/prism/snapshots/return.txt new file mode 100644 index 00000000000..9a33076193c --- /dev/null +++ b/test/mri/prism/snapshots/return.txt @@ -0,0 +1,155 @@ +@ ProgramNode (location: (1,0)-(23,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(23,9)) + └── body: (length: 10) + ├── @ ReturnNode (location: (1,0)-(1,6)) + │ ├── keyword_loc: (1,0)-(1,6) = "return" + │ └── arguments: ∅ + ├── @ ReturnNode (location: (3,0)-(3,20)) + │ ├── keyword_loc: (3,0)-(3,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (3,7)-(3,20)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ ParenthesesNode (location: (3,7)-(3,10)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,8)-(3,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,8)-(3,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (3,7)-(3,8) = "(" + │ │ └── closing_loc: (3,9)-(3,10) = ")" + │ ├── @ ParenthesesNode (location: (3,12)-(3,15)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,13)-(3,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,13)-(3,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (3,12)-(3,13) = "(" + │ │ └── closing_loc: (3,14)-(3,15) = ")" + │ └── @ ParenthesesNode (location: (3,17)-(3,20)) + │ ├── body: + │ │ @ StatementsNode (location: (3,18)-(3,19)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (3,18)-(3,19)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── opening_loc: (3,17)-(3,18) = "(" + │ └── closing_loc: (3,19)-(3,20) = ")" + ├── @ ReturnNode (location: (5,0)-(5,9)) + │ ├── keyword_loc: (5,0)-(5,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (5,7)-(5,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SplatNode (location: (5,7)-(5,9)) + │ ├── operator_loc: (5,7)-(5,8) = "*" + │ └── expression: + │ @ IntegerNode (location: (5,8)-(5,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ReturnNode (location: (7,0)-(7,8)) + │ ├── keyword_loc: (7,0)-(7,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (7,7)-(7,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (7,7)-(7,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ReturnNode (location: (9,0)-(10,1)) + │ ├── keyword_loc: (9,0)-(9,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (9,7)-(10,1)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (9,7)-(9,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (9,10)-(9,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (10,0)-(10,1)) + │ ├── flags: decimal + │ └── value: 3 + ├── @ ReturnNode (location: (12,0)-(12,14)) + │ ├── keyword_loc: (12,0)-(12,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (12,7)-(12,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (12,7)-(12,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (12,10)-(12,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (12,13)-(12,14)) + │ ├── flags: decimal + │ └── value: 3 + ├── @ ReturnNode (location: (14,0)-(14,16)) + │ ├── keyword_loc: (14,0)-(14,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (14,7)-(14,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (14,7)-(14,16)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ IntegerNode (location: (14,8)-(14,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (14,11)-(14,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (14,14)-(14,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── opening_loc: (14,7)-(14,8) = "[" + │ └── closing_loc: (14,15)-(14,16) = "]" + ├── @ ReturnNode (location: (16,0)-(19,1)) + │ ├── keyword_loc: (16,0)-(16,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (16,6)-(19,1)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (16,6)-(19,1)) + │ ├── body: + │ │ @ StatementsNode (location: (17,2)-(18,3)) + │ │ └── body: (length: 2) + │ │ ├── @ IntegerNode (location: (17,2)-(17,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (18,2)-(18,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (16,6)-(16,7) = "(" + │ └── closing_loc: (19,0)-(19,1) = ")" + ├── @ ReturnNode (location: (21,0)-(21,8)) + │ ├── keyword_loc: (21,0)-(21,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (21,6)-(21,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (21,6)-(21,8)) + │ ├── body: ∅ + │ ├── opening_loc: (21,6)-(21,7) = "(" + │ └── closing_loc: (21,7)-(21,8) = ")" + └── @ ReturnNode (location: (23,0)-(23,9)) + ├── keyword_loc: (23,0)-(23,6) = "return" + └── arguments: + @ ArgumentsNode (location: (23,6)-(23,9)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ ParenthesesNode (location: (23,6)-(23,9)) + ├── body: + │ @ StatementsNode (location: (23,7)-(23,8)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (23,7)-(23,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── opening_loc: (23,6)-(23,7) = "(" + └── closing_loc: (23,8)-(23,9) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/BEGIN.txt b/test/mri/prism/snapshots/seattlerb/BEGIN.txt new file mode 100644 index 00000000000..246f39cbba8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/BEGIN.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ PreExecutionNode (location: (1,0)-(1,12)) + ├── statements: + │ @ StatementsNode (location: (1,8)-(1,10)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,10)) + │ ├── flags: decimal + │ └── value: 42 + ├── keyword_loc: (1,0)-(1,5) = "BEGIN" + ├── opening_loc: (1,6)-(1,7) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/TestRubyParserShared.txt b/test/mri/prism/snapshots/seattlerb/TestRubyParserShared.txt new file mode 100644 index 00000000000..fabc92e4779 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/TestRubyParserShared.txt @@ -0,0 +1,361 @@ +@ ProgramNode (location: (1,0)-(92,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(92,1)) + └── body: (length: 16) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (1,0)-(1,3) = "%I[" + │ └── closing_loc: (4,0)-(4,1) = "]" + ├── @ ArrayNode (location: (6,0)-(9,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (7,0)-(7,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (7,0)-(7,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (8,0)-(8,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (8,0)-(8,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (6,0)-(6,3) = "%I[" + │ └── closing_loc: (9,0)-(9,1) = "]" + ├── @ ArrayNode (location: (11,0)-(14,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (11,0)-(11,3) = "%W[" + │ └── closing_loc: (14,0)-(14,1) = "]" + ├── @ ArrayNode (location: (16,0)-(19,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (17,0)-(17,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (17,0)-(17,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ StringNode (location: (18,0)-(18,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (18,0)-(18,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (16,0)-(16,3) = "%W[" + │ └── closing_loc: (19,0)-(19,1) = "]" + ├── @ ArrayNode (location: (21,0)-(24,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (21,0)-(21,3) = "%i[" + │ └── closing_loc: (24,0)-(24,1) = "]" + ├── @ ArrayNode (location: (26,0)-(29,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (27,0)-(27,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (27,0)-(27,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (28,0)-(28,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (28,0)-(28,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (26,0)-(26,3) = "%i[" + │ └── closing_loc: (29,0)-(29,1) = "]" + ├── @ RegularExpressionNode (location: (31,0)-(34,1)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (31,0)-(31,3) = "%r[" + │ ├── content_loc: (31,3)-(34,0) = "\n\n\n" + │ ├── closing_loc: (34,0)-(34,1) = "]" + │ └── unescaped: "\n\n\n" + ├── @ ArrayNode (location: (36,0)-(39,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (36,0)-(36,3) = "%w[" + │ └── closing_loc: (39,0)-(39,1) = "]" + ├── @ ArrayNode (location: (41,0)-(44,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (42,0)-(42,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (42,0)-(42,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ StringNode (location: (43,0)-(43,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (43,0)-(43,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (41,0)-(41,3) = "%w[" + │ └── closing_loc: (44,0)-(44,1) = "]" + ├── @ ArrayNode (location: (46,0)-(49,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (47,0)-(47,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (47,0)-(47,1) = ":" + │ │ │ ├── value_loc: (47,1)-(47,6) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (48,0)-(48,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (48,0)-(48,1) = ":" + │ │ ├── value_loc: (48,1)-(48,6) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (46,0)-(46,1) = "[" + │ └── closing_loc: (49,0)-(49,1) = "]" + ├── @ ClassNode (location: (51,0)-(56,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (51,0)-(51,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (51,6)-(51,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (52,2)-(55,5)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (52,2)-(55,5)) + │ │ ├── name: :y + │ │ ├── name_loc: (52,11)-(52,12) = "y" + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (52,6)-(52,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (52,13)-(53,9)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (52,13)-(52,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (53,8)-(53,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (54,4)-(54,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (54,4)-(54,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (54,4)-(54,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (54,6)-(54,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (54,8)-(54,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (54,8)-(54,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [:a, :b] + │ │ ├── def_keyword_loc: (52,2)-(52,5) = "def" + │ │ ├── operator_loc: (52,10)-(52,11) = "." + │ │ ├── lparen_loc: (52,12)-(52,13) = "(" + │ │ ├── rparen_loc: (53,9)-(53,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (55,2)-(55,5) = "end" + │ ├── end_keyword_loc: (56,0)-(56,3) = "end" + │ └── name: :X + ├── @ ClassNode (location: (59,0)-(63,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (59,0)-(59,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (59,6)-(59,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (60,2)-(62,5)) + │ │ └── body: (length: 1) + │ │ └── @ ClassNode (location: (60,2)-(62,5)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (60,2)-(60,7) = "class" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (60,8)-(60,9)) + │ │ │ └── name: :Y + │ │ ├── inheritance_operator_loc: ∅ + │ │ ├── superclass: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (61,4)-(61,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantWriteNode (location: (61,4)-(61,10)) + │ │ │ ├── name: :Z + │ │ │ ├── name_loc: (61,4)-(61,5) = "Z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (61,8)-(61,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── operator_loc: (61,6)-(61,7) = "=" + │ │ ├── end_keyword_loc: (62,2)-(62,5) = "end" + │ │ └── name: :Y + │ ├── end_keyword_loc: (63,0)-(63,3) = "end" + │ └── name: :X + ├── @ ClassNode (location: (66,0)-(71,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (66,0)-(66,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (66,6)-(66,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (67,2)-(70,5)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (67,2)-(70,5)) + │ │ ├── name: :y + │ │ ├── name_loc: (67,6)-(67,7) = "y" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (67,8)-(68,9)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (67,8)-(67,9)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (68,8)-(68,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (69,4)-(69,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (69,4)-(69,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (69,4)-(69,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (69,6)-(69,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (69,8)-(69,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (69,8)-(69,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [:a, :b] + │ │ ├── def_keyword_loc: (67,2)-(67,5) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (67,7)-(67,8) = "(" + │ │ ├── rparen_loc: (68,9)-(68,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (70,2)-(70,5) = "end" + │ ├── end_keyword_loc: (71,0)-(71,3) = "end" + │ └── name: :X + ├── @ ModuleNode (location: (74,0)-(79,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (74,0)-(74,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (74,7)-(74,8)) + │ │ └── name: :X + │ ├── body: + │ │ @ StatementsNode (location: (75,2)-(78,3)) + │ │ └── body: (length: 1) + │ │ └── @ ConstantWriteNode (location: (75,2)-(78,3)) + │ │ ├── name: :X + │ │ ├── name_loc: (75,2)-(75,3) = "X" + │ │ ├── value: + │ │ │ @ ArrayNode (location: (75,6)-(78,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (76,4)-(76,10)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (76,4)-(76,5) = ":" + │ │ │ │ │ ├── value_loc: (76,5)-(76,10) = "line3" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "line3" + │ │ │ │ └── @ SymbolNode (location: (77,4)-(77,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (77,4)-(77,5) = ":" + │ │ │ │ ├── value_loc: (77,5)-(77,10) = "line4" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "line4" + │ │ │ ├── opening_loc: (75,6)-(75,7) = "[" + │ │ │ └── closing_loc: (78,2)-(78,3) = "]" + │ │ └── operator_loc: (75,4)-(75,5) = "=" + │ ├── end_keyword_loc: (79,0)-(79,3) = "end" + │ └── name: :X + ├── @ ModuleNode (location: (82,0)-(86,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (82,0)-(82,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (82,7)-(82,8)) + │ │ └── name: :X + │ ├── body: + │ │ @ StatementsNode (location: (83,2)-(85,5)) + │ │ └── body: (length: 1) + │ │ └── @ ModuleNode (location: (83,2)-(85,5)) + │ │ ├── locals: [] + │ │ ├── module_keyword_loc: (83,2)-(83,8) = "module" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (83,9)-(83,10)) + │ │ │ └── name: :Y + │ │ ├── body: + │ │ │ @ StatementsNode (location: (84,4)-(84,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantWriteNode (location: (84,4)-(84,10)) + │ │ │ ├── name: :Z + │ │ │ ├── name_loc: (84,4)-(84,5) = "Z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (84,8)-(84,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── operator_loc: (84,6)-(84,7) = "=" + │ │ ├── end_keyword_loc: (85,2)-(85,5) = "end" + │ │ └── name: :Y + │ ├── end_keyword_loc: (86,0)-(86,3) = "end" + │ └── name: :X + └── @ CallNode (location: (89,0)-(92,1)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (89,0)-(89,1) = "x" + ├── opening_loc: (89,1)-(89,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (90,0)-(91,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (90,0)-(90,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (90,0)-(90,1) = ":" + │ │ ├── value_loc: (90,1)-(90,6) = "line2" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line2" + │ └── @ SymbolNode (location: (91,0)-(91,6)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (91,0)-(91,1) = ":" + │ ├── value_loc: (91,1)-(91,6) = "line3" + │ ├── closing_loc: ∅ + │ └── unescaped: "line3" + ├── closing_loc: (92,0)-(92,1) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/__ENCODING__.txt b/test/mri/prism/snapshots/seattlerb/__ENCODING__.txt new file mode 100644 index 00000000000..1b223bd8fe7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/__ENCODING__.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ SourceEncodingNode (location: (1,0)-(1,12)) diff --git a/test/mri/prism/snapshots/seattlerb/alias_gvar_backref.txt b/test/mri/prism/snapshots/seattlerb/alias_gvar_backref.txt new file mode 100644 index 00000000000..a2586423d78 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/alias_gvar_backref.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ AliasGlobalVariableNode (location: (1,0)-(1,15)) + ├── new_name: + │ @ GlobalVariableReadNode (location: (1,6)-(1,12)) + │ └── name: :$MATCH + ├── old_name: + │ @ BackReferenceReadNode (location: (1,13)-(1,15)) + │ └── name: :$& + └── keyword_loc: (1,0)-(1,5) = "alias" diff --git a/test/mri/prism/snapshots/seattlerb/alias_resword.txt b/test/mri/prism/snapshots/seattlerb/alias_resword.txt new file mode 100644 index 00000000000..99ed696c687 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/alias_resword.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ AliasMethodNode (location: (1,0)-(1,12)) + ├── new_name: + │ @ SymbolNode (location: (1,6)-(1,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,6)-(1,8) = "in" + │ ├── closing_loc: ∅ + │ └── unescaped: "in" + ├── old_name: + │ @ SymbolNode (location: (1,9)-(1,12)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,9)-(1,12) = "out" + │ ├── closing_loc: ∅ + │ └── unescaped: "out" + └── keyword_loc: (1,0)-(1,5) = "alias" diff --git a/test/mri/prism/snapshots/seattlerb/and_multi.txt b/test/mri/prism/snapshots/seattlerb/and_multi.txt new file mode 100644 index 00000000000..b60b131fd2d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/and_multi.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 1) + └── @ AndNode (location: (1,0)-(3,4)) + ├── left: + │ @ AndNode (location: (1,0)-(2,9)) + │ ├── left: + │ │ @ TrueNode (location: (1,0)-(1,4)) + │ ├── right: + │ │ @ CallNode (location: (2,0)-(2,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ FalseNode (location: (2,4)-(2,9)) + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (2,0)-(2,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,5)-(1,8) = "and" + ├── right: + │ @ TrueNode (location: (3,0)-(3,4)) + └── operator_loc: (2,10)-(2,13) = "and" diff --git a/test/mri/prism/snapshots/seattlerb/aref_args_assocs.txt b/test/mri/prism/snapshots/seattlerb/aref_args_assocs.txt new file mode 100644 index 00000000000..b729186dc5e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/aref_args_assocs.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── elements: (length: 1) + │ └── @ KeywordHashNode (location: (1,1)-(1,7)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,1)-(1,7)) + │ ├── key: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── value: + │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (1,7)-(1,8) = "]" diff --git a/test/mri/prism/snapshots/seattlerb/aref_args_lit_assocs.txt b/test/mri/prism/snapshots/seattlerb/aref_args_lit_assocs.txt new file mode 100644 index 00000000000..0e9454d780b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/aref_args_lit_assocs.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,4)-(1,10)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,4)-(1,10)) + │ ├── key: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (1,10)-(1,11) = "]" diff --git a/test/mri/prism/snapshots/seattlerb/args_kw_block.txt b/test/mri/prism/snapshots/seattlerb/args_kw_block.txt new file mode 100644 index 00000000000..1ad933c74e3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/args_kw_block.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ ├── flags: ∅ + │ ├── name: :b + │ ├── name_loc: (1,13)-(1,14) = "b" + │ └── operator_loc: (1,12)-(1,13) = "&" + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/array_line_breaks.txt b/test/mri/prism/snapshots/seattlerb/array_line_breaks.txt new file mode 100644 index 00000000000..880fedf9330 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(4,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(3,4)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(2,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (2,0)-(2,1) = "'" + │ │ │ ├── content_loc: (2,1)-(2,2) = "a" + │ │ │ ├── closing_loc: (2,2)-(2,3) = "'" + │ │ │ └── unescaped: "a" + │ │ └── @ StringNode (location: (3,0)-(3,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (3,0)-(3,1) = "'" + │ │ ├── content_loc: (3,1)-(3,2) = "b" + │ │ ├── closing_loc: (3,2)-(3,3) = "'" + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (3,3)-(3,4) = "]" + └── @ IntegerNode (location: (4,0)-(4,1)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/array_lits_trailing_calls.txt b/test/mri/prism/snapshots/seattlerb/array_lits_trailing_calls.txt new file mode 100644 index 00000000000..d46a181fc76 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/array_lits_trailing_calls.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ArrayNode (location: (1,0)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── opening_loc: (1,0)-(1,3) = "%w[" + │ │ └── closing_loc: (1,3)-(1,4) = "]" + │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ ├── name: :b + │ ├── message_loc: (1,5)-(1,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,4)) + ├── flags: ∅ + ├── receiver: + │ @ ArrayNode (location: (3,0)-(3,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (3,0)-(3,1) = "[" + │ └── closing_loc: (3,1)-(3,2) = "]" + ├── call_operator_loc: (3,2)-(3,3) = "." + ├── name: :b + ├── message_loc: (3,3)-(3,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/assoc__bare.txt b/test/mri/prism/snapshots/seattlerb/assoc__bare.txt new file mode 100644 index 00000000000..28e4f713c51 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/assoc__bare.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,6)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,4)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "y" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "y" + │ ├── value: + │ │ @ ImplicitNode (location: (1,2)-(1,4)) + │ │ └── value: + │ │ @ CallNode (location: (1,2)-(1,4)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (1,2)-(1,3) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: ∅ + └── closing_loc: (1,5)-(1,6) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/assoc_label.txt b/test/mri/prism/snapshots/seattlerb/assoc_label.txt new file mode 100644 index 00000000000..923f5450f43 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/assoc_label.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "b" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "b" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/attr_asgn_colon_id.txt b/test/mri/prism/snapshots/seattlerb/attr_asgn_colon_id.txt new file mode 100644 index 00000000000..589433eda89 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/attr_asgn_colon_id.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: attribute_write + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b= + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/attrasgn_array_arg.txt b/test/mri/prism/snapshots/seattlerb/attrasgn_array_arg.txt new file mode 100644 index 00000000000..9b04ae9656e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/attrasgn_array_arg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,1)-(1,9) = "[[1, 2]]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ ArrayNode (location: (1,2)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (1,2)-(1,3) = "[" + │ │ └── closing_loc: (1,7)-(1,8) = "]" + │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ ├── flags: decimal + │ └── value: 3 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/attrasgn_array_lhs.txt b/test/mri/prism/snapshots/seattlerb/attrasgn_array_lhs.txt new file mode 100644 index 00000000000..39544e98da2 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/attrasgn_array_lhs.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── flags: attribute_write + ├── receiver: + │ @ ArrayNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── elements: (length: 4) + │ │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (1,11)-(1,12) = "]" + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,12)-(1,24) = "[from .. to]" + ├── opening_loc: (1,12)-(1,13) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,13)-(1,42)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ RangeNode (location: (1,13)-(1,23)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ CallNode (location: (1,13)-(1,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :from + │ │ │ ├── message_loc: (1,13)-(1,17) = "from" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (1,21)-(1,23)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :to + │ │ │ ├── message_loc: (1,21)-(1,23) = "to" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (1,18)-(1,20) = ".." + │ └── @ ArrayNode (location: (1,27)-(1,42)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (1,28)-(1,31)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,28)-(1,29) = "\"" + │ │ │ ├── content_loc: (1,29)-(1,30) = "a" + │ │ │ ├── closing_loc: (1,30)-(1,31) = "\"" + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (1,33)-(1,36)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,33)-(1,34) = "\"" + │ │ │ ├── content_loc: (1,34)-(1,35) = "b" + │ │ │ ├── closing_loc: (1,35)-(1,36) = "\"" + │ │ │ └── unescaped: "b" + │ │ └── @ StringNode (location: (1,38)-(1,41)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,38)-(1,39) = "\"" + │ │ ├── content_loc: (1,39)-(1,40) = "c" + │ │ ├── closing_loc: (1,40)-(1,41) = "\"" + │ │ └── unescaped: "c" + │ ├── opening_loc: (1,27)-(1,28) = "[" + │ └── closing_loc: (1,41)-(1,42) = "]" + ├── closing_loc: (1,23)-(1,24) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt b/test/mri/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt new file mode 100644 index 00000000000..d4c4fe10705 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :B= + ├── message_loc: (1,2)-(1,3) = "B" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/backticks_interpolation_line.txt b/test/mri/prism/snapshots/seattlerb/backticks_interpolation_line.txt new file mode 100644 index 00000000000..67c8be034eb --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/backticks_interpolation_line.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InterpolatedXStringNode (location: (1,2)-(1,8)) + │ ├── opening_loc: (1,2)-(1,3) = "`" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :y + │ │ │ ├── message_loc: (1,5)-(1,6) = "y" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── closing_loc: (1,7)-(1,8) = "`" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bang_eq.txt b/test/mri/prism/snapshots/seattlerb/bang_eq.txt new file mode 100644 index 00000000000..ec3dd888b27 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bang_eq.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :!= + ├── message_loc: (1,2)-(1,4) = "!=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bdot2.txt b/test/mri/prism/snapshots/seattlerb/bdot2.txt new file mode 100644 index 00000000000..d4fb86fbe66 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bdot2.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,4)) + │ ├── flags: ∅ + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,2)-(1,4)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (1,0)-(1,2) = ".." + ├── @ RangeNode (location: (2,2)-(2,5)) + │ ├── flags: ∅ + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,4)-(2,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,4)-(2,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (2,2)-(2,4) = ".." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bdot3.txt b/test/mri/prism/snapshots/seattlerb/bdot3.txt new file mode 100644 index 00000000000..0c960f04587 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bdot3.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,5)) + │ ├── flags: exclude_end + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,3)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (1,0)-(1,3) = "..." + ├── @ RangeNode (location: (2,2)-(2,6)) + │ ├── flags: exclude_end + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,5)-(2,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,5)-(2,6) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (2,2)-(2,5) = "..." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt b/test/mri/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt new file mode 100644 index 00000000000..e1698d0baef --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(3,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (2,0)-(3,3)) + │ ├── ensure_keyword_loc: (2,0)-(2,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt b/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt new file mode 100644 index 00000000000..6603e5c8945 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(9,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,3)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── rescue_clause: + │ @ RescueNode (location: (3,0)-(4,3)) + │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (4,2)-(4,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (4,2)-(4,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (5,0)-(7,6)) + │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (6,2)-(6,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (6,2)-(6,3)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + ├── ensure_clause: + │ @ EnsureNode (location: (7,0)-(9,3)) + │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ ├── statements: + │ │ @ StatementsNode (location: (8,2)-(8,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (8,2)-(8,3)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + └── end_keyword_loc: (9,0)-(9,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt b/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt new file mode 100644 index 00000000000..02e1f097ac4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(9,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (3,0)-(3,6)) + │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: ∅ + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (5,0)-(7,6)) + │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ ├── statements: ∅ + │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + ├── ensure_clause: + │ @ EnsureNode (location: (7,0)-(9,3)) + │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + └── end_keyword_loc: (9,0)-(9,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt b/test/mri/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt new file mode 100644 index 00000000000..b36fe5c1fef --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(4,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (2,0)-(2,6)) + │ ├── keyword_loc: (2,0)-(2,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (3,0)-(4,3)) + │ ├── ensure_keyword_loc: (3,0)-(3,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (4,0)-(4,3) = "end" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg__bare.txt b/test/mri/prism/snapshots/seattlerb/block_arg__bare.txt new file mode 100644 index 00000000000..165c2980be3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg__bare.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,7)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ ├── name: ∅ + │ ├── name_loc: ∅ + │ └── operator_loc: (1,6)-(1,7) = "&" + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,7)-(1,8) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_kwsplat.txt b/test/mri/prism/snapshots/seattlerb/block_arg_kwsplat.txt new file mode 100644 index 00000000000..392de8559b9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_kwsplat.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,11)) + ├── locals: [:b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,9)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,7)-(1,8) = "b" + │ │ │ └── operator_loc: (1,5)-(1,7) = "**" + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,8)-(1,9) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt b/test/mri/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt new file mode 100644 index 00000000000..ee9644d59d8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,21)) + ├── locals: [:b, :c, :d, :e] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── name: :e + │ │ ├── name_loc: (1,17)-(1,18) = "e" + │ │ └── operator_loc: (1,16)-(1,17) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,18)-(1,19) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,20)-(1,21) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat.txt b/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat.txt new file mode 100644 index 00000000000..799bd21057a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,20)) + ├── locals: [:b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,18)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,15)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,16)-(1,17) = "d" + │ │ │ └── operator_loc: (1,15)-(1,16) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,17)-(1,18) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,19)-(1,20) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..b5df136a622 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,25)) + ├── locals: [:b, :c, :d, :e, :f] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,14)-(1,15) = "d" + │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :e + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── name: :f + │ │ ├── name_loc: (1,21)-(1,22) = "f" + │ │ └── operator_loc: (1,20)-(1,21) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,22)-(1,23) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,24)-(1,25) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_optional.txt b/test/mri/prism/snapshots/seattlerb/block_arg_optional.txt new file mode 100644 index 00000000000..8a850e9a21a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_optional.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,13)) + ├── locals: [:b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,10)-(1,11) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_scope.txt b/test/mri/prism/snapshots/seattlerb/block_arg_scope.txt new file mode 100644 index 00000000000..b99cc5e45ce --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_scope.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,12)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,10)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,6)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── name: :c + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,9)-(1,10) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_scope2.txt b/test/mri/prism/snapshots/seattlerb/block_arg_scope2.txt new file mode 100644 index 00000000000..98b3a7da3aa --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_scope2.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,5)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 2) + │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ └── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── name: :d + │ ├── opening_loc: (1,3)-(1,4) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_arg_splat_arg.txt b/test/mri/prism/snapshots/seattlerb/block_arg_splat_arg.txt new file mode 100644 index 00000000000..fd5813c9836 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_arg_splat_arg.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,16)) + ├── locals: [:b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,14)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,13)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,9)-(1,10) = "c" + │ │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,13)-(1,14) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,15)-(1,16) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_kwargs.txt b/test/mri/prism/snapshots/seattlerb/block_args_kwargs.txt new file mode 100644 index 00000000000..0975ce33679 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_kwargs.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,23)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,23)) + ├── locals: [:kwargs] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,14)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,13)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :kwargs + │ │ │ ├── name_loc: (1,7)-(1,13) = "kwargs" + │ │ │ └── operator_loc: (1,5)-(1,7) = "**" + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,13)-(1,14) = "|" + ├── body: + │ @ StatementsNode (location: (1,15)-(1,21)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,15)-(1,21)) + │ ├── name: :kwargs + │ └── depth: 0 + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,22)-(1,23) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_no_kwargs.txt b/test/mri/prism/snapshots/seattlerb/block_args_no_kwargs.txt new file mode 100644 index 00000000000..d47349defbd --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_no_kwargs.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,13)) + ├── locals: [] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ NoKeywordsParameterNode (location: (1,5)-(1,10)) + │ │ │ ├── operator_loc: (1,5)-(1,7) = "**" + │ │ │ └── keyword_loc: (1,7)-(1,10) = "nil" + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,10)-(1,11) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_opt1.txt b/test/mri/prism/snapshots/seattlerb/block_args_opt1.txt new file mode 100644 index 00000000000..1f21c0a4773 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_opt1.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,24)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: + │ @ StatementsNode (location: (1,16)-(1,22)) + │ └── body: (length: 1) + │ └── @ ArrayNode (location: (1,16)-(1,22)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,17)-(1,18)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,20)-(1,21)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── opening_loc: (1,16)-(1,17) = "[" + │ └── closing_loc: (1,21)-(1,22) = "]" + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,23)-(1,24) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_opt2.txt b/test/mri/prism/snapshots/seattlerb/block_args_opt2.txt new file mode 100644 index 00000000000..a8d736dde73 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_opt2.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,18)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ OptionalParameterNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ ├── operator_loc: (1,12)-(1,13) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,15)-(1,16) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,17)-(1,18) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_opt2_2.txt b/test/mri/prism/snapshots/seattlerb/block_args_opt2_2.txt new file mode 100644 index 00000000000..0403851ed7b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_opt2_2.txt @@ -0,0 +1,71 @@ +@ ProgramNode (location: (1,0)-(1,35)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,35)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,35)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,35)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 24 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,22)-(1,23) = "|" + ├── body: + │ @ StatementsNode (location: (1,24)-(1,33)) + │ └── body: (length: 1) + │ └── @ ArrayNode (location: (1,24)-(1,33)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ LocalVariableReadNode (location: (1,25)-(1,26)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── @ LocalVariableReadNode (location: (1,28)-(1,29)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,31)-(1,32)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── opening_loc: (1,24)-(1,25) = "[" + │ └── closing_loc: (1,32)-(1,33) = "]" + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,34)-(1,35) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_args_opt3.txt b/test/mri/prism/snapshots/seattlerb/block_args_opt3.txt new file mode 100644 index 00000000000..ff4495019c7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_args_opt3.txt @@ -0,0 +1,79 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,42)) + ├── locals: [:a, :b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,27)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,26)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 24 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,24)-(1,26)) + │ │ ├── flags: ∅ + │ │ ├── name: :d + │ │ ├── name_loc: (1,25)-(1,26) = "d" + │ │ └── operator_loc: (1,24)-(1,25) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,26)-(1,27) = "|" + ├── body: + │ @ StatementsNode (location: (1,28)-(1,40)) + │ └── body: (length: 1) + │ └── @ ArrayNode (location: (1,28)-(1,40)) + │ ├── flags: ∅ + │ ├── elements: (length: 4) + │ │ ├── @ LocalVariableReadNode (location: (1,29)-(1,30)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── @ LocalVariableReadNode (location: (1,32)-(1,33)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── @ LocalVariableReadNode (location: (1,35)-(1,36)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,38)-(1,39)) + │ │ ├── name: :d + │ │ └── depth: 0 + │ ├── opening_loc: (1,28)-(1,29) = "[" + │ └── closing_loc: (1,39)-(1,40) = "]" + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,41)-(1,42) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_break.txt b/test/mri/prism/snapshots/seattlerb/block_break.txt new file mode 100644 index 00000000000..ce61b2f0d12 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_break.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ BreakNode (location: (1,0)-(1,26)) + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,26)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,26)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,6)-(1,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :arg + │ │ ├── message_loc: (1,10)-(1,13) = "arg" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,14)-(1,26)) + │ ├── locals: [:bar] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,17)-(1,22)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,18)-(1,21)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :bar + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,17)-(1,18) = "|" + │ │ └── closing_loc: (1,21)-(1,22) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,14)-(1,16) = "do" + │ └── closing_loc: (1,23)-(1,26) = "end" + └── keyword_loc: (1,0)-(1,5) = "break" diff --git a/test/mri/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt b/test/mri/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt new file mode 100644 index 00000000000..2e634dc937a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt @@ -0,0 +1,80 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(3,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(3,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (1,2)-(3,4)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,8)-(1,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,1)-(2,2)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,1)-(2,2)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (2,1)-(2,2) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [:c] + │ │ ├── def_keyword_loc: (1,2)-(1,5) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ │ ├── rparen_loc: (1,9)-(1,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (3,1)-(3,4) = "end" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (4,1)-(4,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (4,1)-(4,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :e + │ ├── message_loc: (4,1)-(4,2) = "e" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (4,2)-(4,3) = "." + ├── name: :f + ├── message_loc: (4,3)-(4,4) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (4,5)-(4,11)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (4,5)-(4,7) = "do" + └── closing_loc: (4,8)-(4,11) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt b/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt new file mode 100644 index 00000000000..e46104b868c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt @@ -0,0 +1,100 @@ +@ ProgramNode (location: (1,0)-(1,31)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,31)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,31)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,8)-(1,16)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ └── closing_loc: (1,13)-(1,16) = "end" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── name: :e + ├── message_loc: (1,17)-(1,18) = "e" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,19)-(1,31)) + ├── locals: [:f] + ├── parameters: + │ @ BlockParametersNode (location: (1,22)-(1,25)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,23)-(1,24)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,23)-(1,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :f + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,22)-(1,23) = "|" + │ └── closing_loc: (1,24)-(1,25) = "|" + ├── body: + │ @ StatementsNode (location: (1,26)-(1,27)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,26)-(1,27)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :g + │ ├── message_loc: (1,26)-(1,27) = "g" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,19)-(1,21) = "do" + └── closing_loc: (1,28)-(1,31) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt new file mode 100644 index 00000000000..05d076f8d6f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -0,0 +1,113 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,8)-(1,16)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ └── closing_loc: (1,13)-(1,16) = "end" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── name: :e + ├── message_loc: (1,17)-(1,18) = "e" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,19)-(1,20)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,19)-(1,20)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,19)-(1,20) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,21)-(1,33)) + ├── locals: [:g] + ├── parameters: + │ @ BlockParametersNode (location: (1,24)-(1,27)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,25)-(1,26)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,25)-(1,26)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :g + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,24)-(1,25) = "|" + │ └── closing_loc: (1,26)-(1,27) = "|" + ├── body: + │ @ StatementsNode (location: (1,28)-(1,29)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,28)-(1,29)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :h + │ ├── message_loc: (1,28)-(1,29) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,21)-(1,23) = "do" + └── closing_loc: (1,30)-(1,33) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_call_operation_colon.txt b/test/mri/prism/snapshots/seattlerb/block_call_operation_colon.txt new file mode 100644 index 00000000000..9fd13b0dfcc --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_operation_colon.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,6)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,6)-(1,8) = "do" + │ └── closing_loc: (1,9)-(1,12) = "end" + ├── call_operator_loc: (1,12)-(1,14) = "::" + ├── name: :d + ├── message_loc: (1,14)-(1,15) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/block_call_operation_dot.txt b/test/mri/prism/snapshots/seattlerb/block_call_operation_dot.txt new file mode 100644 index 00000000000..43c19d33181 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_operation_dot.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,6)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,6)-(1,8) = "do" + │ └── closing_loc: (1,9)-(1,12) = "end" + ├── call_operator_loc: (1,12)-(1,13) = "." + ├── name: :d + ├── message_loc: (1,13)-(1,14) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt b/test/mri/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt new file mode 100644 index 00000000000..10c1780d374 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt @@ -0,0 +1,60 @@ +@ ProgramNode (location: (1,0)-(2,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,10)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (1,2)-(1,5)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (1,4)-(1,5) = ")" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(2,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (2,0)-(2,1) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :d + ├── message_loc: (2,2)-(2,3) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (2,4)-(2,10)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (2,4)-(2,6) = "do" + └── closing_loc: (2,7)-(2,10) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_command_operation_colon.txt b/test/mri/prism/snapshots/seattlerb/block_command_operation_colon.txt new file mode 100644 index 00000000000..30fd6dafa00 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_command_operation_colon.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,2)-(1,3) = ":" + │ │ ├── value_loc: (1,3)-(1,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,5)-(1,11)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ └── closing_loc: (1,8)-(1,11) = "end" + ├── call_operator_loc: (1,11)-(1,13) = "::" + ├── name: :c + ├── message_loc: (1,13)-(1,14) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,15)-(1,17)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,15)-(1,16) = ":" + │ ├── value_loc: (1,16)-(1,17) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/block_command_operation_dot.txt b/test/mri/prism/snapshots/seattlerb/block_command_operation_dot.txt new file mode 100644 index 00000000000..e4f69d36045 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_command_operation_dot.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,2)-(1,3) = ":" + │ │ ├── value_loc: (1,3)-(1,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,5)-(1,11)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ └── closing_loc: (1,8)-(1,11) = "end" + ├── call_operator_loc: (1,11)-(1,12) = "." + ├── name: :c + ├── message_loc: (1,12)-(1,13) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,14)-(1,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,14)-(1,16)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,14)-(1,15) = ":" + │ ├── value_loc: (1,15)-(1,16) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt b/test/mri/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt new file mode 100644 index 00000000000..e309ec1f98f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:a] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,6)-(1,7)) + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat.txt b/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat.txt new file mode 100644 index 00000000000..8d28fa7e02d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt b/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt new file mode 100644 index 00000000000..4f4a82acf59 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,18)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,15)-(1,16) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,17)-(1,18) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_decomp_splat.txt b/test/mri/prism/snapshots/seattlerb/block_decomp_splat.txt new file mode 100644 index 00000000000..09d34401264 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_decomp_splat.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,12)) + ├── locals: [:a] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,10)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,9)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,9)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,6)-(1,8)) + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,8)-(1,9) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,9)-(1,10) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_kw.txt b/test/mri/prism/snapshots/seattlerb/block_kw.txt new file mode 100644 index 00000000000..f022637dae6 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_kw.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :blah + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,15)) + ├── locals: [:k] + ├── parameters: + │ @ BlockParametersNode (location: (1,7)-(1,13)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,12)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,8)-(1,10) = "k:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,7)-(1,8) = "|" + │ └── closing_loc: (1,12)-(1,13) = "|" + ├── body: ∅ + ├── opening_loc: (1,5)-(1,6) = "{" + └── closing_loc: (1,14)-(1,15) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_kw__required.txt b/test/mri/prism/snapshots/seattlerb/block_kw__required.txt new file mode 100644 index 00000000000..8a49c8bec7e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_kw__required.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :blah + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,16)) + ├── locals: [:k] + ├── parameters: + │ @ BlockParametersNode (location: (1,8)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,9)-(1,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ └── name_loc: (1,9)-(1,11) = "k:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,8)-(1,9) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,5)-(1,7) = "do" + └── closing_loc: (1,13)-(1,16) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar.txt b/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar.txt new file mode 100644 index 00000000000..e77bf90a276 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bl + ├── message_loc: (1,0)-(1,2) = "bl" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,3)-(1,20)) + ├── locals: [:kw] + ├── parameters: + │ @ BlockParametersNode (location: (1,5)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :kw + │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ │ ├── value_loc: (1,11)-(1,14) = "val" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "val" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,5)-(1,6) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: + │ @ StatementsNode (location: (1,16)-(1,18)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,16)-(1,18)) + │ ├── name: :kw + │ └── depth: 0 + ├── opening_loc: (1,3)-(1,4) = "{" + └── closing_loc: (1,19)-(1,20) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt b/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt new file mode 100644 index 00000000000..a527c8c993d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bl + ├── message_loc: (1,0)-(1,2) = "bl" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,3)-(1,33)) + ├── locals: [:kw, :kw2] + ├── parameters: + │ @ BlockParametersNode (location: (1,5)-(1,28)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,26)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :kw + │ │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ │ │ ├── value_loc: (1,11)-(1,14) = "val" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "val" + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,16)-(1,26)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :kw2 + │ │ │ ├── name_loc: (1,16)-(1,20) = "kw2:" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,21)-(1,26)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,21)-(1,22) = ":" + │ │ │ ├── value_loc: (1,22)-(1,26) = "val2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "val2" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,5)-(1,6) = "|" + │ └── closing_loc: (1,27)-(1,28) = "|" + ├── body: + │ @ StatementsNode (location: (1,29)-(1,31)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,29)-(1,31)) + │ ├── name: :kw + │ └── depth: 0 + ├── opening_loc: (1,3)-(1,4) = "{" + └── closing_loc: (1,32)-(1,33) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_next.txt b/test/mri/prism/snapshots/seattlerb/block_next.txt new file mode 100644 index 00000000000..71f2deb2ddf --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_next.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ NextNode (location: (1,0)-(1,25)) + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,25)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,5)-(1,25)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,5)-(1,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :arg + │ │ ├── message_loc: (1,9)-(1,12) = "arg" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,13)-(1,25)) + │ ├── locals: [:bar] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,16)-(1,21)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,17)-(1,20)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :bar + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,16)-(1,17) = "|" + │ │ └── closing_loc: (1,20)-(1,21) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,13)-(1,15) = "do" + │ └── closing_loc: (1,22)-(1,25) = "end" + └── keyword_loc: (1,0)-(1,4) = "next" diff --git a/test/mri/prism/snapshots/seattlerb/block_opt_arg.txt b/test/mri/prism/snapshots/seattlerb/block_opt_arg.txt new file mode 100644 index 00000000000..64dc928f14b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_opt_arg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_opt_splat.txt b/test/mri/prism/snapshots/seattlerb/block_opt_splat.txt new file mode 100644 index 00000000000..c18df9c27d4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_opt_splat.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,13)-(1,14) = "c" + │ │ │ └── operator_loc: (1,12)-(1,13) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt b/test/mri/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..3806809d2bd --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,22)) + ├── locals: [:b, :c, :d, :e] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,20)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,19)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ └── operator_loc: (1,10)-(1,11) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── name: :e + │ │ ├── name_loc: (1,18)-(1,19) = "e" + │ │ └── operator_loc: (1,17)-(1,18) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,19)-(1,20) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,21)-(1,22) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_optarg.txt b/test/mri/prism/snapshots/seattlerb/block_optarg.txt new file mode 100644 index 00000000000..5da99aec799 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_optarg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,9)-(1,10) = ":" + │ │ │ ├── value_loc: (1,10)-(1,11) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_paren_splat.txt b/test/mri/prism/snapshots/seattlerb/block_paren_splat.txt new file mode 100644 index 00000000000..ebd937904cc --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_paren_splat.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,15)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,13)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,12)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,12)-(1,13) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,14)-(1,15) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_reg_optarg.txt b/test/mri/prism/snapshots/seattlerb/block_reg_optarg.txt new file mode 100644 index 00000000000..53c43603a7e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_reg_optarg.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,12)-(1,13) = ":" + │ │ │ ├── value_loc: (1,13)-(1,14) = "d" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "d" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_return.txt b/test/mri/prism/snapshots/seattlerb/block_return.txt new file mode 100644 index 00000000000..e91f5f25922 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_return.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ ReturnNode (location: (1,0)-(1,27)) + ├── keyword_loc: (1,0)-(1,6) = "return" + └── arguments: + @ ArgumentsNode (location: (1,7)-(1,27)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ CallNode (location: (1,7)-(1,27)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,7)-(1,10) = "foo" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,11)-(1,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :arg + │ ├── message_loc: (1,11)-(1,14) = "arg" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,15)-(1,27)) + ├── locals: [:bar] + ├── parameters: + │ @ BlockParametersNode (location: (1,18)-(1,23)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,19)-(1,22)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,19)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,18)-(1,19) = "|" + │ └── closing_loc: (1,22)-(1,23) = "|" + ├── body: ∅ + ├── opening_loc: (1,15)-(1,17) = "do" + └── closing_loc: (1,24)-(1,27) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/block_scope.txt b/test/mri/prism/snapshots/seattlerb/block_scope.txt new file mode 100644 index 00000000000..a21a28b9937 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_scope.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,10)) + ├── locals: [:b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,8)) + │ ├── parameters: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :b + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,7)-(1,8) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,9)-(1,10) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/block_splat_reg.txt b/test/mri/prism/snapshots/seattlerb/block_splat_reg.txt new file mode 100644 index 00000000000..617ff886225 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/block_splat_reg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,13)) + ├── locals: [:b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,10)-(1,11) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug169.txt b/test/mri/prism/snapshots/seattlerb/bug169.txt new file mode 100644 index 00000000000..e4fb47a6de9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug169.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (1,0)-(1,1) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,2)-(1,4)) + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,3)-(1,4) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,7)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,5)-(1,6) = "{" + └── closing_loc: (1,6)-(1,7) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug179.txt b/test/mri/prism/snapshots/seattlerb/bug179.txt new file mode 100644 index 00000000000..d7695bc7a74 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug179.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ RangeNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ ParenthesesNode (location: (1,2)-(1,4)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (1,3)-(1,4) = ")" + │ ├── right: + │ │ @ NilNode (location: (1,6)-(1,9)) + │ └── operator_loc: (1,4)-(1,6) = ".." + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug190.txt b/test/mri/prism/snapshots/seattlerb/bug190.txt new file mode 100644 index 00000000000..b261a166cf9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug190.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,6)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,3) = "%r'" + ├── content_loc: (1,3)-(1,5) = "\\'" + ├── closing_loc: (1,5)-(1,6) = "'" + └── unescaped: "'" diff --git a/test/mri/prism/snapshots/seattlerb/bug191.txt b/test/mri/prism/snapshots/seattlerb/bug191.txt new file mode 100644 index 00000000000..69835ab1d03 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug191.txt @@ -0,0 +1,87 @@ +@ ProgramNode (location: (1,0)-(3,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,9)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(1,9)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,2)-(1,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,4)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,4)-(1,5) = "\"" + │ │ ├── content_loc: (1,5)-(1,5) = "" + │ │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ │ └── unescaped: "" + │ ├── consequent: + │ │ @ ElseNode (location: (1,6)-(1,9)) + │ │ ├── else_keyword_loc: (1,6)-(1,7) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,8)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,8)-(1,9) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ IfNode (location: (3,0)-(3,9)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (3,0)-(3,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (3,2)-(3,3) = "?" + ├── statements: + │ @ StatementsNode (location: (3,4)-(3,6)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (3,4)-(3,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (3,4)-(3,5) = "'" + │ ├── content_loc: (3,5)-(3,5) = "" + │ ├── closing_loc: (3,5)-(3,6) = "'" + │ └── unescaped: "" + ├── consequent: + │ @ ElseNode (location: (3,6)-(3,9)) + │ ├── else_keyword_loc: (3,6)-(3,7) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (3,8)-(3,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,8)-(3,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (3,8)-(3,9) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug202.txt b/test/mri/prism/snapshots/seattlerb/bug202.txt new file mode 100644 index 00000000000..377b53727ed --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug202.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(2,10)) +├── locals: [:测试] +└── statements: + @ StatementsNode (location: (1,0)-(2,10)) + └── body: (length: 2) + ├── @ GlobalVariableWriteNode (location: (1,0)-(1,11)) + │ ├── name: :$测试 + │ ├── name_loc: (1,0)-(1,7) = "$测试" + │ ├── value: + │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,8)-(1,9) = "=" + └── @ LocalVariableWriteNode (location: (2,0)-(2,10)) + ├── name: :测试 + ├── depth: 0 + ├── name_loc: (2,0)-(2,6) = "测试" + ├── value: + │ @ IntegerNode (location: (2,9)-(2,10)) + │ ├── flags: decimal + │ └── value: 1 + └── operator_loc: (2,7)-(2,8) = "=" diff --git a/test/mri/prism/snapshots/seattlerb/bug236.txt b/test/mri/prism/snapshots/seattlerb/bug236.txt new file mode 100644 index 00000000000..203a39a793a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug236.txt @@ -0,0 +1,70 @@ +@ ProgramNode (location: (1,0)-(3,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,6)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,1)-(1,7)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,2)-(1,6)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,3)-(1,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ ImplicitRestNode (location: (1,4)-(1,5)) + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,2)-(1,3) = "|" + │ │ └── closing_loc: (1,5)-(1,6) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,1)-(1,2) = "{" + │ └── closing_loc: (1,6)-(1,7) = "}" + └── @ CallNode (location: (3,0)-(3,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (3,0)-(3,1) = "x" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (3,1)-(3,6)) + ├── locals: [:a] + ├── parameters: + │ @ BlockParametersNode (location: (3,2)-(3,5)) + │ ├── parameters: + │ │ @ ParametersNode (location: (3,3)-(3,4)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (3,3)-(3,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (3,2)-(3,3) = "|" + │ └── closing_loc: (3,4)-(3,5) = "|" + ├── body: ∅ + ├── opening_loc: (3,1)-(3,2) = "{" + └── closing_loc: (3,5)-(3,6) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug290.txt b/test/mri/prism/snapshots/seattlerb/bug290.txt new file mode 100644 index 00000000000..4f1e673c4b3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug290.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(3,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (2,2)-(2,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/bug_187.txt b/test/mri/prism/snapshots/seattlerb/bug_187.txt new file mode 100644 index 00000000000..ae72675e5cf --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_187.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :private + ├── message_loc: (1,0)-(1,7) = "private" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(3,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ DefNode (location: (1,8)-(3,3)) + │ ├── name: :f + │ ├── name_loc: (1,12)-(1,13) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,0)-(2,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,0)-(2,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (2,2)-(2,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (2,4)-(2,10)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (2,4)-(2,6) = "do" + │ │ └── closing_loc: (2,7)-(2,10) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,8)-(1,11) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_215.txt b/test/mri/prism/snapshots/seattlerb/bug_215.txt new file mode 100644 index 00000000000..de7716335e9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_215.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ UndefNode (location: (1,0)-(1,13)) + ├── names: (length: 1) + │ └── @ SymbolNode (location: (1,6)-(1,13)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,6)-(1,9) = "%s(" + │ ├── value_loc: (1,9)-(1,12) = "foo" + │ ├── closing_loc: (1,12)-(1,13) = ")" + │ └── unescaped: "foo" + └── keyword_loc: (1,0)-(1,5) = "undef" diff --git a/test/mri/prism/snapshots/seattlerb/bug_249.txt b/test/mri/prism/snapshots/seattlerb/bug_249.txt new file mode 100644 index 00000000000..569bea14c54 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_249.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(4,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,28)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :mount + ├── message_loc: (1,0)-(1,5) = "mount" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(4,28)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,6)-(4,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ ParenthesesNode (location: (1,6)-(4,5)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (1,7)-(4,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,7)-(4,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ ConstantReadNode (location: (1,7)-(1,12)) + │ │ │ │ │ └── name: :Class + │ │ │ │ ├── call_operator_loc: (1,12)-(1,13) = "." + │ │ │ │ ├── name: :new + │ │ │ │ ├── message_loc: (1,13)-(1,16) = "new" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (1,17)-(4,4)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (2,0)-(3,3)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ DefNode (location: (2,0)-(3,3)) + │ │ │ │ │ ├── name: :initialize + │ │ │ │ │ ├── name_loc: (2,4)-(2,14) = "initialize" + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── def_keyword_loc: (2,0)-(2,3) = "def" + │ │ │ │ │ ├── operator_loc: ∅ + │ │ │ │ │ ├── lparen_loc: ∅ + │ │ │ │ │ ├── rparen_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ │ └── end_keyword_loc: (3,0)-(3,3) = "end" + │ │ │ │ ├── opening_loc: (1,17)-(1,19) = "do" + │ │ │ │ └── closing_loc: (4,1)-(4,4) = "end" + │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" + │ │ │ └── closing_loc: (4,4)-(4,5) = ")" + │ │ ├── call_operator_loc: (4,5)-(4,6) = "." + │ │ ├── name: :new + │ │ ├── message_loc: (4,6)-(4,9) = "new" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ KeywordHashNode (location: (4,11)-(4,28)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (4,11)-(4,28)) + │ ├── key: + │ │ @ SymbolNode (location: (4,11)-(4,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (4,11)-(4,12) = ":" + │ │ ├── value_loc: (4,12)-(4,14) = "at" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "at" + │ ├── value: + │ │ @ StringNode (location: (4,18)-(4,28)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (4,18)-(4,19) = "'" + │ │ ├── content_loc: (4,19)-(4,27) = "endpoint" + │ │ ├── closing_loc: (4,27)-(4,28) = "'" + │ │ └── unescaped: "endpoint" + │ └── operator_loc: (4,15)-(4,17) = "=>" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_and.txt b/test/mri/prism/snapshots/seattlerb/bug_and.txt new file mode 100644 index 00000000000..3daf505e5f1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_and.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 2) + ├── @ AndNode (location: (1,0)-(2,4)) + │ ├── left: + │ │ @ TrueNode (location: (1,0)-(1,4)) + │ ├── right: + │ │ @ TrueNode (location: (2,0)-(2,4)) + │ └── operator_loc: (1,5)-(1,8) = "and" + └── @ AndNode (location: (4,0)-(4,11)) + ├── left: + │ @ TrueNode (location: (4,0)-(4,4)) + ├── right: + │ @ ArrayNode (location: (4,9)-(4,11)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (4,9)-(4,10) = "[" + │ └── closing_loc: (4,10)-(4,11) = "]" + └── operator_loc: (4,5)-(4,8) = "and" diff --git a/test/mri/prism/snapshots/seattlerb/bug_args__19.txt b/test/mri/prism/snapshots/seattlerb/bug_args__19.txt new file mode 100644 index 00000000000..f451bd01722 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_args__19.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,16)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: + │ @ StatementsNode (location: (1,13)-(1,14)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :d + │ ├── message_loc: (1,13)-(1,14) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,15)-(1,16) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_args_masgn.txt b/test/mri/prism/snapshots/seattlerb/bug_args_masgn.txt new file mode 100644 index 00000000000..297979c182c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_args_masgn.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_args_masgn2.txt b/test/mri/prism/snapshots/seattlerb/bug_args_masgn2.txt new file mode 100644 index 00000000000..6bec9187b3b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_args_masgn2.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,22)) + ├── locals: [:a, :b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,20)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,19)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ │ └── name: :a + │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" + │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,19)-(1,20) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,21)-(1,22) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt b/test/mri/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt new file mode 100644 index 00000000000..42a060d02aa --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,19)) + ├── locals: [:k, :v, :i] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,17)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,16)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :k + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :v + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :i + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,16)-(1,17) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,18)-(1,19) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_call_arglist_parens.txt b/test/mri/prism/snapshots/seattlerb/bug_call_arglist_parens.txt new file mode 100644 index 00000000000..53d6f9220b2 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_call_arglist_parens.txt @@ -0,0 +1,110 @@ +@ ProgramNode (location: (1,6)-(11,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,6)-(11,9)) + └── body: (length: 3) + ├── @ DefNode (location: (1,6)-(3,9)) + │ ├── name: :f + │ ├── name_loc: (1,10)-(1,11) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,8)-(2,17)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,8)-(2,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (2,8)-(2,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,10)-(2,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ ParenthesesNode (location: (2,10)-(2,14)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (2,12)-(2,13)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (2,12)-(2,13)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (2,10)-(2,11) = "(" + │ │ │ │ └── closing_loc: (2,13)-(2,14) = ")" + │ │ │ └── @ IntegerNode (location: (2,16)-(2,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,6)-(1,9) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,6)-(3,9) = "end" + ├── @ DefNode (location: (6,6)-(8,9)) + │ ├── name: :f + │ ├── name_loc: (6,10)-(6,11) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,8)-(7,16)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,8)-(7,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (7,8)-(7,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,10)-(7,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ ParenthesesNode (location: (7,10)-(7,13)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (7,11)-(7,12)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (7,11)-(7,12)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (7,10)-(7,11) = "(" + │ │ │ │ └── closing_loc: (7,12)-(7,13) = ")" + │ │ │ └── @ IntegerNode (location: (7,15)-(7,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (6,6)-(6,9) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (6,11)-(6,12) = "(" + │ ├── rparen_loc: (6,12)-(6,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,6)-(8,9) = "end" + └── @ CallNode (location: (11,0)-(11,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :g + ├── message_loc: (11,0)-(11,1) = "g" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,2)-(11,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ ParenthesesNode (location: (11,2)-(11,6)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (11,4)-(11,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (11,4)-(11,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (11,2)-(11,3) = "(" + │ │ └── closing_loc: (11,5)-(11,6) = ")" + │ └── @ IntegerNode (location: (11,8)-(11,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_case_when_regexp.txt b/test/mri/prism/snapshots/seattlerb/bug_case_when_regexp.txt new file mode 100644 index 00000000000..0cc1ca05e1f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_case_when_regexp.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,26)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "x" + │ ├── closing_loc: ∅ + │ └── unescaped: "x" + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,9)-(1,22)) + │ ├── keyword_loc: (1,9)-(1,13) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,14)-(1,17)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,14)-(1,15) = "/" + │ │ ├── content_loc: (1,15)-(1,16) = "x" + │ │ ├── closing_loc: (1,16)-(1,17) = "/" + │ │ └── unescaped: "x" + │ ├── then_keyword_loc: (1,18)-(1,22) = "then" + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,23)-(1,26) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/bug_comma.txt b/test/mri/prism/snapshots/seattlerb/bug_comma.txt new file mode 100644 index 00000000000..af886999b5e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_comma.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,24)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ CallNode (location: (1,3)-(1,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :test + │ ├── message_loc: (1,3)-(1,7) = "test" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,8)-(1,9) = "?" + │ │ │ ├── content_loc: (1,9)-(1,10) = "d" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "d" + │ │ └── @ CallNode (location: (1,12)-(1,15)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :dir + │ │ ├── message_loc: (1,12)-(1,15) = "dir" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (1,16)-(1,20) = "then" + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/bug_cond_pct.txt b/test/mri/prism/snapshots/seattlerb/bug_cond_pct.txt new file mode 100644 index 00000000000..cbf3bc3ef02 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_cond_pct.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,28)) + ├── predicate: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,6)-(1,23)) + │ ├── keyword_loc: (1,6)-(1,10) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,11)-(1,23)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,11)-(1,14) = "%r%" + │ │ ├── content_loc: (1,14)-(1,22) = "blahblah" + │ │ ├── closing_loc: (1,22)-(1,23) = "%" + │ │ └── unescaped: "blahblah" + │ ├── then_keyword_loc: ∅ + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,25)-(1,28) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/bug_hash_args.txt b/test/mri/prism/snapshots/seattlerb/bug_hash_args.txt new file mode 100644 index 00000000000..6f17e88714a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_hash_args.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,10)-(1,13) = "baz" + │ │ ├── closing_loc: (1,13)-(1,14) = ":" + │ │ └── unescaped: "baz" + │ ├── value: + │ │ @ NilNode (location: (1,15)-(1,18)) + │ └── operator_loc: ∅ + ├── closing_loc: (1,18)-(1,19) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt b/test/mri/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt new file mode 100644 index 00000000000..e7256b337b9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,10)-(1,13) = "baz" + │ │ ├── closing_loc: (1,13)-(1,14) = ":" + │ │ └── unescaped: "baz" + │ ├── value: + │ │ @ NilNode (location: (1,15)-(1,18)) + │ └── operator_loc: ∅ + ├── closing_loc: (1,19)-(1,20) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_hash_interp_array.txt b/test/mri/prism/snapshots/seattlerb/bug_hash_interp_array.txt new file mode 100644 index 00000000000..433fb024115 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_hash_interp_array.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,13)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,11)) + │ ├── key: + │ │ @ InterpolatedSymbolNode (location: (1,2)-(1,8)) + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,6)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (1,5)-(1,6) = "}" + │ │ └── closing_loc: (1,6)-(1,8) = "\":" + │ ├── value: + │ │ @ ArrayNode (location: (1,9)-(1,11)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── opening_loc: (1,9)-(1,10) = "[" + │ │ └── closing_loc: (1,10)-(1,11) = "]" + │ └── operator_loc: ∅ + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_masgn_right.txt b/test/mri/prism/snapshots/seattlerb/bug_masgn_right.txt new file mode 100644 index 00000000000..b4c75c4607e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_masgn_right.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/bug_not_parens.txt b/test/mri/prism/snapshots/seattlerb/bug_not_parens.txt new file mode 100644 index 00000000000..9e4a416d4aa --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_not_parens.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,4)-(1,5) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt b/test/mri/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt new file mode 100644 index 00000000000..33016f32f86 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ LocalVariableOrWriteNode (location: (1,0)-(1,18)) + ├── name_loc: (1,0)-(1,1) = "a" + ├── operator_loc: (1,2)-(1,5) = "||=" + ├── value: + │ @ RescueModifierNode (location: (1,6)-(1,18)) + │ ├── expression: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,8)-(1,14) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (1,15)-(1,18)) + ├── name: :a + └── depth: 0 diff --git a/test/mri/prism/snapshots/seattlerb/call_and.txt b/test/mri/prism/snapshots/seattlerb/call_and.txt new file mode 100644 index 00000000000..d3e88b3f9e4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_and.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :& + ├── message_loc: (1,2)-(1,3) = "&" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_arg_assoc.txt b/test/mri/prism/snapshots/seattlerb/call_arg_assoc.txt new file mode 100644 index 00000000000..27c19fd3392 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_arg_assoc.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,9)-(1,10) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt b/test/mri/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt new file mode 100644 index 00000000000..0193eb1dfcf --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ ├── flags: contains_keyword_splat + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,15)) + │ ├── flags: ∅ + │ └── elements: (length: 2) + │ ├── @ AssocNode (location: (1,5)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,5)-(1,7) = "kw" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "kw" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── @ AssocSplatNode (location: (1,12)-(1,15)) + │ ├── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,12)-(1,14) = "**" + ├── closing_loc: (1,15)-(1,16) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_arg_kwsplat.txt b/test/mri/prism/snapshots/seattlerb/call_arg_kwsplat.txt new file mode 100644 index 00000000000..91c7725525f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_arg_kwsplat.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ ├── flags: contains_keyword_splat + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ KeywordHashNode (location: (1,5)-(1,8)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,5)-(1,8)) + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,5)-(1,7) = "**" + ├── closing_loc: (1,8)-(1,9) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_args_assoc_quoted.txt b/test/mri/prism/snapshots/seattlerb/call_args_assoc_quoted.txt new file mode 100644 index 00000000000..2d6f81c8186 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_args_assoc_quoted.txt @@ -0,0 +1,106 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,2)-(1,11)) + │ │ ├── key: + │ │ │ @ InterpolatedSymbolNode (location: (1,2)-(1,9)) + │ │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ │ ├── parts: (length: 1) + │ │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :k + │ │ │ │ │ ├── message_loc: (1,5)-(1,6) = "k" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ │ └── closing_loc: (1,7)-(1,9) = "\":" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (3,0)-(3,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (3,2)-(3,8)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (3,2)-(3,8)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,2)-(3,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (3,2)-(3,3) = "\"" + │ │ │ ├── value_loc: (3,3)-(3,4) = "k" + │ │ │ ├── closing_loc: (3,4)-(3,6) = "\":" + │ │ │ └── unescaped: "k" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,6)-(3,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (5,0)-(5,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (5,2)-(5,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (5,2)-(5,8)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (5,2)-(5,8)) + │ ├── key: + │ │ @ SymbolNode (location: (5,2)-(5,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,2)-(5,3) = "'" + │ │ ├── value_loc: (5,3)-(5,4) = "k" + │ │ ├── closing_loc: (5,4)-(5,6) = "':" + │ │ └── unescaped: "k" + │ ├── value: + │ │ @ IntegerNode (location: (5,6)-(5,8)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt b/test/mri/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt new file mode 100644 index 00000000000..312a1981a06 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,10)-(1,11) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_args_command.txt b/test/mri/prism/snapshots/seattlerb/call_args_command.txt new file mode 100644 index 00000000000..f4a55ff58c3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_args_command.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,5)-(1,6) = "." + │ ├── name: :d + │ ├── message_loc: (1,6)-(1,7) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_array_arg.txt b/test/mri/prism/snapshots/seattlerb/call_array_arg.txt new file mode 100644 index 00000000000..95d2f4859d0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_array_arg.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :== + ├── message_loc: (1,2)-(1,4) = "==" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_array_block_call.txt b/test/mri/prism/snapshots/seattlerb/call_array_block_call.txt new file mode 100644 index 00000000000..e02740e7f58 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_array_block_call.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ NilNode (location: (1,4)-(1,7)) + │ │ └── @ CallNode (location: (1,9)-(1,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,9)-(1,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,11)-(1,17)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,11)-(1,13) = "do" + │ │ └── closing_loc: (1,14)-(1,17) = "end" + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,18)-(1,19) = "]" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_array_lambda_block_call.txt b/test/mri/prism/snapshots/seattlerb/call_array_lambda_block_call.txt new file mode 100644 index 00000000000..c6aa7228123 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_array_lambda_block_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,11)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ LambdaNode (location: (1,3)-(1,10)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (1,3)-(1,5) = "->" + │ │ ├── opening_loc: (1,8)-(1,9) = "{" + │ │ ├── closing_loc: (1,9)-(1,10) = "}" + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ │ ├── parameters: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ │ └── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,10)-(1,11) = "]" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,12)-(2,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,12)-(1,14) = "do" + └── closing_loc: (2,0)-(2,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt b/test/mri/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt new file mode 100644 index 00000000000..091e21c00a6 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,3)-(1,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,3)-(1,4) = ":" + │ │ │ ├── value_loc: (1,4)-(1,5) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ KeywordHashNode (location: (1,7)-(1,14)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,7)-(1,14)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,7)-(1,9)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,7)-(1,8) = ":" + │ │ │ ├── value_loc: (1,8)-(1,9) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (1,10)-(1,12) = "=>" + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,14)-(1,15) = "]" + ├── closing_loc: (1,15)-(1,16) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_assoc.txt b/test/mri/prism/snapshots/seattlerb/call_assoc.txt new file mode 100644 index 00000000000..438c2565538 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_assoc.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,6)-(1,7) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_assoc_new.txt b/test/mri/prism/snapshots/seattlerb/call_assoc_new.txt new file mode 100644 index 00000000000..b4d7e0bf834 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_assoc_new.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "a" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt b/test/mri/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt new file mode 100644 index 00000000000..9587e2e074d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(5,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,4)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(5,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(5,3)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(5,3)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "b" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "b" + │ ├── value: + │ │ @ IfNode (location: (1,5)-(5,3)) + │ │ ├── if_keyword_loc: (1,5)-(1,7) = "if" + │ │ ├── predicate: + │ │ │ @ SymbolNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,8)-(1,9) = ":" + │ │ │ ├── value_loc: (1,9)-(1,10) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,0)-(2,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (3,0)-(5,3)) + │ │ │ ├── else_keyword_loc: (3,0)-(3,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,0)-(4,1)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (4,0)-(4,1)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ └── operator_loc: ∅ + ├── closing_loc: (5,3)-(5,4) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt b/test/mri/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt new file mode 100644 index 00000000000..8d0b285172c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,7)-(1,8) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_bang_command_call.txt b/test/mri/prism/snapshots/seattlerb/call_bang_command_call.txt new file mode 100644 index 00000000000..5e4e10d953c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_bang_command_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,2)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :b + │ ├── message_loc: (1,4)-(1,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_bang_squiggle.txt b/test/mri/prism/snapshots/seattlerb/call_bang_squiggle.txt new file mode 100644 index 00000000000..bf11bc0136f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_bang_squiggle.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :!~ + ├── message_loc: (1,2)-(1,4) = "!~" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_begin_call_block_call.txt b/test/mri/prism/snapshots/seattlerb/call_begin_call_block_call.txt new file mode 100644 index 00000000000..1aa994c8e6d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_begin_call_block_call.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ BeginNode (location: (1,2)-(3,3)) + │ ├── begin_keyword_loc: (1,2)-(1,7) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (2,0)-(2,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,0)-(2,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (2,0)-(2,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── name: :c + │ │ ├── message_loc: (2,2)-(2,3) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (2,4)-(2,10)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (2,4)-(2,6) = "do" + │ │ └── closing_loc: (2,7)-(2,10) = "end" + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_block_arg_named.txt b/test/mri/prism/snapshots/seattlerb/call_block_arg_named.txt new file mode 100644 index 00000000000..f87c29cf2e1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_block_arg_named.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,6)-(1,7) = ")" + └── block: + @ BlockArgumentNode (location: (1,2)-(1,6)) + ├── expression: + │ @ CallNode (location: (1,3)-(1,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :blk + │ ├── message_loc: (1,3)-(1,6) = "blk" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (1,2)-(1,3) = "&" diff --git a/test/mri/prism/snapshots/seattlerb/call_carat.txt b/test/mri/prism/snapshots/seattlerb/call_carat.txt new file mode 100644 index 00000000000..856e9a7847f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_carat.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :^ + ├── message_loc: (1,2)-(1,3) = "^" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_colon2.txt b/test/mri/prism/snapshots/seattlerb/call_colon2.txt new file mode 100644 index 00000000000..98bfc631260 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_colon2.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_colon_parens.txt b/test/mri/prism/snapshots/seattlerb/call_colon_parens.txt new file mode 100644 index 00000000000..6d10171a2b1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_colon_parens.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,4)-(1,5) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_div.txt b/test/mri/prism/snapshots/seattlerb/call_div.txt new file mode 100644 index 00000000000..ba62fb87bd1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_div.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :/ + ├── message_loc: (1,2)-(1,3) = "/" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_dot_parens.txt b/test/mri/prism/snapshots/seattlerb/call_dot_parens.txt new file mode 100644 index 00000000000..c9b70846996 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_dot_parens.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (1,2)-(1,3) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,3)-(1,4) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_env.txt b/test/mri/prism/snapshots/seattlerb/call_env.txt new file mode 100644 index 00000000000..fd1f95388ed --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_env.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :happy + ├── message_loc: (1,2)-(1,7) = "happy" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_eq3.txt b/test/mri/prism/snapshots/seattlerb/call_eq3.txt new file mode 100644 index 00000000000..e636e157257 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_eq3.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :=== + ├── message_loc: (1,2)-(1,5) = "===" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_gt.txt b/test/mri/prism/snapshots/seattlerb/call_gt.txt new file mode 100644 index 00000000000..a6f19e5adfe --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_gt.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :> + ├── message_loc: (1,2)-(1,3) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_kwsplat.txt b/test/mri/prism/snapshots/seattlerb/call_kwsplat.txt new file mode 100644 index 00000000000..4199e97a44c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_kwsplat.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: contains_keyword_splat + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,2)-(1,5)) + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,2)-(1,4) = "**" + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_leading_dots.txt b/test/mri/prism/snapshots/seattlerb/call_leading_dots.txt new file mode 100644 index 00000000000..e8435d7e7a1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_leading_dots.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── name: :b + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (3,0)-(3,1) = "." + ├── name: :c + ├── message_loc: (3,1)-(3,2) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_leading_dots_comment.txt b/test/mri/prism/snapshots/seattlerb/call_leading_dots_comment.txt new file mode 100644 index 00000000000..e5dfb723723 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_leading_dots_comment.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(4,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── name: :b + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (4,0)-(4,1) = "." + ├── name: :d + ├── message_loc: (4,1)-(4,2) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_lt.txt b/test/mri/prism/snapshots/seattlerb/call_lt.txt new file mode 100644 index 00000000000..14f50585d93 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_lt.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :< + ├── message_loc: (1,2)-(1,3) = "<" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_lte.txt b/test/mri/prism/snapshots/seattlerb/call_lte.txt new file mode 100644 index 00000000000..665a99d60a8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_lte.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :<= + ├── message_loc: (1,2)-(1,4) = "<=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_not.txt b/test/mri/prism/snapshots/seattlerb/call_not.txt new file mode 100644 index 00000000000..86c68923031 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_not.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,4)-(1,6)) + │ ├── flags: decimal + │ └── value: 42 + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_pipe.txt b/test/mri/prism/snapshots/seattlerb/call_pipe.txt new file mode 100644 index 00000000000..855e986ef6f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_pipe.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :| + ├── message_loc: (1,2)-(1,3) = "|" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_rshift.txt b/test/mri/prism/snapshots/seattlerb/call_rshift.txt new file mode 100644 index 00000000000..26e593db187 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_rshift.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :>> + ├── message_loc: (1,2)-(1,4) = ">>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_self_brackets.txt b/test/mri/prism/snapshots/seattlerb/call_self_brackets.txt new file mode 100644 index 00000000000..16ca69b5c29 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_self_brackets.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: + │ @ SelfNode (location: (1,0)-(1,4)) + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,4)-(1,7) = "[1]" + ├── opening_loc: (1,4)-(1,5) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,6)-(1,7) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_spaceship.txt b/test/mri/prism/snapshots/seattlerb/call_spaceship.txt new file mode 100644 index 00000000000..8d43c3f9710 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_spaceship.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :<=> + ├── message_loc: (1,2)-(1,5) = "<=>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt b/test/mri/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt new file mode 100644 index 00000000000..242db9e9cb5 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,13)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ ├── closing_loc: (1,10)-(1,13) = "end" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (1,8)-(1,9)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,14)-(1,22)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,17)-(1,18)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,17)-(1,18)) + │ ├── flags: decimal + │ └── value: 2 + ├── opening_loc: (1,14)-(1,16) = "do" + └── closing_loc: (1,19)-(1,22) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt b/test/mri/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt new file mode 100644 index 00000000000..7c3ab8dad8f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,10)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── closing_loc: (1,9)-(1,10) = "}" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (1,7)-(1,8)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,11)-(1,19)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,14)-(1,15)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ ├── flags: decimal + │ └── value: 2 + ├── opening_loc: (1,11)-(1,13) = "do" + └── closing_loc: (1,16)-(1,19) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/call_star.txt b/test/mri/prism/snapshots/seattlerb/call_star.txt new file mode 100644 index 00000000000..49aee1672c7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_star.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :* + ├── message_loc: (1,2)-(1,3) = "*" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_star2.txt b/test/mri/prism/snapshots/seattlerb/call_star2.txt new file mode 100644 index 00000000000..cc2532cc7c8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_star2.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :** + ├── message_loc: (1,2)-(1,4) = "**" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_trailing_comma.txt b/test/mri/prism/snapshots/seattlerb/call_trailing_comma.txt new file mode 100644 index 00000000000..fe28a3ad3eb --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_trailing_comma.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,4)-(1,5) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_trailing_dots.txt b/test/mri/prism/snapshots/seattlerb/call_trailing_dots.txt new file mode 100644 index 00000000000..b0e23eb27b9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_trailing_dots.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,1)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :c + ├── message_loc: (3,0)-(3,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/call_unary_bang.txt b/test/mri/prism/snapshots/seattlerb/call_unary_bang.txt new file mode 100644 index 00000000000..782cc83b103 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/call_unary_bang.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,1)-(1,2)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/case_in.txt b/test/mri/prism/snapshots/seattlerb/case_in.txt new file mode 100644 index 00000000000..950d66647e6 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in.txt @@ -0,0 +1,976 @@ +@ ProgramNode (location: (1,0)-(111,3)) +├── locals: [:b, :_, :lhs, :x, :rhs, :c, :e] +└── statements: + @ StatementsNode (location: (1,0)-(111,3)) + └── body: (length: 28) + ├── @ CaseMatchNode (location: (1,0)-(3,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (1,5)-(1,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,5)-(1,6) = ":" + │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (2,0)-(2,8)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (2,4)-(2,8)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (2,4)-(2,8)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,8)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "\"" + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,8) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (2,5)-(2,6)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (2,5)-(2,6)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ CaseMatchNode (location: (5,0)-(7,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (5,5)-(5,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,5)-(5,6) = ":" + │ │ ├── value_loc: (5,6)-(5,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (6,0)-(6,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (6,3)-(6,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (6,6)-(6,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (6,6)-(6,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (6,8)-(6,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (6,8)-(6,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (6,3)-(6,6) = "%I[" + │ │ │ └── closing_loc: (6,9)-(6,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (6,0)-(6,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (5,0)-(5,4) = "case" + │ └── end_keyword_loc: (7,0)-(7,3) = "end" + ├── @ CaseMatchNode (location: (9,0)-(11,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (9,5)-(9,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,5)-(9,6) = ":" + │ │ ├── value_loc: (9,6)-(9,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (10,0)-(10,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (10,3)-(10,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ StringNode (location: (10,6)-(10,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (10,6)-(10,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ StringNode (location: (10,8)-(10,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (10,8)-(10,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (10,3)-(10,6) = "%W[" + │ │ │ └── closing_loc: (10,9)-(10,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (10,0)-(10,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (9,0)-(9,4) = "case" + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ CaseMatchNode (location: (13,0)-(15,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (13,5)-(13,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (13,5)-(13,6) = ":" + │ │ ├── value_loc: (13,6)-(13,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (14,0)-(14,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (14,3)-(14,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (14,6)-(14,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (14,6)-(14,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (14,8)-(14,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (14,8)-(14,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (14,3)-(14,6) = "%i[" + │ │ │ └── closing_loc: (14,9)-(14,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (14,0)-(14,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (13,0)-(13,4) = "case" + │ └── end_keyword_loc: (15,0)-(15,3) = "end" + ├── @ CaseMatchNode (location: (17,0)-(19,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (17,5)-(17,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (17,5)-(17,6) = ":" + │ │ ├── value_loc: (17,6)-(17,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (18,0)-(18,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (18,3)-(18,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ StringNode (location: (18,6)-(18,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (18,6)-(18,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ StringNode (location: (18,8)-(18,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (18,8)-(18,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (18,3)-(18,6) = "%w[" + │ │ │ └── closing_loc: (18,9)-(18,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (18,0)-(18,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (17,0)-(17,4) = "case" + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ CaseMatchNode (location: (21,0)-(23,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (21,5)-(21,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (21,5)-(21,6) = ":" + │ │ ├── value_loc: (21,6)-(21,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (22,0)-(22,10)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (22,3)-(22,10)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (22,4)-(22,9)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (22,7)-(22,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (22,4)-(22,7) = "..." + │ │ │ ├── opening_loc: (22,3)-(22,4) = "(" + │ │ │ └── closing_loc: (22,9)-(22,10) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (22,0)-(22,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (21,0)-(21,4) = "case" + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ CaseMatchNode (location: (25,0)-(27,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (25,5)-(25,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (25,5)-(25,6) = ":" + │ │ ├── value_loc: (25,6)-(25,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (26,0)-(26,9)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (26,3)-(26,9)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (26,4)-(26,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (26,6)-(26,8)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (26,4)-(26,6) = ".." + │ │ │ ├── opening_loc: (26,3)-(26,4) = "(" + │ │ │ └── closing_loc: (26,8)-(26,9) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (26,0)-(26,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (25,0)-(25,4) = "case" + │ └── end_keyword_loc: (27,0)-(27,3) = "end" + ├── @ CaseMatchNode (location: (29,0)-(31,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (29,5)-(29,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (29,5)-(29,6) = ":" + │ │ ├── value_loc: (29,6)-(29,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (30,0)-(30,9)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (30,3)-(30,9)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (30,4)-(30,8)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (30,4)-(30,5)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: ∅ + │ │ │ │ └── operator_loc: (30,5)-(30,8) = "..." + │ │ │ ├── opening_loc: (30,3)-(30,4) = "(" + │ │ │ └── closing_loc: (30,8)-(30,9) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (30,0)-(30,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (29,0)-(29,4) = "case" + │ └── end_keyword_loc: (31,0)-(31,3) = "end" + ├── @ CaseMatchNode (location: (33,0)-(35,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (33,5)-(33,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (33,5)-(33,6) = ":" + │ │ ├── value_loc: (33,6)-(33,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (34,0)-(34,10)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (34,3)-(34,10)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (34,4)-(34,9)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (34,4)-(34,5)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (34,8)-(34,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 3 + │ │ │ │ └── operator_loc: (34,5)-(34,8) = "..." + │ │ │ ├── opening_loc: (34,3)-(34,4) = "(" + │ │ │ └── closing_loc: (34,9)-(34,10) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (34,0)-(34,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (33,0)-(33,4) = "case" + │ └── end_keyword_loc: (35,0)-(35,3) = "end" + ├── @ CaseMatchNode (location: (37,0)-(39,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (37,5)-(37,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (37,5)-(37,6) = ":" + │ │ ├── value_loc: (37,6)-(37,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (38,0)-(38,7)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (38,3)-(38,7)) + │ │ │ ├── body: + │ │ │ │ @ IntegerNode (location: (38,4)-(38,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ ├── opening_loc: (38,3)-(38,4) = "(" + │ │ │ └── closing_loc: (38,6)-(38,7) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (38,0)-(38,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (37,0)-(37,4) = "case" + │ └── end_keyword_loc: (39,0)-(39,3) = "end" + ├── @ CaseMatchNode (location: (41,0)-(43,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (41,5)-(41,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (41,5)-(41,6) = ":" + │ │ ├── value_loc: (41,6)-(41,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (42,0)-(42,8)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (42,3)-(42,8)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ NoKeywordsParameterNode (location: (42,3)-(42,8)) + │ │ │ │ ├── operator_loc: (42,3)-(42,5) = "**" + │ │ │ │ └── keyword_loc: (42,5)-(42,8) = "nil" + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (42,0)-(42,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (41,0)-(41,4) = "case" + │ └── end_keyword_loc: (43,0)-(43,3) = "end" + ├── @ CaseMatchNode (location: (45,0)-(47,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (45,5)-(45,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (45,5)-(45,6) = ":" + │ │ ├── value_loc: (45,6)-(45,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (46,0)-(46,11)) + │ │ ├── pattern: + │ │ │ @ RegularExpressionNode (location: (46,3)-(46,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (46,3)-(46,4) = "/" + │ │ │ ├── content_loc: (46,4)-(46,10) = "regexp" + │ │ │ ├── closing_loc: (46,10)-(46,11) = "/" + │ │ │ └── unescaped: "regexp" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (46,0)-(46,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (45,0)-(45,4) = "case" + │ └── end_keyword_loc: (47,0)-(47,3) = "end" + ├── @ CaseMatchNode (location: (49,0)-(51,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (49,5)-(49,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (49,5)-(49,6) = ":" + │ │ ├── value_loc: (49,6)-(49,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (50,0)-(50,13)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (50,3)-(50,13)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (50,3)-(50,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (50,3)-(50,4) = ":" + │ │ │ │ ├── value_loc: (50,4)-(50,5) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (50,7)-(50,9)) + │ │ │ │ ├── operator_loc: (50,7)-(50,8) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (50,8)-(50,9)) + │ │ │ │ ├── name: :_ + │ │ │ │ └── depth: 0 + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (50,11)-(50,13)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (50,11)-(50,12) = ":" + │ │ │ │ ├── value_loc: (50,12)-(50,13) = "c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (50,0)-(50,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (49,0)-(49,4) = "case" + │ └── end_keyword_loc: (51,0)-(51,3) = "end" + ├── @ CaseMatchNode (location: (53,0)-(55,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (53,5)-(53,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (53,5)-(53,6) = ":" + │ │ ├── value_loc: (53,6)-(53,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (54,0)-(54,11)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (54,3)-(54,11)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (54,3)-(54,5)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (54,3)-(54,4) = ":" + │ │ │ │ │ ├── value_loc: (54,4)-(54,5) = "b" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ └── @ ArrayPatternNode (location: (54,7)-(54,11)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (54,8)-(54,10)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (54,8)-(54,9) = ":" + │ │ │ │ │ ├── value_loc: (54,9)-(54,10) = "c" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "c" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (54,7)-(54,8) = "[" + │ │ │ │ └── closing_loc: (54,10)-(54,11) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (54,0)-(54,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (53,0)-(53,4) = "case" + │ └── end_keyword_loc: (55,0)-(55,3) = "end" + ├── @ CaseMatchNode (location: (57,0)-(59,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (57,5)-(57,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (57,5)-(57,6) = ":" + │ │ ├── value_loc: (57,6)-(57,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (58,0)-(58,11)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (58,3)-(58,11)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (58,3)-(58,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (58,9)-(58,10) = "(" + │ │ │ └── closing_loc: (58,10)-(58,11) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (58,0)-(58,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (57,0)-(57,4) = "case" + │ └── end_keyword_loc: (59,0)-(59,3) = "end" + ├── @ CaseMatchNode (location: (61,0)-(63,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (61,5)-(61,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (61,5)-(61,6) = ":" + │ │ ├── value_loc: (61,6)-(61,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (62,0)-(62,24)) + │ │ ├── pattern: + │ │ │ @ FindPatternNode (location: (62,3)-(62,24)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (62,3)-(62,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── left: + │ │ │ │ @ SplatNode (location: (62,10)-(62,14)) + │ │ │ │ ├── operator_loc: (62,10)-(62,11) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (62,11)-(62,14)) + │ │ │ │ ├── name: :lhs + │ │ │ │ └── depth: 0 + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (62,16)-(62,17)) + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ ├── right: + │ │ │ │ @ SplatNode (location: (62,19)-(62,23)) + │ │ │ │ ├── operator_loc: (62,19)-(62,20) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (62,20)-(62,23)) + │ │ │ │ ├── name: :rhs + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (62,9)-(62,10) = "(" + │ │ │ └── closing_loc: (62,23)-(62,24) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (62,0)-(62,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (61,0)-(61,4) = "case" + │ └── end_keyword_loc: (63,0)-(63,3) = "end" + ├── @ CaseMatchNode (location: (65,0)-(67,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (65,5)-(65,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (65,5)-(65,6) = ":" + │ │ ├── value_loc: (65,6)-(65,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (66,0)-(66,24)) + │ │ ├── pattern: + │ │ │ @ FindPatternNode (location: (66,3)-(66,24)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (66,3)-(66,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── left: + │ │ │ │ @ SplatNode (location: (66,10)-(66,14)) + │ │ │ │ ├── operator_loc: (66,10)-(66,11) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (66,11)-(66,14)) + │ │ │ │ ├── name: :lhs + │ │ │ │ └── depth: 0 + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (66,16)-(66,17)) + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ ├── right: + │ │ │ │ @ SplatNode (location: (66,19)-(66,23)) + │ │ │ │ ├── operator_loc: (66,19)-(66,20) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (66,20)-(66,23)) + │ │ │ │ ├── name: :rhs + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (66,9)-(66,10) = "[" + │ │ │ └── closing_loc: (66,23)-(66,24) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (66,0)-(66,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (65,0)-(65,4) = "case" + │ └── end_keyword_loc: (67,0)-(67,3) = "end" + ├── @ CaseMatchNode (location: (69,0)-(71,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (69,5)-(69,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (69,5)-(69,6) = ":" + │ │ ├── value_loc: (69,6)-(69,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (70,0)-(70,22)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (70,3)-(70,22)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ LambdaNode (location: (70,4)-(70,18)) + │ │ │ │ │ ├── locals: [:b] + │ │ │ │ │ ├── operator_loc: (70,4)-(70,6) = "->" + │ │ │ │ │ ├── opening_loc: (70,10)-(70,11) = "{" + │ │ │ │ │ ├── closing_loc: (70,17)-(70,18) = "}" + │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ @ BlockParametersNode (location: (70,6)-(70,9)) + │ │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ │ @ ParametersNode (location: (70,7)-(70,8)) + │ │ │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (70,7)-(70,8)) + │ │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ │ ├── locals: (length: 0) + │ │ │ │ │ │ ├── opening_loc: (70,6)-(70,7) = "(" + │ │ │ │ │ │ └── closing_loc: (70,8)-(70,9) = ")" + │ │ │ │ │ └── body: + │ │ │ │ │ @ StatementsNode (location: (70,12)-(70,16)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ TrueNode (location: (70,12)-(70,16)) + │ │ │ │ └── @ LocalVariableTargetNode (location: (70,20)-(70,21)) + │ │ │ │ ├── name: :c + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (70,3)-(70,4) = "[" + │ │ │ └── closing_loc: (70,21)-(70,22) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (70,0)-(70,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (69,0)-(69,4) = "case" + │ └── end_keyword_loc: (71,0)-(71,3) = "end" + ├── @ CaseMatchNode (location: (73,0)-(75,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (73,5)-(73,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (73,5)-(73,6) = ":" + │ │ ├── value_loc: (73,6)-(73,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (74,0)-(74,28)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (74,3)-(74,28)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 4) + │ │ │ │ ├── @ SymbolNode (location: (74,4)-(74,6)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (74,4)-(74,5) = ":" + │ │ │ │ │ ├── value_loc: (74,5)-(74,6) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── @ LocalVariableTargetNode (location: (74,8)-(74,9)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── @ LocalVariableTargetNode (location: (74,11)-(74,12)) + │ │ │ │ │ ├── name: :c + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── @ ArrayPatternNode (location: (74,14)-(74,27)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (74,15)-(74,17)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (74,15)-(74,16) = ":" + │ │ │ │ │ ├── value_loc: (74,16)-(74,17) = "d" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "d" + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (74,19)-(74,21)) + │ │ │ │ │ ├── operator_loc: (74,19)-(74,20) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ LocalVariableTargetNode (location: (74,20)-(74,21)) + │ │ │ │ │ ├── name: :e + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── posts: (length: 1) + │ │ │ │ │ └── @ NilNode (location: (74,23)-(74,26)) + │ │ │ │ ├── opening_loc: (74,14)-(74,15) = "[" + │ │ │ │ └── closing_loc: (74,26)-(74,27) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (74,3)-(74,4) = "[" + │ │ │ └── closing_loc: (74,27)-(74,28) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (74,0)-(74,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (73,0)-(73,4) = "case" + │ └── end_keyword_loc: (75,0)-(75,3) = "end" + ├── @ CaseMatchNode (location: (77,0)-(79,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (77,5)-(77,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (77,5)-(77,6) = ":" + │ │ ├── value_loc: (77,6)-(77,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (78,0)-(78,12)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (78,3)-(78,12)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (78,4)-(78,5)) + │ │ │ │ └── name: :A + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (78,7)-(78,8)) + │ │ │ │ ├── operator_loc: (78,7)-(78,8) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (78,10)-(78,11)) + │ │ │ │ └── name: :B + │ │ │ ├── opening_loc: (78,3)-(78,4) = "[" + │ │ │ └── closing_loc: (78,11)-(78,12) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (78,0)-(78,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (77,0)-(77,4) = "case" + │ └── end_keyword_loc: (79,0)-(79,3) = "end" + ├── @ CaseMatchNode (location: (81,0)-(83,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (81,5)-(81,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (81,5)-(81,6) = ":" + │ │ ├── value_loc: (81,6)-(81,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (82,0)-(82,22)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (82,3)-(82,22)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ ArrayPatternNode (location: (82,4)-(82,11)) + │ │ │ │ │ ├── constant: ∅ + │ │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ │ ├── @ SymbolNode (location: (82,5)-(82,7)) + │ │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ │ ├── opening_loc: (82,5)-(82,6) = ":" + │ │ │ │ │ │ │ ├── value_loc: (82,6)-(82,7) = "b" + │ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ │ └── unescaped: "b" + │ │ │ │ │ │ └── @ LocalVariableTargetNode (location: (82,9)-(82,10)) + │ │ │ │ │ │ ├── name: :c + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── opening_loc: (82,4)-(82,5) = "[" + │ │ │ │ │ └── closing_loc: (82,10)-(82,11) = "]" + │ │ │ │ └── @ ArrayPatternNode (location: (82,13)-(82,21)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ SymbolNode (location: (82,14)-(82,16)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: (82,14)-(82,15) = ":" + │ │ │ │ │ │ ├── value_loc: (82,15)-(82,16) = "d" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "d" + │ │ │ │ │ └── @ PinnedVariableNode (location: (82,18)-(82,20)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ LocalVariableReadNode (location: (82,19)-(82,20)) + │ │ │ │ │ │ ├── name: :e + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: (82,18)-(82,19) = "^" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (82,13)-(82,14) = "[" + │ │ │ │ └── closing_loc: (82,20)-(82,21) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (82,3)-(82,4) = "[" + │ │ │ └── closing_loc: (82,21)-(82,22) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (82,0)-(82,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (81,0)-(81,4) = "case" + │ └── end_keyword_loc: (83,0)-(83,3) = "end" + ├── @ CaseMatchNode (location: (85,0)-(87,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (85,5)-(85,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (85,5)-(85,6) = ":" + │ │ ├── value_loc: (85,6)-(85,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (86,0)-(86,5)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (86,3)-(86,5)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (86,3)-(86,4) = "[" + │ │ │ └── closing_loc: (86,4)-(86,5) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (86,0)-(86,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (85,0)-(85,4) = "case" + │ └── end_keyword_loc: (87,0)-(87,3) = "end" + ├── @ CaseMatchNode (location: (89,0)-(91,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (89,5)-(89,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (89,5)-(89,6) = ":" + │ │ ├── value_loc: (89,6)-(89,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (90,0)-(90,9)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (90,3)-(90,9)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ PinnedExpressionNode (location: (90,4)-(90,8)) + │ │ │ │ ├── expression: + │ │ │ │ │ @ CallNode (location: (90,6)-(90,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── message_loc: (90,6)-(90,7) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── operator_loc: (90,4)-(90,5) = "^" + │ │ │ │ ├── lparen_loc: (90,5)-(90,6) = "(" + │ │ │ │ └── rparen_loc: (90,7)-(90,8) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (90,3)-(90,4) = "[" + │ │ │ └── closing_loc: (90,8)-(90,9) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (90,0)-(90,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (89,0)-(89,4) = "case" + │ └── end_keyword_loc: (91,0)-(91,3) = "end" + ├── @ CaseMatchNode (location: (93,0)-(95,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (93,5)-(93,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (93,5)-(93,6) = ":" + │ │ ├── value_loc: (93,6)-(93,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (94,0)-(94,19)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (94,3)-(94,19)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 3) + │ │ │ │ ├── @ PinnedVariableNode (location: (94,4)-(94,7)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ InstanceVariableReadNode (location: (94,5)-(94,7)) + │ │ │ │ │ │ └── name: :@a + │ │ │ │ │ └── operator_loc: (94,4)-(94,5) = "^" + │ │ │ │ ├── @ PinnedVariableNode (location: (94,9)-(94,12)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ GlobalVariableReadNode (location: (94,10)-(94,12)) + │ │ │ │ │ │ └── name: :$b + │ │ │ │ │ └── operator_loc: (94,9)-(94,10) = "^" + │ │ │ │ └── @ PinnedVariableNode (location: (94,14)-(94,18)) + │ │ │ │ ├── variable: + │ │ │ │ │ @ ClassVariableReadNode (location: (94,15)-(94,18)) + │ │ │ │ │ └── name: :@@c + │ │ │ │ └── operator_loc: (94,14)-(94,15) = "^" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (94,3)-(94,4) = "[" + │ │ │ └── closing_loc: (94,18)-(94,19) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (94,0)-(94,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (93,0)-(93,4) = "case" + │ └── end_keyword_loc: (95,0)-(95,3) = "end" + ├── @ CaseMatchNode (location: (97,0)-(99,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (97,5)-(97,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (97,5)-(97,6) = ":" + │ │ ├── value_loc: (97,6)-(97,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (98,0)-(98,12)) + │ │ ├── pattern: + │ │ │ @ XStringNode (location: (98,3)-(98,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (98,3)-(98,4) = "`" + │ │ │ ├── content_loc: (98,4)-(98,11) = "echo hi" + │ │ │ ├── closing_loc: (98,11)-(98,12) = "`" + │ │ │ └── unescaped: "echo hi" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (98,0)-(98,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (97,0)-(97,4) = "case" + │ └── end_keyword_loc: (99,0)-(99,3) = "end" + ├── @ CaseMatchNode (location: (101,0)-(103,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (101,5)-(101,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (101,5)-(101,6) = ":" + │ │ ├── value_loc: (101,6)-(101,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (102,0)-(102,16)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (102,3)-(102,16)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 3) + │ │ │ │ ├── @ NilNode (location: (102,3)-(102,6)) + │ │ │ │ ├── @ NilNode (location: (102,8)-(102,11)) + │ │ │ │ └── @ NilNode (location: (102,13)-(102,16)) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (102,0)-(102,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (101,0)-(101,4) = "case" + │ └── end_keyword_loc: (103,0)-(103,3) = "end" + ├── @ CaseMatchNode (location: (105,0)-(107,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (105,5)-(105,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (105,5)-(105,6) = ":" + │ │ ├── value_loc: (105,6)-(105,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (106,0)-(106,11)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (106,3)-(106,11)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (106,5)-(106,9)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (106,5)-(106,9)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (106,5)-(106,6) = "\"" + │ │ │ │ │ ├── value_loc: (106,6)-(106,7) = "b" + │ │ │ │ │ ├── closing_loc: (106,7)-(106,9) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (106,6)-(106,7)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (106,6)-(106,7)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── opening_loc: (106,3)-(106,4) = "{" + │ │ │ └── closing_loc: (106,10)-(106,11) = "}" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (106,0)-(106,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (105,0)-(105,4) = "case" + │ └── end_keyword_loc: (107,0)-(107,3) = "end" + └── @ CaseMatchNode (location: (109,0)-(111,3)) + ├── predicate: + │ @ SymbolNode (location: (109,5)-(109,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (109,5)-(109,6) = ":" + │ ├── value_loc: (109,6)-(109,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (110,0)-(110,5)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (110,3)-(110,5)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (110,3)-(110,4) = "{" + │ │ └── closing_loc: (110,4)-(110,5) = "}" + │ ├── statements: ∅ + │ ├── in_loc: (110,0)-(110,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (109,0)-(109,4) = "case" + └── end_keyword_loc: (111,0)-(111,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_31.txt b/test/mri/prism/snapshots/seattlerb/case_in_31.txt new file mode 100644 index 00000000000..fdf5ce2a29e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_31.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (2,4)-(2,5) = ":" + │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,8)-(2,10)) + │ │ │ ├── operator_loc: (2,8)-(2,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,9)-(2,10)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,10)-(2,11) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_37.txt b/test/mri/prism/snapshots/seattlerb/case_in_37.txt new file mode 100644 index 00000000000..1a1d887b4fd --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_37.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,19)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,17)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ ArrayPatternNode (location: (2,8)-(2,17)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ ConstantReadNode (location: (2,9)-(2,13)) + │ │ │ │ │ └── name: :Hash + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (2,15)-(2,16)) + │ │ │ │ │ ├── operator_loc: (2,15)-(2,16) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (2,8)-(2,9) = "[" + │ │ │ │ └── closing_loc: (2,16)-(2,17) = "]" + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,18)-(2,19) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_42.txt b/test/mri/prism/snapshots/seattlerb/case_in_42.txt new file mode 100644 index 00000000000..f985d6bc8db --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_42.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:_] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,18)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,9)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (2,3)-(2,4) = ":" + │ │ │ ├── value_loc: (2,4)-(2,5) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,7)-(2,9)) + │ │ │ ├── operator_loc: (2,7)-(2,8) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,8)-(2,9)) + │ │ │ ├── name: :_ + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,15)-(2,18)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,15)-(2,18)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,10)-(2,14) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_42_2.txt b/test/mri/prism/snapshots/seattlerb/case_in_42_2.txt new file mode 100644 index 00000000000..c399ba1bfa4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_42_2.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:list] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,20)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :A + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,5)-(2,10)) + │ │ │ ├── operator_loc: (2,5)-(2,6) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,10)) + │ │ │ ├── name: :list + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,10)-(2,11) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (2,17)-(2,20)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,17)-(2,20)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,12)-(2,16) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_47.txt b/test/mri/prism/snapshots/seattlerb/case_in_47.txt new file mode 100644 index 00000000000..99baebce05a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_47.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,14)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,4)-(2,5)) + │ │ │ ├── operator_loc: (2,4)-(2,5) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 2) + │ │ │ ├── @ SymbolNode (location: (2,7)-(2,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (2,7)-(2,8) = ":" + │ │ │ │ ├── value_loc: (2,8)-(2,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ SymbolNode (location: (2,11)-(2,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (2,11)-(2,12) = ":" + │ │ │ ├── value_loc: (2,12)-(2,13) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,13)-(2,14) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_67.txt b/test/mri/prism/snapshots/seattlerb/case_in_67.txt new file mode 100644 index 00000000000..4bab417d578 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_67.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,15)) + │ ├── pattern: + │ │ @ RangeNode (location: (2,3)-(2,6)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (2,4)-(2,6) = ".." + │ ├── statements: + │ │ @ StatementsNode (location: (2,12)-(2,15)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,12)-(2,15)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,7)-(2,11) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_86.txt b/test/mri/prism/snapshots/seattlerb/case_in_86.txt new file mode 100644 index 00000000000..58891378448 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_86.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,25)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ ConstantPathNode (location: (2,3)-(2,13)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,5)-(2,13)) + │ │ │ │ └── name: :NilClass + │ │ │ └── delimiter_loc: (2,3)-(2,5) = "::" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,15)-(2,16)) + │ │ │ ├── operator_loc: (2,15)-(2,16) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,22)-(2,25)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,22)-(2,25)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,17)-(2,21) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_86_2.txt b/test/mri/prism/snapshots/seattlerb/case_in_86_2.txt new file mode 100644 index 00000000000..18ce70ae93f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_86_2.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,25)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,3)-(2,4)) + │ │ │ ├── operator_loc: (2,3)-(2,4) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ ConstantPathNode (location: (2,6)-(2,16)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,8)-(2,16)) + │ │ │ │ └── name: :NilClass + │ │ │ └── delimiter_loc: (2,6)-(2,8) = "::" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,22)-(2,25)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,22)-(2,25)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,17)-(2,21) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const.txt b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const.txt new file mode 100644 index 00000000000..f361e8d4589 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,7)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (2,5)-(2,6)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "[" + │ │ └── closing_loc: (2,6)-(2,7) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const2.txt b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const2.txt new file mode 100644 index 00000000000..c783af9ce56 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_const2.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,10)) + │ │ ├── constant: + │ │ │ @ ConstantPathNode (location: (2,3)-(2,7)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :B + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,6)-(2,7)) + │ │ │ │ └── name: :C + │ │ │ └── delimiter_loc: (2,4)-(2,6) = "::" + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (2,8)-(2,9)) + │ │ │ ├── name: :d + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,7)-(2,8) = "[" + │ │ └── closing_loc: (2,9)-(2,10) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt new file mode 100644 index 00000000000..8d185b250a7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,12)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── requireds: (length: 1) + │ │ │ └── @ CapturePatternNode (location: (2,5)-(2,11)) + │ │ │ ├── value: + │ │ │ │ @ ConstantReadNode (location: (2,5)-(2,6)) + │ │ │ │ └── name: :C + │ │ │ ├── target: + │ │ │ │ @ LocalVariableTargetNode (location: (2,10)-(2,11)) + │ │ │ │ ├── name: :d + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,7)-(2,9) = "=>" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,11)-(2,12) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_const.txt b/test/mri/prism/snapshots/seattlerb/case_in_const.txt new file mode 100644 index 00000000000..c4b838aa1d5 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_const.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ ConstantReadNode (location: (1,5)-(1,10)) + │ └── name: :Array + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ConstantReadNode (location: (2,3)-(2,8)) + │ │ └── name: :Class + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_else.txt b/test/mri/prism/snapshots/seattlerb/case_in_else.txt new file mode 100644 index 00000000000..5eae7fc1ea2 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_else.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ ConstantReadNode (location: (1,5)-(1,10)) + │ └── name: :Array + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ConstantReadNode (location: (2,3)-(2,8)) + │ │ └── name: :Class + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: + │ @ ElseNode (location: (4,0)-(6,3)) + │ ├── else_keyword_loc: (4,0)-(4,4) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_find.txt b/test/mri/prism/snapshots/seattlerb/case_in_find.txt new file mode 100644 index 00000000000..f84c4c30d0d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_find.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,2)-(2,15)) + │ ├── pattern: + │ │ @ FindPatternNode (location: (2,5)-(2,15)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (2,5)-(2,7)) + │ │ │ ├── operator_loc: (2,5)-(2,6) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,7)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,9)-(2,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (2,9)-(2,10) = ":" + │ │ │ ├── value_loc: (2,10)-(2,11) = "+" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "+" + │ │ ├── right: + │ │ │ @ SplatNode (location: (2,13)-(2,15)) + │ │ │ ├── operator_loc: (2,13)-(2,14) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,14)-(2,15)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: ∅ + │ ├── in_loc: (2,2)-(2,4) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_find_array.txt b/test/mri/prism/snapshots/seattlerb/case_in_find_array.txt new file mode 100644 index 00000000000..a757f803460 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_find_array.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,16)) + │ ├── pattern: + │ │ @ FindPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (2,4)-(2,5)) + │ │ │ ├── operator_loc: (2,4)-(2,5) = "*" + │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ SymbolNode (location: (2,7)-(2,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (2,7)-(2,8) = ":" + │ │ │ │ ├── value_loc: (2,8)-(2,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ LocalVariableTargetNode (location: (2,11)-(2,12)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (2,14)-(2,15)) + │ │ │ ├── operator_loc: (2,14)-(2,15) = "*" + │ │ │ └── expression: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,15)-(2,16) = "]" + │ ├── statements: ∅ + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat.txt new file mode 100644 index 00000000000..e813efa9ee5 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat.txt @@ -0,0 +1,68 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,21)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,11)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ StringNode (location: (2,8)-(2,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,8)-(2,9) = "'" + │ │ │ │ │ ├── content_loc: (2,9)-(2,10) = "c" + │ │ │ │ │ ├── closing_loc: (2,10)-(2,11) = "'" + │ │ │ │ │ └── unescaped: "c" + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (2,13)-(2,19)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,13)-(2,15)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,13)-(2,14) = "d" + │ │ │ │ ├── closing_loc: (2,14)-(2,15) = ":" + │ │ │ │ └── unescaped: "d" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (2,16)-(2,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (2,16)-(2,17) = "\"" + │ │ │ │ ├── content_loc: (2,17)-(2,18) = "e" + │ │ │ │ ├── closing_loc: (2,18)-(2,19) = "\"" + │ │ │ │ └── unescaped: "e" + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,20)-(2,21) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "f" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "f" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,22)-(2,26) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt new file mode 100644 index 00000000000..790d9d63ffb --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:x, :f] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,34)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 3) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,20)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ CapturePatternNode (location: (2,8)-(2,20)) + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ ConstantReadNode (location: (2,8)-(2,15)) + │ │ │ │ │ │ └── name: :Integer + │ │ │ │ │ ├── target: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (2,19)-(2,20)) + │ │ │ │ │ │ ├── name: :x + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: (2,16)-(2,18) = "=>" + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── @ AssocNode (location: (2,22)-(2,28)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,22)-(2,24)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,22)-(2,23) = "d" + │ │ │ │ │ ├── closing_loc: (2,23)-(2,24) = ":" + │ │ │ │ │ └── unescaped: "d" + │ │ │ │ ├── value: + │ │ │ │ │ @ StringNode (location: (2,25)-(2,28)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "\"" + │ │ │ │ │ ├── content_loc: (2,26)-(2,27) = "e" + │ │ │ │ │ ├── closing_loc: (2,27)-(2,28) = "\"" + │ │ │ │ │ └── unescaped: "e" + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (2,30)-(2,32)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,30)-(2,32)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,30)-(2,31) = "f" + │ │ │ │ ├── closing_loc: (2,31)-(2,32) = ":" + │ │ │ │ └── unescaped: "f" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (2,30)-(2,31)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,30)-(2,31)) + │ │ │ │ ├── name: :f + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,33)-(2,34) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "g" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "g" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,35)-(2,39) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt new file mode 100644 index 00000000000..4c8cfd0e544 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,5)-(2,6) = "a" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (2,8)-(2,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,10)-(2,11) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt new file mode 100644 index 00000000000..8ff95a161f3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,10)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,3)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,3)-(2,4) = "b" + │ │ │ │ ├── closing_loc: (2,4)-(2,5) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ TrueNode (location: (2,6)-(2,10)) + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,11)-(2,15) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt new file mode 100644 index 00000000000..b93b889ec5f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c, :rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,23)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,15)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,3)-(2,7)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,3)-(2,4) = "b" + │ │ │ │ ├── closing_loc: (2,4)-(2,5) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,7)) + │ │ │ │ ├── name: :c + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,9)-(2,15)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,11)-(2,15)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,9)-(2,11) = "**" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,21)-(2,23)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,21)-(2,23)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (2,21)-(2,22) = ":" + │ │ ├── value_loc: (2,22)-(2,23) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,16)-(2,20) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt new file mode 100644 index 00000000000..956e93faa02 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,17)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,9)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,3)-(2,9)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,5)-(2,9)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,3)-(2,5) = "**" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,15)-(2,17)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,15)-(2,17)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (2,15)-(2,16) = ":" + │ │ ├── value_loc: (2,16)-(2,17) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,10)-(2,14) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt b/test/mri/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt new file mode 100644 index 00000000000..a21d3e15dd4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt @@ -0,0 +1,67 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 2) + │ ├── @ InNode (location: (2,0)-(3,4)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (2,3)-(2,12)) + │ │ │ ├── if_keyword_loc: (2,5)-(2,7) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ TrueNode (location: (2,8)-(2,12)) + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (2,3)-(2,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :A + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ │ ├── value_loc: (3,3)-(3,4) = "C" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "C" + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ └── @ InNode (location: (4,0)-(5,4)) + │ ├── pattern: + │ │ @ UnlessNode (location: (4,3)-(4,17)) + │ │ ├── keyword_loc: (4,5)-(4,11) = "unless" + │ │ ├── predicate: + │ │ │ @ FalseNode (location: (4,12)-(4,17)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (4,3)-(4,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (4,3)-(4,4)) + │ │ │ └── name: :D + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "E" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "E" + │ ├── in_loc: (4,0)-(4,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_multiple.txt b/test/mri/prism/snapshots/seattlerb/case_in_multiple.txt new file mode 100644 index 00000000000..d8597c4bfab --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_multiple.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 2) + │ ├── @ InNode (location: (2,0)-(3,4)) + │ │ ├── pattern: + │ │ │ @ ConstantPathNode (location: (2,3)-(2,7)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :A + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,6)-(2,7)) + │ │ │ │ └── name: :B + │ │ │ └── delimiter_loc: (2,4)-(2,6) = "::" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ │ ├── value_loc: (3,3)-(3,4) = "C" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "C" + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ └── @ InNode (location: (4,0)-(5,4)) + │ ├── pattern: + │ │ @ ConstantPathNode (location: (4,3)-(4,7)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (4,3)-(4,4)) + │ │ │ └── name: :D + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (4,6)-(4,7)) + │ │ │ └── name: :E + │ │ └── delimiter_loc: (4,4)-(4,6) = "::" + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "F" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "F" + │ ├── in_loc: (4,0)-(4,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/case_in_or.txt b/test/mri/prism/snapshots/seattlerb/case_in_or.txt new file mode 100644 index 00000000000..7ac66176082 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/case_in_or.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ AlternationPatternNode (location: (2,3)-(2,8)) + │ │ ├── left: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── right: + │ │ │ @ ConstantReadNode (location: (2,7)-(2,8)) + │ │ │ └── name: :C + │ │ └── operator_loc: (2,5)-(2,6) = "|" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/class_comments.txt b/test/mri/prism/snapshots/seattlerb/class_comments.txt new file mode 100644 index 00000000000..5ac05b6be68 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/class_comments.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (4,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(9,3)) + └── body: (length: 1) + └── @ ClassNode (location: (4,0)-(9,3)) + ├── locals: [] + ├── class_keyword_loc: (4,0)-(4,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (4,6)-(4,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (6,2)-(8,5)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (6,2)-(8,5)) + │ ├── name: :blah + │ ├── name_loc: (6,6)-(6,10) = "blah" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (6,2)-(6,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,2)-(8,5) = "end" + ├── end_keyword_loc: (9,0)-(9,3) = "end" + └── name: :X diff --git a/test/mri/prism/snapshots/seattlerb/cond_unary_minus.txt b/test/mri/prism/snapshots/seattlerb/cond_unary_minus.txt new file mode 100644 index 00000000000..b6e12dfb15c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/cond_unary_minus.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,10)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ IntegerNode (location: (1,3)-(1,5)) + │ ├── flags: decimal + │ └── value: -1 + ├── then_keyword_loc: ∅ + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,7)-(1,10) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt b/test/mri/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt new file mode 100644 index 00000000000..b018ac48d4f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,12)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,6)) + │ ├── parent: + │ │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ │ └── name: :X + │ │ └── delimiter_loc: (1,0)-(1,2) = "::" + │ ├── child: + │ │ @ ConstantReadNode (location: (1,5)-(1,6)) + │ │ └── name: :Y + │ └── delimiter_loc: (1,3)-(1,5) = "::" + ├── operator_loc: (1,7)-(1,10) = "||=" + └── value: + @ IntegerNode (location: (1,11)-(1,12)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/const_3_op_asgn_or.txt b/test/mri/prism/snapshots/seattlerb/const_3_op_asgn_or.txt new file mode 100644 index 00000000000..8d9d94931b9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/const_3_op_asgn_or.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,9)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/const_op_asgn_and1.txt b/test/mri/prism/snapshots/seattlerb/const_op_asgn_and1.txt new file mode 100644 index 00000000000..b1d61b3752c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/const_op_asgn_and1.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ ConstantPathOperatorWriteNode (location: (1,0)-(1,8)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,6) = "&=" + ├── value: + │ @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + └── operator: :& diff --git a/test/mri/prism/snapshots/seattlerb/const_op_asgn_and2.txt b/test/mri/prism/snapshots/seattlerb/const_op_asgn_and2.txt new file mode 100644 index 00000000000..22f66825349 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/const_op_asgn_and2.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ConstantPathAndWriteNode (location: (1,0)-(1,9)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,7) = "&&=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/const_op_asgn_or.txt b/test/mri/prism/snapshots/seattlerb/const_op_asgn_or.txt new file mode 100644 index 00000000000..067e0fbb93d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/const_op_asgn_or.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,10)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,4)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ │ └── name: :X + │ ├── child: + │ │ @ ConstantReadNode (location: (1,3)-(1,4)) + │ │ └── name: :Y + │ └── delimiter_loc: (1,1)-(1,3) = "::" + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ IntegerNode (location: (1,9)-(1,10)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/dasgn_icky2.txt b/test/mri/prism/snapshots/seattlerb/dasgn_icky2.txt new file mode 100644 index 00000000000..e118362f876 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dasgn_icky2.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(8,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(8,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(8,3)) + ├── locals: [:v] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(7,5)) + │ └── body: (length: 2) + │ ├── @ LocalVariableWriteNode (location: (2,2)-(2,9)) + │ │ ├── name: :v + │ │ ├── depth: 0 + │ │ ├── name_loc: (2,2)-(2,3) = "v" + │ │ ├── value: + │ │ │ @ NilNode (location: (2,6)-(2,9)) + │ │ └── operator_loc: (2,4)-(2,5) = "=" + │ └── @ BeginNode (location: (3,2)-(7,5)) + │ ├── begin_keyword_loc: (3,2)-(3,7) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (4,4)-(4,9)) + │ │ └── body: (length: 1) + │ │ └── @ YieldNode (location: (4,4)-(4,9)) + │ │ ├── keyword_loc: (4,4)-(4,9) = "yield" + │ │ ├── lparen_loc: ∅ + │ │ ├── arguments: ∅ + │ │ └── rparen_loc: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (5,2)-(6,9)) + │ │ ├── keyword_loc: (5,2)-(5,8) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (5,9)-(5,18)) + │ │ │ └── name: :Exception + │ │ ├── operator_loc: (5,19)-(5,21) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (5,22)-(5,23)) + │ │ │ ├── name: :v + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (6,4)-(6,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (6,4)-(6,9)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (6,4)-(6,9) = "break" + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (7,2)-(7,5) = "end" + ├── opening_loc: (1,2)-(1,4) = "do" + └── closing_loc: (8,0)-(8,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defined_eh_parens.txt b/test/mri/prism/snapshots/seattlerb/defined_eh_parens.txt new file mode 100644 index 00000000000..49b577fcd13 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defined_eh_parens.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ DefinedNode (location: (1,0)-(1,12)) + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── value: + │ @ IntegerNode (location: (1,9)-(1,11)) + │ ├── flags: decimal + │ └── value: 42 + ├── rparen_loc: (1,11)-(1,12) = ")" + └── keyword_loc: (1,0)-(1,8) = "defined?" diff --git a/test/mri/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt b/test/mri/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt new file mode 100644 index 00000000000..3f2bdf44a44 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,29)) + ├── name: :call + ├── name_loc: (1,4)-(1,8) = "call" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,24)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,15)) + │ │ ├── flags: ∅ + │ │ └── name: :interp + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,17)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,17)-(1,18) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,20)-(1,24)) + │ │ ├── flags: ∅ + │ │ └── name: :args + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:interp, :args] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,24)-(1,25) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_arg_forward_args.txt b/test/mri/prism/snapshots/seattlerb/defn_arg_forward_args.txt new file mode 100644 index 00000000000..4121770c5c2 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_arg_forward_args.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,29)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :x + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,9)-(1,12)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,15)-(1,24)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,15)-(1,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,15)-(1,16) = "b" + │ ├── opening_loc: (1,16)-(1,17) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,17)-(1,18)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ └── @ ForwardingArgumentsNode (location: (1,20)-(1,23)) + │ ├── closing_loc: (1,23)-(1,24) = ")" + │ └── block: ∅ + ├── locals: [:x] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_args_forward_args.txt b/test/mri/prism/snapshots/seattlerb/defn_args_forward_args.txt new file mode 100644 index 00000000000..178b6ccde73 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_args_forward_args.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(1,41)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,41)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,41)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,18)) + │ ├── requireds: (length: 3) + │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :y + │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── name: :z + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,15)-(1,18)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,21)-(1,36)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,21)-(1,36)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,21)-(1,22) = "b" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,35)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ SymbolNode (location: (1,23)-(1,27)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,23)-(1,24) = ":" + │ │ │ ├── value_loc: (1,24)-(1,27) = "get" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "get" + │ │ ├── @ LocalVariableReadNode (location: (1,29)-(1,30)) + │ │ │ ├── name: :z + │ │ │ └── depth: 0 + │ │ └── @ ForwardingArgumentsNode (location: (1,32)-(1,35)) + │ ├── closing_loc: (1,35)-(1,36) = ")" + │ └── block: ∅ + ├── locals: [:x, :y, :z] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,38)-(1,41) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_comments.txt b/test/mri/prism/snapshots/seattlerb/defn_comments.txt new file mode 100644 index 00000000000..585aa65c9a6 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_comments.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (4,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(5,3)) + └── body: (length: 1) + └── @ DefNode (location: (4,0)-(5,3)) + ├── name: :blah + ├── name_loc: (4,4)-(4,8) = "blah" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (4,0)-(4,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,0)-(5,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_endless_command.txt b/test/mri/prism/snapshots/seattlerb/defn_endless_command.txt new file mode 100644 index 00000000000..c3ea59282a7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_endless_command.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,33)) + ├── name: :some_method + ├── name_loc: (1,4)-(1,15) = "some_method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,18)-(1,33)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,18)-(1,33)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :other_method + │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,33)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,31)-(1,33)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,16)-(1,17) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_endless_command_rescue.txt b/test/mri/prism/snapshots/seattlerb/defn_endless_command_rescue.txt new file mode 100644 index 00000000000..dfd1d01ba82 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_endless_command_rescue.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,43)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,43)) + ├── name: :some_method + ├── name_loc: (1,4)-(1,15) = "some_method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,18)-(1,43)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (1,18)-(1,43)) + │ ├── expression: + │ │ @ CallNode (location: (1,18)-(1,33)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :other_method + │ │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,31)-(1,33)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,31)-(1,33)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,34)-(1,40) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,41)-(1,43)) + │ ├── flags: decimal + │ └── value: 24 + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,16)-(1,17) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_forward_args.txt b/test/mri/prism/snapshots/seattlerb/defn_forward_args.txt new file mode 100644 index 00000000000..71a984c8115 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_forward_args.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,9)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,6)-(1,9)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,12)-(1,18)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,12)-(1,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,12)-(1,13) = "b" + │ ├── opening_loc: (1,13)-(1,14) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,14)-(1,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (1,14)-(1,17)) + │ ├── closing_loc: (1,17)-(1,18) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt b/test/mri/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt new file mode 100644 index 00000000000..4a4d69e4d03 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(3,3)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,9)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,6)-(1,9)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,8)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (2,2)-(2,3) = "m" + │ ├── opening_loc: (2,3)-(2,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (2,4)-(2,7)) + │ ├── closing_loc: (2,7)-(2,8) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_env.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_env.txt new file mode 100644 index 00000000000..f420420fc37 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_env.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,45)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,45)) + ├── name: :test + ├── name_loc: (1,4)-(1,8) = "test" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,18)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,9)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── name: :testing + │ │ ├── name_loc: (1,11)-(1,18) = "testing" + │ │ └── operator_loc: (1,9)-(1,11) = "**" + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,41)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,41)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :test_splat + │ ├── message_loc: (1,20)-(1,30) = "test_splat" + │ ├── opening_loc: (1,30)-(1,31) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,40)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,31)-(1,40)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (1,31)-(1,40)) + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,33)-(1,40)) + │ │ │ ├── name: :testing + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,31)-(1,33) = "**" + │ ├── closing_loc: (1,40)-(1,41) = ")" + │ └── block: ∅ + ├── locals: [:testing] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,42)-(1,45) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt new file mode 100644 index 00000000000..8a5022ff37d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,24)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,19)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 2) + │ │ ├── @ OptionalKeywordParameterNode (location: (1,9)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ OptionalKeywordParameterNode (location: (1,15)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── name: :c + │ │ ├── name_loc: (1,15)-(1,17) = "c:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,18)-(1,19)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt new file mode 100644 index 00000000000..4c980bc27f8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,15)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── name: :c + │ │ ├── name_loc: (1,14)-(1,15) = "c" + │ │ └── operator_loc: (1,12)-(1,14) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,15)-(1,16) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt new file mode 100644 index 00000000000..40afacc2a7d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,12)-(1,14) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,16)-(1,19) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_lvar.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_lvar.txt new file mode 100644 index 00000000000..0eae56924c8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_lvar.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,26)) + ├── name: :fun + ├── name_loc: (1,4)-(1,7) = "fun" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,16)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ + │ │ ├── name: :kw + │ │ ├── name_loc: (1,8)-(1,11) = "kw:" + │ │ └── value: + │ │ @ SymbolNode (location: (1,12)-(1,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,12)-(1,13) = ":" + │ │ ├── value_loc: (1,13)-(1,16) = "val" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "val" + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,19)-(1,21)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,19)-(1,21)) + │ ├── name: :kw + │ └── depth: 0 + ├── locals: [:kw] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,16)-(1,17) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,23)-(1,26) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt new file mode 100644 index 00000000000..bc5747ad02d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_kwarg_val.txt b/test/mri/prism/snapshots/seattlerb/defn_kwarg_val.txt new file mode 100644 index 00000000000..82527f7875f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_kwarg_val.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_no_kwargs.txt b/test/mri/prism/snapshots/seattlerb/defn_no_kwargs.txt new file mode 100644 index 00000000000..0ef0634a537 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_no_kwargs.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,11)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ NoKeywordsParameterNode (location: (1,6)-(1,11)) + │ │ ├── operator_loc: (1,6)-(1,8) = "**" + │ │ └── keyword_loc: (1,8)-(1,11) = "nil" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,11)-(1,12) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_oneliner.txt b/test/mri/prism/snapshots/seattlerb/defn_oneliner.txt new file mode 100644 index 00000000000..e7004998092 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_oneliner.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,27)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,16)-(1,27)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,16)-(1,27)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,16)-(1,22) = "system" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,26)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,23)-(1,26)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,26)-(1,27) = ")" + │ └── block: ∅ + ├── locals: [:cmd] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: (1,14)-(1,15) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_oneliner_eq2.txt b/test/mri/prism/snapshots/seattlerb/defn_oneliner_eq2.txt new file mode 100644 index 00000000000..2708351ede4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_oneliner_eq2.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ ClassNode (location: (1,0)-(3,3)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,16)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (2,2)-(2,16)) + │ ├── name: :== + │ ├── name_loc: (2,6)-(2,8) = "==" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (2,9)-(2,10)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (2,9)-(2,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :o + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,14)-(2,16)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,14)-(2,16)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [:o] + │ ├── def_keyword_loc: (2,2)-(2,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (2,8)-(2,9) = "(" + │ ├── rparen_loc: (2,10)-(2,11) = ")" + │ ├── equal_loc: (2,12)-(2,13) = "=" + │ └── end_keyword_loc: ∅ + ├── end_keyword_loc: (3,0)-(3,3) = "end" + └── name: :X diff --git a/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs.txt b/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs.txt new file mode 100644 index 00000000000..54555b1a238 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,11)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,17)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,11)-(1,17) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,9)-(1,10) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt b/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt new file mode 100644 index 00000000000..e0fc4636f18 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,13)-(1,19)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,19)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,13)-(1,19) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,9)-(1,10) = ")" + ├── equal_loc: (1,11)-(1,12) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_oneliner_rescue.txt b/test/mri/prism/snapshots/seattlerb/defn_oneliner_rescue.txt new file mode 100644 index 00000000000..b5b5dbe6ac6 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_oneliner_rescue.txt @@ -0,0 +1,158 @@ +@ ProgramNode (location: (1,0)-(13,38)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,38)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(5,3)) + │ ├── name: :exec + │ ├── name_loc: (1,4)-(1,8) = "exec" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,9)-(1,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,0)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,5)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ NilNode (location: (4,2)-(4,5)) + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ ├── rparen_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (8,0)-(10,3)) + │ ├── name: :exec + │ ├── name_loc: (8,4)-(8,8) = "exec" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (8,9)-(8,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (8,9)-(8,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(9,24)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (9,2)-(9,24)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (9,2)-(9,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (9,21)-(9,24)) + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (8,8)-(8,9) = "(" + │ ├── rparen_loc: (8,12)-(8,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (10,0)-(10,3) = "end" + └── @ DefNode (location: (13,0)-(13,38)) + ├── name: :exec + ├── name_loc: (13,4)-(13,8) = "exec" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (13,9)-(13,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (13,9)-(13,12)) + │ │ ├── flags: ∅ + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (13,16)-(13,38)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (13,16)-(13,38)) + │ ├── expression: + │ │ @ CallNode (location: (13,16)-(13,27)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :system + │ │ ├── message_loc: (13,16)-(13,22) = "system" + │ │ ├── opening_loc: (13,22)-(13,23) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,23)-(13,26)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,23)-(13,26)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,26)-(13,27) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (13,28)-(13,34) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (13,35)-(13,38)) + ├── locals: [:cmd] + ├── def_keyword_loc: (13,0)-(13,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (13,8)-(13,9) = "(" + ├── rparen_loc: (13,12)-(13,13) = ")" + ├── equal_loc: (13,14)-(13,15) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defn_opt_last_arg.txt b/test/mri/prism/snapshots/seattlerb/defn_opt_last_arg.txt new file mode 100644 index 00000000000..569bc230783 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_opt_last_arg.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :m + ├── name_loc: (1,4)-(1,5) = "m" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,17)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,6)-(1,17)) + │ │ ├── flags: ∅ + │ │ ├── name: :arg + │ │ ├── name_loc: (1,6)-(1,9) = "arg" + │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ └── value: + │ │ @ FalseNode (location: (1,12)-(1,17)) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:arg] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_opt_reg.txt b/test/mri/prism/snapshots/seattlerb/defn_opt_reg.txt new file mode 100644 index 00000000000..f86168513ac --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_opt_reg.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ └── value: + │ │ @ NilNode (location: (1,8)-(1,11)) + │ ├── rest: ∅ + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ ├── flags: ∅ + │ │ └── name: :b + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,16)-(1,19) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_opt_splat_arg.txt b/test/mri/prism/snapshots/seattlerb/defn_opt_splat_arg.txt new file mode 100644 index 00000000000..3019e9b73e3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_opt_splat_arg.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,24)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,7)-(1,19)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,7)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,7)-(1,8) = "a" + │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── rest: + │ │ @ RestParameterNode (location: (1,14)-(1,16)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,15)-(1,16) = "b" + │ │ └── operator_loc: (1,14)-(1,15) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ ├── flags: ∅ + │ │ └── name: :c + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,6)-(1,7) = "(" + ├── rparen_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_powarg.txt b/test/mri/prism/snapshots/seattlerb/defn_powarg.txt new file mode 100644 index 00000000000..bce131ad183 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_powarg.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,6)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── name: :opts + │ │ ├── name_loc: (1,8)-(1,12) = "opts" + │ │ └── operator_loc: (1,6)-(1,8) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:opts] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_reg_opt_reg.txt b/test/mri/prism/snapshots/seattlerb/defn_reg_opt_reg.txt new file mode 100644 index 00000000000..d079e1b5f39 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_reg_opt_reg.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,18)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,9)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ ├── operator_loc: (1,11)-(1,12) = "=" + │ │ └── value: + │ │ @ SymbolNode (location: (1,13)-(1,15)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,13)-(1,14) = ":" + │ │ ├── value_loc: (1,14)-(1,15) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── rest: ∅ + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ ├── flags: ∅ + │ │ └── name: :d + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :d] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_splat_arg.txt b/test/mri/prism/snapshots/seattlerb/defn_splat_arg.txt new file mode 100644 index 00000000000..109fac495ab --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_splat_arg.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,15)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,6)-(1,7) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,12)-(1,15) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defn_unary_not.txt b/test/mri/prism/snapshots/seattlerb/defn_unary_not.txt new file mode 100644 index 00000000000..231a3c0da9e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defn_unary_not.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :! + ├── name_loc: (1,4)-(1,6) = "!@" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,8)-(1,12)) + │ └── body: (length: 1) + │ └── @ TrueNode (location: (1,8)-(1,12)) + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defns_reserved.txt b/test/mri/prism/snapshots/seattlerb/defns_reserved.txt new file mode 100644 index 00000000000..96860b49ce0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defns_reserved.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :return + ├── name_loc: (1,9)-(1,15) = "return" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt b/test/mri/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt new file mode 100644 index 00000000000..24bb14f8e14 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -0,0 +1,60 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,30)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ DefNode (location: (1,2)-(1,30)) + │ ├── name: :b + │ ├── name_loc: (1,11)-(1,12) = "b" + │ ├── receiver: + │ │ @ SelfNode (location: (1,6)-(1,10)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,14)-(1,25)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,14)-(1,25)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (1,14)-(1,15) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,15)-(1,16) = "." + │ │ ├── name: :y + │ │ ├── message_loc: (1,16)-(1,17) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,18)-(1,25)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,18)-(1,20) = "do" + │ │ └── closing_loc: (1,22)-(1,25) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,2)-(1,5) = "def" + │ ├── operator_loc: (1,10)-(1,11) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,27)-(1,30) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defs_comments.txt b/test/mri/prism/snapshots/seattlerb/defs_comments.txt new file mode 100644 index 00000000000..a2976e7ee28 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_comments.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (4,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(5,3)) + └── body: (length: 1) + └── @ DefNode (location: (4,0)-(5,3)) + ├── name: :blah + ├── name_loc: (4,9)-(4,13) = "blah" + ├── receiver: + │ @ SelfNode (location: (4,4)-(4,8)) + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (4,0)-(4,3) = "def" + ├── operator_loc: (4,8)-(4,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,0)-(5,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defs_endless_command.txt b/test/mri/prism/snapshots/seattlerb/defs_endless_command.txt new file mode 100644 index 00000000000..f3c4e794178 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_endless_command.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,35)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,35)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,35)) + ├── name: :some_method + ├── name_loc: (1,6)-(1,17) = "some_method" + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,35)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,35)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :other_method + │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,33)-(1,35)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,33)-(1,35)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,5)-(1,6) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,18)-(1,19) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defs_endless_command_rescue.txt b/test/mri/prism/snapshots/seattlerb/defs_endless_command_rescue.txt new file mode 100644 index 00000000000..b0cd34a9c83 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_endless_command_rescue.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,45)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,45)) + ├── name: :some_method + ├── name_loc: (1,6)-(1,17) = "some_method" + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,45)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (1,20)-(1,45)) + │ ├── expression: + │ │ @ CallNode (location: (1,20)-(1,35)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :other_method + │ │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,33)-(1,35)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,33)-(1,35)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,36)-(1,42) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,43)-(1,45)) + │ ├── flags: decimal + │ └── value: 24 + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,5)-(1,6) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,18)-(1,19) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defs_kwarg.txt b/test/mri/prism/snapshots/seattlerb/defs_kwarg.txt new file mode 100644 index 00000000000..53235c9bb80 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_kwarg.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :a + ├── name_loc: (1,9)-(1,10) = "a" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: + │ @ ParametersNode (location: (1,11)-(1,15)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,11)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,11)-(1,13) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/defs_oneliner.txt b/test/mri/prism/snapshots/seattlerb/defs_oneliner.txt new file mode 100644 index 00000000000..d32975354d9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_oneliner.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,32)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,32)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,32)) + ├── name: :exec + ├── name_loc: (1,9)-(1,13) = "exec" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: + │ @ ParametersNode (location: (1,14)-(1,17)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ ├── flags: ∅ + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,21)-(1,32)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,21)-(1,32)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,21)-(1,27) = "system" + │ ├── opening_loc: (1,27)-(1,28) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,28)-(1,31)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,28)-(1,31)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,31)-(1,32) = ")" + │ └── block: ∅ + ├── locals: [:cmd] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: (1,13)-(1,14) = "(" + ├── rparen_loc: (1,17)-(1,18) = ")" + ├── equal_loc: (1,19)-(1,20) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/defs_oneliner_eq2.txt b/test/mri/prism/snapshots/seattlerb/defs_oneliner_eq2.txt new file mode 100644 index 00000000000..fcc5c63cf06 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_oneliner_eq2.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ ClassNode (location: (1,0)-(3,3)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,21)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (2,2)-(2,21)) + │ ├── name: :== + │ ├── name_loc: (2,11)-(2,13) = "==" + │ ├── receiver: + │ │ @ SelfNode (location: (2,6)-(2,10)) + │ ├── parameters: + │ │ @ ParametersNode (location: (2,14)-(2,15)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (2,14)-(2,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :o + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,19)-(2,21)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,19)-(2,21)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [:o] + │ ├── def_keyword_loc: (2,2)-(2,5) = "def" + │ ├── operator_loc: (2,10)-(2,11) = "." + │ ├── lparen_loc: (2,13)-(2,14) = "(" + │ ├── rparen_loc: (2,15)-(2,16) = ")" + │ ├── equal_loc: (2,17)-(2,18) = "=" + │ └── end_keyword_loc: ∅ + ├── end_keyword_loc: (3,0)-(3,3) = "end" + └── name: :X diff --git a/test/mri/prism/snapshots/seattlerb/defs_oneliner_rescue.txt b/test/mri/prism/snapshots/seattlerb/defs_oneliner_rescue.txt new file mode 100644 index 00000000000..f7762107682 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/defs_oneliner_rescue.txt @@ -0,0 +1,161 @@ +@ ProgramNode (location: (1,0)-(13,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,43)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(5,3)) + │ ├── name: :exec + │ ├── name_loc: (1,9)-(1,13) = "exec" + │ ├── receiver: + │ │ @ SelfNode (location: (1,4)-(1,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,14)-(1,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,0)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,5)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ NilNode (location: (4,2)-(4,5)) + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: (1,8)-(1,9) = "." + │ ├── lparen_loc: (1,13)-(1,14) = "(" + │ ├── rparen_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (8,0)-(10,3)) + │ ├── name: :exec + │ ├── name_loc: (8,9)-(8,13) = "exec" + │ ├── receiver: + │ │ @ SelfNode (location: (8,4)-(8,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (8,14)-(8,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (8,14)-(8,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(9,24)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (9,2)-(9,24)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (9,2)-(9,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (9,21)-(9,24)) + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: (8,8)-(8,9) = "." + │ ├── lparen_loc: (8,13)-(8,14) = "(" + │ ├── rparen_loc: (8,17)-(8,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (10,0)-(10,3) = "end" + └── @ DefNode (location: (13,0)-(13,43)) + ├── name: :exec + ├── name_loc: (13,9)-(13,13) = "exec" + ├── receiver: + │ @ SelfNode (location: (13,4)-(13,8)) + ├── parameters: + │ @ ParametersNode (location: (13,14)-(13,17)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (13,14)-(13,17)) + │ │ ├── flags: ∅ + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (13,21)-(13,43)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (13,21)-(13,43)) + │ ├── expression: + │ │ @ CallNode (location: (13,21)-(13,32)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :system + │ │ ├── message_loc: (13,21)-(13,27) = "system" + │ │ ├── opening_loc: (13,27)-(13,28) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,28)-(13,31)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,28)-(13,31)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,31)-(13,32) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (13,33)-(13,39) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (13,40)-(13,43)) + ├── locals: [:cmd] + ├── def_keyword_loc: (13,0)-(13,3) = "def" + ├── operator_loc: (13,8)-(13,9) = "." + ├── lparen_loc: (13,13)-(13,14) = "(" + ├── rparen_loc: (13,17)-(13,18) = ")" + ├── equal_loc: (13,19)-(13,20) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult0_.txt b/test/mri/prism/snapshots/seattlerb/difficult0_.txt new file mode 100644 index 00000000000..251a80125de --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult0_.txt @@ -0,0 +1,72 @@ +@ ProgramNode (location: (1,0)-(4,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(4,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(4,4)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ StringNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,2)-(1,8) = "<<-END" + │ │ │ ├── content_loc: (2,0)-(3,0) = " a\n" + │ │ │ ├── closing_loc: (3,0)-(4,0) = " END\n" + │ │ │ └── unescaped: " a\n" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (1,8)-(1,9) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,9)-(4,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) + │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (1,10)-(2,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (1,10)-(2,0) = "b\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b\n" + │ │ │ │ └── @ StringNode (location: (4,0)-(4,3)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (4,0)-(4,3) = " c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " c" + │ │ │ └── closing_loc: (4,3)-(4,4) = "'" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (4,4)-(4,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (4,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (4,5)-(4,6) = "'" + │ │ ├── content_loc: (4,6)-(4,7) = "d" + │ │ ├── closing_loc: (4,7)-(4,8) = "'" + │ │ └── unescaped: "d" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers.txt b/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers.txt new file mode 100644 index 00000000000..da2306312c7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers.txt @@ -0,0 +1,267 @@ +@ ProgramNode (location: (1,0)-(12,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(12,3)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(12,3)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ TrueNode (location: (1,3)-(1,7)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (2,2)-(11,11)) + │ └── body: (length: 10) + │ ├── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (3,2)-(3,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (3,2)-(3,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (3,2)-(3,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (3,4)-(3,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (4,2)-(4,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (4,2)-(4,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (4,2)-(4,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (4,3)-(4,4) = "." + │ │ ├── name: :d + │ │ ├── message_loc: (4,4)-(4,5) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (4,6)-(4,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (4,6)-(4,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ └── @ IntegerNode (location: (4,9)-(4,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 4 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (5,2)-(5,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,2)-(5,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :e + │ │ │ ├── message_loc: (5,2)-(5,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (5,3)-(5,4) = "." + │ │ ├── name: :f + │ │ ├── message_loc: (5,4)-(5,5) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 5 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (6,2)-(6,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (6,2)-(6,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :g + │ │ │ ├── message_loc: (6,2)-(6,3) = "g" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (6,3)-(6,4) = "." + │ │ ├── name: :h + │ │ ├── message_loc: (6,4)-(6,5) = "h" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (6,6)-(6,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (6,6)-(6,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 6 + │ │ │ └── @ IntegerNode (location: (6,9)-(6,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 7 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (7,2)-(7,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (7,2)-(7,3) = "p" + │ │ ├── opening_loc: (7,3)-(7,4) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (7,5)-(7,6) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (8,2)-(8,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (8,2)-(8,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (8,2)-(8,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (8,3)-(8,4) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (8,4)-(8,5) = "b" + │ │ ├── opening_loc: (8,5)-(8,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (8,6)-(8,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (8,6)-(8,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: (8,7)-(8,8) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (9,2)-(9,11)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (9,2)-(9,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (9,2)-(9,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (9,3)-(9,4) = "." + │ │ ├── name: :d + │ │ ├── message_loc: (9,4)-(9,5) = "d" + │ │ ├── opening_loc: (9,5)-(9,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,6)-(9,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (9,6)-(9,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ └── @ IntegerNode (location: (9,9)-(9,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 4 + │ │ ├── closing_loc: (9,10)-(9,11) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (10,2)-(10,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (10,2)-(10,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :e + │ │ │ ├── message_loc: (10,2)-(10,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (10,3)-(10,4) = "." + │ │ ├── name: :f + │ │ ├── message_loc: (10,4)-(10,5) = "f" + │ │ ├── opening_loc: (10,5)-(10,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,6)-(10,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (10,6)-(10,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 5 + │ │ ├── closing_loc: (10,7)-(10,8) = ")" + │ │ └── block: ∅ + │ └── @ CallNode (location: (11,2)-(11,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (11,2)-(11,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (11,2)-(11,3) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (11,3)-(11,4) = "." + │ ├── name: :h + │ ├── message_loc: (11,4)-(11,5) = "h" + │ ├── opening_loc: (11,5)-(11,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,6)-(11,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (11,6)-(11,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 6 + │ │ └── @ IntegerNode (location: (11,9)-(11,10)) + │ │ ├── flags: decimal + │ │ └── value: 7 + │ ├── closing_loc: (11,10)-(11,11) = ")" + │ └── block: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (12,0)-(12,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers2.txt b/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers2.txt new file mode 100644 index 00000000000..f586634c59b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult1_line_numbers2.txt @@ -0,0 +1,78 @@ +@ ProgramNode (location: (1,0)-(7,1)) +├── locals: [:b, :c] +└── statements: + @ StatementsNode (location: (1,0)-(7,1)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(6,3)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (1,3)-(1,7)) + │ ├── then_keyword_loc: (1,8)-(1,12) = "then" + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(5,6)) + │ │ └── body: (length: 4) + │ │ ├── @ CallNode (location: (2,2)-(2,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :p + │ │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ │ ├── opening_loc: (2,3)-(2,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (2,4)-(2,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "\"" + │ │ │ │ ├── content_loc: (2,5)-(2,6) = "a" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = "\"" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ │ │ └── block: ∅ + │ │ ├── @ LocalVariableWriteNode (location: (3,2)-(3,7)) + │ │ │ ├── name: :b + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (3,2)-(3,3) = "b" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (3,4)-(3,5) = "=" + │ │ ├── @ CallNode (location: (4,2)-(4,5)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :p + │ │ │ ├── message_loc: (4,2)-(4,3) = "p" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (4,4)-(4,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (4,4)-(4,5)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ LocalVariableWriteNode (location: (5,2)-(5,6)) + │ │ ├── name: :c + │ │ ├── depth: 0 + │ │ ├── name_loc: (5,2)-(5,3) = "c" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,5)-(5,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (5,4)-(5,5) = "=" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + └── @ CallNode (location: (7,0)-(7,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (7,0)-(7,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult2_.txt b/test/mri/prism/snapshots/seattlerb/difficult2_.txt new file mode 100644 index 00000000000..a9b3736fe33 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult2_.txt @@ -0,0 +1,74 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(1,13)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── then_keyword_loc: (1,2)-(1,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,6)-(1,7) = "'" + │ │ │ ├── content_loc: (1,7)-(1,7) = "" + │ │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: (1,8)-(1,9) = ")" + │ │ └── block: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (1,10)-(1,13)) + │ │ ├── else_keyword_loc: (1,10)-(1,11) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,12)-(1,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ CallNode (location: (2,0)-(2,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (2,0)-(2,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (2,2)-(2,6)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (2,2)-(2,6)) + │ ├── key: + │ │ @ SymbolNode (location: (2,2)-(2,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (2,2)-(2,3) = "d" + │ │ ├── closing_loc: (2,3)-(2,4) = ":" + │ │ └── unescaped: "d" + │ ├── value: + │ │ @ IntegerNode (location: (2,5)-(2,6)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult3_.txt b/test/mri/prism/snapshots/seattlerb/difficult3_.txt new file mode 100644 index 00000000000..f074c49a9f9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3_.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,18)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,15)-(1,16) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,17)-(1,18) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3_2.txt b/test/mri/prism/snapshots/seattlerb/difficult3_2.txt new file mode 100644 index 00000000000..af1a6491716 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3_2.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,13)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,10)-(1,11) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3_3.txt b/test/mri/prism/snapshots/seattlerb/difficult3_3.txt new file mode 100644 index 00000000000..e49bbcd55ab --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3_3.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── name: :c + │ │ ├── name_loc: (1,13)-(1,14) = "c" + │ │ └── operator_loc: (1,12)-(1,13) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3_4.txt b/test/mri/prism/snapshots/seattlerb/difficult3_4.txt new file mode 100644 index 00000000000..73afffb4cb7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3_4.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,17)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ IfNode (location: (1,2)-(1,17)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,4)-(1,5) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,6)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (1,6)-(1,10)) + │ ├── consequent: + │ │ @ ElseNode (location: (1,10)-(1,17)) + │ │ ├── else_keyword_loc: (1,10)-(1,11) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,12)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ FalseNode (location: (1,12)-(1,17)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── operator_loc: (1,1)-(1,2) = "=" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3_5.txt b/test/mri/prism/snapshots/seattlerb/difficult3_5.txt new file mode 100644 index 00000000000..793c3f1e118 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3_5.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,19)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,7)-(1,8) = "{" + │ ├── closing_loc: (1,18)-(1,19) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,6)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ └── closing_loc: (1,5)-(1,6) = ")" + │ └── body: + │ @ StatementsNode (location: (1,9)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,9)-(1,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :g + │ ├── message_loc: (1,9)-(1,10) = "g" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,11)-(1,17)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,11)-(1,13) = "do" + │ └── closing_loc: (1,14)-(1,17) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__10.txt b/test/mri/prism/snapshots/seattlerb/difficult3__10.txt new file mode 100644 index 00000000000..0131e44d445 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__10.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,18)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,15)-(1,16) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,17)-(1,18) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__11.txt b/test/mri/prism/snapshots/seattlerb/difficult3__11.txt new file mode 100644 index 00000000000..a658b091c23 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__11.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,14)) + ├── locals: [:a] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,11)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,11)-(1,12) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__12.txt b/test/mri/prism/snapshots/seattlerb/difficult3__12.txt new file mode 100644 index 00000000000..5aa252fe6ac --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__12.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__6.txt b/test/mri/prism/snapshots/seattlerb/difficult3__6.txt new file mode 100644 index 00000000000..a42a625be73 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__6.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,21)) + ├── locals: [:a, :b, :c, :d] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :d + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,17)-(1,18) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,18)-(1,19) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,20)-(1,21) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__7.txt b/test/mri/prism/snapshots/seattlerb/difficult3__7.txt new file mode 100644 index 00000000000..b08025804ca --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__7.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,17)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,14)-(1,15) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__8.txt b/test/mri/prism/snapshots/seattlerb/difficult3__8.txt new file mode 100644 index 00000000000..b2b118faef0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__8.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,20)) + ├── locals: [:a, :b, :c] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,18)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,17)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,17)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,16)-(1,17) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,17)-(1,18) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,19)-(1,20) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult3__9.txt b/test/mri/prism/snapshots/seattlerb/difficult3__9.txt new file mode 100644 index 00000000000..85c10a4432b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult3__9.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,2)-(1,15)) + ├── locals: [:a, :b] + ├── parameters: + │ @ BlockParametersNode (location: (1,4)-(1,13)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,5)-(1,12)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,12)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,4)-(1,5) = "|" + │ └── closing_loc: (1,12)-(1,13) = "|" + ├── body: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,14)-(1,15) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots.txt b/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots.txt new file mode 100644 index 00000000000..8307c806e62 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(2,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,0)-(2,1) = "." + ├── name: :b + ├── message_loc: (2,1)-(2,2) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots2.txt b/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots2.txt new file mode 100644 index 00000000000..ee4370c0f03 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult4__leading_dots2.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + └── @ RangeNode (location: (2,0)-(2,3)) + ├── flags: ∅ + ├── left: ∅ + ├── right: + │ @ IntegerNode (location: (2,2)-(2,3)) + │ ├── flags: decimal + │ └── value: 3 + └── operator_loc: (2,0)-(2,2) = ".." diff --git a/test/mri/prism/snapshots/seattlerb/difficult6_.txt b/test/mri/prism/snapshots/seattlerb/difficult6_.txt new file mode 100644 index 00000000000..bf80034fe95 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult6_.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,25)) + ├── locals: [:a, :b] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,13)-(1,14) = "{" + ├── closing_loc: (1,24)-(1,25) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ NilNode (location: (1,8)-(1,11)) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,11)-(1,12) = ")" + └── body: + @ StatementsNode (location: (1,15)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,15)-(1,23)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,15)-(1,16) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,17)-(1,23)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,18)-(1,19)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,21)-(1,22)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── opening_loc: (1,17)-(1,18) = "[" + │ └── closing_loc: (1,22)-(1,23) = "]" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/difficult6__7.txt b/test/mri/prism/snapshots/seattlerb/difficult6__7.txt new file mode 100644 index 00000000000..7fe70c70332 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult6__7.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,7)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,6)-(1,7) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,8)-(1,11)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,9)-(1,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,9)-(1,10) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,8)-(1,9) = "{" + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult6__8.txt b/test/mri/prism/snapshots/seattlerb/difficult6__8.txt new file mode 100644 index 00000000000..7f915e283c7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult6__8.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,5)-(1,8)) + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,7)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (1,5)-(1,6) = "(" + │ └── closing_loc: (1,7)-(1,8) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,9)-(1,12)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,10)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,10)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,10)-(1,11) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,9)-(1,10) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/difficult7_.txt b/test/mri/prism/snapshots/seattlerb/difficult7_.txt new file mode 100644 index 00000000000..40c778cf6cc --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/difficult7_.txt @@ -0,0 +1,93 @@ +@ ProgramNode (location: (1,6)-(4,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,6)-(4,7)) + └── body: (length: 1) + └── @ HashNode (location: (1,6)-(4,7)) + ├── opening_loc: (1,6)-(1,7) = "{" + ├── elements: (length: 2) + │ ├── @ AssocNode (location: (2,8)-(2,33)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (2,8)-(2,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,8)-(2,9) = "a" + │ │ │ ├── closing_loc: (2,9)-(2,10) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (2,11)-(2,33)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :lambda + │ │ │ ├── message_loc: (2,11)-(2,17) = "lambda" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (2,18)-(2,33)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (2,20)-(2,31)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IfNode (location: (2,20)-(2,31)) + │ │ │ │ ├── if_keyword_loc: ∅ + │ │ │ │ ├── predicate: + │ │ │ │ │ @ CallNode (location: (2,20)-(2,21)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── message_loc: (2,20)-(2,21) = "b" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── then_keyword_loc: (2,22)-(2,23) = "?" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (2,24)-(2,27)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (2,24)-(2,27)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :c + │ │ │ │ │ ├── message_loc: (2,24)-(2,25) = "c" + │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "(" + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: (2,26)-(2,27) = ")" + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── consequent: + │ │ │ │ │ @ ElseNode (location: (2,28)-(2,31)) + │ │ │ │ │ ├── else_keyword_loc: (2,28)-(2,29) = ":" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (2,30)-(2,31)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (2,30)-(2,31)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :d + │ │ │ │ │ │ ├── message_loc: (2,30)-(2,31) = "d" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ ├── opening_loc: (2,18)-(2,19) = "{" + │ │ │ └── closing_loc: (2,32)-(2,33) = "}" + │ │ └── operator_loc: ∅ + │ └── @ AssocNode (location: (3,8)-(3,14)) + │ ├── key: + │ │ @ SymbolNode (location: (3,8)-(3,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (3,8)-(3,9) = "e" + │ │ ├── closing_loc: (3,9)-(3,10) = ":" + │ │ └── unescaped: "e" + │ ├── value: + │ │ @ NilNode (location: (3,11)-(3,14)) + │ └── operator_loc: ∅ + └── closing_loc: (4,6)-(4,7) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/do_bug.txt b/test/mri/prism/snapshots/seattlerb/do_bug.txt new file mode 100644 index 00000000000..5877b18d686 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/do_bug.txt @@ -0,0 +1,63 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(4,3)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (2,4)-(4,3)) + ├── locals: [:c] + ├── parameters: + │ @ BlockParametersNode (location: (2,7)-(2,10)) + │ ├── parameters: + │ │ @ ParametersNode (location: (2,8)-(2,9)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (2,8)-(2,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (2,7)-(2,8) = "|" + │ └── closing_loc: (2,9)-(2,10) = "|" + ├── body: ∅ + ├── opening_loc: (2,4)-(2,6) = "do" + └── closing_loc: (4,0)-(4,3) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/do_lambda.txt b/test/mri/prism/snapshots/seattlerb/do_lambda.txt new file mode 100644 index 00000000000..4713fb3e4b7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/do_lambda.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,5)-(1,7) = "do" + ├── closing_loc: (1,8)-(1,11) = "end" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,4)) + │ ├── parameters: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,3)-(1,4) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/dot2_nil__26.txt b/test/mri/prism/snapshots/seattlerb/dot2_nil__26.txt new file mode 100644 index 00000000000..104515ac3ad --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dot2_nil__26.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,3)) + ├── flags: ∅ + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: ∅ + └── operator_loc: (1,1)-(1,3) = ".." diff --git a/test/mri/prism/snapshots/seattlerb/dot3_nil__26.txt b/test/mri/prism/snapshots/seattlerb/dot3_nil__26.txt new file mode 100644 index 00000000000..ec7f57cd96f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dot3_nil__26.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,4)) + ├── flags: exclude_end + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: ∅ + └── operator_loc: (1,1)-(1,4) = "..." diff --git a/test/mri/prism/snapshots/seattlerb/dstr_evstr.txt b/test/mri/prism/snapshots/seattlerb/dstr_evstr.txt new file mode 100644 index 00000000000..ce692238cdf --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dstr_evstr.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,3)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,3)-(1,4) = "'" + │ │ │ ├── content_loc: (1,4)-(1,5) = "a" + │ │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ │ └── unescaped: "a" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ EmbeddedStatementsNode (location: (1,7)-(1,11)) + │ ├── opening_loc: (1,7)-(1,9) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,9)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,9)-(1,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── closing_loc: (1,10)-(1,11) = "}" + └── closing_loc: (1,11)-(1,12) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt b/test/mri/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt new file mode 100644 index 00000000000..53f97e4b363 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ InterpolatedSymbolNode (location: (1,0)-(1,11)) + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,2)-(1,10)) + │ ├── opening_loc: (1,2)-(1,4) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :field + │ │ ├── message_loc: (1,4)-(1,9) = "field" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── closing_loc: (1,9)-(1,10) = "}" + └── closing_loc: (1,10)-(1,11) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/dstr_lex_state.txt b/test/mri/prism/snapshots/seattlerb/dstr_lex_state.txt new file mode 100644 index 00000000000..0e7f8ff83d9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dstr_lex_state.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,3)-(1,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,3)-(1,4) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SymbolNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ │ ├── value_loc: (1,5)-(1,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── closing_loc: (1,6)-(1,7) = "}" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/dstr_str.txt b/test/mri/prism/snapshots/seattlerb/dstr_str.txt new file mode 100644 index 00000000000..42bd37a1ac9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dstr_str.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,3)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,3)-(1,4) = "'" + │ │ │ ├── content_loc: (1,4)-(1,5) = "a" + │ │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ │ └── unescaped: "a" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ StringNode (location: (1,7)-(1,9)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,7)-(1,9) = " b" + │ ├── closing_loc: ∅ + │ └── unescaped: " b" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/dsym_esc_to_sym.txt b/test/mri/prism/snapshots/seattlerb/dsym_esc_to_sym.txt new file mode 100644 index 00000000000..7b1b68131e0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dsym_esc_to_sym.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,17)) + ├── flags: forced_utf8_encoding + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── value_loc: (1,2)-(1,16) = "Variet\\303\\240" + ├── closing_loc: (1,16)-(1,17) = "\"" + └── unescaped: "Varietà" diff --git a/test/mri/prism/snapshots/seattlerb/dsym_to_sym.txt b/test/mri/prism/snapshots/seattlerb/dsym_to_sym.txt new file mode 100644 index 00000000000..eb7e435c630 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/dsym_to_sym.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,13)) + └── body: (length: 2) + ├── @ AliasMethodNode (location: (1,0)-(1,17)) + │ ├── new_name: + │ │ @ SymbolNode (location: (1,6)-(1,11)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,6)-(1,8) = ":\"" + │ │ ├── value_loc: (1,8)-(1,10) = "<<" + │ │ ├── closing_loc: (1,10)-(1,11) = "\"" + │ │ └── unescaped: "<<" + │ ├── old_name: + │ │ @ SymbolNode (location: (1,12)-(1,17)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,12)-(1,14) = ":\"" + │ │ ├── value_loc: (1,14)-(1,16) = ">>" + │ │ ├── closing_loc: (1,16)-(1,17) = "\"" + │ │ └── unescaped: ">>" + │ └── keyword_loc: (1,0)-(1,5) = "alias" + └── @ AliasMethodNode (location: (3,0)-(3,13)) + ├── new_name: + │ @ SymbolNode (location: (3,6)-(3,9)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (3,6)-(3,7) = ":" + │ ├── value_loc: (3,7)-(3,9) = "<<" + │ ├── closing_loc: ∅ + │ └── unescaped: "<<" + ├── old_name: + │ @ SymbolNode (location: (3,10)-(3,13)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (3,10)-(3,11) = ":" + │ ├── value_loc: (3,11)-(3,13) = ">>" + │ ├── closing_loc: ∅ + │ └── unescaped: ">>" + └── keyword_loc: (3,0)-(3,5) = "alias" diff --git a/test/mri/prism/snapshots/seattlerb/eq_begin_line_numbers.txt b/test/mri/prism/snapshots/seattlerb/eq_begin_line_numbers.txt new file mode 100644 index 00000000000..a5fc3951d69 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/eq_begin_line_numbers.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(6,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,1)) + └── body: (length: 2) + ├── @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + └── @ IntegerNode (location: (6,0)-(6,1)) + ├── flags: decimal + └── value: 2 diff --git a/test/mri/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt b/test/mri/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt new file mode 100644 index 00000000000..2103bde8cbf --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,8)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :h + │ ├── message_loc: (1,0)-(1,1) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,1)-(1,4) = "[k]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :k + │ │ ├── message_loc: (1,2)-(1,3) = "k" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ BeginNode (location: (1,5)-(3,8)) + │ ├── begin_keyword_loc: (1,5)-(1,10) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (2,7)-(2,9)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,7)-(2,9)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,5)-(3,8) = "end" + ├── closing_loc: (1,3)-(1,4) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/evstr_evstr.txt b/test/mri/prism/snapshots/seattlerb/evstr_evstr.txt new file mode 100644 index 00000000000..ef7545c2f25 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/evstr_evstr.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,5)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ └── @ EmbeddedStatementsNode (location: (1,5)-(1,9)) + │ ├── opening_loc: (1,5)-(1,7) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,7)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,7)-(1,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,7)-(1,8) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── closing_loc: (1,8)-(1,9) = "}" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/evstr_str.txt b/test/mri/prism/snapshots/seattlerb/evstr_str.txt new file mode 100644 index 00000000000..214491d6cf0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/evstr_str.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,5)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ └── @ StringNode (location: (1,5)-(1,7)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,5)-(1,7) = " b" + │ ├── closing_loc: ∅ + │ └── unescaped: " b" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/expr_not_bang.txt b/test/mri/prism/snapshots/seattlerb/expr_not_bang.txt new file mode 100644 index 00000000000..0a289ab7bed --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/expr_not_bang.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,2)-(1,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/f_kw.txt b/test/mri/prism/snapshots/seattlerb/f_kw.txt new file mode 100644 index 00000000000..4226137925a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/f_kw.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,15)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :k + │ │ ├── name_loc: (1,6)-(1,8) = "k:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,8)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:k] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,12)-(1,15) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/f_kw__required.txt b/test/mri/prism/snapshots/seattlerb/f_kw__required.txt new file mode 100644 index 00000000000..f72f43e034e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/f_kw__required.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,8)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── name: :k + │ │ └── name_loc: (1,6)-(1,8) = "k:" + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:k] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/flip2_env_lvar.txt b/test/mri/prism/snapshots/seattlerb/flip2_env_lvar.txt new file mode 100644 index 00000000000..5a71ab6cda3 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/flip2_env_lvar.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,16)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ FlipFlopNode (location: (1,3)-(1,7)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,4)-(1,6) = ".." + ├── then_keyword_loc: (1,8)-(1,12) = "then" + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,13)-(1,16) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/float_with_if_modifier.txt b/test/mri/prism/snapshots/seattlerb/float_with_if_modifier.txt new file mode 100644 index 00000000000..9c1da70f242 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/float_with_if_modifier.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,10)) + ├── if_keyword_loc: (1,3)-(1,5) = "if" + ├── predicate: + │ @ TrueNode (location: (1,6)-(1,10)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,3)) + │ └── body: (length: 1) + │ └── @ FloatNode (location: (1,0)-(1,3)) + │ └── value: 1.0 + ├── consequent: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt b/test/mri/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt new file mode 100644 index 00000000000..6ba437e36a9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:str] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :str + ├── depth: 0 + ├── name_loc: (1,0)-(1,3) = "str" + ├── value: + │ @ StringNode (location: (1,6)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,6)-(1,12) = "<<-XXX" + │ ├── content_loc: (2,0)-(4,0) = "before\\\r\nafter\r\n" + │ ├── closing_loc: (4,0)-(5,0) = "XXX\r\n" + │ └── unescaped: "beforeafter\r\n" + └── operator_loc: (1,4)-(1,5) = "=" diff --git a/test/mri/prism/snapshots/seattlerb/heredoc_backslash_nl.txt b/test/mri/prism/snapshots/seattlerb/heredoc_backslash_nl.txt new file mode 100644 index 00000000000..fc4c1784fef --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/heredoc_backslash_nl.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(5,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,7)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(3,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(3,0) = " why would someone do this? \\\n blah\n" + │ ├── closing_loc: (3,0)-(3,1) = "\"" + │ └── unescaped: " why would someone do this? blah\n" + └── @ StringNode (location: (5,0)-(5,7)) + ├── flags: ∅ + ├── opening_loc: (5,0)-(5,7) = "<<-DESC" + ├── content_loc: (6,0)-(8,0) = " why would someone do this? \\\n blah\n" + ├── closing_loc: (8,0)-(9,0) = "DESC\n" + └── unescaped: " why would someone do this? blah\n" diff --git a/test/mri/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt b/test/mri/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt new file mode 100644 index 00000000000..2b1d776404b --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [:s] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,9)) + ├── name: :s + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "s" + ├── value: + │ @ StringNode (location: (1,4)-(1,9)) + │ ├── flags: forced_utf8_encoding + │ ├── opening_loc: (1,4)-(1,9) = "< + ├── message_loc: (1,3)-(1,4) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/safe_call_rhs_newline.txt b/test/mri/prism/snapshots/seattlerb/safe_call_rhs_newline.txt new file mode 100644 index 00000000000..34790ebb337 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/safe_call_rhs_newline.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,8)) + ├── name: :c + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "c" + ├── value: + │ @ CallNode (location: (1,4)-(1,8)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,4)-(1,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,5)-(1,7) = "&." + │ ├── name: :b + │ ├── message_loc: (1,7)-(1,8) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/mri/prism/snapshots/seattlerb/safe_calls.txt b/test/mri/prism/snapshots/seattlerb/safe_calls.txt new file mode 100644 index 00000000000..54e591d9c0a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/safe_calls.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,3) = "&." + │ ├── name: :b + │ ├── message_loc: (1,3)-(1,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,4)-(1,6) = "&." + ├── name: :c + ├── message_loc: (1,6)-(1,7) = "c" + ├── opening_loc: (1,7)-(1,8) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,9)-(1,10) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/safe_op_asgn.txt b/test/mri/prism/snapshots/seattlerb/safe_op_asgn.txt new file mode 100644 index 00000000000..7a9fd2b7f71 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/safe_op_asgn.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,11)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── operator: :+ + ├── operator_loc: (1,5)-(1,7) = "+=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,8)-(1,9) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/safe_op_asgn2.txt b/test/mri/prism/snapshots/seattlerb/safe_op_asgn2.txt new file mode 100644 index 00000000000..bdb0e061560 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/safe_op_asgn2.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(2,1)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ CallNode (location: (2,0)-(2,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (2,0)-(2,1) = "x" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/slashy_newlines_within_string.txt b/test/mri/prism/snapshots/seattlerb/slashy_newlines_within_string.txt new file mode 100644 index 00000000000..f9be33ffdd0 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/slashy_newlines_within_string.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(6,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,5)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(4,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :puts + │ ├── message_loc: (1,0)-(1,4) = "puts" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,5)-(1,6) = "\"" + │ │ ├── content_loc: (1,6)-(4,7) = "hello\\\n my\\\n dear\\\n friend" + │ │ ├── closing_loc: (4,7)-(4,8) = "\"" + │ │ └── unescaped: "hello my dear friend" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (6,0)-(6,5)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (6,0)-(6,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (6,0)-(6,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :+ + ├── message_loc: (6,2)-(6,3) = "+" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (6,4)-(6,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (6,4)-(6,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (6,4)-(6,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_arg_no_paren.txt b/test/mri/prism/snapshots/seattlerb/stabby_arg_no_paren.txt new file mode 100644 index 00000000000..e665565d383 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_arg_no_paren.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,5)) + ├── locals: [:a] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,3)-(1,4) = "{" + ├── closing_loc: (1,4)-(1,5) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,3)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,2)-(1,3)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,2)-(1,3)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt b/test/mri/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 00000000000..0b0000ef335 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,23)) + ├── locals: [:b, :c, :d, :e, :f] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,21)-(1,22) = "{" + ├── closing_loc: (1,22)-(1,23) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,21)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,20)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,6)-(1,7) = "c" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,12)-(1,13) = "d" + │ │ │ └── operator_loc: (1,11)-(1,12) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :e + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,18)-(1,20)) + │ │ ├── flags: ∅ + │ │ ├── name: :f + │ │ ├── name_loc: (1,19)-(1,20) = "f" + │ │ └── operator_loc: (1,18)-(1,19) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,20)-(1,21) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call.txt b/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call.txt new file mode 100644 index 00000000000..e51c7d97edd --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(4,3)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ ├── closing_loc: (4,0)-(4,3) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ └── body: + │ @ StatementsNode (location: (2,0)-(3,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(3,3)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ ├── name: :b + │ ├── message_loc: (2,2)-(2,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (2,4)-(3,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (2,4)-(2,6) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt b/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt new file mode 100644 index 00000000000..d7a268a5d5a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(4,3)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ ├── closing_loc: (4,0)-(4,3) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ └── body: + │ @ StatementsNode (location: (2,0)-(3,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(3,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: (2,1)-(2,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (2,3)-(2,4) = ")" + │ └── block: + │ @ BlockNode (location: (2,5)-(3,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (2,5)-(2,7) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_block_kw.txt b/test/mri/prism/snapshots/seattlerb/stabby_block_kw.txt new file mode 100644 index 00000000000..7addbb8b288 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_block_kw.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,13)) + ├── locals: [:k] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,10)-(1,11) = "{" + ├── closing_loc: (1,12)-(1,13) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,9)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,4)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,4)-(1,6) = "k:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ └── closing_loc: (1,8)-(1,9) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_block_kw__required.txt b/test/mri/prism/snapshots/seattlerb/stabby_block_kw__required.txt new file mode 100644 index 00000000000..b5040d91dbe --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_block_kw__required.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [:k] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,8)-(1,9) = "{" + ├── closing_loc: (1,10)-(1,11) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,7)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,6)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ └── name_loc: (1,4)-(1,6) = "k:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ └── closing_loc: (1,6)-(1,7) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/stabby_proc_scope.txt b/test/mri/prism/snapshots/seattlerb/stabby_proc_scope.txt new file mode 100644 index 00000000000..898f823f245 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/stabby_proc_scope.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [:a, :b] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,9)-(1,10) = "{" + ├── closing_loc: (1,10)-(1,11) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,4)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── name: :b + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,7)-(1,8) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_backslashes.txt b/test/mri/prism/snapshots/seattlerb/str_backslashes.txt new file mode 100644 index 00000000000..ec41a89c380 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_backslashes.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,204)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,204)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,204)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,204)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,2)-(1,204)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "'" + │ ├── content_loc: (1,3)-(1,203) = "\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n" + │ ├── closing_loc: (1,203)-(1,204) = "'" + │ └── unescaped: "\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt b/test/mri/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt new file mode 100644 index 00000000000..620b43f631a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,6) = "\\\\n" + │ │ ├── closing_loc: (1,6)-(1,7) = "\"" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (1,8)-(1,9)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_double_escaped_newline.txt b/test/mri/prism/snapshots/seattlerb/str_double_escaped_newline.txt new file mode 100644 index 00000000000..2aee91b75c9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,5) = "\\n" + │ │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (1,7)-(1,8)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_double_newline.txt b/test/mri/prism/snapshots/seattlerb/str_double_newline.txt new file mode 100644 index 00000000000..eb249cde8a1 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_double_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(2,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "\"" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,2)-(2,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_evstr.txt b/test/mri/prism/snapshots/seattlerb/str_evstr.txt new file mode 100644 index 00000000000..24b4bdaa859 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_evstr.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── closing_loc: (1,6)-(1,7) = "}" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/str_evstr_escape.txt b/test/mri/prism/snapshots/seattlerb/str_evstr_escape.txt new file mode 100644 index 00000000000..c14c39ee85f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_evstr_escape.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,16)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ StringNode (location: (1,7)-(1,15)) + │ ├── flags: forced_utf8_encoding + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,7)-(1,15) = "\\302\\275" + │ ├── closing_loc: ∅ + │ └── unescaped: "½" + └── closing_loc: (1,15)-(1,16) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/str_heredoc_interp.txt b/test/mri/prism/snapshots/seattlerb/str_heredoc_interp.txt new file mode 100644 index 00000000000..cdb5e7e804f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_heredoc_interp.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,4)) + ├── opening_loc: (1,0)-(1,4) = "<<\"\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (2,0)-(2,4)) + │ │ ├── opening_loc: (2,0)-(2,2) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (2,2)-(2,3) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (2,3)-(2,4) = "}" + │ └── @ StringNode (location: (2,4)-(4,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,4)-(4,0) = "\nblah2\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\nblah2\n" + └── closing_loc: (4,0)-(5,0) = "\n" diff --git a/test/mri/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt b/test/mri/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt new file mode 100644 index 00000000000..474c42ebc8c --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt @@ -0,0 +1,104 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,23)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,1)-(1,22)) + │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,3)-(1,21)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (1,3)-(1,21)) + │ │ ├── if_keyword_loc: ∅ + │ │ ├── predicate: + │ │ │ @ CallNode (location: (1,3)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ │ │ ├── name: :b? + │ │ │ ├── message_loc: (1,5)-(1,7) = "b?" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: (1,8)-(1,9) = "?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,10)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,10)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,10)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ StringNode (location: (1,10)-(1,12)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (1,10)-(1,11) = "\"" + │ │ │ │ │ ├── content_loc: (1,11)-(1,11) = "" + │ │ │ │ │ ├── closing_loc: (1,11)-(1,12) = "\"" + │ │ │ │ │ └── unescaped: "" + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :+ + │ │ │ │ ├── message_loc: (1,12)-(1,13) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── message_loc: (1,13)-(1,14) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (1,14)-(1,15) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,15)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,15)-(1,16) = "\"" + │ │ │ │ ├── content_loc: (1,16)-(1,16) = "" + │ │ │ │ ├── closing_loc: (1,16)-(1,17) = "\"" + │ │ │ │ └── unescaped: "" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (1,17)-(1,21)) + │ │ │ ├── else_keyword_loc: (1,17)-(1,18) = ":" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,19)-(1,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,19)-(1,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,19)-(1,20) = "\"" + │ │ │ │ ├── content_loc: (1,20)-(1,20) = "" + │ │ │ │ ├── closing_loc: (1,20)-(1,21) = "\"" + │ │ │ │ └── unescaped: "" + │ │ │ └── end_keyword_loc: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── closing_loc: (1,21)-(1,22) = "}" + └── closing_loc: (1,22)-(1,23) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt b/test/mri/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt new file mode 100644 index 00000000000..b841407cd8d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(2,66)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,66)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(2,66)) + ├── opening_loc: ∅ + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,0)-(1,62)) + │ │ ├── flags: forced_utf8_encoding + │ │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ │ ├── content_loc: (1,1)-(1,61) = "\\xE3\\xD3\\x8B\\xE3\\x83\\xBC\\x83\\xE3\\x83\\xE3\\x82\\xB3\\xA3\\x82\\x99" + │ │ ├── closing_loc: (1,61)-(1,62) = "\"" + │ │ └── unescaped: "\xE3Ӌー\x83\xE3\x83コ\xA3\x82\x99" + │ └── @ StringNode (location: (2,8)-(2,66)) + │ ├── flags: forced_utf8_encoding + │ ├── opening_loc: (2,8)-(2,9) = "\"" + │ ├── content_loc: (2,9)-(2,65) = "\\xE3\\x83\\xB3\\xE3\\x83\\x8F\\xE3\\x82\\x9A\\xC3\\xBD;foo@bar.com" + │ ├── closing_loc: (2,65)-(2,66) = "\"" + │ └── unescaped: "ンパý;foo@bar.com" + └── closing_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_newline_hash_line_number.txt b/test/mri/prism/snapshots/seattlerb/str_newline_hash_line_number.txt new file mode 100644 index 00000000000..d55d9650685 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_newline_hash_line_number.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,11)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(1,10) = "\\n\\n\\n\\n#" + │ ├── closing_loc: (1,10)-(1,11) = "\"" + │ └── unescaped: "\n\n\n\n#" + └── @ IntegerNode (location: (2,0)-(2,1)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/seattlerb/str_pct_Q_nested.txt b/test/mri/prism/snapshots/seattlerb/str_pct_Q_nested.txt new file mode 100644 index 00000000000..92ee7a9c6cc --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_pct_Q_nested.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,26)) + ├── opening_loc: (1,0)-(1,3) = "%Q[" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,3)-(1,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,3)-(1,11) = "before [" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "before [" + │ ├── @ EmbeddedStatementsNode (location: (1,11)-(1,18)) + │ │ ├── opening_loc: (1,11)-(1,13) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,13)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,13)-(1,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :nest + │ │ │ ├── message_loc: (1,13)-(1,17) = "nest" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,17)-(1,18) = "}" + │ └── @ StringNode (location: (1,18)-(1,25)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,18)-(1,25) = "] after" + │ ├── closing_loc: ∅ + │ └── unescaped: "] after" + └── closing_loc: (1,25)-(1,26) = "]" diff --git a/test/mri/prism/snapshots/seattlerb/str_pct_nested_nested.txt b/test/mri/prism/snapshots/seattlerb/str_pct_nested_nested.txt new file mode 100644 index 00000000000..b9c39c9a93e --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_pct_nested_nested.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,20)) + ├── opening_loc: (1,0)-(1,2) = "%{" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,2)-(1,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,2)-(1,5) = " { " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " { " + │ ├── @ EmbeddedStatementsNode (location: (1,5)-(1,16)) + │ │ ├── opening_loc: (1,5)-(1,7) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,8)-(1,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (1,8)-(1,14)) + │ │ │ ├── opening_loc: (1,8)-(1,9) = "\"" + │ │ │ ├── parts: (length: 1) + │ │ │ │ └── @ EmbeddedStatementsNode (location: (1,9)-(1,13)) + │ │ │ │ ├── opening_loc: (1,9)-(1,11) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (1,11)-(1,12)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── closing_loc: (1,12)-(1,13) = "}" + │ │ │ └── closing_loc: (1,13)-(1,14) = "\"" + │ │ └── closing_loc: (1,15)-(1,16) = "}" + │ └── @ StringNode (location: (1,16)-(1,19)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,16)-(1,19) = " } " + │ ├── closing_loc: ∅ + │ └── unescaped: " } " + └── closing_loc: (1,19)-(1,20) = "}" diff --git a/test/mri/prism/snapshots/seattlerb/str_pct_q.txt b/test/mri/prism/snapshots/seattlerb/str_pct_q.txt new file mode 100644 index 00000000000..c4dd5bacae2 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_pct_q.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%q{" + ├── content_loc: (1,3)-(1,8) = "a b c" + ├── closing_loc: (1,8)-(1,9) = "}" + └── unescaped: "a b c" diff --git a/test/mri/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt b/test/mri/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt new file mode 100644 index 00000000000..8fa8886029a --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(1,6) = "\\\\n" + │ │ ├── closing_loc: (1,6)-(1,7) = "'" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (1,8)-(1,9)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_single_escaped_newline.txt b/test/mri/prism/snapshots/seattlerb/str_single_escaped_newline.txt new file mode 100644 index 00000000000..c840c7688bc --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_single_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(1,5) = "\\n" + │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (1,7)-(1,8)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_single_newline.txt b/test/mri/prism/snapshots/seattlerb/str_single_newline.txt new file mode 100644 index 00000000000..15b0f2ff729 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_single_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(2,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "'" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,2)-(2,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/str_str.txt b/test/mri/prism/snapshots/seattlerb/str_str.txt new file mode 100644 index 00000000000..f183980f5e7 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_str.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,9)) + │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,5)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,5)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,5)-(1,6) = "'" + │ │ ├── content_loc: (1,6)-(1,7) = "b" + │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ └── unescaped: "b" + │ └── closing_loc: (1,8)-(1,9) = "}" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/str_str_str.txt b/test/mri/prism/snapshots/seattlerb/str_str_str.txt new file mode 100644 index 00000000000..68873d81825 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/str_str_str.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,9)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,5)-(1,6) = "'" + │ │ │ ├── content_loc: (1,6)-(1,7) = "b" + │ │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ │ └── unescaped: "b" + │ │ └── closing_loc: (1,8)-(1,9) = "}" + │ └── @ StringNode (location: (1,9)-(1,11)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,9)-(1,11) = " c" + │ ├── closing_loc: ∅ + │ └── unescaped: " c" + └── closing_loc: (1,11)-(1,12) = "\"" diff --git a/test/mri/prism/snapshots/seattlerb/super_arg.txt b/test/mri/prism/snapshots/seattlerb/super_arg.txt new file mode 100644 index 00000000000..61b5f0b6313 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/super_arg.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ SuperNode (location: (1,0)-(1,8)) + ├── keyword_loc: (1,0)-(1,5) = "super" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ ├── flags: decimal + │ └── value: 42 + ├── rparen_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/symbol_empty.txt b/test/mri/prism/snapshots/seattlerb/symbol_empty.txt new file mode 100644 index 00000000000..e95543e925d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbol_empty.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,3)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,2) = ":'" + ├── value_loc: (1,2)-(1,2) = "" + ├── closing_loc: (1,2)-(1,3) = "'" + └── unescaped: "" diff --git a/test/mri/prism/snapshots/seattlerb/symbol_list.txt b/test/mri/prism/snapshots/seattlerb/symbol_list.txt new file mode 100644 index 00000000000..6750160d507 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbol_list.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ InterpolatedSymbolNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ └── closing_loc: ∅ + │ └── @ InterpolatedSymbolNode (location: (1,8)-(1,12)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (1,8)-(1,12)) + │ │ ├── opening_loc: (1,8)-(1,10) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,10)-(1,11) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ └── closing_loc: ∅ + ├── opening_loc: (1,0)-(1,3) = "%I[" + └── closing_loc: (1,12)-(1,13) = "]" diff --git a/test/mri/prism/snapshots/seattlerb/symbols.txt b/test/mri/prism/snapshots/seattlerb/symbols.txt new file mode 100644 index 00000000000..30cf57c5287 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbols.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,6) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── @ SymbolNode (location: (1,7)-(1,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,7)-(1,8) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,8)-(1,9) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/symbols_empty.txt b/test/mri/prism/snapshots/seattlerb/symbols_empty.txt new file mode 100644 index 00000000000..dc743e2be50 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbols_empty.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,3)-(1,4) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/symbols_empty_space.txt b/test/mri/prism/snapshots/seattlerb/symbols_empty_space.txt new file mode 100644 index 00000000000..ea7ada9446d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbols_empty_space.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,4)-(1,5) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/symbols_interp.txt b/test/mri/prism/snapshots/seattlerb/symbols_interp.txt new file mode 100644 index 00000000000..2ad3cc502d9 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/symbols_interp.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,15)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,12) = "b\#{1+1}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\#{1+1}" + │ └── @ SymbolNode (location: (1,13)-(1,14)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,13)-(1,14) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,14)-(1,15) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/thingy.txt b/test/mri/prism/snapshots/seattlerb/thingy.txt new file mode 100644 index 00000000000..4dd2ac44a65 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/thingy.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(3,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,7)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :f + │ │ ├── message_loc: (1,0)-(1,1) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,3)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,3)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: (1,5)-(1,6) = ")" + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (3,0)-(3,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (3,1)-(3,3) = "::" + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (3,3)-(3,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,4)-(3,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (3,4)-(3,6)) + │ ├── flags: decimal + │ └── value: 42 + ├── closing_loc: (3,6)-(3,7) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/uminus_float.txt b/test/mri/prism/snapshots/seattlerb/uminus_float.txt new file mode 100644 index 00000000000..0578dbbd680 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/uminus_float.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ FloatNode (location: (1,0)-(1,4)) + └── value: -0.0 diff --git a/test/mri/prism/snapshots/seattlerb/unary_minus.txt b/test/mri/prism/snapshots/seattlerb/unary_minus.txt new file mode 100644 index 00000000000..79889bffb04 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/unary_minus.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :-@ + ├── message_loc: (1,0)-(1,1) = "-" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/unary_plus.txt b/test/mri/prism/snapshots/seattlerb/unary_plus.txt new file mode 100644 index 00000000000..b570cbf73be --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/unary_plus.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :+@ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/unary_plus_on_literal.txt b/test/mri/prism/snapshots/seattlerb/unary_plus_on_literal.txt new file mode 100644 index 00000000000..4deb857536f --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/unary_plus_on_literal.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,3)) + ├── flags: ∅ + ├── receiver: + │ @ SymbolNode (location: (1,1)-(1,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,1)-(1,2) = ":" + │ ├── value_loc: (1,2)-(1,3) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── call_operator_loc: ∅ + ├── name: :+@ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/unary_tilde.txt b/test/mri/prism/snapshots/seattlerb/unary_tilde.txt new file mode 100644 index 00000000000..5fd1a5d00e8 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/unary_tilde.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :~ + ├── message_loc: (1,0)-(1,1) = "~" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/utf8_bom.txt b/test/mri/prism/snapshots/seattlerb/utf8_bom.txt new file mode 100644 index 00000000000..9f0eb83b052 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/utf8_bom.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (2,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (2,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (2,0)-(2,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ ├── flags: decimal + │ └── value: 0 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/when_splat.txt b/test/mri/prism/snapshots/seattlerb/when_splat.txt new file mode 100644 index 00000000000..19e70019c0d --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/when_splat.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,25)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,5)-(1,6) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,8)-(1,20)) + │ ├── keyword_loc: (1,8)-(1,12) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ SplatNode (location: (1,13)-(1,15)) + │ │ ├── operator_loc: (1,13)-(1,14) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (1,14)-(1,15)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,14)-(1,15) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,16)-(1,20) = "then" + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,22)-(1,25) = "end" diff --git a/test/mri/prism/snapshots/seattlerb/words_interp.txt b/test/mri/prism/snapshots/seattlerb/words_interp.txt new file mode 100644 index 00000000000..dfead7d3534 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/words_interp.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── elements: (length: 1) + │ └── @ InterpolatedStringNode (location: (1,3)-(1,8)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ └── @ StringNode (location: (1,7)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,7)-(1,8) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── closing_loc: ∅ + ├── opening_loc: (1,0)-(1,3) = "%W(" + └── closing_loc: (1,8)-(1,9) = ")" diff --git a/test/mri/prism/snapshots/seattlerb/yield_arg.txt b/test/mri/prism/snapshots/seattlerb/yield_arg.txt new file mode 100644 index 00000000000..22e0c14f837 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/yield_arg.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ YieldNode (location: (1,0)-(1,8)) + ├── keyword_loc: (1,0)-(1,5) = "yield" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ ├── flags: decimal + │ └── value: 42 + └── rparen_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/yield_call_assocs.txt b/test/mri/prism/snapshots/seattlerb/yield_call_assocs.txt new file mode 100644 index 00000000000..c04273f5aa4 --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/yield_call_assocs.txt @@ -0,0 +1,224 @@ +@ ProgramNode (location: (1,0)-(11,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,13)) + └── body: (length: 6) + ├── @ YieldNode (location: (1,0)-(1,16)) + │ ├── keyword_loc: (1,0)-(1,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (1,9)-(1,16)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,9)-(1,16)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,9)-(1,10) = ":" + │ │ │ ├── value_loc: (1,10)-(1,11) = "z" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,15)-(1,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (1,12)-(1,14) = "=>" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (3,0)-(3,25)) + │ ├── keyword_loc: (3,0)-(3,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,6)-(3,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (3,9)-(3,25)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 2) + │ │ ├── @ AssocNode (location: (3,9)-(3,16)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (3,9)-(3,11)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (3,9)-(3,10) = ":" + │ │ │ │ ├── value_loc: (3,10)-(3,11) = "z" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (3,15)-(3,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (3,12)-(3,14) = "=>" + │ │ └── @ AssocNode (location: (3,18)-(3,25)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,18)-(3,20)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (3,18)-(3,19) = ":" + │ │ │ ├── value_loc: (3,19)-(3,20) = "w" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "w" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,24)-(3,25)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (3,21)-(3,23) = "=>" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (5,0)-(5,13)) + │ ├── keyword_loc: (5,0)-(5,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (5,6)-(5,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (5,6)-(5,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,8)-(5,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (5,8)-(5,13)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,8)-(5,13)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,8)-(5,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (5,8)-(5,9) = ":" + │ │ │ │ ├── value_loc: (5,9)-(5,10) = "z" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (5,12)-(5,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (5,10)-(5,12) = "=>" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (7,0)-(7,11)) + │ ├── keyword_loc: (7,0)-(7,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(7,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,6)-(7,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (7,6)-(7,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,8)-(7,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (7,8)-(7,11)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,8)-(7,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (7,8)-(7,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (7,8)-(7,9) = "z" + │ │ │ │ ├── closing_loc: (7,9)-(7,10) = ":" + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (7,10)-(7,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (9,0)-(9,12)) + │ ├── keyword_loc: (9,0)-(9,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,6)-(9,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (9,6)-(9,12)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (9,6)-(9,7) = "y" + │ │ ├── opening_loc: (9,7)-(9,8) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,8)-(9,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (9,8)-(9,11)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (9,8)-(9,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (9,8)-(9,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (9,8)-(9,9) = "z" + │ │ │ │ ├── closing_loc: (9,9)-(9,10) = ":" + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (9,10)-(9,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: (9,11)-(9,12) = ")" + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + └── @ YieldNode (location: (11,0)-(11,13)) + ├── keyword_loc: (11,0)-(11,5) = "yield" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,6)-(11,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (11,6)-(11,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :y + │ ├── message_loc: (11,6)-(11,7) = "y" + │ ├── opening_loc: (11,7)-(11,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,8)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (11,8)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (11,8)-(11,12)) + │ │ ├── key: + │ │ │ @ CallNode (location: (11,8)-(11,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :z + │ │ │ ├── message_loc: (11,8)-(11,9) = "z" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ IntegerNode (location: (11,11)-(11,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (11,9)-(11,11) = "=>" + │ ├── closing_loc: (11,12)-(11,13) = ")" + │ └── block: ∅ + └── rparen_loc: ∅ diff --git a/test/mri/prism/snapshots/seattlerb/yield_empty_parens.txt b/test/mri/prism/snapshots/seattlerb/yield_empty_parens.txt new file mode 100644 index 00000000000..5ecd89823fd --- /dev/null +++ b/test/mri/prism/snapshots/seattlerb/yield_empty_parens.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ YieldNode (location: (1,0)-(1,7)) + ├── keyword_loc: (1,0)-(1,5) = "yield" + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── arguments: ∅ + └── rparen_loc: (1,6)-(1,7) = ")" diff --git a/test/mri/prism/snapshots/single_method_call_with_bang.txt b/test/mri/prism/snapshots/single_method_call_with_bang.txt new file mode 100644 index 00000000000..4c68e0adac9 --- /dev/null +++ b/test/mri/prism/snapshots/single_method_call_with_bang.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo! + ├── message_loc: (1,0)-(1,4) = "foo!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/single_quote_heredocs.txt b/test/mri/prism/snapshots/single_quote_heredocs.txt new file mode 100644 index 00000000000..429c9daf11c --- /dev/null +++ b/test/mri/prism/snapshots/single_quote_heredocs.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,8) = "<<-'EOS'" + ├── content_loc: (2,0)-(3,0) = " cd L:\\Work\\MG3710IQPro\\Develop\n" + ├── closing_loc: (3,0)-(4,0) = "EOS\n" + └── unescaped: " cd L:\\Work\\MG3710IQPro\\Develop\n" diff --git a/test/mri/prism/snapshots/spanning_heredoc.txt b/test/mri/prism/snapshots/spanning_heredoc.txt new file mode 100644 index 00000000000..90297d2282c --- /dev/null +++ b/test/mri/prism/snapshots/spanning_heredoc.txt @@ -0,0 +1,409 @@ +@ ProgramNode (location: (4,0)-(63,2)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (4,0)-(63,2)) + └── body: (length: 14) + ├── @ CallNode (location: (4,0)-(7,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (4,0)-(4,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,3)-(7,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (4,3)-(7,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ StringNode (location: (4,3)-(4,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (4,3)-(4,7) = "<<-A" + │ │ │ ├── content_loc: (5,0)-(6,0) = "a\n" + │ │ │ ├── closing_loc: (6,0)-(7,0) = "A\n" + │ │ │ └── unescaped: "a\n" + │ │ ├── call_operator_loc: (4,7)-(4,8) = "." + │ │ ├── name: :gsub + │ │ ├── message_loc: (4,8)-(4,12) = "gsub" + │ │ ├── opening_loc: (4,12)-(4,13) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (4,13)-(7,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ InterpolatedRegularExpressionNode (location: (4,13)-(7,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (4,13)-(4,14) = "/" + │ │ │ │ ├── parts: (length: 2) + │ │ │ │ │ ├── @ StringNode (location: (4,14)-(4,16)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── content_loc: (4,14)-(4,16) = "b\\" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "b" + │ │ │ │ │ └── @ StringNode (location: (7,0)-(7,1)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (7,0)-(7,1) = "b" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ └── closing_loc: (7,1)-(7,2) = "/" + │ │ │ └── @ StringNode (location: (7,4)-(7,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (7,4)-(7,5) = "\"" + │ │ │ ├── content_loc: (7,5)-(7,5) = "" + │ │ │ ├── closing_loc: (7,5)-(7,6) = "\"" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: (7,6)-(7,7) = ")" + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (10,0)-(13,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (10,0)-(10,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (10,3)-(13,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (10,3)-(10,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (10,3)-(10,7) = "<<-A" + │ │ │ ├── content_loc: (11,0)-(12,0) = "c\n" + │ │ │ ├── closing_loc: (12,0)-(13,0) = "A\n" + │ │ │ └── unescaped: "c\n" + │ │ └── @ InterpolatedStringNode (location: (10,9)-(13,2)) + │ │ ├── opening_loc: (10,9)-(10,10) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (10,10)-(10,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (10,10)-(10,12) = "d\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "d" + │ │ │ └── @ StringNode (location: (13,0)-(13,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (13,0)-(13,1) = "d" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "d" + │ │ └── closing_loc: (13,1)-(13,2) = "\"" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (16,0)-(19,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (16,0)-(16,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (16,3)-(19,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (16,3)-(16,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (16,3)-(16,7) = "<<-A" + │ │ │ ├── content_loc: (17,0)-(18,0) = "e\n" + │ │ │ ├── closing_loc: (18,0)-(19,0) = "A\n" + │ │ │ └── unescaped: "e\n" + │ │ └── @ InterpolatedStringNode (location: (16,9)-(19,2)) + │ │ ├── opening_loc: (16,9)-(16,12) = "%q[" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (16,12)-(16,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (16,12)-(16,14) = "f\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "f\\\n" + │ │ │ └── @ StringNode (location: (19,0)-(19,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (19,0)-(19,1) = "f" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "f" + │ │ └── closing_loc: (19,1)-(19,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (22,0)-(25,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (22,0)-(22,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (22,3)-(25,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (22,3)-(22,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (22,3)-(22,7) = "<<-A" + │ │ │ ├── content_loc: (23,0)-(24,0) = "g\n" + │ │ │ ├── closing_loc: (24,0)-(25,0) = "A\n" + │ │ │ └── unescaped: "g\n" + │ │ └── @ InterpolatedStringNode (location: (22,9)-(25,2)) + │ │ ├── opening_loc: (22,9)-(22,12) = "%Q[" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (22,12)-(22,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (22,12)-(22,14) = "h\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "h" + │ │ │ └── @ StringNode (location: (25,0)-(25,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (25,0)-(25,1) = "h" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "h" + │ │ └── closing_loc: (25,1)-(25,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (28,0)-(31,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (28,0)-(28,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (28,3)-(31,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (28,3)-(28,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (28,3)-(28,7) = "<<-A" + │ │ │ ├── content_loc: (29,0)-(30,0) = "i\n" + │ │ │ ├── closing_loc: (30,0)-(31,0) = "A\n" + │ │ │ └── unescaped: "i\n" + │ │ └── @ ArrayNode (location: (28,9)-(31,2)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ StringNode (location: (28,12)-(28,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (28,12)-(28,14) = "j\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "j\n" + │ │ │ └── @ StringNode (location: (31,0)-(31,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (31,0)-(31,1) = "j" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "j" + │ │ ├── opening_loc: (28,9)-(28,12) = "%w[" + │ │ └── closing_loc: (31,1)-(31,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(38,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (35,0)-(35,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,3)-(38,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (35,3)-(35,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (35,3)-(35,7) = "<<-A" + │ │ │ ├── content_loc: (36,0)-(37,0) = "k\n" + │ │ │ ├── closing_loc: (37,0)-(38,0) = "A\n" + │ │ │ └── unescaped: "k\n" + │ │ └── @ ArrayNode (location: (35,9)-(38,2)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (35,12)-(38,1)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (35,12)-(35,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (35,12)-(35,14) = "l\\" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "l\n" + │ │ │ │ └── @ StringNode (location: (38,0)-(38,1)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (38,0)-(38,1) = "l" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "l" + │ │ │ └── closing_loc: ∅ + │ │ ├── opening_loc: (35,9)-(35,12) = "%W[" + │ │ └── closing_loc: (38,1)-(38,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(44,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (41,0)-(41,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (41,3)-(44,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (41,3)-(41,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (41,3)-(41,7) = "<<-A" + │ │ │ ├── content_loc: (42,0)-(43,0) = "m\n" + │ │ │ ├── closing_loc: (43,0)-(44,0) = "A\n" + │ │ │ └── unescaped: "m\n" + │ │ └── @ ArrayNode (location: (41,9)-(44,2)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ SymbolNode (location: (41,12)-(41,14)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (41,12)-(41,14) = "n\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "n\n" + │ │ │ └── @ SymbolNode (location: (44,0)-(44,1)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (44,0)-(44,1) = "n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "n" + │ │ ├── opening_loc: (41,9)-(41,12) = "%i[" + │ │ └── closing_loc: (44,1)-(44,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (48,0)-(51,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :pp + │ ├── message_loc: (48,0)-(48,2) = "pp" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (48,3)-(51,2)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (48,3)-(48,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (48,3)-(48,7) = "<<-A" + │ │ │ ├── content_loc: (49,0)-(50,0) = "o\n" + │ │ │ ├── closing_loc: (50,0)-(51,0) = "A\n" + │ │ │ └── unescaped: "o\n" + │ │ └── @ ArrayNode (location: (48,9)-(51,2)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ InterpolatedSymbolNode (location: (48,12)-(48,14)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (48,12)-(48,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (48,12)-(48,14) = "p\\" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "p\n" + │ │ │ │ └── @ StringNode (location: (48,12)-(48,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (48,12)-(48,14) = "p\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "p" + │ │ │ └── closing_loc: ∅ + │ │ ├── opening_loc: (48,9)-(48,12) = "%I[" + │ │ └── closing_loc: (51,1)-(51,2) = "]" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ StringNode (location: (53,0)-(53,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (53,0)-(53,3) = "<)" + │ │ │ └── closing_loc: (55,6)-(55,7) = "/" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (55,8)-(55,10) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (55,11)-(55,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (55,11)-(55,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (55,11)-(55,12) = "'" + │ │ │ ├── content_loc: (55,12)-(55,12) = "" + │ │ │ ├── closing_loc: (55,12)-(55,13) = "'" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (53,5)-(55,7)) + │ ├── name: :a + │ └── depth: 0 + ├── @ StringNode (location: (57,0)-(57,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (57,0)-(57,3) = "<=" + ├── @ SymbolNode (location: (77,0)-(77,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (77,0)-(77,1) = ":" + │ ├── value_loc: (77,1)-(77,3) = ">>" + │ ├── closing_loc: ∅ + │ └── unescaped: ">>" + ├── @ SymbolNode (location: (79,0)-(79,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (79,0)-(79,1) = ":" + │ ├── value_loc: (79,1)-(79,2) = ">" + │ ├── closing_loc: ∅ + │ └── unescaped: ">" + ├── @ SymbolNode (location: (81,0)-(81,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (81,0)-(81,1) = ":" + │ ├── value_loc: (81,1)-(81,4) = "<=>" + │ ├── closing_loc: ∅ + │ └── unescaped: "<=>" + ├── @ SymbolNode (location: (83,0)-(83,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (83,0)-(83,1) = ":" + │ ├── value_loc: (83,1)-(83,3) = "<=" + │ ├── closing_loc: ∅ + │ └── unescaped: "<=" + ├── @ SymbolNode (location: (85,0)-(85,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (85,0)-(85,1) = ":" + │ ├── value_loc: (85,1)-(85,3) = "<<" + │ ├── closing_loc: ∅ + │ └── unescaped: "<<" + ├── @ SymbolNode (location: (87,0)-(87,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (87,0)-(87,1) = ":" + │ ├── value_loc: (87,1)-(87,2) = "<" + │ ├── closing_loc: ∅ + │ └── unescaped: "<" + ├── @ SymbolNode (location: (89,0)-(89,9)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (89,0)-(89,1) = ":" + │ ├── value_loc: (89,1)-(89,9) = "__LINE__" + │ ├── closing_loc: ∅ + │ └── unescaped: "__LINE__" + ├── @ SymbolNode (location: (91,0)-(91,9)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (91,0)-(91,1) = ":" + │ ├── value_loc: (91,1)-(91,9) = "__FILE__" + │ ├── closing_loc: ∅ + │ └── unescaped: "__FILE__" + └── @ SymbolNode (location: (93,0)-(93,13)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (93,0)-(93,1) = ":" + ├── value_loc: (93,1)-(93,13) = "__ENCODING__" + ├── closing_loc: ∅ + └── unescaped: "__ENCODING__" diff --git a/test/mri/prism/snapshots/ternary_operator.txt b/test/mri/prism/snapshots/ternary_operator.txt new file mode 100644 index 00000000000..0277ac88f0c --- /dev/null +++ b/test/mri/prism/snapshots/ternary_operator.txt @@ -0,0 +1,295 @@ +@ ProgramNode (location: (1,0)-(15,12)) +├── locals: [:_a] +└── statements: + @ StatementsNode (location: (1,0)-(15,12)) + └── body: (length: 8) + ├── @ IfNode (location: (1,0)-(1,9)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,2)-(1,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (1,6)-(1,9)) + │ │ ├── else_keyword_loc: (1,6)-(1,7) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,8)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (1,8)-(1,9) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (3,0)-(3,27)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (3,2)-(3,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (3,4)-(3,14)) + │ │ └── body: (length: 1) + │ │ └── @ DefinedNode (location: (3,4)-(3,14)) + │ │ ├── lparen_loc: ∅ + │ │ ├── value: + │ │ │ @ CallNode (location: (3,13)-(3,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,13)-(3,14) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rparen_loc: ∅ + │ │ └── keyword_loc: (3,4)-(3,12) = "defined?" + │ ├── consequent: + │ │ @ ElseNode (location: (3,15)-(3,27)) + │ │ ├── else_keyword_loc: (3,15)-(3,16) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,17)-(3,27)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ DefinedNode (location: (3,17)-(3,27)) + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (3,26)-(3,27)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (3,26)-(3,27) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ └── keyword_loc: (3,17)-(3,25) = "defined?" + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (5,0)-(5,15)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (5,0)-(5,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :empty? + │ │ ├── message_loc: (5,0)-(5,6) = "empty?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (5,6)-(5,7) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (5,7)-(5,11)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (5,7)-(5,11)) + │ ├── consequent: + │ │ @ ElseNode (location: (5,11)-(5,15)) + │ │ ├── else_keyword_loc: (5,11)-(5,12) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (5,12)-(5,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NilNode (location: (5,12)-(5,15)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (7,0)-(7,16)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (7,0)-(7,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :empty? + │ │ ├── message_loc: (7,0)-(7,6) = "empty?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (7,6)-(7,7) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (7,7)-(7,12)) + │ │ └── body: (length: 1) + │ │ └── @ FalseNode (location: (7,7)-(7,12)) + │ ├── consequent: + │ │ @ ElseNode (location: (7,12)-(7,16)) + │ │ ├── else_keyword_loc: (7,12)-(7,13) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (7,13)-(7,16)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NilNode (location: (7,13)-(7,16)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (9,0)-(9,14)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (9,0)-(9,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :empty? + │ │ ├── message_loc: (9,0)-(9,6) = "empty?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (9,6)-(9,7) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (9,7)-(9,10)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (9,7)-(9,10)) + │ ├── consequent: + │ │ @ ElseNode (location: (9,10)-(9,14)) + │ │ ├── else_keyword_loc: (9,10)-(9,11) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (9,11)-(9,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NilNode (location: (9,11)-(9,14)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (11,0)-(11,10)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (11,0)-(11,2)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a? + │ │ ├── message_loc: (11,0)-(11,2) = "a?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (11,2)-(11,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (11,3)-(11,6)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (11,3)-(11,6)) + │ ├── consequent: + │ │ @ ElseNode (location: (11,6)-(11,10)) + │ │ ├── else_keyword_loc: (11,6)-(11,7) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (11,7)-(11,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NilNode (location: (11,7)-(11,10)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (13,0)-(13,14)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (13,0)-(13,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (13,0)-(13,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (13,2)-(13,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (13,3)-(13,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (13,3)-(13,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :var1 + │ │ ├── message_loc: (13,3)-(13,7) = "var1" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (13,8)-(13,14)) + │ │ ├── else_keyword_loc: (13,8)-(13,9) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (13,10)-(13,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (13,10)-(13,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var2 + │ │ │ ├── message_loc: (13,10)-(13,14) = "var2" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ IfNode (location: (15,0)-(15,12)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ CallNode (location: (15,0)-(15,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :nil? + │ ├── message_loc: (15,0)-(15,4) = "nil?" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (15,4)-(15,5) = "?" + ├── statements: + │ @ StatementsNode (location: (15,5)-(15,10)) + │ └── body: (length: 1) + │ └── @ LocalVariableWriteNode (location: (15,5)-(15,10)) + │ ├── name: :_a + │ ├── depth: 0 + │ ├── name_loc: (15,5)-(15,7) = "_a" + │ ├── value: + │ │ @ IntegerNode (location: (15,9)-(15,10)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (15,8)-(15,9) = "=" + ├── consequent: + │ @ ElseNode (location: (15,10)-(15,12)) + │ ├── else_keyword_loc: (15,10)-(15,11) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (15,11)-(15,12)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (15,11)-(15,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/tilde_heredocs.txt b/test/mri/prism/snapshots/tilde_heredocs.txt new file mode 100644 index 00000000000..fd369a64b2a --- /dev/null +++ b/test/mri/prism/snapshots/tilde_heredocs.txt @@ -0,0 +1,388 @@ +@ ProgramNode (location: (1,0)-(94,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(94,6)) + └── body: (length: 19) + ├── @ InterpolatedStringNode (location: (1,0)-(1,6)) + │ ├── opening_loc: (1,0)-(1,6) = "<<~EOF" + │ ├── parts: (length: 4) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (3,0)-(3,4)) + │ │ │ ├── opening_loc: (3,0)-(3,2) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,2)-(3,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,2)-(3,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (3,3)-(3,4) = "}" + │ │ ├── @ StringNode (location: (3,4)-(4,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,4)-(4,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (4,0)-(5,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,0)-(5,0) = " a\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " a\n" + │ └── closing_loc: (5,0)-(6,0) = "EOF\n" + ├── @ StringNode (location: (7,0)-(7,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(7,6) = "<<~EOF" + │ ├── content_loc: (8,0)-(9,0) = " a\n" + │ ├── closing_loc: (9,0)-(10,0) = "EOF\n" + │ └── unescaped: "a\n" + ├── @ InterpolatedStringNode (location: (11,0)-(11,6)) + │ ├── opening_loc: (11,0)-(11,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (12,0)-(13,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (12,0)-(13,0) = "\ta\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\ta\n" + │ │ ├── @ StringNode (location: (13,0)-(14,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (13,0)-(14,0) = " b\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b\n" + │ │ └── @ StringNode (location: (14,0)-(15,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (14,0)-(15,0) = "\t\tc\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\t\tc\n" + │ └── closing_loc: (15,0)-(16,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (17,0)-(17,6)) + │ ├── opening_loc: (17,0)-(17,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ EmbeddedStatementsNode (location: (18,2)-(18,6)) + │ │ │ ├── opening_loc: (18,2)-(18,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (18,4)-(18,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (18,4)-(18,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (18,5)-(18,6) = "}" + │ │ └── @ StringNode (location: (18,6)-(19,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (18,6)-(19,0) = " a\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " a\n" + │ └── closing_loc: (19,0)-(20,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (21,0)-(21,6)) + │ ├── opening_loc: (21,0)-(21,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (22,0)-(22,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (22,0)-(22,4) = " a " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a " + │ │ ├── @ EmbeddedStatementsNode (location: (22,4)-(22,8)) + │ │ │ ├── opening_loc: (22,4)-(22,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (22,6)-(22,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (22,6)-(22,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (22,7)-(22,8) = "}" + │ │ └── @ StringNode (location: (22,8)-(23,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (22,8)-(23,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (23,0)-(24,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (25,0)-(25,6)) + │ ├── opening_loc: (25,0)-(25,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (26,0)-(27,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (26,0)-(27,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (27,1)-(27,5)) + │ │ │ ├── opening_loc: (27,1)-(27,3) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (27,3)-(27,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (27,3)-(27,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (27,4)-(27,5) = "}" + │ │ └── @ StringNode (location: (27,5)-(28,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (27,5)-(28,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (28,0)-(29,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (30,0)-(30,6)) + │ ├── opening_loc: (30,0)-(30,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (31,0)-(32,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (31,0)-(32,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ ├── @ EmbeddedStatementsNode (location: (32,2)-(32,6)) + │ │ │ ├── opening_loc: (32,2)-(32,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (32,4)-(32,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (32,4)-(32,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (32,5)-(32,6) = "}" + │ │ └── @ StringNode (location: (32,6)-(33,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (32,6)-(33,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (33,0)-(34,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (35,0)-(35,6)) + │ ├── opening_loc: (35,0)-(35,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (36,0)-(37,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (36,0)-(37,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ StringNode (location: (37,0)-(38,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (37,0)-(38,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (38,0)-(39,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (40,0)-(40,6)) + │ ├── opening_loc: (40,0)-(40,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (41,0)-(42,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (41,0)-(42,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ StringNode (location: (42,0)-(43,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (42,0)-(43,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " b\n" + │ └── closing_loc: (43,0)-(44,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (45,0)-(45,6)) + │ ├── opening_loc: (45,0)-(45,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (46,0)-(47,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (46,0)-(47,0) = "\t\t\ta\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\ta\n" + │ │ └── @ StringNode (location: (47,0)-(48,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (47,0)-(48,0) = "\t\tb\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (48,0)-(49,0) = "EOF\n" + ├── @ StringNode (location: (50,0)-(50,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (50,0)-(50,8) = "<<~'EOF'" + │ ├── content_loc: (51,0)-(52,0) = " a \#{1}\n" + │ ├── closing_loc: (52,0)-(53,0) = "EOF\n" + │ └── unescaped: "a \#{1}\n" + ├── @ InterpolatedStringNode (location: (54,0)-(54,6)) + │ ├── opening_loc: (54,0)-(54,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (55,0)-(56,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (55,0)-(56,0) = "\ta\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ StringNode (location: (56,0)-(57,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (56,0)-(57,0) = "\t b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " b\n" + │ └── closing_loc: (57,0)-(58,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (59,0)-(59,6)) + │ ├── opening_loc: (59,0)-(59,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (60,0)-(61,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (60,0)-(61,0) = "\t a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " a\n" + │ │ └── @ StringNode (location: (61,0)-(62,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (61,0)-(62,0) = "\tb\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (62,0)-(63,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (64,0)-(64,6)) + │ ├── opening_loc: (64,0)-(64,6) = "<<~EOF" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (65,0)-(66,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (65,0)-(66,0) = " \ta\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ StringNode (location: (66,0)-(67,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (66,0)-(67,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (67,0)-(68,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (69,0)-(69,6)) + │ ├── opening_loc: (69,0)-(69,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (70,0)-(71,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (70,0)-(71,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ ├── @ StringNode (location: (71,0)-(72,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (71,0)-(72,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (72,0)-(73,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (72,0)-(73,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (73,0)-(74,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (75,0)-(75,6)) + │ ├── opening_loc: (75,0)-(75,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (76,0)-(77,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (76,0)-(77,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ ├── @ StringNode (location: (77,0)-(78,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (77,0)-(78,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (78,0)-(79,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (78,0)-(79,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (79,0)-(80,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (81,0)-(81,6)) + │ ├── opening_loc: (81,0)-(81,6) = "<<~EOF" + │ ├── parts: (length: 5) + │ │ ├── @ StringNode (location: (82,0)-(83,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (82,0)-(83,0) = " a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ ├── @ StringNode (location: (83,0)-(84,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (83,0)-(84,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ StringNode (location: (84,0)-(85,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (84,0)-(85,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ StringNode (location: (85,0)-(86,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (85,0)-(86,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (86,0)-(87,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (86,0)-(87,0) = " b\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\n" + │ └── closing_loc: (87,0)-(88,0) = "EOF\n" + ├── @ InterpolatedStringNode (location: (89,0)-(89,6)) + │ ├── opening_loc: (89,0)-(89,6) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (90,0)-(91,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (90,0)-(91,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ EmbeddedStatementsNode (location: (91,2)-(91,6)) + │ │ │ ├── opening_loc: (91,2)-(91,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (91,4)-(91,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (91,4)-(91,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (91,5)-(91,6) = "}" + │ │ └── @ StringNode (location: (91,6)-(92,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (91,6)-(92,0) = "a\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\n" + │ └── closing_loc: (92,0)-(93,0) = " EOF\n" + └── @ InterpolatedStringNode (location: (94,0)-(94,6)) + ├── opening_loc: (94,0)-(94,6) = "<<~EOT" + ├── parts: (length: 3) + │ ├── @ EmbeddedStatementsNode (location: (95,2)-(95,6)) + │ │ ├── opening_loc: (95,2)-(95,4) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (95,4)-(95,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (95,4)-(95,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── closing_loc: (95,5)-(95,6) = "}" + │ ├── @ StringNode (location: (95,6)-(96,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (95,6)-(96,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── @ StringNode (location: (96,0)-(97,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (96,0)-(97,0) = "\tb\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\tb\n" + └── closing_loc: (97,0)-(98,0) = "EOT\n" diff --git a/test/mri/prism/snapshots/undef.txt b/test/mri/prism/snapshots/undef.txt new file mode 100644 index 00000000000..6031119ad17 --- /dev/null +++ b/test/mri/prism/snapshots/undef.txt @@ -0,0 +1,117 @@ +@ ProgramNode (location: (1,0)-(17,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(17,14)) + └── body: (length: 9) + ├── @ UndefNode (location: (1,0)-(1,7)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (1,6)-(1,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ └── keyword_loc: (1,0)-(1,5) = "undef" + ├── @ UndefNode (location: (3,0)-(3,10)) + │ ├── names: (length: 2) + │ │ ├── @ SymbolNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (3,6)-(3,7) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (3,9)-(3,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (3,9)-(3,10) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── keyword_loc: (3,0)-(3,5) = "undef" + ├── @ UndefNode (location: (5,0)-(5,8)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (5,6)-(5,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (5,6)-(5,8) = "if" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "if" + │ └── keyword_loc: (5,0)-(5,5) = "undef" + ├── @ UndefNode (location: (7,0)-(7,9)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (7,6)-(7,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (7,6)-(7,9) = "<=>" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "<=>" + │ └── keyword_loc: (7,0)-(7,5) = "undef" + ├── @ UndefNode (location: (9,0)-(9,8)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (9,6)-(9,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,6)-(9,7) = ":" + │ │ ├── value_loc: (9,7)-(9,8) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ └── keyword_loc: (9,0)-(9,5) = "undef" + ├── @ UndefNode (location: (11,0)-(11,16)) + │ ├── names: (length: 3) + │ │ ├── @ SymbolNode (location: (11,6)-(11,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (11,6)-(11,7) = ":" + │ │ │ ├── value_loc: (11,7)-(11,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ SymbolNode (location: (11,10)-(11,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (11,10)-(11,11) = ":" + │ │ │ ├── value_loc: (11,11)-(11,12) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ SymbolNode (location: (11,14)-(11,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (11,14)-(11,15) = ":" + │ │ ├── value_loc: (11,15)-(11,16) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ └── keyword_loc: (11,0)-(11,5) = "undef" + ├── @ UndefNode (location: (13,0)-(13,12)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (13,6)-(13,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (13,6)-(13,8) = ":'" + │ │ ├── value_loc: (13,8)-(13,11) = "abc" + │ │ ├── closing_loc: (13,11)-(13,12) = "'" + │ │ └── unescaped: "abc" + │ └── keyword_loc: (13,0)-(13,5) = "undef" + ├── @ UndefNode (location: (15,0)-(15,16)) + │ ├── names: (length: 1) + │ │ └── @ InterpolatedSymbolNode (location: (15,6)-(15,16)) + │ │ ├── opening_loc: (15,6)-(15,8) = ":\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (15,8)-(15,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (15,8)-(15,11) = "abc" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "abc" + │ │ │ └── @ EmbeddedStatementsNode (location: (15,11)-(15,15)) + │ │ │ ├── opening_loc: (15,11)-(15,13) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (15,13)-(15,14)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (15,13)-(15,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (15,14)-(15,15) = "}" + │ │ └── closing_loc: (15,15)-(15,16) = "\"" + │ └── keyword_loc: (15,0)-(15,5) = "undef" + └── @ UndefNode (location: (17,0)-(17,14)) + ├── names: (length: 1) + │ └── @ SymbolNode (location: (17,6)-(17,14)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (17,6)-(17,14) = "Constant" + │ ├── closing_loc: ∅ + │ └── unescaped: "Constant" + └── keyword_loc: (17,0)-(17,5) = "undef" diff --git a/test/mri/prism/snapshots/unescaping.txt b/test/mri/prism/snapshots/unescaping.txt new file mode 100644 index 00000000000..456ef226d07 --- /dev/null +++ b/test/mri/prism/snapshots/unescaping.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(7,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,7)) + └── body: (length: 4) + ├── @ ArrayNode (location: (1,0)-(1,10)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (1,1)-(1,9)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,1)-(1,2) = "\"" + │ │ ├── content_loc: (1,2)-(1,8) = "\\c\#{1}" + │ │ ├── closing_loc: (1,8)-(1,9) = "\"" + │ │ └── unescaped: "\u0003{1}" + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (1,9)-(1,10) = "]" + ├── @ RegularExpressionNode (location: (3,0)-(3,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (3,0)-(3,1) = "/" + │ ├── content_loc: (3,1)-(3,7) = "\\c\#{1}" + │ ├── closing_loc: (3,7)-(3,8) = "/" + │ └── unescaped: "\\x03{1}" + ├── @ StringNode (location: (5,0)-(5,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (5,0)-(5,1) = "\"" + │ ├── content_loc: (5,1)-(5,7) = "\\c\#{1}" + │ ├── closing_loc: (5,7)-(5,8) = "\"" + │ └── unescaped: "\u0003{1}" + └── @ StringNode (location: (7,0)-(7,7)) + ├── flags: ∅ + ├── opening_loc: (7,0)-(7,7) = "<<~HERE" + ├── content_loc: (8,0)-(9,0) = " \\c\#{1}\n" + ├── closing_loc: (9,0)-(10,0) = "HERE\n" + └── unescaped: "\u0003{1}\n" diff --git a/test/mri/prism/snapshots/unless.txt b/test/mri/prism/snapshots/unless.txt new file mode 100644 index 00000000000..df16f90fd8e --- /dev/null +++ b/test/mri/prism/snapshots/unless.txt @@ -0,0 +1,136 @@ +@ ProgramNode (location: (1,0)-(14,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(14,22)) + └── body: (length: 7) + ├── @ UnlessNode (location: (1,0)-(1,19)) + │ ├── keyword_loc: (1,0)-(1,6) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (1,7)-(1,11)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,13)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,13)-(1,14)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── consequent: ∅ + │ └── end_keyword_loc: (1,16)-(1,19) = "end" + ├── @ UnlessNode (location: (3,0)-(4,12)) + │ ├── keyword_loc: (3,0)-(3,6) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (3,7)-(3,11)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (4,0)-(4,1)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (4,0)-(4,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── consequent: + │ │ @ ElseNode (location: (4,2)-(4,12)) + │ │ ├── else_keyword_loc: (4,2)-(4,6) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (4,7)-(4,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (4,7)-(4,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── end_keyword_loc: (4,9)-(4,12) = "end" + │ └── end_keyword_loc: (4,9)-(4,12) = "end" + ├── @ UnlessNode (location: (6,0)-(6,13)) + │ ├── keyword_loc: (6,2)-(6,8) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (6,9)-(6,13)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (6,0)-(6,1)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (6,0)-(6,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ UnlessNode (location: (8,0)-(8,17)) + │ ├── keyword_loc: (8,6)-(8,12) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (8,13)-(8,17)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (8,0)-(8,5)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (8,0)-(8,5)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (8,0)-(8,5) = "break" + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ UnlessNode (location: (10,0)-(10,16)) + │ ├── keyword_loc: (10,5)-(10,11) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (10,12)-(10,16)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (10,0)-(10,4)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (10,0)-(10,4)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (10,0)-(10,4) = "next" + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + ├── @ UnlessNode (location: (12,0)-(12,18)) + │ ├── keyword_loc: (12,7)-(12,13) = "unless" + │ ├── predicate: + │ │ @ TrueNode (location: (12,14)-(12,18)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (12,0)-(12,6)) + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (12,0)-(12,6)) + │ │ ├── keyword_loc: (12,0)-(12,6) = "return" + │ │ └── arguments: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: ∅ + └── @ UnlessNode (location: (14,0)-(14,22)) + ├── keyword_loc: (14,11)-(14,17) = "unless" + ├── predicate: + │ @ CallNode (location: (14,18)-(14,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar? + │ ├── message_loc: (14,18)-(14,22) = "bar?" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (14,0)-(14,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (14,0)-(14,10)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (14,0)-(14,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (14,4)-(14,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SymbolNode (location: (14,4)-(14,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (14,4)-(14,5) = ":" + │ │ │ ├── value_loc: (14,5)-(14,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (14,8)-(14,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (14,8)-(14,9) = ":" + │ │ ├── value_loc: (14,9)-(14,10) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/alias.txt b/test/mri/prism/snapshots/unparser/corpus/literal/alias.txt new file mode 100644 index 00000000000..18ddc86d4f4 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/alias.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(2,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,15)) + └── body: (length: 2) + ├── @ AliasGlobalVariableNode (location: (1,0)-(1,15)) + │ ├── new_name: + │ │ @ GlobalVariableReadNode (location: (1,6)-(1,10)) + │ │ └── name: :$foo + │ ├── old_name: + │ │ @ GlobalVariableReadNode (location: (1,11)-(1,15)) + │ │ └── name: :$bar + │ └── keyword_loc: (1,0)-(1,5) = "alias" + └── @ AliasMethodNode (location: (2,0)-(2,15)) + ├── new_name: + │ @ SymbolNode (location: (2,6)-(2,10)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (2,6)-(2,7) = ":" + │ ├── value_loc: (2,7)-(2,10) = "foo" + │ ├── closing_loc: ∅ + │ └── unescaped: "foo" + ├── old_name: + │ @ SymbolNode (location: (2,11)-(2,15)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (2,11)-(2,12) = ":" + │ ├── value_loc: (2,12)-(2,15) = "bar" + │ ├── closing_loc: ∅ + │ └── unescaped: "bar" + └── keyword_loc: (2,0)-(2,5) = "alias" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/assignment.txt b/test/mri/prism/snapshots/unparser/corpus/literal/assignment.txt new file mode 100644 index 00000000000..3a458b83e80 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/assignment.txt @@ -0,0 +1,1075 @@ +@ ProgramNode (location: (1,0)-(51,17)) +├── locals: [:a, :b, :foo, :c, :x] +└── statements: + @ StatementsNode (location: (1,0)-(51,17)) + └── body: (length: 43) + ├── @ GlobalVariableWriteNode (location: (1,0)-(1,6)) + │ ├── name: :$a + │ ├── name_loc: (1,0)-(1,2) = "$a" + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,3)-(1,4) = "=" + ├── @ MultiWriteNode (location: (2,0)-(2,17)) + │ ├── lefts: (length: 2) + │ │ ├── @ GlobalVariableTargetNode (location: (2,1)-(2,3)) + │ │ │ └── name: :$a + │ │ └── @ GlobalVariableTargetNode (location: (2,5)-(2,7)) + │ │ └── name: :$b + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (2,0)-(2,1) = "(" + │ ├── rparen_loc: (2,7)-(2,8) = ")" + │ ├── operator_loc: (2,9)-(2,10) = "=" + │ └── value: + │ @ ArrayNode (location: (2,11)-(2,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (2,12)-(2,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (2,15)-(2,16)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (2,11)-(2,12) = "[" + │ └── closing_loc: (2,16)-(2,17) = "]" + ├── @ MultiWriteNode (location: (3,0)-(3,13)) + │ ├── lefts: (length: 2) + │ │ ├── @ MultiTargetNode (location: (3,1)-(3,5)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (3,2)-(3,3)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: + │ │ │ │ @ ImplicitRestNode (location: (3,3)-(3,4)) + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (3,1)-(3,2) = "(" + │ │ │ └── rparen_loc: (3,4)-(3,5) = ")" + │ │ └── @ LocalVariableTargetNode (location: (3,7)-(3,8)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (3,0)-(3,1) = "(" + │ ├── rparen_loc: (3,8)-(3,9) = ")" + │ ├── operator_loc: (3,10)-(3,11) = "=" + │ └── value: + │ @ IntegerNode (location: (3,12)-(3,13)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ MultiWriteNode (location: (4,0)-(4,9)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (4,1)-(4,3)) + │ │ ├── operator_loc: (4,1)-(4,2) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (4,2)-(4,3)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rights: (length: 0) + │ ├── lparen_loc: (4,0)-(4,1) = "(" + │ ├── rparen_loc: (4,3)-(4,4) = ")" + │ ├── operator_loc: (4,5)-(4,6) = "=" + │ └── value: + │ @ ArrayNode (location: (4,7)-(4,9)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (4,7)-(4,8) = "[" + │ └── closing_loc: (4,8)-(4,9) = "]" + ├── @ MultiWriteNode (location: (5,0)-(5,15)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (5,1)-(5,5)) + │ │ ├── operator_loc: (5,1)-(5,2) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (5,2)-(5,5)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rights: (length: 0) + │ ├── lparen_loc: (5,0)-(5,1) = "(" + │ ├── rparen_loc: (5,5)-(5,6) = ")" + │ ├── operator_loc: (5,7)-(5,8) = "=" + │ └── value: + │ @ ArrayNode (location: (5,9)-(5,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (5,10)-(5,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (5,13)-(5,14)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (5,9)-(5,10) = "[" + │ └── closing_loc: (5,14)-(5,15) = "]" + ├── @ MultiWriteNode (location: (6,0)-(6,19)) + │ ├── lefts: (length: 2) + │ │ ├── @ ClassVariableTargetNode (location: (6,1)-(6,4)) + │ │ │ └── name: :@@a + │ │ └── @ ClassVariableTargetNode (location: (6,6)-(6,9)) + │ │ └── name: :@@b + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (6,0)-(6,1) = "(" + │ ├── rparen_loc: (6,9)-(6,10) = ")" + │ ├── operator_loc: (6,11)-(6,12) = "=" + │ └── value: + │ @ ArrayNode (location: (6,13)-(6,19)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (6,14)-(6,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (6,17)-(6,18)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (6,13)-(6,14) = "[" + │ └── closing_loc: (6,18)-(6,19) = "]" + ├── @ MultiWriteNode (location: (7,0)-(7,17)) + │ ├── lefts: (length: 2) + │ │ ├── @ InstanceVariableTargetNode (location: (7,1)-(7,3)) + │ │ │ └── name: :@a + │ │ └── @ InstanceVariableTargetNode (location: (7,5)-(7,7)) + │ │ └── name: :@b + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (7,0)-(7,1) = "(" + │ ├── rparen_loc: (7,7)-(7,8) = ")" + │ ├── operator_loc: (7,9)-(7,10) = "=" + │ └── value: + │ @ ArrayNode (location: (7,11)-(7,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (7,12)-(7,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (7,15)-(7,16)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (7,11)-(7,12) = "[" + │ └── closing_loc: (7,16)-(7,17) = "]" + ├── @ MultiWriteNode (location: (8,0)-(8,25)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (8,1)-(8,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ MultiTargetNode (location: (8,4)-(8,10)) + │ │ ├── lefts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (8,5)-(8,6)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (8,8)-(8,9)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: (8,4)-(8,5) = "(" + │ │ └── rparen_loc: (8,9)-(8,10) = ")" + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (8,0)-(8,1) = "(" + │ ├── rparen_loc: (8,10)-(8,11) = ")" + │ ├── operator_loc: (8,12)-(8,13) = "=" + │ └── value: + │ @ ArrayNode (location: (8,14)-(8,25)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (8,15)-(8,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ ArrayNode (location: (8,18)-(8,24)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (8,19)-(8,20)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (8,22)-(8,23)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── opening_loc: (8,18)-(8,19) = "[" + │ │ └── closing_loc: (8,23)-(8,24) = "]" + │ ├── opening_loc: (8,14)-(8,15) = "[" + │ └── closing_loc: (8,24)-(8,25) = "]" + ├── @ MultiWriteNode (location: (9,0)-(9,15)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (9,1)-(9,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (9,4)-(9,5)) + │ │ ├── operator_loc: (9,4)-(9,5) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (9,0)-(9,1) = "(" + │ ├── rparen_loc: (9,5)-(9,6) = ")" + │ ├── operator_loc: (9,7)-(9,8) = "=" + │ └── value: + │ @ ArrayNode (location: (9,9)-(9,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (9,10)-(9,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (9,13)-(9,14)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (9,9)-(9,10) = "[" + │ └── closing_loc: (9,14)-(9,15) = "]" + ├── @ MultiWriteNode (location: (10,0)-(10,18)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (10,1)-(10,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (10,4)-(10,8)) + │ │ ├── operator_loc: (10,4)-(10,5) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (10,5)-(10,8)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rights: (length: 0) + │ ├── lparen_loc: (10,0)-(10,1) = "(" + │ ├── rparen_loc: (10,8)-(10,9) = ")" + │ ├── operator_loc: (10,10)-(10,11) = "=" + │ └── value: + │ @ ArrayNode (location: (10,12)-(10,18)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (10,13)-(10,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (10,16)-(10,17)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (10,12)-(10,13) = "[" + │ └── closing_loc: (10,17)-(10,18) = "]" + ├── @ MultiWriteNode (location: (11,0)-(11,15)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (11,1)-(11,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (11,4)-(11,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (11,0)-(11,1) = "(" + │ ├── rparen_loc: (11,5)-(11,6) = ")" + │ ├── operator_loc: (11,7)-(11,8) = "=" + │ └── value: + │ @ ArrayNode (location: (11,9)-(11,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (11,10)-(11,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (11,13)-(11,14)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (11,9)-(11,10) = "[" + │ └── closing_loc: (11,14)-(11,15) = "]" + ├── @ MultiWriteNode (location: (12,0)-(12,12)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (12,1)-(12,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (12,4)-(12,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (12,0)-(12,1) = "(" + │ ├── rparen_loc: (12,5)-(12,6) = ")" + │ ├── operator_loc: (12,7)-(12,8) = "=" + │ └── value: + │ @ LocalVariableReadNode (location: (12,9)-(12,12)) + │ ├── name: :foo + │ └── depth: 0 + ├── @ MultiWriteNode (location: (13,0)-(13,10)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (13,1)-(13,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ ImplicitRestNode (location: (13,2)-(13,3)) + │ ├── rights: (length: 0) + │ ├── lparen_loc: (13,0)-(13,1) = "(" + │ ├── rparen_loc: (13,3)-(13,4) = ")" + │ ├── operator_loc: (13,5)-(13,6) = "=" + │ └── value: + │ @ LocalVariableReadNode (location: (13,7)-(13,10)) + │ ├── name: :foo + │ └── depth: 0 + ├── @ MultiWriteNode (location: (14,0)-(14,23)) + │ ├── lefts: (length: 2) + │ │ ├── @ CallTargetNode (location: (14,1)-(14,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (14,1)-(14,2)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: (14,2)-(14,3) = "." + │ │ │ ├── name: :foo= + │ │ │ └── message_loc: (14,3)-(14,6) = "foo" + │ │ └── @ CallTargetNode (location: (14,8)-(14,13)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (14,8)-(14,9)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: (14,9)-(14,10) = "." + │ │ ├── name: :bar= + │ │ └── message_loc: (14,10)-(14,13) = "bar" + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (14,0)-(14,1) = "(" + │ ├── rparen_loc: (14,13)-(14,14) = ")" + │ ├── operator_loc: (14,15)-(14,16) = "=" + │ └── value: + │ @ ArrayNode (location: (14,17)-(14,23)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (14,18)-(14,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (14,21)-(14,22)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (14,17)-(14,18) = "[" + │ └── closing_loc: (14,22)-(14,23) = "]" + ├── @ MultiWriteNode (location: (15,0)-(15,24)) + │ ├── lefts: (length: 2) + │ │ ├── @ IndexTargetNode (location: (15,1)-(15,8)) + │ │ │ ├── flags: attribute_write + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (15,1)-(15,2)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (15,2)-(15,3) = "[" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (15,3)-(15,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SplatNode (location: (15,3)-(15,7)) + │ │ │ │ ├── operator_loc: (15,3)-(15,4) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableReadNode (location: (15,4)-(15,7)) + │ │ │ │ ├── name: :foo + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (15,7)-(15,8) = "]" + │ │ │ └── block: ∅ + │ │ └── @ IndexTargetNode (location: (15,10)-(15,14)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (15,10)-(15,11)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (15,11)-(15,12) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,12)-(15,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (15,12)-(15,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (15,13)-(15,14) = "]" + │ │ └── block: ∅ + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (15,0)-(15,1) = "(" + │ ├── rparen_loc: (15,14)-(15,15) = ")" + │ ├── operator_loc: (15,16)-(15,17) = "=" + │ └── value: + │ @ ArrayNode (location: (15,18)-(15,24)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (15,19)-(15,20)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (15,22)-(15,23)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (15,18)-(15,19) = "[" + │ └── closing_loc: (15,23)-(15,24) = "]" + ├── @ MultiWriteNode (location: (16,0)-(16,21)) + │ ├── lefts: (length: 2) + │ │ ├── @ IndexTargetNode (location: (16,1)-(16,5)) + │ │ │ ├── flags: attribute_write + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (16,1)-(16,2)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (16,2)-(16,3) = "[" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (16,3)-(16,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (16,3)-(16,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ ├── closing_loc: (16,4)-(16,5) = "]" + │ │ │ └── block: ∅ + │ │ └── @ IndexTargetNode (location: (16,7)-(16,11)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (16,7)-(16,8)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (16,8)-(16,9) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (16,9)-(16,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (16,9)-(16,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (16,10)-(16,11) = "]" + │ │ └── block: ∅ + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (16,0)-(16,1) = "(" + │ ├── rparen_loc: (16,11)-(16,12) = ")" + │ ├── operator_loc: (16,13)-(16,14) = "=" + │ └── value: + │ @ ArrayNode (location: (16,15)-(16,21)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (16,16)-(16,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (16,19)-(16,20)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (16,15)-(16,16) = "[" + │ └── closing_loc: (16,20)-(16,21) = "]" + ├── @ MultiWriteNode (location: (17,0)-(17,12)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (17,1)-(17,7)) + │ │ ├── operator_loc: (17,1)-(17,2) = "*" + │ │ └── expression: + │ │ @ CallTargetNode (location: (17,2)-(17,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (17,2)-(17,3)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: (17,3)-(17,4) = "." + │ │ ├── name: :foo= + │ │ └── message_loc: (17,4)-(17,7) = "foo" + │ ├── rights: (length: 0) + │ ├── lparen_loc: (17,0)-(17,1) = "(" + │ ├── rparen_loc: (17,7)-(17,8) = ")" + │ ├── operator_loc: (17,9)-(17,10) = "=" + │ └── value: + │ @ IntegerNode (location: (17,11)-(17,12)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ConstantPathWriteNode (location: (18,0)-(18,13)) + │ ├── target: + │ │ @ ConstantPathNode (location: (18,0)-(18,5)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (18,2)-(18,5)) + │ │ │ └── name: :Foo + │ │ └── delimiter_loc: (18,0)-(18,2) = "::" + │ ├── operator_loc: (18,6)-(18,7) = "=" + │ └── value: + │ @ ConstantPathNode (location: (18,8)-(18,13)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (18,10)-(18,13)) + │ │ └── name: :Bar + │ └── delimiter_loc: (18,8)-(18,10) = "::" + ├── @ ClassVariableWriteNode (location: (19,0)-(19,7)) + │ ├── name: :@@a + │ ├── name_loc: (19,0)-(19,3) = "@@a" + │ ├── value: + │ │ @ IntegerNode (location: (19,6)-(19,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (19,4)-(19,5) = "=" + ├── @ InstanceVariableWriteNode (location: (20,0)-(20,6)) + │ ├── name: :@a + │ ├── name_loc: (20,0)-(20,2) = "@a" + │ ├── value: + │ │ @ IntegerNode (location: (20,5)-(20,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (20,3)-(20,4) = "=" + ├── @ ConstantWriteNode (location: (21,0)-(21,9)) + │ ├── name: :CONST + │ ├── name_loc: (21,0)-(21,5) = "CONST" + │ ├── value: + │ │ @ IntegerNode (location: (21,8)-(21,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (21,6)-(21,7) = "=" + ├── @ ConstantPathWriteNode (location: (22,0)-(22,23)) + │ ├── target: + │ │ @ ConstantPathNode (location: (22,0)-(22,19)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (22,0)-(22,12)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (22,0)-(22,4)) + │ │ │ │ └── name: :Name + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (22,6)-(22,12)) + │ │ │ │ └── name: :Spaced + │ │ │ └── delimiter_loc: (22,4)-(22,6) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (22,14)-(22,19)) + │ │ │ └── name: :CONST + │ │ └── delimiter_loc: (22,12)-(22,14) = "::" + │ ├── operator_loc: (22,20)-(22,21) = "=" + │ └── value: + │ @ IntegerNode (location: (22,22)-(22,23)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ LocalVariableWriteNode (location: (23,0)-(23,16)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (23,0)-(23,1) = "a" + │ ├── value: + │ │ @ ParenthesesNode (location: (23,4)-(23,16)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (23,5)-(23,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ MultiWriteNode (location: (23,5)-(23,15)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ LocalVariableTargetNode (location: (23,6)-(23,7)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── @ LocalVariableTargetNode (location: (23,9)-(23,10)) + │ │ │ │ ├── name: :c + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (23,5)-(23,6) = "(" + │ │ │ ├── rparen_loc: (23,10)-(23,11) = ")" + │ │ │ ├── operator_loc: (23,12)-(23,13) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (23,14)-(23,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (23,4)-(23,5) = "(" + │ │ └── closing_loc: (23,15)-(23,16) = ")" + │ └── operator_loc: (23,2)-(23,3) = "=" + ├── @ LocalVariableWriteNode (location: (24,0)-(24,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (24,0)-(24,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (24,4)-(24,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (24,2)-(24,3) = "=" + ├── @ LocalVariableWriteNode (location: (25,0)-(25,11)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (25,0)-(25,3) = "foo" + │ ├── value: + │ │ @ CallNode (location: (25,6)-(25,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (25,6)-(25,9) = "foo" + │ │ ├── opening_loc: (25,9)-(25,10) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (25,10)-(25,11) = ")" + │ │ └── block: ∅ + │ └── operator_loc: (25,4)-(25,5) = "=" + ├── @ CallNode (location: (26,0)-(26,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (26,0)-(26,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (26,3)-(26,4) = "." + │ ├── name: :[]= + │ ├── message_loc: (26,4)-(26,7) = "[]=" + │ ├── opening_loc: (26,7)-(26,8) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (26,8)-(26,9) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (27,0)-(27,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (27,0)-(27,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (27,3)-(27,4) = "." + │ ├── name: :[]= + │ ├── message_loc: (27,4)-(27,7) = "[]=" + │ ├── opening_loc: (27,7)-(27,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,8)-(27,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (27,8)-(27,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (27,11)-(27,12)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: (27,12)-(27,13) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (28,0)-(28,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (28,0)-(28,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (28,3)-(28,4) = "." + │ ├── name: :[]= + │ ├── message_loc: (28,4)-(28,7) = "[]=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (28,7)-(28,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ TrueNode (location: (28,7)-(28,11)) + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(29,19)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (29,0)-(29,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (29,3)-(29,11) = "[*index]" + │ ├── opening_loc: (29,3)-(29,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (29,4)-(29,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SplatNode (location: (29,4)-(29,10)) + │ │ │ ├── operator_loc: (29,4)-(29,5) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (29,5)-(29,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :index + │ │ │ ├── message_loc: (29,5)-(29,10) = "index" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (29,14)-(29,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :value + │ │ ├── message_loc: (29,14)-(29,19) = "value" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (29,10)-(29,11) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (30,0)-(30,17)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (30,0)-(30,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (30,3)-(30,9) = "[1..2]" + │ ├── opening_loc: (30,3)-(30,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (30,4)-(30,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ RangeNode (location: (30,4)-(30,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── left: + │ │ │ │ @ IntegerNode (location: (30,4)-(30,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── right: + │ │ │ │ @ IntegerNode (location: (30,7)-(30,8)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── operator_loc: (30,5)-(30,7) = ".." + │ │ └── @ CallNode (location: (30,12)-(30,17)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :value + │ │ ├── message_loc: (30,12)-(30,17) = "value" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (30,8)-(30,9) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(31,9)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (31,0)-(31,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (31,3)-(31,5) = "[]" + │ ├── opening_loc: (31,3)-(31,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,8)-(31,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (31,8)-(31,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (31,4)-(31,5) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (32,0)-(32,17)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (32,0)-(32,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (32,3)-(32,9) = "[a, b]" + │ ├── opening_loc: (32,3)-(32,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (32,4)-(32,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ LocalVariableReadNode (location: (32,4)-(32,5)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── @ LocalVariableReadNode (location: (32,7)-(32,8)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ └── @ CallNode (location: (32,12)-(32,17)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :value + │ │ ├── message_loc: (32,12)-(32,17) = "value" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (32,8)-(32,9) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,18)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (33,0)-(33,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (33,3)-(33,10) = "[index]" + │ ├── opening_loc: (33,3)-(33,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,4)-(33,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (33,4)-(33,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :index + │ │ │ ├── message_loc: (33,4)-(33,9) = "index" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (33,13)-(33,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :value + │ │ ├── message_loc: (33,13)-(33,18) = "value" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (33,9)-(33,10) = "]" + │ └── block: ∅ + ├── @ LocalVariableWriteNode (location: (34,0)-(34,7)) + │ ├── name: :x + │ ├── depth: 0 + │ ├── name_loc: (34,0)-(34,1) = "x" + │ ├── value: + │ │ @ StringNode (location: (34,4)-(34,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (34,4)-(34,6) = "%(" + │ │ ├── content_loc: (34,6)-(34,6) = "" + │ │ ├── closing_loc: (34,6)-(34,7) = ")" + │ │ └── unescaped: "" + │ └── operator_loc: (34,2)-(34,3) = "=" + ├── @ CallNode (location: (35,0)-(35,7)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (35,0)-(35,1)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: (35,1)-(35,2) = "." + │ ├── name: :x= + │ ├── message_loc: (35,2)-(35,3) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,4)-(35,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (35,4)-(35,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (35,4)-(35,6) = "%(" + │ │ ├── content_loc: (35,6)-(35,6) = "" + │ │ ├── closing_loc: (35,6)-(35,7) = ")" + │ │ └── unescaped: "" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (36,0)-(36,12)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (36,0)-(36,1)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (36,1)-(36,6) = "[%()]" + │ ├── opening_loc: (36,1)-(36,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (36,2)-(36,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (36,2)-(36,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (36,2)-(36,4) = "%(" + │ │ │ ├── content_loc: (36,4)-(36,4) = "" + │ │ │ ├── closing_loc: (36,4)-(36,5) = ")" + │ │ │ └── unescaped: "" + │ │ └── @ CallNode (location: (36,9)-(36,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (36,9)-(36,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (36,5)-(36,6) = "]" + │ └── block: ∅ + ├── @ IndexOrWriteNode (location: (37,0)-(37,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (37,0)-(37,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (37,1)-(37,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,2)-(37,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (37,2)-(37,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (37,2)-(37,4) = "%(" + │ │ ├── content_loc: (37,4)-(37,4) = "" + │ │ ├── closing_loc: (37,4)-(37,5) = ")" + │ │ └── unescaped: "" + │ ├── closing_loc: (37,5)-(37,6) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (37,7)-(37,10) = "||=" + │ └── value: + │ @ CallNode (location: (37,11)-(37,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (37,11)-(37,14) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ InstanceVariableOrWriteNode (location: (38,0)-(38,10)) + │ ├── name: :@a + │ ├── name_loc: (38,0)-(38,2) = "@a" + │ ├── operator_loc: (38,3)-(38,6) = "||=" + │ └── value: + │ @ StringNode (location: (38,7)-(38,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (38,7)-(38,9) = "%(" + │ ├── content_loc: (38,9)-(38,9) = "" + │ ├── closing_loc: (38,9)-(38,10) = ")" + │ └── unescaped: "" + ├── @ LocalVariableWriteNode (location: (39,0)-(39,14)) + │ ├── name: :x + │ ├── depth: 0 + │ ├── name_loc: (39,0)-(39,1) = "x" + │ ├── value: + │ │ @ InterpolatedStringNode (location: (39,4)-(39,14)) + │ │ ├── opening_loc: (39,4)-(39,14) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (40,0)-(40,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (40,0)-(40,2) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (40,2)-(40,5)) + │ │ │ │ ├── opening_loc: (40,2)-(40,4) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (40,4)-(40,5) = "}" + │ │ │ └── @ StringNode (location: (40,5)-(41,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (40,5)-(41,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (41,0)-(42,0) = "HEREDOC\n" + │ └── operator_loc: (39,2)-(39,3) = "=" + ├── @ CallNode (location: (42,0)-(42,14)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (42,0)-(42,1)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: (42,1)-(42,2) = "." + │ ├── name: :x= + │ ├── message_loc: (42,2)-(42,3) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (42,4)-(42,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (42,4)-(42,14)) + │ │ ├── opening_loc: (42,4)-(42,14) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (43,0)-(43,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (43,0)-(43,2) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (43,2)-(43,5)) + │ │ │ │ ├── opening_loc: (43,2)-(43,4) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (43,4)-(43,5) = "}" + │ │ │ └── @ StringNode (location: (43,5)-(44,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (43,5)-(44,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (44,0)-(45,0) = "HEREDOC\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,16)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (45,0)-(45,1)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (45,1)-(45,3) = "[]" + │ ├── opening_loc: (45,1)-(45,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (45,6)-(45,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (45,6)-(45,16)) + │ │ ├── opening_loc: (45,6)-(45,16) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (46,0)-(46,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (46,0)-(46,2) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (46,2)-(46,5)) + │ │ │ │ ├── opening_loc: (46,2)-(46,4) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (46,4)-(46,5) = "}" + │ │ │ └── @ StringNode (location: (46,5)-(47,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (46,5)-(47,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (47,0)-(48,0) = "HEREDOC\n" + │ ├── closing_loc: (45,2)-(45,3) = "]" + │ └── block: ∅ + ├── @ IndexOrWriteNode (location: (48,0)-(48,21)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (48,0)-(48,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (48,1)-(48,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (48,2)-(48,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (48,2)-(48,12)) + │ │ ├── opening_loc: (48,2)-(48,12) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (49,0)-(49,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (49,0)-(49,2) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (49,2)-(49,5)) + │ │ │ │ ├── opening_loc: (49,2)-(49,4) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (49,4)-(49,5) = "}" + │ │ │ └── @ StringNode (location: (49,5)-(50,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (49,5)-(50,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (50,0)-(51,0) = "HEREDOC\n" + │ ├── closing_loc: (48,12)-(48,13) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (48,14)-(48,17) = "||=" + │ └── value: + │ @ CallNode (location: (48,18)-(48,21)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (48,18)-(48,21) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ InstanceVariableOrWriteNode (location: (51,0)-(51,17)) + ├── name: :@a + ├── name_loc: (51,0)-(51,2) = "@a" + ├── operator_loc: (51,3)-(51,6) = "||=" + └── value: + @ InterpolatedStringNode (location: (51,7)-(51,17)) + ├── opening_loc: (51,7)-(51,17) = "<<-HEREDOC" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (52,0)-(52,2)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (52,0)-(52,2) = " " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " " + │ ├── @ EmbeddedStatementsNode (location: (52,2)-(52,5)) + │ │ ├── opening_loc: (52,2)-(52,4) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (52,4)-(52,5) = "}" + │ └── @ StringNode (location: (52,5)-(53,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (52,5)-(53,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (53,0)-(54,0) = "HEREDOC\n" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/block.txt b/test/mri/prism/snapshots/unparser/corpus/literal/block.txt new file mode 100644 index 00000000000..b4c86d0b04b --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/block.txt @@ -0,0 +1,1402 @@ +@ ProgramNode (location: (1,0)-(96,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(96,1)) + └── body: (length: 30) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(2,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "{" + │ └── closing_loc: (2,0)-(2,1) = "}" + ├── @ CallNode (location: (3,0)-(4,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,4)-(4,1)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (3,6)-(3,9)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (3,7)-(3,8)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (3,7)-(3,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (3,6)-(3,7) = "|" + │ │ └── closing_loc: (3,8)-(3,9) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (3,4)-(3,5) = "{" + │ └── closing_loc: (4,0)-(4,1) = "}" + ├── @ CallNode (location: (5,0)-(6,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,0)-(5,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,4)-(6,1)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (5,6)-(5,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,7)-(5,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (5,7)-(5,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ ImplicitRestNode (location: (5,8)-(5,9)) + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (5,6)-(5,7) = "|" + │ │ └── closing_loc: (5,9)-(5,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (6,0)-(6,1) = "}" + ├── @ CallNode (location: (7,0)-(8,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,0)-(7,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,4)-(8,1)) + │ ├── locals: [:a, :x] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (7,6)-(7,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (7,7)-(7,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (7,7)-(7,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ ImplicitRestNode (location: (7,8)-(7,9)) + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (7,11)-(7,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── opening_loc: (7,6)-(7,7) = "|" + │ │ └── closing_loc: (7,12)-(7,13) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (8,0)-(8,1) = "}" + ├── @ CallNode (location: (9,0)-(10,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (9,0)-(9,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (9,4)-(10,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (9,6)-(9,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (9,7)-(9,11)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (9,7)-(9,8)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (9,10)-(9,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (9,6)-(9,7) = "|" + │ │ └── closing_loc: (9,11)-(9,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (9,4)-(9,5) = "{" + │ └── closing_loc: (10,0)-(10,1) = "}" + ├── @ CallNode (location: (11,0)-(13,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (11,0)-(11,3) = "foo" + │ ├── opening_loc: (11,3)-(11,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,4)-(11,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (11,4)-(11,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (11,5)-(11,6) = ")" + │ └── block: + │ @ BlockNode (location: (11,7)-(13,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (12,2)-(12,5)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (12,2)-(12,5)) + │ ├── opening_loc: (11,7)-(11,8) = "{" + │ └── closing_loc: (13,0)-(13,1) = "}" + ├── @ CallNode (location: (14,0)-(16,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (14,0)-(14,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (14,4)-(16,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (14,6)-(14,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (14,7)-(14,12)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (14,7)-(14,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (14,10)-(14,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (14,11)-(14,12) = "b" + │ │ │ │ └── operator_loc: (14,10)-(14,11) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (14,6)-(14,7) = "|" + │ │ └── closing_loc: (14,12)-(14,13) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (15,2)-(15,5)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (15,2)-(15,5)) + │ ├── opening_loc: (14,4)-(14,5) = "{" + │ └── closing_loc: (16,0)-(16,1) = "}" + ├── @ CallNode (location: (17,0)-(19,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (17,0)-(17,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,4)-(19,1)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (17,6)-(17,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (17,7)-(17,11)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (17,7)-(17,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (17,10)-(17,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: ∅ + │ │ │ │ ├── name_loc: ∅ + │ │ │ │ └── operator_loc: (17,10)-(17,11) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (17,6)-(17,7) = "|" + │ │ └── closing_loc: (17,11)-(17,12) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (18,2)-(18,5)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (18,2)-(18,5)) + │ ├── opening_loc: (17,4)-(17,5) = "{" + │ └── closing_loc: (19,0)-(19,1) = "}" + ├── @ CallNode (location: (20,0)-(22,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (20,0)-(20,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (20,4)-(22,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (21,2)-(21,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (21,2)-(21,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (21,2)-(21,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (20,4)-(20,5) = "{" + │ └── closing_loc: (22,0)-(22,1) = "}" + ├── @ CallNode (location: (23,0)-(25,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (23,0)-(23,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (23,0)-(23,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (23,3)-(23,4) = "." + │ ├── name: :bar + │ ├── message_loc: (23,4)-(23,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (23,8)-(25,1)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (23,10)-(23,21)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (23,11)-(23,20)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (23,11)-(23,17)) + │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (23,12)-(23,13)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :a + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (23,15)-(23,16)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (23,11)-(23,12) = "(" + │ │ │ │ │ └── rparen_loc: (23,16)-(23,17) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (23,19)-(23,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (23,10)-(23,11) = "|" + │ │ └── closing_loc: (23,20)-(23,21) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (24,2)-(24,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (24,2)-(24,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (24,2)-(24,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (23,8)-(23,9) = "{" + │ └── closing_loc: (25,0)-(25,1) = "}" + ├── @ CallNode (location: (26,0)-(27,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (26,0)-(26,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (26,0)-(26,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (26,3)-(26,4) = "." + │ ├── name: :bar + │ ├── message_loc: (26,4)-(26,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (26,8)-(27,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (26,10)-(26,17)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (26,11)-(26,13)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (26,11)-(26,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (26,12)-(26,13) = "a" + │ │ │ │ └── operator_loc: (26,11)-(26,12) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (26,15)-(26,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── opening_loc: (26,10)-(26,11) = "|" + │ │ └── closing_loc: (26,16)-(26,17) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (26,8)-(26,9) = "{" + │ └── closing_loc: (27,0)-(27,1) = "}" + ├── @ CallNode (location: (28,0)-(29,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (28,0)-(28,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (28,0)-(28,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (28,3)-(28,4) = "." + │ ├── name: :bar + │ ├── message_loc: (28,4)-(28,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (28,8)-(29,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (28,10)-(28,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (28,11)-(28,12)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (28,11)-(28,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (28,14)-(28,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── opening_loc: (28,10)-(28,11) = "|" + │ │ └── closing_loc: (28,15)-(28,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (28,8)-(28,9) = "{" + │ └── closing_loc: (29,0)-(29,1) = "}" + ├── @ CallNode (location: (30,0)-(31,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (30,0)-(30,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (30,0)-(30,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (30,3)-(30,4) = "." + │ ├── name: :bar + │ ├── message_loc: (30,4)-(30,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (30,8)-(31,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (30,10)-(30,18)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 2) + │ │ │ ├── @ BlockLocalVariableNode (location: (30,13)-(30,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ BlockLocalVariableNode (location: (30,16)-(30,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── opening_loc: (30,10)-(30,11) = "|" + │ │ └── closing_loc: (30,17)-(30,18) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (30,8)-(30,9) = "{" + │ └── closing_loc: (31,0)-(31,1) = "}" + ├── @ CallNode (location: (32,0)-(34,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (32,0)-(32,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (32,0)-(32,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (32,3)-(32,4) = "." + │ ├── name: :bar + │ ├── message_loc: (32,4)-(32,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (32,8)-(34,1)) + │ ├── locals: [] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (32,10)-(32,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (32,11)-(32,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (32,11)-(32,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: ∅ + │ │ │ │ ├── name_loc: ∅ + │ │ │ │ └── operator_loc: (32,11)-(32,12) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (32,10)-(32,11) = "|" + │ │ └── closing_loc: (32,12)-(32,13) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (33,2)-(33,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (33,2)-(33,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (33,2)-(33,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (32,8)-(32,9) = "{" + │ └── closing_loc: (34,0)-(34,1) = "}" + ├── @ CallNode (location: (35,0)-(37,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (35,0)-(35,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (35,0)-(35,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (35,3)-(35,4) = "." + │ ├── name: :bar + │ ├── message_loc: (35,4)-(35,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (35,8)-(37,1)) + │ ├── locals: [] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (35,10)-(35,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (35,11)-(35,14)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (35,11)-(35,14)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (35,12)-(35,13)) + │ │ │ │ │ ├── operator_loc: (35,12)-(35,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (35,11)-(35,12) = "(" + │ │ │ │ └── rparen_loc: (35,13)-(35,14) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (35,10)-(35,11) = "|" + │ │ └── closing_loc: (35,14)-(35,15) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (36,2)-(36,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (36,2)-(36,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (36,2)-(36,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (35,8)-(35,9) = "{" + │ └── closing_loc: (37,0)-(37,1) = "}" + ├── @ CallNode (location: (38,0)-(40,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (38,0)-(38,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (38,0)-(38,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (38,3)-(38,4) = "." + │ ├── name: :bar + │ ├── message_loc: (38,4)-(38,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (38,8)-(40,1)) + │ ├── locals: [] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (38,10)-(38,17)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (38,11)-(38,16)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (38,11)-(38,16)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ MultiTargetNode (location: (38,12)-(38,15)) + │ │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ │ ├── rest: + │ │ │ │ │ │ @ SplatNode (location: (38,13)-(38,14)) + │ │ │ │ │ │ ├── operator_loc: (38,13)-(38,14) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (38,12)-(38,13) = "(" + │ │ │ │ │ └── rparen_loc: (38,14)-(38,15) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (38,11)-(38,12) = "(" + │ │ │ │ └── rparen_loc: (38,15)-(38,16) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (38,10)-(38,11) = "|" + │ │ └── closing_loc: (38,16)-(38,17) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (39,2)-(39,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (39,2)-(39,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (39,2)-(39,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (38,8)-(38,9) = "{" + │ └── closing_loc: (40,0)-(40,1) = "}" + ├── @ CallNode (location: (41,0)-(43,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (41,0)-(41,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (41,0)-(41,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (41,3)-(41,4) = "." + │ ├── name: :bar + │ ├── message_loc: (41,4)-(41,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (41,8)-(43,1)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (41,10)-(41,20)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (41,11)-(41,19)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (41,11)-(41,19)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (41,12)-(41,13)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ MultiTargetNode (location: (41,15)-(41,18)) + │ │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ │ ├── rest: + │ │ │ │ │ │ @ SplatNode (location: (41,16)-(41,17)) + │ │ │ │ │ │ ├── operator_loc: (41,16)-(41,17) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (41,15)-(41,16) = "(" + │ │ │ │ │ └── rparen_loc: (41,17)-(41,18) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (41,11)-(41,12) = "(" + │ │ │ │ └── rparen_loc: (41,18)-(41,19) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (41,10)-(41,11) = "|" + │ │ └── closing_loc: (41,19)-(41,20) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (42,2)-(42,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (42,2)-(42,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (42,2)-(42,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (41,8)-(41,9) = "{" + │ └── closing_loc: (43,0)-(43,1) = "}" + ├── @ CallNode (location: (44,0)-(46,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (44,0)-(44,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (44,0)-(44,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (44,3)-(44,4) = "." + │ ├── name: :bar + │ ├── message_loc: (44,4)-(44,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (44,8)-(46,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (44,10)-(44,18)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (44,11)-(44,17)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (44,11)-(44,17)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (44,12)-(44,13)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ RequiredParameterNode (location: (44,15)-(44,16)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (44,11)-(44,12) = "(" + │ │ │ │ └── rparen_loc: (44,16)-(44,17) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (44,10)-(44,11) = "|" + │ │ └── closing_loc: (44,17)-(44,18) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (45,2)-(45,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (45,2)-(45,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (45,2)-(45,3) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (44,8)-(44,9) = "{" + │ └── closing_loc: (46,0)-(46,1) = "}" + ├── @ CallNode (location: (47,0)-(48,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (47,0)-(48,1)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (47,0)-(47,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (47,0)-(47,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (47,3)-(47,4) = "." + │ │ ├── name: :bar + │ │ ├── message_loc: (47,4)-(47,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (47,8)-(48,1)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (47,8)-(47,9) = "{" + │ │ └── closing_loc: (48,0)-(48,1) = "}" + │ ├── call_operator_loc: (48,1)-(48,2) = "." + │ ├── name: :baz + │ ├── message_loc: (48,2)-(48,5) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (49,0)-(51,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (49,0)-(49,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (49,2)-(51,3)) + │ ├── locals: [:e] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (49,2)-(51,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (50,0)-(50,21)) + │ │ │ ├── keyword_loc: (50,0)-(50,6) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (50,7)-(50,16)) + │ │ │ │ └── name: :Exception + │ │ │ ├── operator_loc: (50,17)-(50,19) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ LocalVariableTargetNode (location: (50,20)-(50,21)) + │ │ │ │ ├── name: :e + │ │ │ │ └── depth: 0 + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (51,0)-(51,3) = "end" + │ ├── opening_loc: (49,2)-(49,4) = "do" + │ └── closing_loc: (51,0)-(51,3) = "end" + ├── @ CallNode (location: (52,0)-(56,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (52,0)-(52,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (52,2)-(56,3)) + │ ├── locals: [:bar] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (52,2)-(56,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (53,2)-(53,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (53,2)-(53,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (53,2)-(53,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (54,0)-(55,5)) + │ │ │ ├── keyword_loc: (54,0)-(54,6) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (54,7)-(54,16)) + │ │ │ │ └── name: :Exception + │ │ │ ├── operator_loc: (54,17)-(54,19) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ LocalVariableTargetNode (location: (54,20)-(54,23)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (55,2)-(55,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (55,2)-(55,5)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (56,0)-(56,3) = "end" + │ ├── opening_loc: (52,2)-(52,4) = "do" + │ └── closing_loc: (56,0)-(56,3) = "end" + ├── @ CallNode (location: (57,0)-(61,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (57,0)-(57,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (57,2)-(61,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (57,2)-(61,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (58,2)-(58,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (58,2)-(58,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (58,2)-(58,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (59,0)-(60,5)) + │ │ │ ├── keyword_loc: (59,0)-(59,6) = "rescue" + │ │ │ ├── exceptions: (length: 2) + │ │ │ │ ├── @ ConstantReadNode (location: (59,7)-(59,16)) + │ │ │ │ │ └── name: :SomeError + │ │ │ │ └── @ SplatNode (location: (59,18)-(59,22)) + │ │ │ │ ├── operator_loc: (59,18)-(59,19) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ CallNode (location: (59,19)-(59,22)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (59,19)-(59,22) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (60,2)-(60,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (60,2)-(60,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (60,2)-(60,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (61,0)-(61,3) = "end" + │ ├── opening_loc: (57,2)-(57,4) = "do" + │ └── closing_loc: (61,0)-(61,3) = "end" + ├── @ CallNode (location: (62,0)-(66,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (62,0)-(62,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (62,2)-(66,3)) + │ ├── locals: [:exception] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (62,2)-(66,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (63,2)-(63,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (63,2)-(63,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (63,2)-(63,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (64,0)-(65,5)) + │ │ │ ├── keyword_loc: (64,0)-(64,6) = "rescue" + │ │ │ ├── exceptions: (length: 2) + │ │ │ │ ├── @ ConstantReadNode (location: (64,7)-(64,16)) + │ │ │ │ │ └── name: :SomeError + │ │ │ │ └── @ SplatNode (location: (64,18)-(64,22)) + │ │ │ │ ├── operator_loc: (64,18)-(64,19) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ CallNode (location: (64,19)-(64,22)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (64,19)-(64,22) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── operator_loc: (64,23)-(64,25) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ LocalVariableTargetNode (location: (64,26)-(64,35)) + │ │ │ │ ├── name: :exception + │ │ │ │ └── depth: 0 + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (65,2)-(65,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (65,2)-(65,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (65,2)-(65,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (66,0)-(66,3) = "end" + │ ├── opening_loc: (62,2)-(62,4) = "do" + │ └── closing_loc: (66,0)-(66,3) = "end" + ├── @ CallNode (location: (67,0)-(71,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (67,0)-(67,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (67,2)-(71,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (67,2)-(71,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (68,2)-(68,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (68,2)-(68,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (68,2)-(68,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (69,0)-(70,5)) + │ │ │ ├── keyword_loc: (69,0)-(69,6) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ SplatNode (location: (69,7)-(69,11)) + │ │ │ │ ├── operator_loc: (69,7)-(69,8) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ CallNode (location: (69,8)-(69,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (69,8)-(69,11) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (70,2)-(70,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (70,2)-(70,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (70,2)-(70,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (71,0)-(71,3) = "end" + │ ├── opening_loc: (67,2)-(67,4) = "do" + │ └── closing_loc: (71,0)-(71,3) = "end" + ├── @ CallNode (location: (72,0)-(75,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (72,0)-(72,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (72,2)-(75,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (72,2)-(75,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (73,2)-(73,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (73,2)-(73,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (73,2)-(73,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (74,0)-(74,16)) + │ │ │ ├── keyword_loc: (74,0)-(74,6) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (74,7)-(74,16)) + │ │ │ │ └── name: :LoadError + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (75,0)-(75,3) = "end" + │ ├── opening_loc: (72,2)-(72,4) = "do" + │ └── closing_loc: (75,0)-(75,3) = "end" + ├── @ CallNode (location: (76,0)-(81,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (76,0)-(76,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (76,2)-(81,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (76,2)-(81,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (77,2)-(77,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (77,2)-(77,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (77,2)-(77,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (78,0)-(78,6)) + │ │ │ ├── keyword_loc: (78,0)-(78,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (79,0)-(81,3)) + │ │ │ ├── else_keyword_loc: (79,0)-(79,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (80,2)-(80,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (80,2)-(80,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (80,2)-(80,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (81,0)-(81,3) = "end" + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (81,0)-(81,3) = "end" + │ ├── opening_loc: (76,2)-(76,4) = "do" + │ └── closing_loc: (81,0)-(81,3) = "end" + ├── @ CallNode (location: (82,0)-(86,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (82,0)-(82,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (82,2)-(86,3)) + │ ├── locals: [:exception] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (82,2)-(86,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (83,2)-(83,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (83,2)-(83,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (83,2)-(83,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (84,0)-(85,5)) + │ │ │ ├── keyword_loc: (84,0)-(84,6) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ SplatNode (location: (84,7)-(84,11)) + │ │ │ │ ├── operator_loc: (84,7)-(84,8) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ CallNode (location: (84,8)-(84,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (84,8)-(84,11) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── operator_loc: (84,12)-(84,14) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ LocalVariableTargetNode (location: (84,15)-(84,24)) + │ │ │ │ ├── name: :exception + │ │ │ │ └── depth: 0 + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (85,2)-(85,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (85,2)-(85,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (85,2)-(85,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (86,0)-(86,3) = "end" + │ ├── opening_loc: (82,2)-(82,4) = "do" + │ └── closing_loc: (86,0)-(86,3) = "end" + ├── @ CallNode (location: (87,0)-(89,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (87,0)-(87,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (87,2)-(89,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (87,2)-(89,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (88,0)-(89,3)) + │ │ │ ├── ensure_keyword_loc: (88,0)-(88,6) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (89,0)-(89,3) = "end" + │ │ └── end_keyword_loc: (89,0)-(89,3) = "end" + │ ├── opening_loc: (87,2)-(87,4) = "do" + │ └── closing_loc: (89,0)-(89,3) = "end" + ├── @ CallNode (location: (90,0)-(93,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (90,0)-(90,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (90,2)-(93,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (90,2)-(93,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (91,0)-(91,6)) + │ │ │ ├── keyword_loc: (91,0)-(91,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (92,0)-(93,3)) + │ │ │ ├── ensure_keyword_loc: (92,0)-(92,6) = "ensure" + │ │ │ ├── statements: ∅ + │ │ │ └── end_keyword_loc: (93,0)-(93,3) = "end" + │ │ └── end_keyword_loc: (93,0)-(93,3) = "end" + │ ├── opening_loc: (90,2)-(90,4) = "do" + │ └── closing_loc: (93,0)-(93,3) = "end" + └── @ CallNode (location: (94,0)-(96,1)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bar + ├── message_loc: (94,0)-(94,3) = "bar" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (94,4)-(96,1)) + ├── locals: [:_1, :_2] + ├── parameters: + │ @ NumberedParametersNode (location: (94,4)-(96,1)) + │ └── maximum: 2 + ├── body: + │ @ StatementsNode (location: (95,2)-(95,9)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (95,2)-(95,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (95,2)-(95,4)) + │ │ ├── name: :_1 + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (95,5)-(95,6) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (95,7)-(95,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (95,7)-(95,9)) + │ │ ├── name: :_2 + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (94,4)-(94,5) = "{" + └── closing_loc: (96,0)-(96,1) = "}" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/case.txt b/test/mri/prism/snapshots/unparser/corpus/literal/case.txt new file mode 100644 index 00000000000..509caa55c8b --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/case.txt @@ -0,0 +1,446 @@ +@ ProgramNode (location: (1,0)-(37,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(37,3)) + └── body: (length: 8) + ├── @ CaseNode (location: (1,0)-(6,3)) + │ ├── predicate: ∅ + │ ├── conditions: (length: 2) + │ │ ├── @ WhenNode (location: (2,0)-(3,5)) + │ │ │ ├── keyword_loc: (2,0)-(2,4) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ CallNode (location: (2,5)-(2,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (2,5)-(2,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,2)-(3,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (3,2)-(3,5) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ WhenNode (location: (4,0)-(5,5)) + │ │ ├── keyword_loc: (4,0)-(4,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (4,5)-(4,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (4,5)-(4,8) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (5,2)-(5,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,2)-(5,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (5,2)-(5,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── @ CaseNode (location: (7,0)-(11,3)) + │ ├── predicate: + │ │ @ CallNode (location: (7,5)-(7,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,5)-(7,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 2) + │ │ ├── @ WhenNode (location: (8,0)-(8,8)) + │ │ │ ├── keyword_loc: (8,0)-(8,4) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ CallNode (location: (8,5)-(8,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (8,5)-(8,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: ∅ + │ │ └── @ WhenNode (location: (9,0)-(10,5)) + │ │ ├── keyword_loc: (9,0)-(9,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (9,5)-(9,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (9,5)-(9,8) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (10,2)-(10,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (10,2)-(10,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (10,2)-(10,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (7,0)-(7,4) = "case" + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ CaseNode (location: (12,0)-(17,3)) + │ ├── predicate: + │ │ @ CallNode (location: (12,5)-(12,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (12,5)-(12,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 2) + │ │ ├── @ WhenNode (location: (13,0)-(14,5)) + │ │ │ ├── keyword_loc: (13,0)-(13,4) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ CallNode (location: (13,5)-(13,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (13,5)-(13,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (14,2)-(14,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (14,2)-(14,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (14,2)-(14,5) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ WhenNode (location: (15,0)-(16,5)) + │ │ ├── keyword_loc: (15,0)-(15,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (15,5)-(15,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (15,5)-(15,8) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (16,2)-(16,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (16,2)-(16,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (16,2)-(16,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (12,0)-(12,4) = "case" + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ CaseNode (location: (18,0)-(21,3)) + │ ├── predicate: + │ │ @ CallNode (location: (18,5)-(18,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (18,5)-(18,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (19,0)-(20,8)) + │ │ ├── keyword_loc: (19,0)-(19,4) = "when" + │ │ ├── conditions: (length: 2) + │ │ │ ├── @ CallNode (location: (19,5)-(19,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (19,5)-(19,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ CallNode (location: (19,10)-(19,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (19,10)-(19,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (20,2)-(20,8)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (20,2)-(20,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (20,2)-(20,3) = ":" + │ │ ├── value_loc: (20,3)-(20,8) = "other" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "other" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (18,0)-(18,4) = "case" + │ └── end_keyword_loc: (21,0)-(21,3) = "end" + ├── @ CaseNode (location: (22,0)-(25,3)) + │ ├── predicate: + │ │ @ CallNode (location: (22,5)-(22,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (22,5)-(22,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (23,0)-(24,8)) + │ │ ├── keyword_loc: (23,0)-(23,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SplatNode (location: (23,5)-(23,9)) + │ │ │ ├── operator_loc: (23,5)-(23,6) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (23,6)-(23,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (23,6)-(23,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (24,2)-(24,8)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (24,2)-(24,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (24,2)-(24,3) = ":" + │ │ ├── value_loc: (24,3)-(24,8) = "value" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "value" + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (22,0)-(22,4) = "case" + │ └── end_keyword_loc: (25,0)-(25,3) = "end" + ├── @ CaseNode (location: (26,0)-(31,3)) + │ ├── predicate: + │ │ @ CallNode (location: (26,5)-(26,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (26,5)-(26,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (27,0)-(28,5)) + │ │ ├── keyword_loc: (27,0)-(27,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ CallNode (location: (27,5)-(27,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (27,5)-(27,8) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (28,2)-(28,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (28,2)-(28,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (28,2)-(28,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (29,0)-(31,3)) + │ │ ├── else_keyword_loc: (29,0)-(29,4) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (30,2)-(30,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (30,2)-(30,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (30,2)-(30,3) = ":" + │ │ │ ├── value_loc: (30,3)-(30,6) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── end_keyword_loc: (31,0)-(31,3) = "end" + │ ├── case_keyword_loc: (26,0)-(26,4) = "case" + │ └── end_keyword_loc: (31,0)-(31,3) = "end" + ├── @ CaseNode (location: (32,0)-(34,3)) + │ ├── predicate: + │ │ @ CallNode (location: (32,5)-(32,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (32,5)-(32,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ WhenNode (location: (33,0)-(33,15)) + │ │ ├── keyword_loc: (33,0)-(33,4) = "when" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ SplatNode (location: (33,5)-(33,15)) + │ │ │ ├── operator_loc: (33,5)-(33,6) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (33,6)-(33,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (33,6)-(33,9)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (33,6)-(33,9) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :| + │ │ │ ├── message_loc: (33,10)-(33,11) = "|" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (33,12)-(33,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (33,12)-(33,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (33,12)-(33,15) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (32,0)-(32,4) = "case" + │ └── end_keyword_loc: (34,0)-(34,3) = "end" + └── @ CaseNode (location: (35,0)-(37,3)) + ├── predicate: + │ @ CallNode (location: (35,5)-(35,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (35,5)-(35,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (36,0)-(36,15)) + │ ├── keyword_loc: (36,0)-(36,4) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ SplatNode (location: (36,5)-(36,15)) + │ │ ├── operator_loc: (36,5)-(36,6) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (36,6)-(36,15)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ CallNode (location: (36,6)-(36,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (36,6)-(36,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (36,9)-(36,10) = "." + │ │ ├── name: :baz= + │ │ ├── message_loc: (36,10)-(36,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (36,14)-(36,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (36,14)-(36,15)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (35,0)-(35,4) = "case" + └── end_keyword_loc: (37,0)-(37,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/class.txt b/test/mri/prism/snapshots/unparser/corpus/literal/class.txt new file mode 100644 index 00000000000..34eb03edb3d --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/class.txt @@ -0,0 +1,233 @@ +@ ProgramNode (location: (1,0)-(35,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(35,3)) + └── body: (length: 10) + ├── @ ClassNode (location: (1,0)-(2,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (1,0)-(1,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: ∅ + │ ├── end_keyword_loc: (2,0)-(2,3) = "end" + │ └── name: :A + ├── @ SingletonClassNode (location: (4,0)-(5,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (4,0)-(4,5) = "class" + │ ├── operator_loc: (4,6)-(4,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (4,9)-(4,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (4,9)-(4,10) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ SingletonClassNode (location: (7,0)-(9,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (7,0)-(7,5) = "class" + │ ├── operator_loc: (7,6)-(7,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (7,9)-(7,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (7,9)-(7,10) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (8,2)-(8,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (8,2)-(8,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (8,2)-(8,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + ├── @ ClassNode (location: (11,0)-(12,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (11,0)-(11,5) = "class" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (11,6)-(11,10)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (11,6)-(11,7)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (11,9)-(11,10)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (11,7)-(11,9) = "::" + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: ∅ + │ ├── end_keyword_loc: (12,0)-(12,3) = "end" + │ └── name: :B + ├── @ ClassNode (location: (14,0)-(15,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (14,0)-(14,5) = "class" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (14,6)-(14,13)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (14,6)-(14,10)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (14,6)-(14,7)) + │ │ │ │ └── name: :A + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (14,9)-(14,10)) + │ │ │ │ └── name: :B + │ │ │ └── delimiter_loc: (14,7)-(14,9) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (14,12)-(14,13)) + │ │ │ └── name: :C + │ │ └── delimiter_loc: (14,10)-(14,12) = "::" + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: ∅ + │ ├── end_keyword_loc: (15,0)-(15,3) = "end" + │ └── name: :C + ├── @ ClassNode (location: (17,0)-(18,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (17,0)-(17,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (17,6)-(17,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: (17,8)-(17,9) = "<" + │ ├── superclass: + │ │ @ ConstantReadNode (location: (17,10)-(17,11)) + │ │ └── name: :B + │ ├── body: ∅ + │ ├── end_keyword_loc: (18,0)-(18,3) = "end" + │ └── name: :A + ├── @ ClassNode (location: (20,0)-(21,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (20,0)-(20,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (20,6)-(20,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: (20,8)-(20,9) = "<" + │ ├── superclass: + │ │ @ ConstantPathNode (location: (20,10)-(20,14)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (20,10)-(20,11)) + │ │ │ └── name: :B + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (20,13)-(20,14)) + │ │ │ └── name: :C + │ │ └── delimiter_loc: (20,11)-(20,13) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (21,0)-(21,3) = "end" + │ └── name: :A + ├── @ ClassNode (location: (23,0)-(24,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (23,0)-(23,5) = "class" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (23,6)-(23,10)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (23,6)-(23,7)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (23,9)-(23,10)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (23,7)-(23,9) = "::" + │ ├── inheritance_operator_loc: (23,11)-(23,12) = "<" + │ ├── superclass: + │ │ @ ConstantPathNode (location: (23,13)-(23,17)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (23,13)-(23,14)) + │ │ │ └── name: :C + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (23,16)-(23,17)) + │ │ │ └── name: :D + │ │ └── delimiter_loc: (23,14)-(23,16) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (24,0)-(24,3) = "end" + │ └── name: :B + ├── @ ClassNode (location: (26,0)-(32,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (26,0)-(26,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (26,6)-(26,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (27,2)-(31,5)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (27,2)-(27,16)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :include + │ │ │ ├── message_loc: (27,2)-(27,9) = "include" + │ │ │ ├── opening_loc: (27,9)-(27,10) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (27,10)-(27,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (27,10)-(27,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ ConstantReadNode (location: (27,10)-(27,11)) + │ │ │ │ │ └── name: :B + │ │ │ │ ├── call_operator_loc: (27,11)-(27,12) = "." + │ │ │ │ ├── name: :new + │ │ │ │ ├── message_loc: (27,12)-(27,15) = "new" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (27,15)-(27,16) = ")" + │ │ │ └── block: ∅ + │ │ └── @ DefNode (location: (29,2)-(31,5)) + │ │ ├── name: :foo + │ │ ├── name_loc: (29,6)-(29,9) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (30,4)-(30,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (30,4)-(30,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (30,4)-(30,5) = ":" + │ │ │ ├── value_loc: (30,5)-(30,8) = "bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bar" + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (29,2)-(29,5) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (31,2)-(31,5) = "end" + │ ├── end_keyword_loc: (32,0)-(32,3) = "end" + │ └── name: :A + └── @ ClassNode (location: (34,0)-(35,3)) + ├── locals: [] + ├── class_keyword_loc: (34,0)-(34,5) = "class" + ├── constant_path: + │ @ ConstantPathNode (location: (34,6)-(34,9)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (34,8)-(34,9)) + │ │ └── name: :A + │ └── delimiter_loc: (34,6)-(34,8) = "::" + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: ∅ + ├── end_keyword_loc: (35,0)-(35,3) = "end" + └── name: :A diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/control.txt b/test/mri/prism/snapshots/unparser/corpus/literal/control.txt new file mode 100644 index 00000000000..9bb303fed42 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/control.txt @@ -0,0 +1,150 @@ +@ ProgramNode (location: (1,0)-(15,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(15,3)) + └── body: (length: 11) + ├── @ NextNode (location: (1,0)-(1,4)) + │ ├── arguments: ∅ + │ └── keyword_loc: (1,0)-(1,4) = "next" + ├── @ ReturnNode (location: (2,0)-(2,6)) + │ ├── keyword_loc: (2,0)-(2,6) = "return" + │ └── arguments: ∅ + ├── @ BreakNode (location: (3,0)-(3,5)) + │ ├── arguments: ∅ + │ └── keyword_loc: (3,0)-(3,5) = "break" + ├── @ RetryNode (location: (4,0)-(4,5)) + ├── @ RedoNode (location: (5,0)-(5,4)) + ├── @ ReturnNode (location: (6,0)-(6,8)) + │ ├── keyword_loc: (6,0)-(6,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (6,7)-(6,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (6,7)-(6,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ ReturnNode (location: (7,0)-(7,11)) + │ ├── keyword_loc: (7,0)-(7,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (7,7)-(7,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (7,7)-(7,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (7,10)-(7,11)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ ReturnNode (location: (8,0)-(8,19)) + │ ├── keyword_loc: (8,0)-(8,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (8,7)-(8,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IfNode (location: (8,7)-(8,19)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ TrueNode (location: (8,7)-(8,11)) + │ ├── then_keyword_loc: (8,12)-(8,13) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (8,14)-(8,15)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (8,14)-(8,15)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── consequent: + │ │ @ ElseNode (location: (8,16)-(8,19)) + │ │ ├── else_keyword_loc: (8,16)-(8,17) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (8,18)-(8,19)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (8,18)-(8,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ BreakNode (location: (9,0)-(9,18)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,6)-(9,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IfNode (location: (9,6)-(9,18)) + │ │ ├── if_keyword_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (9,6)-(9,10)) + │ │ ├── then_keyword_loc: (9,11)-(9,12) = "?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (9,13)-(9,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (9,13)-(9,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (9,15)-(9,18)) + │ │ │ ├── else_keyword_loc: (9,15)-(9,16) = ":" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (9,17)-(9,18)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (9,17)-(9,18)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── end_keyword_loc: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── keyword_loc: (9,0)-(9,5) = "break" + ├── @ NextNode (location: (10,0)-(10,17)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (10,5)-(10,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IfNode (location: (10,5)-(10,17)) + │ │ ├── if_keyword_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (10,5)-(10,9)) + │ │ ├── then_keyword_loc: (10,10)-(10,11) = "?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (10,12)-(10,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (10,12)-(10,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (10,14)-(10,17)) + │ │ │ ├── else_keyword_loc: (10,14)-(10,15) = ":" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (10,16)-(10,17)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (10,16)-(10,17)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── end_keyword_loc: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── keyword_loc: (10,0)-(10,4) = "next" + └── @ ReturnNode (location: (11,0)-(15,3)) + ├── keyword_loc: (11,0)-(11,6) = "return" + └── arguments: + @ ArgumentsNode (location: (11,7)-(15,3)) + ├── flags: ∅ + └── arguments: (length: 2) + ├── @ TrueNode (location: (11,7)-(11,11)) + └── @ IfNode (location: (11,13)-(15,3)) + ├── if_keyword_loc: (11,13)-(11,15) = "if" + ├── predicate: + │ @ TrueNode (location: (11,16)-(11,20)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (12,2)-(12,3)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (12,2)-(12,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── consequent: + │ @ ElseNode (location: (13,0)-(15,3)) + │ ├── else_keyword_loc: (13,0)-(13,4) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (14,2)-(14,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (14,2)-(14,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── end_keyword_loc: (15,0)-(15,3) = "end" + └── end_keyword_loc: (15,0)-(15,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/def.txt b/test/mri/prism/snapshots/unparser/corpus/literal/def.txt new file mode 100644 index 00000000000..da285d894ba --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/def.txt @@ -0,0 +1,1203 @@ +@ ProgramNode (location: (1,0)-(134,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(134,3)) + └── body: (length: 30) + ├── @ DefNode (location: (1,0)-(9,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,0)-(9,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (2,2)-(2,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,3)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (4,2)-(4,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (4,2)-(4,3) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (5,0)-(7,6)) + │ │ │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (6,2)-(6,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (6,2)-(6,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (6,2)-(6,3) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (7,0)-(9,3)) + │ │ │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (8,2)-(8,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (8,2)-(8,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (8,2)-(8,3) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + ├── @ DefNode (location: (11,0)-(19,3)) + │ ├── name: :foo + │ ├── name_loc: (11,4)-(11,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (11,0)-(19,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (12,2)-(12,12)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ RescueModifierNode (location: (12,2)-(12,12)) + │ │ │ ├── expression: + │ │ │ │ @ CallNode (location: (12,2)-(12,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (12,2)-(12,3) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── keyword_loc: (12,4)-(12,10) = "rescue" + │ │ │ └── rescue_expression: + │ │ │ @ CallNode (location: (12,11)-(12,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (12,11)-(12,12) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (13,0)-(14,3)) + │ │ │ ├── keyword_loc: (13,0)-(13,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (14,2)-(14,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (14,2)-(14,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (14,2)-(14,3) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (15,0)-(17,6)) + │ │ │ ├── else_keyword_loc: (15,0)-(15,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (16,2)-(16,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (16,2)-(16,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (16,2)-(16,3) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (17,0)-(17,6) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (17,0)-(19,3)) + │ │ │ ├── ensure_keyword_loc: (17,0)-(17,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (18,2)-(18,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (18,2)-(18,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (18,2)-(18,3) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (19,0)-(19,3) = "end" + │ │ └── end_keyword_loc: (19,0)-(19,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (11,0)-(11,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ DefNode (location: (21,0)-(22,3)) + │ ├── name: :foo + │ ├── name_loc: (21,4)-(21,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (21,8)-(21,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (21,8)-(21,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ └── name_loc: (21,8)-(21,12) = "bar:" + │ │ │ └── @ RequiredKeywordParameterNode (location: (21,14)-(21,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ └── name_loc: (21,14)-(21,18) = "baz:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (21,0)-(21,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (21,7)-(21,8) = "(" + │ ├── rparen_loc: (21,18)-(21,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (22,0)-(22,3) = "end" + ├── @ DefNode (location: (24,0)-(25,3)) + │ ├── name: :foo + │ ├── name_loc: (24,4)-(24,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (24,0)-(24,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (25,0)-(25,3) = "end" + ├── @ DefNode (location: (27,0)-(29,3)) + │ ├── name: :foo + │ ├── name_loc: (27,4)-(27,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (28,2)-(28,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (28,2)-(28,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (28,2)-(28,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (27,0)-(27,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (29,0)-(29,3) = "end" + ├── @ DefNode (location: (31,0)-(37,3)) + │ ├── name: :foo + │ ├── name_loc: (31,4)-(31,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (31,0)-(37,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (32,2)-(32,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (32,2)-(32,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (32,2)-(32,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (33,0)-(34,5)) + │ │ │ ├── keyword_loc: (33,0)-(33,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (34,2)-(34,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (34,2)-(34,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (34,2)-(34,5) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (35,0)-(37,3)) + │ │ │ ├── ensure_keyword_loc: (35,0)-(35,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (36,2)-(36,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (36,2)-(36,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (36,2)-(36,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (37,0)-(37,3) = "end" + │ │ └── end_keyword_loc: (37,0)-(37,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (31,0)-(31,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (37,0)-(37,3) = "end" + ├── @ DefNode (location: (39,0)-(43,3)) + │ ├── name: :foo + │ ├── name_loc: (39,4)-(39,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (39,0)-(43,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (40,2)-(40,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (40,2)-(40,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (40,2)-(40,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (41,0)-(43,3)) + │ │ │ ├── ensure_keyword_loc: (41,0)-(41,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (42,2)-(42,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (42,2)-(42,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (42,2)-(42,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── end_keyword_loc: (43,0)-(43,3) = "end" + │ │ └── end_keyword_loc: (43,0)-(43,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (39,0)-(39,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (43,0)-(43,3) = "end" + ├── @ DefNode (location: (45,0)-(49,3)) + │ ├── name: :foo + │ ├── name_loc: (45,4)-(45,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (45,0)-(49,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (46,2)-(46,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (46,2)-(46,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (46,2)-(46,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (47,0)-(48,5)) + │ │ │ ├── keyword_loc: (47,0)-(47,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (48,2)-(48,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (48,2)-(48,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (48,2)-(48,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (49,0)-(49,3) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (45,0)-(45,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (49,0)-(49,3) = "end" + ├── @ DefNode (location: (51,0)-(53,3)) + │ ├── name: :foo + │ ├── name_loc: (51,4)-(51,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (51,8)-(51,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (51,8)-(51,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (52,2)-(52,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (52,2)-(52,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (51,0)-(51,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (51,7)-(51,8) = "(" + │ ├── rparen_loc: (51,11)-(51,12) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (53,0)-(53,3) = "end" + ├── @ DefNode (location: (55,0)-(57,3)) + │ ├── name: :foo + │ ├── name_loc: (55,4)-(55,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (55,8)-(55,16)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (55,8)-(55,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :bar + │ │ │ └── @ RequiredParameterNode (location: (55,13)-(55,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :baz + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (56,2)-(56,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (56,2)-(56,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (55,0)-(55,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (55,7)-(55,8) = "(" + │ ├── rparen_loc: (55,16)-(55,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (57,0)-(57,3) = "end" + ├── @ DefNode (location: (59,0)-(61,3)) + │ ├── name: :foo + │ ├── name_loc: (59,4)-(59,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (59,8)-(59,16)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (59,8)-(59,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (59,8)-(59,11) = "bar" + │ │ │ ├── operator_loc: (59,12)-(59,13) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (59,14)-(59,16)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (59,14)-(59,15) = "(" + │ │ │ └── closing_loc: (59,15)-(59,16) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (60,2)-(60,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (60,2)-(60,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (59,0)-(59,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (59,7)-(59,8) = "(" + │ ├── rparen_loc: (59,16)-(59,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (61,0)-(61,3) = "end" + ├── @ DefNode (location: (63,0)-(64,3)) + │ ├── name: :foo + │ ├── name_loc: (63,4)-(63,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (63,8)-(63,24)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (63,8)-(63,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (63,8)-(63,11) = "bar" + │ │ │ ├── operator_loc: (63,12)-(63,13) = "=" + │ │ │ └── value: + │ │ │ @ ParenthesesNode (location: (63,14)-(63,24)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (63,15)-(63,23)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ CallNode (location: (63,15)-(63,18)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :baz + │ │ │ │ │ ├── message_loc: (63,15)-(63,18) = "baz" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── @ NilNode (location: (63,20)-(63,23)) + │ │ │ ├── opening_loc: (63,14)-(63,15) = "(" + │ │ │ └── closing_loc: (63,23)-(63,24) = ")" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (63,0)-(63,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (63,7)-(63,8) = "(" + │ ├── rparen_loc: (63,24)-(63,25) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (64,0)-(64,3) = "end" + ├── @ DefNode (location: (66,0)-(68,3)) + │ ├── name: :foo + │ ├── name_loc: (66,4)-(66,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (66,8)-(66,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (66,8)-(66,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (66,8)-(66,11) = "bar" + │ │ │ ├── operator_loc: (66,12)-(66,13) = "=" + │ │ │ └── value: + │ │ │ @ TrueNode (location: (66,14)-(66,18)) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (67,2)-(67,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (67,2)-(67,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (66,0)-(66,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (66,7)-(66,8) = "(" + │ ├── rparen_loc: (66,18)-(66,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (68,0)-(68,3) = "end" + ├── @ DefNode (location: (70,0)-(72,3)) + │ ├── name: :foo + │ ├── name_loc: (70,4)-(70,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (70,8)-(70,23)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (70,8)-(70,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (70,13)-(70,23)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (70,13)-(70,16) = "baz" + │ │ │ ├── operator_loc: (70,17)-(70,18) = "=" + │ │ │ └── value: + │ │ │ @ TrueNode (location: (70,19)-(70,23)) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (71,2)-(71,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (71,2)-(71,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (70,0)-(70,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (70,7)-(70,8) = "(" + │ ├── rparen_loc: (70,23)-(70,24) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (72,0)-(72,3) = "end" + ├── @ DefNode (location: (74,0)-(75,3)) + │ ├── name: :foo + │ ├── name_loc: (74,4)-(74,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (74,8)-(74,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (74,8)-(74,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (74,8)-(74,12) = "bar:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (74,13)-(74,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (74,0)-(74,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (74,7)-(74,8) = "(" + │ ├── rparen_loc: (74,14)-(74,15) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (75,0)-(75,3) = "end" + ├── @ DefNode (location: (77,0)-(78,3)) + │ ├── name: :foo + │ ├── name_loc: (77,4)-(77,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (77,8)-(77,16)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (77,8)-(77,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (77,8)-(77,12) = "bar:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (77,13)-(77,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (77,13)-(77,16) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (77,0)-(77,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (77,7)-(77,8) = "(" + │ ├── rparen_loc: (77,16)-(77,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (78,0)-(78,3) = "end" + ├── @ DefNode (location: (80,0)-(81,3)) + │ ├── name: :foo + │ ├── name_loc: (80,4)-(80,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (80,8)-(80,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (80,8)-(80,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (80,8)-(80,12) = "bar:" + │ │ │ └── value: + │ │ │ @ CallNode (location: (80,13)-(80,18)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (80,13)-(80,16) = "bar" + │ │ │ ├── opening_loc: (80,16)-(80,17) = "(" + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: (80,17)-(80,18) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (80,0)-(80,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (80,7)-(80,8) = "(" + │ ├── rparen_loc: (80,18)-(80,19) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (81,0)-(81,3) = "end" + ├── @ DefNode (location: (83,0)-(85,3)) + │ ├── name: :foo + │ ├── name_loc: (83,4)-(83,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (83,8)-(83,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (83,8)-(83,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (83,8)-(83,9) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (84,2)-(84,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (84,2)-(84,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (84,2)-(84,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (83,0)-(83,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (83,7)-(83,8) = "(" + │ ├── rparen_loc: (83,9)-(83,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (85,0)-(85,3) = "end" + ├── @ DefNode (location: (87,0)-(89,3)) + │ ├── name: :foo + │ ├── name_loc: (87,4)-(87,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (87,8)-(87,12)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (87,8)-(87,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (87,9)-(87,12) = "bar" + │ │ │ └── operator_loc: (87,8)-(87,9) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (88,2)-(88,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (88,2)-(88,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (87,0)-(87,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (87,7)-(87,8) = "(" + │ ├── rparen_loc: (87,12)-(87,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (89,0)-(89,3) = "end" + ├── @ DefNode (location: (91,0)-(93,3)) + │ ├── name: :foo + │ ├── name_loc: (91,4)-(91,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (91,8)-(91,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (91,8)-(91,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (91,13)-(91,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (91,14)-(91,17) = "baz" + │ │ │ └── operator_loc: (91,13)-(91,14) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (92,2)-(92,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (92,2)-(92,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (91,0)-(91,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (91,7)-(91,8) = "(" + │ ├── rparen_loc: (91,17)-(91,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (93,0)-(93,3) = "end" + ├── @ DefNode (location: (95,0)-(97,3)) + │ ├── name: :foo + │ ├── name_loc: (95,4)-(95,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (95,8)-(95,24)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (95,8)-(95,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (95,8)-(95,11) = "baz" + │ │ │ ├── operator_loc: (95,12)-(95,13) = "=" + │ │ │ └── value: + │ │ │ @ TrueNode (location: (95,14)-(95,18)) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (95,20)-(95,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bor + │ │ │ ├── name_loc: (95,21)-(95,24) = "bor" + │ │ │ └── operator_loc: (95,20)-(95,21) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (96,2)-(96,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (96,2)-(96,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (96,2)-(96,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:baz, :bor] + │ ├── def_keyword_loc: (95,0)-(95,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (95,7)-(95,8) = "(" + │ ├── rparen_loc: (95,24)-(95,25) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (97,0)-(97,3) = "end" + ├── @ DefNode (location: (99,0)-(101,3)) + │ ├── name: :foo + │ ├── name_loc: (99,4)-(99,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (99,8)-(99,32)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (99,8)-(99,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (99,8)-(99,11) = "baz" + │ │ │ ├── operator_loc: (99,12)-(99,13) = "=" + │ │ │ └── value: + │ │ │ @ TrueNode (location: (99,14)-(99,18)) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (99,20)-(99,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bor + │ │ │ ├── name_loc: (99,21)-(99,24) = "bor" + │ │ │ └── operator_loc: (99,20)-(99,21) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (99,26)-(99,32)) + │ │ ├── flags: ∅ + │ │ ├── name: :block + │ │ ├── name_loc: (99,27)-(99,32) = "block" + │ │ └── operator_loc: (99,26)-(99,27) = "&" + │ ├── body: + │ │ @ StatementsNode (location: (100,2)-(100,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (100,2)-(100,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (100,2)-(100,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:baz, :bor, :block] + │ ├── def_keyword_loc: (99,0)-(99,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (99,7)-(99,8) = "(" + │ ├── rparen_loc: (99,32)-(99,33) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (101,0)-(101,3) = "end" + ├── @ DefNode (location: (103,0)-(105,3)) + │ ├── name: :foo + │ ├── name_loc: (103,4)-(103,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (103,8)-(103,29)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (103,8)-(103,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (103,13)-(103,23)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (103,13)-(103,16) = "baz" + │ │ │ ├── operator_loc: (103,17)-(103,18) = "=" + │ │ │ └── value: + │ │ │ @ TrueNode (location: (103,19)-(103,23)) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (103,25)-(103,29)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bor + │ │ │ ├── name_loc: (103,26)-(103,29) = "bor" + │ │ │ └── operator_loc: (103,25)-(103,26) = "*" + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (104,2)-(104,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (104,2)-(104,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar, :baz, :bor] + │ ├── def_keyword_loc: (103,0)-(103,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (103,7)-(103,8) = "(" + │ ├── rparen_loc: (103,29)-(103,30) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (105,0)-(105,3) = "end" + ├── @ DefNode (location: (107,0)-(109,3)) + │ ├── name: :foo + │ ├── name_loc: (107,4)-(107,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (107,8)-(107,14)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (107,8)-(107,14)) + │ │ ├── flags: ∅ + │ │ ├── name: :block + │ │ ├── name_loc: (107,9)-(107,14) = "block" + │ │ └── operator_loc: (107,8)-(107,9) = "&" + │ ├── body: + │ │ @ StatementsNode (location: (108,2)-(108,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (108,2)-(108,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (108,2)-(108,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:block] + │ ├── def_keyword_loc: (107,0)-(107,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (107,7)-(107,8) = "(" + │ ├── rparen_loc: (107,14)-(107,15) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (109,0)-(109,3) = "end" + ├── @ DefNode (location: (111,0)-(113,3)) + │ ├── name: :foo + │ ├── name_loc: (111,4)-(111,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (111,8)-(111,19)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (111,8)-(111,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :bar + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (111,13)-(111,19)) + │ │ ├── flags: ∅ + │ │ ├── name: :block + │ │ ├── name_loc: (111,14)-(111,19) = "block" + │ │ └── operator_loc: (111,13)-(111,14) = "&" + │ ├── body: + │ │ @ StatementsNode (location: (112,2)-(112,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (112,2)-(112,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── locals: [:bar, :block] + │ ├── def_keyword_loc: (111,0)-(111,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (111,7)-(111,8) = "(" + │ ├── rparen_loc: (111,19)-(111,20) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (113,0)-(113,3) = "end" + ├── @ DefNode (location: (115,0)-(118,3)) + │ ├── name: :foo + │ ├── name_loc: (115,4)-(115,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (116,2)-(117,5)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (116,2)-(116,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (116,2)-(116,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (117,2)-(117,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (117,2)-(117,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (115,0)-(115,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (118,0)-(118,3) = "end" + ├── @ DefNode (location: (120,0)-(121,3)) + │ ├── name: :f + │ ├── name_loc: (120,4)-(120,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (120,6)-(120,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (120,6)-(120,11)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (120,7)-(120,10)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (120,8)-(120,9)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (120,7)-(120,8) = "(" + │ │ │ │ └── rparen_loc: (120,9)-(120,10) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (120,6)-(120,7) = "(" + │ │ │ └── rparen_loc: (120,10)-(120,11) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (120,0)-(120,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (120,5)-(120,6) = "(" + │ ├── rparen_loc: (120,11)-(120,12) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (121,0)-(121,3) = "end" + ├── @ DefNode (location: (123,0)-(124,3)) + │ ├── name: :foo + │ ├── name_loc: (123,4)-(123,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (123,8)-(123,26)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (123,8)-(123,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ └── name_loc: (123,8)-(123,12) = "bar:" + │ │ │ └── @ OptionalKeywordParameterNode (location: (123,14)-(123,26)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── name_loc: (123,14)-(123,18) = "baz:" + │ │ │ └── value: + │ │ │ @ StringNode (location: (123,19)-(123,26)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (123,19)-(123,20) = "\"" + │ │ │ ├── content_loc: (123,20)-(123,25) = "value" + │ │ │ ├── closing_loc: (123,25)-(123,26) = "\"" + │ │ │ └── unescaped: "value" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:bar, :baz] + │ ├── def_keyword_loc: (123,0)-(123,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (123,7)-(123,8) = "(" + │ ├── rparen_loc: (123,26)-(123,27) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (124,0)-(124,3) = "end" + ├── @ DefNode (location: (126,0)-(130,3)) + │ ├── name: :f + │ ├── name_loc: (126,4)-(126,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (127,2)-(127,12)) + │ │ └── body: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (127,2)-(127,12)) + │ │ ├── opening_loc: (127,2)-(127,12) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (128,0)-(128,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (128,0)-(128,4) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (128,4)-(128,7)) + │ │ │ │ ├── opening_loc: (128,4)-(128,6) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (128,6)-(128,7) = "}" + │ │ │ └── @ StringNode (location: (128,7)-(129,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (128,7)-(129,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (129,0)-(130,0) = " HEREDOC\n" + │ ├── locals: [] + │ ├── def_keyword_loc: (126,0)-(126,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (130,0)-(130,3) = "end" + └── @ DefNode (location: (132,0)-(134,3)) + ├── name: :f + ├── name_loc: (132,4)-(132,5) = "f" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (133,2)-(133,5)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (133,2)-(133,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (133,2)-(133,4) = "%(" + │ ├── content_loc: (133,4)-(133,4) = "" + │ ├── closing_loc: (133,4)-(133,5) = ")" + │ └── unescaped: "" + ├── locals: [] + ├── def_keyword_loc: (132,0)-(132,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (134,0)-(134,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/defined.txt b/test/mri/prism/snapshots/unparser/corpus/literal/defined.txt new file mode 100644 index 00000000000..89145ddcda8 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/defined.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(3,27)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(3,27)) + └── body: (length: 3) + ├── @ DefinedNode (location: (1,0)-(1,14)) + │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ ├── value: + │ │ @ InstanceVariableReadNode (location: (1,9)-(1,13)) + │ │ └── name: :@foo + │ ├── rparen_loc: (1,13)-(1,14) = ")" + │ └── keyword_loc: (1,0)-(1,8) = "defined?" + ├── @ DefinedNode (location: (2,0)-(2,13)) + │ ├── lparen_loc: (2,8)-(2,9) = "(" + │ ├── value: + │ │ @ ConstantReadNode (location: (2,9)-(2,12)) + │ │ └── name: :Foo + │ ├── rparen_loc: (2,12)-(2,13) = ")" + │ └── keyword_loc: (2,0)-(2,8) = "defined?" + └── @ DefinedNode (location: (3,0)-(3,27)) + ├── lparen_loc: (3,8)-(3,9) = "(" + ├── value: + │ @ ParenthesesNode (location: (3,9)-(3,26)) + │ ├── body: + │ │ @ StatementsNode (location: (3,10)-(3,25)) + │ │ └── body: (length: 1) + │ │ └── @ MultiWriteNode (location: (3,10)-(3,25)) + │ │ ├── lefts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (3,11)-(3,12)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (3,14)-(3,15)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: (3,10)-(3,11) = "(" + │ │ ├── rparen_loc: (3,15)-(3,16) = ")" + │ │ ├── operator_loc: (3,17)-(3,18) = "=" + │ │ └── value: + │ │ @ ArrayNode (location: (3,19)-(3,25)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (3,20)-(3,21)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (3,23)-(3,24)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (3,19)-(3,20) = "[" + │ │ └── closing_loc: (3,24)-(3,25) = "]" + │ ├── opening_loc: (3,9)-(3,10) = "(" + │ └── closing_loc: (3,25)-(3,26) = ")" + ├── rparen_loc: (3,26)-(3,27) = ")" + └── keyword_loc: (3,0)-(3,8) = "defined?" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/defs.txt b/test/mri/prism/snapshots/unparser/corpus/literal/defs.txt new file mode 100644 index 00000000000..431843cc191 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/defs.txt @@ -0,0 +1,360 @@ +@ ProgramNode (location: (1,0)-(40,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(40,3)) + └── body: (length: 10) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :foo + │ ├── name_loc: (1,9)-(1,12) = "foo" + │ ├── receiver: + │ │ @ SelfNode (location: (1,4)-(1,8)) + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: (1,8)-(1,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(6,3)) + │ ├── name: :foo + │ ├── name_loc: (4,9)-(4,12) = "foo" + │ ├── receiver: + │ │ @ SelfNode (location: (4,4)-(4,8)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,2)-(5,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,2)-(5,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (5,2)-(5,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: (4,8)-(4,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── @ DefNode (location: (8,0)-(11,3)) + │ ├── name: :foo + │ ├── name_loc: (8,9)-(8,12) = "foo" + │ ├── receiver: + │ │ @ SelfNode (location: (8,4)-(8,8)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(10,5)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (9,2)-(9,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (9,2)-(9,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (10,2)-(10,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (10,2)-(10,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: (8,8)-(8,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ DefNode (location: (13,0)-(15,3)) + │ ├── name: :bar + │ ├── name_loc: (13,8)-(13,11) = "bar" + │ ├── receiver: + │ │ @ ConstantReadNode (location: (13,4)-(13,7)) + │ │ └── name: :Foo + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,2)-(14,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (14,2)-(14,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (14,2)-(14,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: (13,7)-(13,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (15,0)-(15,3) = "end" + ├── @ DefNode (location: (17,0)-(20,3)) + │ ├── name: :bar + │ ├── name_loc: (18,3)-(18,6) = "bar" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (17,4)-(18,2)) + │ │ ├── body: + │ │ │ @ CallNode (location: (17,5)-(18,1)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (17,5)-(17,8) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (17,9)-(18,1)) + │ │ │ ├── locals: [:bar] + │ │ │ ├── parameters: + │ │ │ │ @ BlockParametersNode (location: (17,11)-(17,16)) + │ │ │ │ ├── parameters: + │ │ │ │ │ @ ParametersNode (location: (17,12)-(17,15)) + │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (17,12)-(17,15)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :bar + │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── locals: (length: 0) + │ │ │ │ ├── opening_loc: (17,11)-(17,12) = "|" + │ │ │ │ └── closing_loc: (17,15)-(17,16) = "|" + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (17,9)-(17,10) = "{" + │ │ │ └── closing_loc: (18,0)-(18,1) = "}" + │ │ ├── opening_loc: (17,4)-(17,5) = "(" + │ │ └── closing_loc: (18,1)-(18,2) = ")" + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (19,2)-(19,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (19,2)-(19,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (19,2)-(19,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (17,0)-(17,3) = "def" + │ ├── operator_loc: (18,2)-(18,3) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (20,0)-(20,3) = "end" + ├── @ DefNode (location: (22,0)-(24,3)) + │ ├── name: :bar + │ ├── name_loc: (22,13)-(22,16) = "bar" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (22,4)-(22,12)) + │ │ ├── body: + │ │ │ @ CallNode (location: (22,5)-(22,11)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (22,5)-(22,8) = "foo" + │ │ │ ├── opening_loc: (22,8)-(22,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (22,9)-(22,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (22,9)-(22,10)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: (22,10)-(22,11) = ")" + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (22,4)-(22,5) = "(" + │ │ └── closing_loc: (22,11)-(22,12) = ")" + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (23,2)-(23,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (23,2)-(23,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (23,2)-(23,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: (22,12)-(22,13) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (24,0)-(24,3) = "end" + ├── @ DefNode (location: (26,0)-(28,3)) + │ ├── name: :bar + │ ├── name_loc: (26,19)-(26,22) = "bar" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (26,4)-(26,18)) + │ │ ├── body: + │ │ │ @ CallNode (location: (26,5)-(26,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ ConstantPathNode (location: (26,5)-(26,13)) + │ │ │ │ ├── parent: + │ │ │ │ │ @ ConstantReadNode (location: (26,5)-(26,8)) + │ │ │ │ │ └── name: :Foo + │ │ │ │ ├── child: + │ │ │ │ │ @ ConstantReadNode (location: (26,10)-(26,13)) + │ │ │ │ │ └── name: :Bar + │ │ │ │ └── delimiter_loc: (26,8)-(26,10) = "::" + │ │ │ ├── call_operator_loc: (26,13)-(26,14) = "." + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (26,14)-(26,17) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (26,4)-(26,5) = "(" + │ │ └── closing_loc: (26,17)-(26,18) = ")" + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (27,2)-(27,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (27,2)-(27,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (27,2)-(27,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (26,0)-(26,3) = "def" + │ ├── operator_loc: (26,18)-(26,19) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (28,0)-(28,3) = "end" + ├── @ DefNode (location: (30,0)-(32,3)) + │ ├── name: :bar + │ ├── name_loc: (30,15)-(30,18) = "bar" + │ ├── receiver: + │ │ @ ParenthesesNode (location: (30,4)-(30,14)) + │ │ ├── body: + │ │ │ @ ConstantPathNode (location: (30,5)-(30,13)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (30,5)-(30,8)) + │ │ │ │ └── name: :Foo + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (30,10)-(30,13)) + │ │ │ │ └── name: :Bar + │ │ │ └── delimiter_loc: (30,8)-(30,10) = "::" + │ │ ├── opening_loc: (30,4)-(30,5) = "(" + │ │ └── closing_loc: (30,13)-(30,14) = ")" + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (31,2)-(31,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (31,2)-(31,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (31,2)-(31,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (30,0)-(30,3) = "def" + │ ├── operator_loc: (30,14)-(30,15) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (32,0)-(32,3) = "end" + ├── @ DefNode (location: (34,0)-(36,3)) + │ ├── name: :bar + │ ├── name_loc: (34,8)-(34,11) = "bar" + │ ├── receiver: + │ │ @ ConstantReadNode (location: (34,4)-(34,7)) + │ │ └── name: :Foo + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (35,2)-(35,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (35,2)-(35,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (35,2)-(35,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (34,0)-(34,3) = "def" + │ ├── operator_loc: (34,7)-(34,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (36,0)-(36,3) = "end" + └── @ DefNode (location: (38,0)-(40,3)) + ├── name: :bar + ├── name_loc: (38,8)-(38,11) = "bar" + ├── receiver: + │ @ CallNode (location: (38,4)-(38,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (38,4)-(38,7) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (39,2)-(39,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (39,2)-(39,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :baz + │ ├── message_loc: (39,2)-(39,5) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (38,0)-(38,3) = "def" + ├── operator_loc: (38,7)-(38,8) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (40,0)-(40,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/dstr.txt b/test/mri/prism/snapshots/unparser/corpus/literal/dstr.txt new file mode 100644 index 00000000000..2f8e5da65ae --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/dstr.txt @@ -0,0 +1,341 @@ +@ ProgramNode (location: (1,0)-(37,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(37,1)) + └── body: (length: 11) + ├── @ IfNode (location: (1,0)-(3,3)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (1,3)-(1,7)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,8)) + │ │ └── body: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (2,2)-(2,8)) + │ │ ├── opening_loc: (2,2)-(2,3) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ EmbeddedStatementsNode (location: (2,3)-(2,6)) + │ │ │ │ ├── opening_loc: (2,3)-(2,5) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (2,5)-(2,6) = "}" + │ │ │ └── @ StringNode (location: (2,6)-(2,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,6)-(2,7) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── closing_loc: (2,7)-(2,8) = "\"" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ IfNode (location: (4,0)-(11,3)) + │ ├── if_keyword_loc: (4,0)-(4,2) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (4,3)-(4,7)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(10,3)) + │ │ └── body: (length: 2) + │ │ ├── @ InterpolatedStringNode (location: (5,2)-(5,12)) + │ │ │ ├── opening_loc: (5,2)-(5,12) = "<<-HEREDOC" + │ │ │ ├── parts: (length: 3) + │ │ │ │ ├── @ StringNode (location: (6,0)-(7,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (6,0)-(7,0) = "a\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a\n" + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (7,0)-(7,3)) + │ │ │ │ │ ├── opening_loc: (7,0)-(7,2) = "\#{" + │ │ │ │ │ ├── statements: ∅ + │ │ │ │ │ └── closing_loc: (7,2)-(7,3) = "}" + │ │ │ │ └── @ StringNode (location: (7,3)-(9,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (7,3)-(9,0) = "a\nb\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "a\nb\n" + │ │ │ └── closing_loc: (9,0)-(10,0) = " HEREDOC\n" + │ │ └── @ CallNode (location: (10,2)-(10,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :x + │ │ ├── message_loc: (10,2)-(10,3) = "x" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ InterpolatedStringNode (location: (12,0)-(12,10)) + │ ├── opening_loc: (12,0)-(12,10) = "<<-HEREDOC" + │ ├── parts: (length: 7) + │ │ ├── @ StringNode (location: (13,0)-(14,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (13,0)-(14,0) = "\\\#{}\\\#{}\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\#{}\#{}\n" + │ │ ├── @ EmbeddedStatementsNode (location: (14,0)-(14,3)) + │ │ │ ├── opening_loc: (14,0)-(14,2) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (14,2)-(14,3) = "}" + │ │ ├── @ StringNode (location: (14,3)-(15,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (14,3)-(15,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ EmbeddedStatementsNode (location: (15,0)-(15,3)) + │ │ │ ├── opening_loc: (15,0)-(15,2) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (15,2)-(15,3) = "}" + │ │ ├── @ StringNode (location: (15,3)-(16,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (15,3)-(16,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ EmbeddedStatementsNode (location: (16,0)-(16,3)) + │ │ │ ├── opening_loc: (16,0)-(16,2) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (16,2)-(16,3) = "}" + │ │ └── @ StringNode (location: (16,3)-(17,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (16,3)-(17,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (17,0)-(18,0) = "HEREDOC\n" + ├── @ RescueModifierNode (location: (18,0)-(18,21)) + │ ├── expression: + │ │ @ InterpolatedStringNode (location: (18,0)-(18,10)) + │ │ ├── opening_loc: (18,0)-(18,10) = "<<-HEREDOC" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ EmbeddedStatementsNode (location: (19,0)-(19,3)) + │ │ │ │ ├── opening_loc: (19,0)-(19,2) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (19,2)-(19,3) = "}" + │ │ │ └── @ StringNode (location: (19,3)-(21,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (19,3)-(21,0) = "\na\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\na\n" + │ │ └── closing_loc: (21,0)-(22,0) = "HEREDOC\n" + │ ├── keyword_loc: (18,11)-(18,17) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (18,18)-(18,21)) + ├── @ InterpolatedStringNode (location: (22,0)-(22,6)) + │ ├── opening_loc: (22,0)-(22,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (22,1)-(22,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (22,1)-(22,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ EmbeddedVariableNode (location: (22,2)-(22,5)) + │ │ ├── operator_loc: (22,2)-(22,3) = "#" + │ │ └── variable: + │ │ @ NumberedReferenceReadNode (location: (22,3)-(22,5)) + │ │ └── number: 1 + │ └── closing_loc: (22,5)-(22,6) = "\"" + ├── @ InterpolatedStringNode (location: (23,0)-(23,6)) + │ ├── opening_loc: (23,0)-(23,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (23,1)-(23,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (23,1)-(23,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ EmbeddedVariableNode (location: (23,2)-(23,5)) + │ │ ├── operator_loc: (23,2)-(23,3) = "#" + │ │ └── variable: + │ │ @ GlobalVariableReadNode (location: (23,3)-(23,5)) + │ │ └── name: :$a + │ └── closing_loc: (23,5)-(23,6) = "\"" + ├── @ InterpolatedStringNode (location: (24,0)-(24,6)) + │ ├── opening_loc: (24,0)-(24,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (24,1)-(24,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (24,1)-(24,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ EmbeddedVariableNode (location: (24,2)-(24,5)) + │ │ ├── operator_loc: (24,2)-(24,3) = "#" + │ │ └── variable: + │ │ @ InstanceVariableReadNode (location: (24,3)-(24,5)) + │ │ └── name: :@a + │ └── closing_loc: (24,5)-(24,6) = "\"" + ├── @ InterpolatedStringNode (location: (25,0)-(25,7)) + │ ├── opening_loc: (25,0)-(25,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (25,1)-(25,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (25,1)-(25,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ EmbeddedVariableNode (location: (25,2)-(25,6)) + │ │ ├── operator_loc: (25,2)-(25,3) = "#" + │ │ └── variable: + │ │ @ ClassVariableReadNode (location: (25,3)-(25,6)) + │ │ └── name: :@@a + │ └── closing_loc: (25,6)-(25,7) = "\"" + ├── @ IfNode (location: (26,0)-(30,3)) + │ ├── if_keyword_loc: (26,0)-(26,2) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (26,3)-(26,7)) + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (27,2)-(27,19)) + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (27,2)-(27,19)) + │ │ ├── keyword_loc: (27,2)-(27,8) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (27,9)-(27,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (27,9)-(27,19)) + │ │ ├── opening_loc: (27,9)-(27,19) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (28,0)-(28,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (28,0)-(28,4) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (28,4)-(28,9)) + │ │ │ │ ├── opening_loc: (28,4)-(28,6) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (28,6)-(28,8)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (28,6)-(28,8)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 42 + │ │ │ │ └── closing_loc: (28,8)-(28,9) = "}" + │ │ │ └── @ StringNode (location: (28,9)-(29,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (28,9)-(29,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (29,0)-(30,0) = " HEREDOC\n" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (30,0)-(30,3) = "end" + ├── @ CallNode (location: (31,0)-(31,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (31,0)-(31,3) = "foo" + │ ├── opening_loc: (31,3)-(31,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,4)-(31,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (31,4)-(31,14)) + │ │ ├── opening_loc: (31,4)-(31,14) = "<<-HEREDOC" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ StringNode (location: (32,0)-(32,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (32,0)-(32,2) = " " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " " + │ │ │ ├── @ EmbeddedStatementsNode (location: (32,2)-(32,8)) + │ │ │ │ ├── opening_loc: (32,2)-(32,4) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (32,4)-(32,7)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (32,4)-(32,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :bar + │ │ │ │ │ ├── message_loc: (32,4)-(32,7) = "bar" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── closing_loc: (32,7)-(32,8) = "}" + │ │ │ └── @ StringNode (location: (32,8)-(33,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (32,8)-(33,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── closing_loc: (33,0)-(34,0) = "HEREDOC\n" + │ ├── closing_loc: (31,14)-(31,15) = ")" + │ └── block: ∅ + └── @ CallNode (location: (34,0)-(37,1)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (34,0)-(34,3) = "foo" + ├── opening_loc: (34,3)-(34,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (34,4)-(34,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InterpolatedStringNode (location: (34,4)-(34,14)) + │ ├── opening_loc: (34,4)-(34,14) = "<<-HEREDOC" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (35,0)-(35,2)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (35,0)-(35,2) = " " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " " + │ │ ├── @ EmbeddedStatementsNode (location: (35,2)-(35,8)) + │ │ │ ├── opening_loc: (35,2)-(35,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (35,4)-(35,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (35,4)-(35,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (35,4)-(35,7) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (35,7)-(35,8) = "}" + │ │ └── @ StringNode (location: (35,8)-(36,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (35,8)-(36,0) = "\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\n" + │ └── closing_loc: (36,0)-(37,0) = "HEREDOC\n" + ├── closing_loc: (34,14)-(34,15) = ")" + └── block: + @ BlockNode (location: (34,16)-(37,1)) + ├── locals: [:x] + ├── parameters: + │ @ BlockParametersNode (location: (34,18)-(34,21)) + │ ├── parameters: + │ │ @ ParametersNode (location: (34,19)-(34,20)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (34,19)-(34,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (34,18)-(34,19) = "|" + │ └── closing_loc: (34,20)-(34,21) = "|" + ├── body: ∅ + ├── opening_loc: (34,16)-(34,17) = "{" + └── closing_loc: (37,0)-(37,1) = "}" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/empty.txt b/test/mri/prism/snapshots/unparser/corpus/literal/empty.txt new file mode 100644 index 00000000000..3a21ce5559c --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/empty.txt @@ -0,0 +1,5 @@ +@ ProgramNode (location: (1,0)-(1,0)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,0)) + └── body: (length: 0) diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/empty_begin.txt b/test/mri/prism/snapshots/unparser/corpus/literal/empty_begin.txt new file mode 100644 index 00000000000..838b4bf6f04 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/empty_begin.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ ParenthesesNode (location: (1,0)-(1,2)) + ├── body: ∅ + ├── opening_loc: (1,0)-(1,1) = "(" + └── closing_loc: (1,1)-(1,2) = ")" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/flipflop.txt b/test/mri/prism/snapshots/unparser/corpus/literal/flipflop.txt new file mode 100644 index 00000000000..2794e0534f2 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/flipflop.txt @@ -0,0 +1,193 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(3,3)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ ParenthesesNode (location: (1,3)-(1,23)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,4)-(1,22)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ FlipFlopNode (location: (1,4)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── left: + │ │ │ │ @ ParenthesesNode (location: (1,4)-(1,12)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (1,5)-(1,11)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,5)-(1,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── receiver: + │ │ │ │ │ │ @ CallNode (location: (1,5)-(1,6)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :i + │ │ │ │ │ │ ├── message_loc: (1,5)-(1,6) = "i" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :== + │ │ │ │ │ ├── message_loc: (1,7)-(1,9) = "==" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: + │ │ │ │ │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 4 + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ ├── right: + │ │ │ │ @ ParenthesesNode (location: (1,14)-(1,22)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (1,15)-(1,21)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,15)-(1,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── receiver: + │ │ │ │ │ │ @ CallNode (location: (1,15)-(1,16)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :i + │ │ │ │ │ │ ├── message_loc: (1,15)-(1,16) = "i" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :== + │ │ │ │ │ ├── message_loc: (1,17)-(1,19) = "==" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: + │ │ │ │ │ │ @ ArgumentsNode (location: (1,20)-(1,21)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ │ └── @ IntegerNode (location: (1,20)-(1,21)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 4 + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── opening_loc: (1,14)-(1,15) = "(" + │ │ │ │ └── closing_loc: (1,21)-(1,22) = ")" + │ │ │ └── operator_loc: (1,12)-(1,14) = ".." + │ │ ├── opening_loc: (1,3)-(1,4) = "(" + │ │ └── closing_loc: (1,22)-(1,23) = ")" + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (2,2)-(2,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ IfNode (location: (4,0)-(6,3)) + ├── if_keyword_loc: (4,0)-(4,2) = "if" + ├── predicate: + │ @ ParenthesesNode (location: (4,3)-(4,24)) + │ ├── body: + │ │ @ StatementsNode (location: (4,4)-(4,23)) + │ │ └── body: (length: 1) + │ │ └── @ FlipFlopNode (location: (4,4)-(4,23)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ ParenthesesNode (location: (4,4)-(4,12)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (4,5)-(4,11)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (4,5)-(4,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (4,5)-(4,6)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :i + │ │ │ │ │ ├── message_loc: (4,5)-(4,6) = "i" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :== + │ │ │ │ ├── message_loc: (4,7)-(4,9) = "==" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (4,10)-(4,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (4,10)-(4,11)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 4 + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (4,4)-(4,5) = "(" + │ │ │ └── closing_loc: (4,11)-(4,12) = ")" + │ │ ├── right: + │ │ │ @ ParenthesesNode (location: (4,15)-(4,23)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (4,16)-(4,22)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (4,16)-(4,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ CallNode (location: (4,16)-(4,17)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :i + │ │ │ │ │ ├── message_loc: (4,16)-(4,17) = "i" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :== + │ │ │ │ ├── message_loc: (4,18)-(4,20) = "==" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (4,21)-(4,22)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (4,21)-(4,22)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 4 + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (4,15)-(4,16) = "(" + │ │ │ └── closing_loc: (4,22)-(4,23) = ")" + │ │ └── operator_loc: (4,12)-(4,15) = "..." + │ ├── opening_loc: (4,3)-(4,4) = "(" + │ └── closing_loc: (4,23)-(4,24) = ")" + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (5,2)-(5,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (5,2)-(5,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,2)-(5,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/for.txt b/test/mri/prism/snapshots/unparser/corpus/literal/for.txt new file mode 100644 index 00000000000..660c6b73f3f --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/for.txt @@ -0,0 +1,171 @@ +@ ProgramNode (location: (1,0)-(12,3)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(12,3)) + └── body: (length: 4) + ├── @ CallNode (location: (1,0)-(3,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,0)-(1,3) = "bar" + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(3,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForNode (location: (1,4)-(3,3)) + │ │ ├── index: + │ │ │ @ LocalVariableTargetNode (location: (1,8)-(1,9)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── collection: + │ │ │ @ CallNode (location: (1,13)-(1,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,13)-(1,16) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (2,2)-(2,5) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── for_keyword_loc: (1,4)-(1,7) = "for" + │ │ ├── in_keyword_loc: (1,10)-(1,12) = "in" + │ │ ├── do_keyword_loc: (1,17)-(1,19) = "do" + │ │ └── end_keyword_loc: (3,0)-(3,3) = "end" + │ ├── closing_loc: (3,3)-(3,4) = ")" + │ └── block: ∅ + ├── @ ForNode (location: (4,0)-(6,3)) + │ ├── index: + │ │ @ LocalVariableTargetNode (location: (4,4)-(4,5)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── collection: + │ │ @ CallNode (location: (4,9)-(4,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (4,9)-(4,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,2)-(5,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (5,2)-(5,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── for_keyword_loc: (4,0)-(4,3) = "for" + │ ├── in_keyword_loc: (4,6)-(4,8) = "in" + │ ├── do_keyword_loc: (4,13)-(4,15) = "do" + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── @ ForNode (location: (7,0)-(9,3)) + │ ├── index: + │ │ @ MultiTargetNode (location: (7,4)-(7,11)) + │ │ ├── lefts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (7,5)-(7,6)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (7,8)-(7,10)) + │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (7,9)-(7,10)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: (7,4)-(7,5) = "(" + │ │ └── rparen_loc: (7,10)-(7,11) = ")" + │ ├── collection: + │ │ @ CallNode (location: (7,15)-(7,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (7,15)-(7,18) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (8,2)-(8,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (8,2)-(8,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (8,2)-(8,5) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── for_keyword_loc: (7,0)-(7,3) = "for" + │ ├── in_keyword_loc: (7,12)-(7,14) = "in" + │ ├── do_keyword_loc: (7,19)-(7,21) = "do" + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + └── @ ForNode (location: (10,0)-(12,3)) + ├── index: + │ @ MultiTargetNode (location: (10,4)-(10,10)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (10,5)-(10,6)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (10,8)-(10,9)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (10,4)-(10,5) = "(" + │ └── rparen_loc: (10,9)-(10,10) = ")" + ├── collection: + │ @ CallNode (location: (10,14)-(10,17)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (10,14)-(10,17) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── statements: + │ @ StatementsNode (location: (11,2)-(11,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (11,2)-(11,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :baz + │ ├── message_loc: (11,2)-(11,5) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── for_keyword_loc: (10,0)-(10,3) = "for" + ├── in_keyword_loc: (10,11)-(10,13) = "in" + ├── do_keyword_loc: (10,18)-(10,20) = "do" + └── end_keyword_loc: (12,0)-(12,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/hookexe.txt b/test/mri/prism/snapshots/unparser/corpus/literal/hookexe.txt new file mode 100644 index 00000000000..dabedbc5885 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/hookexe.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(7,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,1)) + └── body: (length: 3) + ├── @ PreExecutionNode (location: (1,0)-(3,1)) + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (2,2)-(2,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,0)-(1,5) = "BEGIN" + │ ├── opening_loc: (1,6)-(1,7) = "{" + │ └── closing_loc: (3,0)-(3,1) = "}" + ├── @ CallNode (location: (4,0)-(4,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (4,0)-(4,3) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ PostExecutionNode (location: (5,0)-(7,1)) + ├── statements: + │ @ StatementsNode (location: (6,2)-(6,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (6,2)-(6,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :baz + │ ├── message_loc: (6,2)-(6,5) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── keyword_loc: (5,0)-(5,3) = "END" + ├── opening_loc: (5,4)-(5,5) = "{" + └── closing_loc: (7,0)-(7,1) = "}" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/if.txt b/test/mri/prism/snapshots/unparser/corpus/literal/if.txt new file mode 100644 index 00000000000..00eeba179c6 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/if.txt @@ -0,0 +1,288 @@ +@ ProgramNode (location: (1,0)-(36,3)) +├── locals: [:foo, :pair] +└── statements: + @ StatementsNode (location: (1,0)-(36,3)) + └── body: (length: 10) + ├── @ IfNode (location: (1,0)-(3,3)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ MatchLastLineNode (location: (1,3)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,3)-(1,4) = "/" + │ │ ├── content_loc: (1,4)-(1,7) = "foo" + │ │ ├── closing_loc: (1,7)-(1,8) = "/" + │ │ └── unescaped: "foo" + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (2,2)-(2,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ IfNode (location: (4,0)-(6,3)) + │ ├── if_keyword_loc: (4,0)-(4,2) = "if" + │ ├── predicate: + │ │ @ IntegerNode (location: (4,3)-(4,4)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (5,2)-(5,3)) + │ │ ├── flags: decimal + │ │ └── value: 9 + │ ├── consequent: ∅ + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── @ IfNode (location: (7,0)-(11,3)) + │ ├── if_keyword_loc: (7,0)-(7,2) = "if" + │ ├── predicate: + │ │ @ IntegerNode (location: (7,3)-(7,4)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (8,2)-(8,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (8,2)-(8,3)) + │ │ ├── flags: decimal + │ │ └── value: 5 + │ ├── consequent: + │ │ @ ElseNode (location: (9,0)-(11,3)) + │ │ ├── else_keyword_loc: (9,0)-(9,4) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (10,2)-(10,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (10,2)-(10,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 6 + │ │ └── end_keyword_loc: (11,0)-(11,3) = "end" + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ UnlessNode (location: (12,0)-(14,3)) + │ ├── keyword_loc: (12,0)-(12,6) = "unless" + │ ├── predicate: + │ │ @ IntegerNode (location: (12,7)-(12,8)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (13,2)-(13,5)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (13,2)-(13,5)) + │ ├── consequent: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ UnlessNode (location: (15,0)-(17,3)) + │ ├── keyword_loc: (15,0)-(15,6) = "unless" + │ ├── predicate: + │ │ @ IntegerNode (location: (15,7)-(15,8)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (16,2)-(16,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (16,2)-(16,3)) + │ │ ├── flags: decimal + │ │ └── value: 9 + │ ├── consequent: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ IfNode (location: (18,0)-(19,3)) + │ ├── if_keyword_loc: (18,0)-(18,2) = "if" + │ ├── predicate: + │ │ @ CallNode (location: (18,3)-(18,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (18,3)-(18,6) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ ModuleNode (location: (21,0)-(23,3)) + │ ├── locals: [:foo] + │ ├── module_keyword_loc: (21,0)-(21,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (21,7)-(21,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (22,2)-(22,18)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (22,2)-(22,18)) + │ │ ├── if_keyword_loc: (22,12)-(22,14) = "if" + │ │ ├── predicate: + │ │ │ @ LocalVariableReadNode (location: (22,15)-(22,18)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (22,2)-(22,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (22,2)-(22,11)) + │ │ │ ├── name: :foo + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (22,2)-(22,5) = "foo" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (22,8)-(22,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (22,8)-(22,11) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (22,6)-(22,7) = "=" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── end_keyword_loc: (23,0)-(23,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (25,0)-(27,3)) + │ ├── locals: [:foo] + │ ├── module_keyword_loc: (25,0)-(25,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (25,7)-(25,8)) + │ │ └── name: :B + │ ├── body: + │ │ @ StatementsNode (location: (26,2)-(26,22)) + │ │ └── body: (length: 1) + │ │ └── @ UnlessNode (location: (26,2)-(26,22)) + │ │ ├── keyword_loc: (26,12)-(26,18) = "unless" + │ │ ├── predicate: + │ │ │ @ LocalVariableReadNode (location: (26,19)-(26,22)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (26,2)-(26,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (26,2)-(26,11)) + │ │ │ ├── name: :foo + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (26,2)-(26,5) = "foo" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (26,8)-(26,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (26,8)-(26,11) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (26,6)-(26,7) = "=" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── end_keyword_loc: (27,0)-(27,3) = "end" + │ └── name: :B + ├── @ UnlessNode (location: (28,0)-(30,3)) + │ ├── keyword_loc: (28,0)-(28,6) = "unless" + │ ├── predicate: + │ │ @ CallNode (location: (28,7)-(28,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (28,7)-(28,10) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (29,2)-(29,11)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (29,2)-(29,11)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (29,2)-(29,5) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (29,8)-(29,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (29,8)-(29,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (29,6)-(29,7) = "=" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (30,0)-(30,3) = "end" + └── @ IfNode (location: (31,0)-(36,3)) + ├── if_keyword_loc: (31,0)-(31,2) = "if" + ├── predicate: + │ @ CallNode (location: (31,3)-(33,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (31,3)-(31,6) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (31,7)-(33,1)) + │ ├── locals: [:pair] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (31,9)-(31,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (31,10)-(31,14)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (31,10)-(31,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :pair + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (31,9)-(31,10) = "|" + │ │ └── closing_loc: (31,14)-(31,15) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (32,2)-(32,6)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (32,2)-(32,6)) + │ │ ├── name: :pair + │ │ └── depth: 0 + │ ├── opening_loc: (31,7)-(31,8) = "{" + │ └── closing_loc: (33,0)-(33,1) = "}" + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (34,2)-(35,5)) + │ └── body: (length: 2) + │ ├── @ LocalVariableWriteNode (location: (34,2)-(34,13)) + │ │ ├── name: :pair + │ │ ├── depth: 0 + │ │ ├── name_loc: (34,2)-(34,6) = "pair" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (34,9)-(34,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (34,9)-(34,10) = ":" + │ │ │ ├── value_loc: (34,10)-(34,13) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── operator_loc: (34,7)-(34,8) = "=" + │ └── @ LocalVariableReadNode (location: (35,2)-(35,5)) + │ ├── name: :foo + │ └── depth: 0 + ├── consequent: ∅ + └── end_keyword_loc: (36,0)-(36,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/kwbegin.txt b/test/mri/prism/snapshots/unparser/corpus/literal/kwbegin.txt new file mode 100644 index 00000000000..48e53af00e4 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/kwbegin.txt @@ -0,0 +1,491 @@ +@ ProgramNode (location: (1,0)-(80,3)) +├── locals: [:foo, :bar, :exception] +└── statements: + @ StatementsNode (location: (1,0)-(80,3)) + └── body: (length: 14) + ├── @ BeginNode (location: (1,0)-(3,3)) + │ ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (2,0)-(2,6)) + │ │ ├── keyword_loc: (2,0)-(2,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ BeginNode (location: (5,0)-(7,3)) + │ ├── begin_keyword_loc: (5,0)-(5,5) = "begin" + │ ├── statements: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (6,0)-(7,3)) + │ │ ├── ensure_keyword_loc: (6,0)-(6,6) = "ensure" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (7,0)-(7,3) = "end" + │ └── end_keyword_loc: (7,0)-(7,3) = "end" + ├── @ BeginNode (location: (9,0)-(11,3)) + │ ├── begin_keyword_loc: (9,0)-(9,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (10,2)-(10,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (10,2)-(10,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (10,2)-(10,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ BeginNode (location: (13,0)-(17,3)) + │ ├── begin_keyword_loc: (13,0)-(13,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (14,2)-(14,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (14,2)-(14,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (14,2)-(14,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (15,0)-(16,3)) + │ │ ├── keyword_loc: (15,0)-(15,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (16,2)-(16,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (16,2)-(16,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (16,2)-(16,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ BeginNode (location: (19,0)-(24,3)) + │ ├── begin_keyword_loc: (19,0)-(19,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (20,2)-(21,3)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (20,2)-(20,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (20,2)-(20,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (21,2)-(21,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (21,2)-(21,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (22,0)-(23,3)) + │ │ ├── keyword_loc: (22,0)-(22,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (23,2)-(23,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (23,2)-(23,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (23,2)-(23,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (24,0)-(24,3) = "end" + ├── @ BeginNode (location: (26,0)-(28,3)) + │ ├── begin_keyword_loc: (26,0)-(26,5) = "begin" + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (27,0)-(27,8)) + │ │ ├── keyword_loc: (27,0)-(27,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (27,7)-(27,8)) + │ │ │ └── name: :A + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (28,0)-(28,3) = "end" + ├── @ BeginNode (location: (30,0)-(32,3)) + │ ├── begin_keyword_loc: (30,0)-(30,5) = "begin" + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (31,0)-(31,15)) + │ │ ├── keyword_loc: (31,0)-(31,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (31,7)-(31,8)) + │ │ │ └── name: :A + │ │ ├── operator_loc: (31,9)-(31,11) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (31,12)-(31,15)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (32,0)-(32,3) = "end" + ├── @ BeginNode (location: (34,0)-(42,3)) + │ ├── begin_keyword_loc: (34,0)-(34,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (35,2)-(35,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (35,2)-(35,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (35,2)-(35,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (36,0)-(39,3)) + │ │ ├── keyword_loc: (36,0)-(36,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (36,7)-(36,8)) + │ │ │ └── name: :A + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (37,2)-(37,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (37,2)-(37,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (37,2)-(37,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: + │ │ @ RescueNode (location: (38,0)-(39,3)) + │ │ ├── keyword_loc: (38,0)-(38,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (38,7)-(38,8)) + │ │ │ └── name: :B + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (39,2)-(39,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (39,2)-(39,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (39,2)-(39,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: + │ │ @ EnsureNode (location: (40,0)-(42,3)) + │ │ ├── ensure_keyword_loc: (40,0)-(40,6) = "ensure" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (41,2)-(41,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (41,2)-(41,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (41,2)-(41,3) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (42,0)-(42,3) = "end" + │ └── end_keyword_loc: (42,0)-(42,3) = "end" + ├── @ BeginNode (location: (44,0)-(53,3)) + │ ├── begin_keyword_loc: (44,0)-(44,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (45,2)-(49,5)) + │ │ └── body: (length: 1) + │ │ └── @ BeginNode (location: (45,2)-(49,5)) + │ │ ├── begin_keyword_loc: (45,2)-(45,7) = "begin" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (46,4)-(47,7)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ LocalVariableReadNode (location: (46,4)-(46,7)) + │ │ │ │ ├── name: :foo + │ │ │ │ └── depth: 0 + │ │ │ └── @ CallNode (location: (47,4)-(47,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (47,4)-(47,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (48,2)-(48,8)) + │ │ │ ├── keyword_loc: (48,2)-(48,8) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (49,2)-(49,5) = "end" + │ ├── rescue_clause: + │ │ @ RescueNode (location: (50,0)-(52,5)) + │ │ ├── keyword_loc: (50,0)-(50,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (51,2)-(52,5)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ CallNode (location: (51,2)-(51,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (51,2)-(51,5) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ CallNode (location: (52,2)-(52,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (52,2)-(52,5) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (53,0)-(53,3) = "end" + ├── @ BeginNode (location: (55,0)-(58,3)) + │ ├── begin_keyword_loc: (55,0)-(55,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (56,2)-(56,35)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (56,2)-(56,35)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (56,2)-(56,18)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (56,2)-(56,7) = "raise" + │ │ │ ├── opening_loc: (56,7)-(56,8) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (56,8)-(56,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (56,8)-(56,17)) + │ │ │ │ └── name: :Exception + │ │ │ ├── closing_loc: (56,17)-(56,18) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (56,19)-(56,25) = "rescue" + │ │ └── rescue_expression: + │ │ @ LocalVariableWriteNode (location: (56,26)-(56,35)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (56,26)-(56,29) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (56,32)-(56,35)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (56,32)-(56,35) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (56,30)-(56,31) = "=" + │ ├── rescue_clause: + │ │ @ RescueNode (location: (57,0)-(57,16)) + │ │ ├── keyword_loc: (57,0)-(57,6) = "rescue" + │ │ ├── exceptions: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (57,7)-(57,16)) + │ │ │ └── name: :Exception + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (58,0)-(58,3) = "end" + ├── @ BeginNode (location: (60,0)-(64,3)) + │ ├── begin_keyword_loc: (60,0)-(60,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (61,2)-(61,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (61,2)-(61,5)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rescue_clause: + │ │ @ RescueNode (location: (62,0)-(63,5)) + │ │ ├── keyword_loc: (62,0)-(62,6) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: (62,7)-(62,9) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (62,10)-(62,13)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (63,2)-(63,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (63,2)-(63,5)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (64,0)-(64,3) = "end" + ├── @ BeginNode (location: (66,0)-(70,3)) + │ ├── begin_keyword_loc: (66,0)-(66,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (67,2)-(67,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (67,2)-(67,5)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rescue_clause: + │ │ @ RescueNode (location: (68,0)-(69,5)) + │ │ ├── keyword_loc: (68,0)-(68,6) = "rescue" + │ │ ├── exceptions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (68,7)-(68,16)) + │ │ │ │ └── name: :Exception + │ │ │ └── @ ConstantReadNode (location: (68,18)-(68,23)) + │ │ │ └── name: :Other + │ │ ├── operator_loc: (68,24)-(68,26) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (68,27)-(68,30)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (69,2)-(69,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (69,2)-(69,5)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (70,0)-(70,3) = "end" + ├── @ BeginNode (location: (72,0)-(76,3)) + │ ├── begin_keyword_loc: (72,0)-(72,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (73,2)-(73,5)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (73,2)-(73,5)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── rescue_clause: + │ │ @ RescueNode (location: (74,0)-(75,5)) + │ │ ├── keyword_loc: (74,0)-(74,6) = "rescue" + │ │ ├── exceptions: (length: 2) + │ │ │ ├── @ ConstantReadNode (location: (74,7)-(74,16)) + │ │ │ │ └── name: :SomeError + │ │ │ └── @ SplatNode (location: (74,18)-(74,22)) + │ │ │ ├── operator_loc: (74,18)-(74,19) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableReadNode (location: (74,19)-(74,22)) + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── operator_loc: (74,23)-(74,25) = "=>" + │ │ ├── reference: + │ │ │ @ LocalVariableTargetNode (location: (74,26)-(74,35)) + │ │ │ ├── name: :exception + │ │ │ └── depth: 0 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (75,2)-(75,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (75,2)-(75,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (75,2)-(75,5) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (76,0)-(76,3) = "end" + └── @ SingletonClassNode (location: (78,0)-(80,3)) + ├── locals: [] + ├── class_keyword_loc: (78,0)-(78,5) = "class" + ├── operator_loc: (78,6)-(78,8) = "<<" + ├── expression: + │ @ SelfNode (location: (78,9)-(78,13)) + ├── body: + │ @ StatementsNode (location: (79,2)-(79,23)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (79,2)-(79,23)) + │ ├── expression: + │ │ @ UndefNode (location: (79,2)-(79,12)) + │ │ ├── names: (length: 1) + │ │ │ └── @ SymbolNode (location: (79,8)-(79,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (79,8)-(79,9) = ":" + │ │ │ ├── value_loc: (79,9)-(79,12) = "bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bar" + │ │ └── keyword_loc: (79,2)-(79,7) = "undef" + │ ├── keyword_loc: (79,13)-(79,19) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (79,20)-(79,23)) + └── end_keyword_loc: (80,0)-(80,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/lambda.txt b/test/mri/prism/snapshots/unparser/corpus/literal/lambda.txt new file mode 100644 index 00000000000..3594787bcab --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/lambda.txt @@ -0,0 +1,151 @@ +@ ProgramNode (location: (1,0)-(13,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,1)) + └── body: (length: 6) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :lambda + │ ├── message_loc: (1,0)-(1,6) = "lambda" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,7)-(2,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,7)-(1,8) = "{" + │ └── closing_loc: (2,0)-(2,1) = "}" + ├── @ CallNode (location: (3,0)-(5,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :lambda + │ ├── message_loc: (3,0)-(3,6) = "lambda" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,7)-(5,1)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (3,9)-(3,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (3,10)-(3,14)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (3,10)-(3,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (3,13)-(3,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (3,9)-(3,10) = "|" + │ │ └── closing_loc: (3,14)-(3,15) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (4,2)-(4,3)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (4,2)-(4,3)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── opening_loc: (3,7)-(3,8) = "{" + │ └── closing_loc: (5,0)-(5,1) = "}" + ├── @ LambdaNode (location: (6,0)-(7,1)) + │ ├── locals: [] + │ ├── operator_loc: (6,0)-(6,2) = "->" + │ ├── opening_loc: (6,5)-(6,6) = "{" + │ ├── closing_loc: (7,0)-(7,1) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (6,2)-(6,4)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (6,2)-(6,3) = "(" + │ │ └── closing_loc: (6,3)-(6,4) = ")" + │ └── body: ∅ + ├── @ LambdaNode (location: (8,0)-(9,1)) + │ ├── locals: [:a] + │ ├── operator_loc: (8,0)-(8,2) = "->" + │ ├── opening_loc: (8,6)-(8,7) = "{" + │ ├── closing_loc: (9,0)-(9,1) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (8,2)-(8,5)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (8,3)-(8,4)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (8,3)-(8,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (8,2)-(8,3) = "(" + │ │ └── closing_loc: (8,4)-(8,5) = ")" + │ └── body: ∅ + ├── @ LambdaNode (location: (10,0)-(11,1)) + │ ├── locals: [:a, :b] + │ ├── operator_loc: (10,0)-(10,2) = "->" + │ ├── opening_loc: (10,9)-(10,10) = "{" + │ ├── closing_loc: (11,0)-(11,1) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (10,2)-(10,8)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (10,3)-(10,7)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (10,3)-(10,4)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (10,6)-(10,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (10,2)-(10,3) = "(" + │ │ └── closing_loc: (10,7)-(10,8) = ")" + │ └── body: ∅ + └── @ LambdaNode (location: (12,0)-(13,1)) + ├── locals: [:a, :b, :c] + ├── operator_loc: (12,0)-(12,2) = "->" + ├── opening_loc: (12,12)-(12,13) = "{" + ├── closing_loc: (13,0)-(13,1) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (12,2)-(12,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (12,3)-(12,7)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (12,3)-(12,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ RequiredParameterNode (location: (12,6)-(12,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (12,9)-(12,10)) + │ │ ├── flags: ∅ + │ │ └── name: :c + │ ├── opening_loc: (12,2)-(12,3) = "(" + │ └── closing_loc: (12,10)-(12,11) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/literal.txt b/test/mri/prism/snapshots/unparser/corpus/literal/literal.txt new file mode 100644 index 00000000000..ba7dd70b5b7 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/literal.txt @@ -0,0 +1,1186 @@ +@ ProgramNode (location: (1,0)-(91,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(91,2)) + └── body: (length: 78) + ├── @ HashNode (location: (1,0)-(1,38)) + │ ├── opening_loc: (1,0)-(1,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (1,2)-(1,21)) + │ │ │ ├── key: + │ │ │ │ @ StringNode (location: (1,2)-(1,7)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ │ │ ├── content_loc: (1,3)-(1,6) = "foo" + │ │ │ │ ├── closing_loc: (1,6)-(1,7) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── value: + │ │ │ │ @ InterpolatedStringNode (location: (1,11)-(1,21)) + │ │ │ │ ├── opening_loc: (1,11)-(1,21) = "<<-HEREDOC" + │ │ │ │ ├── parts: (length: 3) + │ │ │ │ │ ├── @ StringNode (location: (2,0)-(2,2)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── content_loc: (2,0)-(2,2) = " " + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: " " + │ │ │ │ │ ├── @ EmbeddedStatementsNode (location: (2,2)-(2,5)) + │ │ │ │ │ │ ├── opening_loc: (2,2)-(2,4) = "\#{" + │ │ │ │ │ │ ├── statements: ∅ + │ │ │ │ │ │ └── closing_loc: (2,4)-(2,5) = "}" + │ │ │ │ │ └── @ StringNode (location: (2,5)-(3,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (2,5)-(3,0) = "\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "\n" + │ │ │ │ └── closing_loc: (3,0)-(4,0) = "HEREDOC\n" + │ │ │ └── operator_loc: (1,8)-(1,10) = "=>" + │ │ └── @ AssocNode (location: (1,23)-(1,36)) + │ │ ├── key: + │ │ │ @ StringNode (location: (1,23)-(1,28)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: (1,23)-(1,24) = "\"" + │ │ │ ├── content_loc: (1,24)-(1,27) = "bar" + │ │ │ ├── closing_loc: (1,27)-(1,28) = "\"" + │ │ │ └── unescaped: "bar" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (1,32)-(1,36)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,32)-(1,33) = ":" + │ │ │ ├── value_loc: (1,33)-(1,36) = "baz" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz" + │ │ └── operator_loc: (1,29)-(1,31) = "=>" + │ └── closing_loc: (1,37)-(1,38) = "}" + ├── @ HashNode (location: (4,0)-(4,31)) + │ ├── opening_loc: (4,0)-(4,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (4,2)-(4,14)) + │ │ │ ├── key: + │ │ │ │ @ StringNode (location: (4,2)-(4,7)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: (4,2)-(4,3) = "\"" + │ │ │ │ ├── content_loc: (4,3)-(4,6) = "foo" + │ │ │ │ ├── closing_loc: (4,6)-(4,7) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (4,11)-(4,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (4,11)-(4,13) = "%(" + │ │ │ │ ├── content_loc: (4,13)-(4,13) = "" + │ │ │ │ ├── closing_loc: (4,13)-(4,14) = ")" + │ │ │ │ └── unescaped: "" + │ │ │ └── operator_loc: (4,8)-(4,10) = "=>" + │ │ └── @ AssocNode (location: (4,16)-(4,29)) + │ │ ├── key: + │ │ │ @ StringNode (location: (4,16)-(4,21)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: (4,16)-(4,17) = "\"" + │ │ │ ├── content_loc: (4,17)-(4,20) = "bar" + │ │ │ ├── closing_loc: (4,20)-(4,21) = "\"" + │ │ │ └── unescaped: "bar" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (4,25)-(4,29)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (4,25)-(4,26) = ":" + │ │ │ ├── value_loc: (4,26)-(4,29) = "baz" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz" + │ │ └── operator_loc: (4,22)-(4,24) = "=>" + │ └── closing_loc: (4,30)-(4,31) = "}" + ├── @ ArrayNode (location: (5,0)-(5,12)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (5,1)-(5,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (5,1)-(5,2) = "\"" + │ │ │ ├── content_loc: (5,2)-(5,5) = "foo" + │ │ │ ├── closing_loc: (5,5)-(5,6) = "\"" + │ │ │ └── unescaped: "foo" + │ │ └── @ StringNode (location: (5,8)-(5,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (5,8)-(5,10) = "%(" + │ │ ├── content_loc: (5,10)-(5,10) = "" + │ │ ├── closing_loc: (5,10)-(5,11) = ")" + │ │ └── unescaped: "" + │ ├── opening_loc: (5,0)-(5,1) = "[" + │ └── closing_loc: (5,11)-(5,12) = "]" + ├── @ CallNode (location: (6,0)-(6,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (6,0)-(6,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (6,0)-(6,1) = "a" + │ │ ├── opening_loc: (6,1)-(6,2) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (6,2)-(6,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (6,2)-(6,12)) + │ │ │ ├── opening_loc: (6,2)-(6,12) = "<<-HEREDOC" + │ │ │ ├── parts: (length: 3) + │ │ │ │ ├── @ StringNode (location: (7,0)-(7,2)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (7,0)-(7,2) = " " + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: " " + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (7,2)-(7,5)) + │ │ │ │ │ ├── opening_loc: (7,2)-(7,4) = "\#{" + │ │ │ │ │ ├── statements: ∅ + │ │ │ │ │ └── closing_loc: (7,4)-(7,5) = "}" + │ │ │ │ └── @ StringNode (location: (7,5)-(8,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (7,5)-(8,0) = "\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "\n" + │ │ │ └── closing_loc: (8,0)-(9,0) = "HEREDOC\n" + │ │ ├── closing_loc: (6,12)-(6,13) = ")" + │ │ └── block: ∅ + │ ├── call_operator_loc: (6,13)-(6,14) = "." + │ ├── name: :a + │ ├── message_loc: (6,14)-(6,15) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (9,0)-(9,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (9,0)-(9,1) = "a" + │ │ ├── opening_loc: (9,1)-(9,2) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,2)-(9,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (9,2)-(9,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (9,2)-(9,4) = "%(" + │ │ │ ├── content_loc: (9,4)-(9,4) = "" + │ │ │ ├── closing_loc: (9,4)-(9,5) = ")" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: (9,5)-(9,6) = ")" + │ │ └── block: ∅ + │ ├── call_operator_loc: (9,6)-(9,7) = "." + │ ├── name: :a + │ ├── message_loc: (9,7)-(9,8) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ HashNode (location: (10,0)-(10,30)) + │ ├── opening_loc: (10,0)-(10,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (10,2)-(10,21)) + │ │ │ ├── key: + │ │ │ │ @ StringNode (location: (10,2)-(10,7)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: (10,2)-(10,3) = "\"" + │ │ │ │ ├── content_loc: (10,3)-(10,6) = "foo" + │ │ │ │ ├── closing_loc: (10,6)-(10,7) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── value: + │ │ │ │ @ InterpolatedStringNode (location: (10,11)-(10,21)) + │ │ │ │ ├── opening_loc: (10,11)-(10,21) = "<<-HEREDOC" + │ │ │ │ ├── parts: (length: 3) + │ │ │ │ │ ├── @ StringNode (location: (11,0)-(11,2)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── content_loc: (11,0)-(11,2) = " " + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: " " + │ │ │ │ │ ├── @ EmbeddedStatementsNode (location: (11,2)-(11,5)) + │ │ │ │ │ │ ├── opening_loc: (11,2)-(11,4) = "\#{" + │ │ │ │ │ │ ├── statements: ∅ + │ │ │ │ │ │ └── closing_loc: (11,4)-(11,5) = "}" + │ │ │ │ │ └── @ StringNode (location: (11,5)-(12,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (11,5)-(12,0) = "\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "\n" + │ │ │ │ └── closing_loc: (12,0)-(13,0) = "HEREDOC\n" + │ │ │ └── operator_loc: (10,8)-(10,10) = "=>" + │ │ └── @ AssocSplatNode (location: (10,23)-(10,28)) + │ │ ├── value: + │ │ │ @ CallNode (location: (10,25)-(10,28)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (10,25)-(10,28) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (10,23)-(10,25) = "**" + │ └── closing_loc: (10,29)-(10,30) = "}" + ├── @ HashNode (location: (13,0)-(13,23)) + │ ├── opening_loc: (13,0)-(13,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (13,2)-(13,14)) + │ │ │ ├── key: + │ │ │ │ @ StringNode (location: (13,2)-(13,7)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: (13,2)-(13,3) = "\"" + │ │ │ │ ├── content_loc: (13,3)-(13,6) = "foo" + │ │ │ │ ├── closing_loc: (13,6)-(13,7) = "\"" + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (13,11)-(13,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (13,11)-(13,13) = "%(" + │ │ │ │ ├── content_loc: (13,13)-(13,13) = "" + │ │ │ │ ├── closing_loc: (13,13)-(13,14) = ")" + │ │ │ │ └── unescaped: "" + │ │ │ └── operator_loc: (13,8)-(13,10) = "=>" + │ │ └── @ AssocSplatNode (location: (13,16)-(13,21)) + │ │ ├── value: + │ │ │ @ CallNode (location: (13,18)-(13,21)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (13,18)-(13,21) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (13,16)-(13,18) = "**" + │ └── closing_loc: (13,22)-(13,23) = "}" + ├── @ InterpolatedStringNode (location: (14,0)-(14,14)) + │ ├── opening_loc: (14,0)-(14,1) = "\"" + │ ├── parts: (length: 5) + │ │ ├── @ EmbeddedVariableNode (location: (14,1)-(14,4)) + │ │ │ ├── operator_loc: (14,1)-(14,2) = "#" + │ │ │ └── variable: + │ │ │ @ InstanceVariableReadNode (location: (14,2)-(14,4)) + │ │ │ └── name: :@a + │ │ ├── @ StringNode (location: (14,4)-(14,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (14,4)-(14,5) = " " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " " + │ │ ├── @ EmbeddedVariableNode (location: (14,5)-(14,9)) + │ │ │ ├── operator_loc: (14,5)-(14,6) = "#" + │ │ │ └── variable: + │ │ │ @ ClassVariableReadNode (location: (14,6)-(14,9)) + │ │ │ └── name: :@@a + │ │ ├── @ StringNode (location: (14,9)-(14,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (14,9)-(14,10) = " " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " " + │ │ └── @ EmbeddedVariableNode (location: (14,10)-(14,13)) + │ │ ├── operator_loc: (14,10)-(14,11) = "#" + │ │ └── variable: + │ │ @ GlobalVariableReadNode (location: (14,11)-(14,13)) + │ │ └── name: :$a + │ └── closing_loc: (14,13)-(14,14) = "\"" + ├── @ IntegerNode (location: (15,0)-(15,1)) + │ ├── flags: decimal + │ └── value: 0 + ├── @ CallNode (location: (16,0)-(16,3)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (16,1)-(16,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :+@ + │ ├── message_loc: (16,0)-(16,1) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ IntegerNode (location: (17,0)-(17,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ IntegerNode (location: (18,0)-(18,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ RationalNode (location: (19,0)-(19,2)) + │ └── numeric: + │ @ IntegerNode (location: (19,0)-(19,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ RationalNode (location: (20,0)-(20,4)) + │ └── numeric: + │ @ FloatNode (location: (20,0)-(20,3)) + │ └── value: 1.5 + ├── @ RationalNode (location: (21,0)-(21,4)) + │ └── numeric: + │ @ FloatNode (location: (21,0)-(21,3)) + │ └── value: 1.3 + ├── @ ImaginaryNode (location: (22,0)-(22,2)) + │ └── numeric: + │ @ IntegerNode (location: (22,0)-(22,1)) + │ ├── flags: decimal + │ └── value: 5 + ├── @ ImaginaryNode (location: (23,0)-(23,3)) + │ └── numeric: + │ @ IntegerNode (location: (23,0)-(23,2)) + │ ├── flags: decimal + │ └── value: -5 + ├── @ ImaginaryNode (location: (24,0)-(24,4)) + │ └── numeric: + │ @ FloatNode (location: (24,0)-(24,3)) + │ └── value: 0.6 + ├── @ ImaginaryNode (location: (25,0)-(25,5)) + │ └── numeric: + │ @ FloatNode (location: (25,0)-(25,4)) + │ └── value: -0.6 + ├── @ ImaginaryNode (location: (26,0)-(26,32)) + │ └── numeric: + │ @ IntegerNode (location: (26,0)-(26,31)) + │ ├── flags: decimal + │ └── value: 1000000000000000000000000000000 + ├── @ ImaginaryNode (location: (27,0)-(27,3)) + │ └── numeric: + │ @ RationalNode (location: (27,0)-(27,2)) + │ └── numeric: + │ @ IntegerNode (location: (27,0)-(27,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ InterpolatedStringNode (location: (28,0)-(28,11)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (28,0)-(28,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (28,0)-(28,1) = "\"" + │ │ │ ├── content_loc: (28,1)-(28,4) = "foo" + │ │ │ ├── closing_loc: (28,4)-(28,5) = "\"" + │ │ │ └── unescaped: "foo" + │ │ └── @ StringNode (location: (28,6)-(28,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (28,6)-(28,7) = "\"" + │ │ ├── content_loc: (28,7)-(28,10) = "bar" + │ │ ├── closing_loc: (28,10)-(28,11) = "\"" + │ │ └── unescaped: "bar" + │ └── closing_loc: ∅ + ├── @ InterpolatedStringNode (location: (29,0)-(29,15)) + │ ├── opening_loc: (29,0)-(29,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (29,1)-(29,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (29,1)-(29,8) = "foobar " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foobar " + │ │ └── @ EmbeddedStatementsNode (location: (29,8)-(29,14)) + │ │ ├── opening_loc: (29,8)-(29,10) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (29,10)-(29,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (29,10)-(29,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (29,10)-(29,13) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (29,13)-(29,14) = "}" + │ └── closing_loc: (29,14)-(29,15) = "\"" + ├── @ InterpolatedStringNode (location: (30,0)-(30,12)) + │ ├── opening_loc: (30,0)-(30,1) = "\"" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (30,1)-(30,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (30,1)-(30,4) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── @ EmbeddedStatementsNode (location: (30,4)-(30,8)) + │ │ │ ├── opening_loc: (30,4)-(30,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (30,6)-(30,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (30,6)-(30,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (30,7)-(30,8) = "}" + │ │ └── @ StringNode (location: (30,8)-(30,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (30,8)-(30,11) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── closing_loc: (30,11)-(30,12) = "\"" + ├── @ InterpolatedStringNode (location: (31,0)-(31,9)) + │ ├── opening_loc: (31,0)-(31,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (31,1)-(31,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (31,1)-(31,5) = "\\\\\\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\\\" + │ │ └── @ EmbeddedStatementsNode (location: (31,5)-(31,8)) + │ │ ├── opening_loc: (31,5)-(31,7) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (31,7)-(31,8) = "}" + │ └── closing_loc: (31,8)-(31,9) = "\"" + ├── @ InterpolatedStringNode (location: (32,0)-(32,9)) + │ ├── opening_loc: (32,0)-(32,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ EmbeddedStatementsNode (location: (32,1)-(32,4)) + │ │ │ ├── opening_loc: (32,1)-(32,3) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (32,3)-(32,4) = "}" + │ │ └── @ StringNode (location: (32,4)-(32,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (32,4)-(32,8) = "\\\#{}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\#{}" + │ └── closing_loc: (32,8)-(32,9) = "\"" + ├── @ InterpolatedStringNode (location: (33,0)-(33,9)) + │ ├── opening_loc: (33,0)-(33,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (33,1)-(33,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (33,1)-(33,5) = "\\\#{}" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\#{}" + │ │ └── @ EmbeddedStatementsNode (location: (33,5)-(33,8)) + │ │ ├── opening_loc: (33,5)-(33,7) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (33,7)-(33,8) = "}" + │ └── closing_loc: (33,8)-(33,9) = "\"" + ├── @ StringNode (location: (34,0)-(34,15)) + │ ├── flags: ∅ + │ ├── opening_loc: (34,0)-(34,1) = "\"" + │ ├── content_loc: (34,1)-(34,14) = "foo\\\\\\\#{@bar}" + │ ├── closing_loc: (34,14)-(34,15) = "\"" + │ └── unescaped: "foo\\\#{@bar}" + ├── @ StringNode (location: (35,0)-(35,4)) + │ ├── flags: ∅ + │ ├── opening_loc: (35,0)-(35,1) = "\"" + │ ├── content_loc: (35,1)-(35,3) = "\\\"" + │ ├── closing_loc: (35,3)-(35,4) = "\"" + │ └── unescaped: "\"" + ├── @ StringNode (location: (36,0)-(36,9)) + │ ├── flags: ∅ + │ ├── opening_loc: (36,0)-(36,1) = "\"" + │ ├── content_loc: (36,1)-(36,8) = "foo bar" + │ ├── closing_loc: (36,8)-(36,9) = "\"" + │ └── unescaped: "foo bar" + ├── @ StringNode (location: (37,0)-(37,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (37,0)-(37,1) = "\"" + │ ├── content_loc: (37,1)-(37,9) = "foo\\nbar" + │ ├── closing_loc: (37,9)-(37,10) = "\"" + │ └── unescaped: "foo\nbar" + ├── @ XStringNode (location: (38,0)-(38,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (38,0)-(38,1) = "`" + │ ├── content_loc: (38,1)-(38,4) = "foo" + │ ├── closing_loc: (38,4)-(38,5) = "`" + │ └── unescaped: "foo" + ├── @ InterpolatedXStringNode (location: (39,0)-(39,12)) + │ ├── opening_loc: (39,0)-(39,1) = "`" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (39,1)-(39,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (39,1)-(39,4) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ EmbeddedStatementsNode (location: (39,4)-(39,11)) + │ │ ├── opening_loc: (39,4)-(39,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (39,6)-(39,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ InstanceVariableReadNode (location: (39,6)-(39,10)) + │ │ │ └── name: :@bar + │ │ └── closing_loc: (39,10)-(39,11) = "}" + │ └── closing_loc: (39,11)-(39,12) = "`" + ├── @ XStringNode (location: (40,0)-(40,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (40,0)-(40,1) = "`" + │ ├── content_loc: (40,1)-(40,2) = ")" + │ ├── closing_loc: (40,2)-(40,3) = "`" + │ └── unescaped: ")" + ├── @ XStringNode (location: (41,0)-(41,4)) + │ ├── flags: ∅ + │ ├── opening_loc: (41,0)-(41,1) = "`" + │ ├── content_loc: (41,1)-(41,3) = "\\`" + │ ├── closing_loc: (41,3)-(41,4) = "`" + │ └── unescaped: "`" + ├── @ XStringNode (location: (42,0)-(42,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (42,0)-(42,1) = "`" + │ ├── content_loc: (42,1)-(42,2) = "\"" + │ ├── closing_loc: (42,2)-(42,3) = "`" + │ └── unescaped: "\"" + ├── @ SymbolNode (location: (43,0)-(43,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (43,0)-(43,1) = ":" + │ ├── value_loc: (43,1)-(43,4) = "foo" + │ ├── closing_loc: ∅ + │ └── unescaped: "foo" + ├── @ SymbolNode (location: (44,0)-(44,6)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (44,0)-(44,2) = ":\"" + │ ├── value_loc: (44,2)-(44,5) = "A B" + │ ├── closing_loc: (44,5)-(44,6) = "\"" + │ └── unescaped: "A B" + ├── @ SymbolNode (location: (45,0)-(45,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (45,0)-(45,1) = ":" + │ ├── value_loc: (45,1)-(45,4) = "foo" + │ ├── closing_loc: ∅ + │ └── unescaped: "foo" + ├── @ SymbolNode (location: (46,0)-(46,6)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (46,0)-(46,2) = ":\"" + │ ├── value_loc: (46,2)-(46,5) = "A B" + │ ├── closing_loc: (46,5)-(46,6) = "\"" + │ └── unescaped: "A B" + ├── @ SymbolNode (location: (47,0)-(47,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (47,0)-(47,2) = ":\"" + │ ├── value_loc: (47,2)-(47,6) = "A\\\"B" + │ ├── closing_loc: (47,6)-(47,7) = "\"" + │ └── unescaped: "A\"B" + ├── @ SymbolNode (location: (48,0)-(48,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (48,0)-(48,2) = ":\"" + │ ├── value_loc: (1,0)-(1,0) = "" + │ ├── closing_loc: (48,2)-(48,3) = "\"" + │ └── unescaped: "" + ├── @ RegularExpressionNode (location: (49,0)-(49,5)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (49,0)-(49,1) = "/" + │ ├── content_loc: (49,1)-(49,4) = "foo" + │ ├── closing_loc: (49,4)-(49,5) = "/" + │ └── unescaped: "foo" + ├── @ RegularExpressionNode (location: (50,0)-(50,28)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (50,0)-(50,1) = "/" + │ ├── content_loc: (50,1)-(50,27) = "[^-+',.\\/:@[:alnum:]\\[\\]]+" + │ ├── closing_loc: (50,27)-(50,28) = "/" + │ └── unescaped: "[^-+',./:@[:alnum:]\\[\\]]+" + ├── @ InterpolatedRegularExpressionNode (location: (51,0)-(51,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (51,0)-(51,1) = "/" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (51,1)-(51,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (51,1)-(51,4) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ EmbeddedStatementsNode (location: (51,4)-(51,11)) + │ │ ├── opening_loc: (51,4)-(51,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (51,6)-(51,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ InstanceVariableReadNode (location: (51,6)-(51,10)) + │ │ │ └── name: :@bar + │ │ └── closing_loc: (51,10)-(51,11) = "}" + │ └── closing_loc: (51,11)-(51,12) = "/" + ├── @ InterpolatedRegularExpressionNode (location: (52,0)-(52,15)) + │ ├── flags: ignore_case, extended, multi_line + │ ├── opening_loc: (52,0)-(52,1) = "/" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (52,1)-(52,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (52,1)-(52,4) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ EmbeddedStatementsNode (location: (52,4)-(52,11)) + │ │ ├── opening_loc: (52,4)-(52,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (52,6)-(52,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ InstanceVariableReadNode (location: (52,6)-(52,10)) + │ │ │ └── name: :@bar + │ │ └── closing_loc: (52,10)-(52,11) = "}" + │ └── closing_loc: (52,11)-(52,15) = "/imx" + ├── @ InterpolatedRegularExpressionNode (location: (53,0)-(53,13)) + │ ├── flags: ∅ + │ ├── opening_loc: (53,0)-(53,1) = "/" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (53,1)-(53,12)) + │ │ ├── opening_loc: (53,1)-(53,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (53,3)-(53,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (53,3)-(53,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (53,3)-(53,4) = "\"" + │ │ │ ├── content_loc: (53,4)-(53,10) = "\\u0000" + │ │ │ ├── closing_loc: (53,10)-(53,11) = "\"" + │ │ │ └── unescaped: "\u0000" + │ │ └── closing_loc: (53,11)-(53,12) = "}" + │ └── closing_loc: (53,12)-(53,13) = "/" + ├── @ RegularExpressionNode (location: (54,0)-(54,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (54,0)-(54,1) = "/" + │ ├── content_loc: (54,1)-(54,3) = "\\n" + │ ├── closing_loc: (54,3)-(54,4) = "/" + │ └── unescaped: "\\n" + ├── @ RegularExpressionNode (location: (55,0)-(55,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (55,0)-(55,1) = "/" + │ ├── content_loc: (55,1)-(55,3) = "\\n" + │ ├── closing_loc: (55,3)-(55,4) = "/" + │ └── unescaped: "\\n" + ├── @ RegularExpressionNode (location: (56,0)-(56,5)) + │ ├── flags: extended, forced_us_ascii_encoding + │ ├── opening_loc: (56,0)-(56,1) = "/" + │ ├── content_loc: (56,1)-(56,3) = "\\n" + │ ├── closing_loc: (56,3)-(56,5) = "/x" + │ └── unescaped: "\\n" + ├── @ RegularExpressionNode (location: (57,0)-(57,7)) + │ ├── flags: extended, forced_us_ascii_encoding + │ ├── opening_loc: (57,0)-(57,1) = "/" + │ ├── content_loc: (57,1)-(57,5) = "\\/\\/" + │ ├── closing_loc: (57,5)-(57,7) = "/x" + │ └── unescaped: "//" + ├── @ InterpolatedSymbolNode (location: (58,0)-(58,15)) + │ ├── opening_loc: (58,0)-(58,2) = ":\"" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (58,2)-(58,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (58,2)-(58,5) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ ├── @ EmbeddedStatementsNode (location: (58,5)-(58,11)) + │ │ │ ├── opening_loc: (58,5)-(58,7) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (58,7)-(58,10)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (58,7)-(58,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (58,7)-(58,10) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (58,10)-(58,11) = "}" + │ │ └── @ StringNode (location: (58,11)-(58,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (58,11)-(58,14) = "baz" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "baz" + │ └── closing_loc: (58,14)-(58,15) = "\"" + ├── @ InterpolatedSymbolNode (location: (59,0)-(59,11)) + │ ├── opening_loc: (59,0)-(59,2) = ":\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (59,2)-(59,10)) + │ │ ├── opening_loc: (59,2)-(59,4) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (59,4)-(59,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (59,4)-(59,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (59,4)-(59,5) = "\"" + │ │ │ ├── content_loc: (59,5)-(59,8) = "foo" + │ │ │ ├── closing_loc: (59,8)-(59,9) = "\"" + │ │ │ └── unescaped: "foo" + │ │ └── closing_loc: (59,9)-(59,10) = "}" + │ └── closing_loc: (59,10)-(59,11) = "\"" + ├── @ RangeNode (location: (60,0)-(60,14)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ ParenthesesNode (location: (60,0)-(60,11)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (60,1)-(60,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (60,1)-(60,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ FloatNode (location: (60,1)-(60,4)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :/ + │ │ │ ├── message_loc: (60,5)-(60,6) = "/" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (60,7)-(60,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ FloatNode (location: (60,7)-(60,10)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (60,0)-(60,1) = "(" + │ │ └── closing_loc: (60,10)-(60,11) = ")" + │ ├── right: + │ │ @ IntegerNode (location: (60,13)-(60,14)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (60,11)-(60,13) = ".." + ├── @ RangeNode (location: (61,0)-(61,14)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (61,0)-(61,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ ParenthesesNode (location: (61,3)-(61,14)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (61,4)-(61,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (61,4)-(61,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ FloatNode (location: (61,4)-(61,7)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :/ + │ │ │ ├── message_loc: (61,8)-(61,9) = "/" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (61,10)-(61,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ FloatNode (location: (61,10)-(61,13)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (61,3)-(61,4) = "(" + │ │ └── closing_loc: (61,13)-(61,14) = ")" + │ └── operator_loc: (61,1)-(61,3) = ".." + ├── @ RangeNode (location: (62,0)-(62,16)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ ParenthesesNode (location: (62,0)-(62,11)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (62,1)-(62,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (62,1)-(62,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ FloatNode (location: (62,1)-(62,4)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :/ + │ │ │ ├── message_loc: (62,5)-(62,6) = "/" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (62,7)-(62,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ FloatNode (location: (62,7)-(62,10)) + │ │ │ │ └── value: 0.0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (62,0)-(62,1) = "(" + │ │ └── closing_loc: (62,10)-(62,11) = ")" + │ ├── right: + │ │ @ IntegerNode (location: (62,13)-(62,16)) + │ │ ├── flags: decimal + │ │ └── value: 100 + │ └── operator_loc: (62,11)-(62,13) = ".." + ├── @ FloatNode (location: (63,0)-(63,4)) + │ └── value: -0.1 + ├── @ FloatNode (location: (64,0)-(64,3)) + │ └── value: 0.1 + ├── @ ArrayNode (location: (65,0)-(65,6)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (65,1)-(65,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (65,4)-(65,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: (65,0)-(65,1) = "[" + │ └── closing_loc: (65,5)-(65,6) = "]" + ├── @ ArrayNode (location: (66,0)-(66,11)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ IntegerNode (location: (66,1)-(66,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ ParenthesesNode (location: (66,4)-(66,6)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (66,4)-(66,5) = "(" + │ │ │ └── closing_loc: (66,5)-(66,6) = ")" + │ │ └── @ CallNode (location: (66,8)-(66,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :n2 + │ │ ├── message_loc: (66,8)-(66,10) = "n2" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (66,0)-(66,1) = "[" + │ └── closing_loc: (66,10)-(66,11) = "]" + ├── @ ArrayNode (location: (67,0)-(67,3)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ IntegerNode (location: (67,1)-(67,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (67,0)-(67,1) = "[" + │ └── closing_loc: (67,2)-(67,3) = "]" + ├── @ ArrayNode (location: (68,0)-(68,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (68,0)-(68,1) = "[" + │ └── closing_loc: (68,1)-(68,2) = "]" + ├── @ ArrayNode (location: (69,0)-(69,10)) + │ ├── flags: contains_splat + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (69,1)-(69,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ SplatNode (location: (69,4)-(69,9)) + │ │ ├── operator_loc: (69,4)-(69,5) = "*" + │ │ └── expression: + │ │ @ InstanceVariableReadNode (location: (69,5)-(69,9)) + │ │ └── name: :@foo + │ ├── opening_loc: (69,0)-(69,1) = "[" + │ └── closing_loc: (69,9)-(69,10) = "]" + ├── @ ArrayNode (location: (70,0)-(70,10)) + │ ├── flags: contains_splat + │ ├── elements: (length: 2) + │ │ ├── @ SplatNode (location: (70,1)-(70,6)) + │ │ │ ├── operator_loc: (70,1)-(70,2) = "*" + │ │ │ └── expression: + │ │ │ @ InstanceVariableReadNode (location: (70,2)-(70,6)) + │ │ │ └── name: :@foo + │ │ └── @ IntegerNode (location: (70,8)-(70,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (70,0)-(70,1) = "[" + │ └── closing_loc: (70,9)-(70,10) = "]" + ├── @ ArrayNode (location: (71,0)-(71,14)) + │ ├── flags: contains_splat + │ ├── elements: (length: 2) + │ │ ├── @ SplatNode (location: (71,1)-(71,6)) + │ │ │ ├── operator_loc: (71,1)-(71,2) = "*" + │ │ │ └── expression: + │ │ │ @ InstanceVariableReadNode (location: (71,2)-(71,6)) + │ │ │ └── name: :@foo + │ │ └── @ SplatNode (location: (71,8)-(71,13)) + │ │ ├── operator_loc: (71,8)-(71,9) = "*" + │ │ └── expression: + │ │ @ InstanceVariableReadNode (location: (71,9)-(71,13)) + │ │ └── name: :@baz + │ ├── opening_loc: (71,0)-(71,1) = "[" + │ └── closing_loc: (71,13)-(71,14) = "]" + ├── @ HashNode (location: (72,0)-(72,2)) + │ ├── opening_loc: (72,0)-(72,1) = "{" + │ ├── elements: (length: 0) + │ └── closing_loc: (72,1)-(72,2) = "}" + ├── @ HashNode (location: (73,0)-(73,12)) + │ ├── opening_loc: (73,0)-(73,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (73,2)-(73,10)) + │ │ ├── key: + │ │ │ @ ParenthesesNode (location: (73,2)-(73,4)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (73,2)-(73,3) = "(" + │ │ │ └── closing_loc: (73,3)-(73,4) = ")" + │ │ ├── value: + │ │ │ @ ParenthesesNode (location: (73,8)-(73,10)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (73,8)-(73,9) = "(" + │ │ │ └── closing_loc: (73,9)-(73,10) = ")" + │ │ └── operator_loc: (73,5)-(73,7) = "=>" + │ └── closing_loc: (73,11)-(73,12) = "}" + ├── @ HashNode (location: (74,0)-(74,10)) + │ ├── opening_loc: (74,0)-(74,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (74,2)-(74,8)) + │ │ ├── key: + │ │ │ @ IntegerNode (location: (74,2)-(74,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── value: + │ │ │ @ IntegerNode (location: (74,7)-(74,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (74,4)-(74,6) = "=>" + │ └── closing_loc: (74,9)-(74,10) = "}" + ├── @ HashNode (location: (75,0)-(75,18)) + │ ├── opening_loc: (75,0)-(75,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (75,2)-(75,8)) + │ │ │ ├── key: + │ │ │ │ @ IntegerNode (location: (75,2)-(75,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (75,7)-(75,8)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── operator_loc: (75,4)-(75,6) = "=>" + │ │ └── @ AssocNode (location: (75,10)-(75,16)) + │ │ ├── key: + │ │ │ @ IntegerNode (location: (75,10)-(75,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ ├── value: + │ │ │ @ IntegerNode (location: (75,15)-(75,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 4 + │ │ └── operator_loc: (75,12)-(75,14) = "=>" + │ └── closing_loc: (75,17)-(75,18) = "}" + ├── @ HashNode (location: (76,0)-(76,27)) + │ ├── opening_loc: (76,0)-(76,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (76,2)-(76,19)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (76,2)-(76,4)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (76,2)-(76,3) = "a" + │ │ │ │ ├── closing_loc: (76,3)-(76,4) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ParenthesesNode (location: (76,5)-(76,19)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (76,6)-(76,18)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ RescueModifierNode (location: (76,6)-(76,18)) + │ │ │ │ │ ├── expression: + │ │ │ │ │ │ @ IntegerNode (location: (76,6)-(76,7)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ ├── keyword_loc: (76,8)-(76,14) = "rescue" + │ │ │ │ │ └── rescue_expression: + │ │ │ │ │ @ CallNode (location: (76,15)-(76,18)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :foo + │ │ │ │ │ ├── message_loc: (76,15)-(76,18) = "foo" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── opening_loc: (76,5)-(76,6) = "(" + │ │ │ │ └── closing_loc: (76,18)-(76,19) = ")" + │ │ │ └── operator_loc: ∅ + │ │ └── @ AssocNode (location: (76,21)-(76,25)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (76,21)-(76,23)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (76,21)-(76,22) = "b" + │ │ │ ├── closing_loc: (76,22)-(76,23) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (76,24)-(76,25)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── closing_loc: (76,26)-(76,27) = "}" + ├── @ HashNode (location: (77,0)-(77,14)) + │ ├── opening_loc: (77,0)-(77,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (77,2)-(77,6)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (77,2)-(77,4)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (77,2)-(77,3) = "a" + │ │ │ │ ├── closing_loc: (77,3)-(77,4) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (77,5)-(77,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ └── @ AssocNode (location: (77,8)-(77,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (77,8)-(77,10)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (77,8)-(77,9) = "b" + │ │ │ ├── closing_loc: (77,9)-(77,10) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (77,11)-(77,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── closing_loc: (77,13)-(77,14) = "}" + ├── @ HashNode (location: (78,0)-(78,9)) + │ ├── opening_loc: (78,0)-(78,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (78,2)-(78,7)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (78,2)-(78,4)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (78,2)-(78,3) = "a" + │ │ │ ├── closing_loc: (78,3)-(78,4) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (78,5)-(78,7)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (78,5)-(78,6) = ":" + │ │ │ ├── value_loc: (78,6)-(78,7) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── operator_loc: ∅ + │ └── closing_loc: (78,8)-(78,9) = "}" + ├── @ HashNode (location: (79,0)-(79,15)) + │ ├── opening_loc: (79,0)-(79,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (79,2)-(79,13)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (79,2)-(79,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (79,2)-(79,4) = ":\"" + │ │ │ ├── value_loc: (79,4)-(79,7) = "a b" + │ │ │ ├── closing_loc: (79,7)-(79,8) = "\"" + │ │ │ └── unescaped: "a b" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (79,12)-(79,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (79,9)-(79,11) = "=>" + │ └── closing_loc: (79,14)-(79,15) = "}" + ├── @ HashNode (location: (80,0)-(80,12)) + │ ├── opening_loc: (80,0)-(80,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (80,2)-(80,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (80,2)-(80,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (80,2)-(80,3) = ":" + │ │ │ ├── value_loc: (80,3)-(80,5) = "-@" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "-@" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (80,9)-(80,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (80,6)-(80,8) = "=>" + │ └── closing_loc: (80,11)-(80,12) = "}" + ├── @ InterpolatedStringNode (location: (81,0)-(82,7)) + │ ├── opening_loc: (81,0)-(81,1) = "\"" + │ ├── parts: (length: 4) + │ │ ├── @ EmbeddedStatementsNode (location: (81,1)-(81,4)) + │ │ │ ├── opening_loc: (81,1)-(81,3) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (81,3)-(81,4) = "}" + │ │ ├── @ StringNode (location: (81,4)-(82,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (81,4)-(82,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ EmbeddedStatementsNode (location: (82,0)-(82,3)) + │ │ │ ├── opening_loc: (82,0)-(82,2) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (82,2)-(82,3) = "}" + │ │ └── @ StringNode (location: (82,3)-(82,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (82,3)-(82,6) = "\\na" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\na" + │ └── closing_loc: (82,6)-(82,7) = "\"" + ├── @ CallNode (location: (83,0)-(86,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (83,0)-(83,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (83,4)-(86,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (84,2)-(85,7)) + │ │ └── body: (length: 1) + │ │ └── @ InterpolatedStringNode (location: (84,2)-(85,7)) + │ │ ├── opening_loc: (84,2)-(84,3) = "\"" + │ │ ├── parts: (length: 4) + │ │ │ ├── @ EmbeddedStatementsNode (location: (84,3)-(84,6)) + │ │ │ │ ├── opening_loc: (84,3)-(84,5) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (84,5)-(84,6) = "}" + │ │ │ ├── @ StringNode (location: (84,6)-(85,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (84,6)-(85,0) = "\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "\n" + │ │ │ ├── @ EmbeddedStatementsNode (location: (85,0)-(85,3)) + │ │ │ │ ├── opening_loc: (85,0)-(85,2) = "\#{" + │ │ │ │ ├── statements: ∅ + │ │ │ │ └── closing_loc: (85,2)-(85,3) = "}" + │ │ │ └── @ StringNode (location: (85,3)-(85,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (85,3)-(85,6) = "\\na" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\na" + │ │ └── closing_loc: (85,6)-(85,7) = "\"" + │ ├── opening_loc: (83,4)-(83,5) = "{" + │ └── closing_loc: (86,0)-(86,1) = "}" + ├── @ SymbolNode (location: (87,0)-(88,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (87,0)-(87,2) = ":\"" + │ ├── value_loc: (87,2)-(88,1) = "a\\\\\nb" + │ ├── closing_loc: (88,1)-(88,2) = "\"" + │ └── unescaped: "a\\\nb" + └── @ InterpolatedXStringNode (location: (89,0)-(91,2)) + ├── opening_loc: (89,0)-(89,1) = "`" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (89,1)-(90,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (89,1)-(90,0) = " x\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " x\n" + │ ├── @ EmbeddedStatementsNode (location: (90,0)-(90,6)) + │ │ ├── opening_loc: (90,0)-(90,2) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (90,2)-(90,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (90,2)-(90,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (90,2)-(90,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (90,5)-(90,6) = "}" + │ └── @ StringNode (location: (90,6)-(91,1)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (90,6)-(91,1) = "\n#" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n#" + └── closing_loc: (91,1)-(91,2) = "`" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/module.txt b/test/mri/prism/snapshots/unparser/corpus/literal/module.txt new file mode 100644 index 00000000000..5dd8c03b517 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/module.txt @@ -0,0 +1,107 @@ +@ ProgramNode (location: (1,0)-(16,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(16,3)) + └── body: (length: 4) + ├── @ ModuleNode (location: (1,0)-(2,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (1,0)-(1,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,7)-(1,8)) + │ │ └── name: :A + │ ├── body: ∅ + │ ├── end_keyword_loc: (2,0)-(2,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (4,0)-(5,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (4,0)-(4,6) = "module" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (4,7)-(4,11)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (4,7)-(4,8)) + │ │ │ └── name: :A + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (4,10)-(4,11)) + │ │ │ └── name: :B + │ │ └── delimiter_loc: (4,8)-(4,10) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (5,0)-(5,3) = "end" + │ └── name: :B + ├── @ ModuleNode (location: (7,0)-(8,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (7,0)-(7,6) = "module" + │ ├── constant_path: + │ │ @ ConstantPathNode (location: (7,7)-(7,14)) + │ │ ├── parent: + │ │ │ @ ConstantPathNode (location: (7,7)-(7,11)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (7,7)-(7,8)) + │ │ │ │ └── name: :A + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (7,10)-(7,11)) + │ │ │ │ └── name: :B + │ │ │ └── delimiter_loc: (7,8)-(7,10) = "::" + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (7,13)-(7,14)) + │ │ │ └── name: :C + │ │ └── delimiter_loc: (7,11)-(7,13) = "::" + │ ├── body: ∅ + │ ├── end_keyword_loc: (8,0)-(8,3) = "end" + │ └── name: :C + └── @ ModuleNode (location: (10,0)-(16,3)) + ├── locals: [] + ├── module_keyword_loc: (10,0)-(10,6) = "module" + ├── constant_path: + │ @ ConstantReadNode (location: (10,7)-(10,8)) + │ └── name: :A + ├── body: + │ @ StatementsNode (location: (11,2)-(15,5)) + │ └── body: (length: 2) + │ ├── @ CallNode (location: (11,2)-(11,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :include + │ │ ├── message_loc: (11,2)-(11,9) = "include" + │ │ ├── opening_loc: (11,9)-(11,10) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,10)-(11,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (11,10)-(11,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ ConstantReadNode (location: (11,10)-(11,11)) + │ │ │ │ └── name: :B + │ │ │ ├── call_operator_loc: (11,11)-(11,12) = "." + │ │ │ ├── name: :new + │ │ │ ├── message_loc: (11,12)-(11,15) = "new" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (11,15)-(11,16) = ")" + │ │ └── block: ∅ + │ └── @ DefNode (location: (13,2)-(15,5)) + │ ├── name: :foo + │ ├── name_loc: (13,6)-(13,9) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,4)-(14,8)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (14,4)-(14,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (14,4)-(14,5) = ":" + │ │ ├── value_loc: (14,5)-(14,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ ├── locals: [] + │ ├── def_keyword_loc: (13,2)-(13,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (15,2)-(15,5) = "end" + ├── end_keyword_loc: (16,0)-(16,3) = "end" + └── name: :A diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/opasgn.txt b/test/mri/prism/snapshots/unparser/corpus/literal/opasgn.txt new file mode 100644 index 00000000000..8dc08496381 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/opasgn.txt @@ -0,0 +1,509 @@ +@ ProgramNode (location: (1,0)-(24,10)) +├── locals: [:a, :h] +└── statements: + @ StatementsNode (location: (1,0)-(24,10)) + └── body: (length: 24) + ├── @ LocalVariableOperatorWriteNode (location: (1,0)-(1,6)) + │ ├── name_loc: (1,0)-(1,1) = "a" + │ ├── operator_loc: (1,2)-(1,4) = "+=" + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ ├── operator: :+ + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (2,0)-(2,6)) + │ ├── name_loc: (2,0)-(2,1) = "a" + │ ├── operator_loc: (2,2)-(2,4) = "-=" + │ ├── value: + │ │ @ IntegerNode (location: (2,5)-(2,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ ├── operator: :- + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (3,0)-(3,7)) + │ ├── name_loc: (3,0)-(3,1) = "a" + │ ├── operator_loc: (3,2)-(3,5) = "**=" + │ ├── value: + │ │ @ IntegerNode (location: (3,6)-(3,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ ├── operator: :** + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (4,0)-(4,6)) + │ ├── name_loc: (4,0)-(4,1) = "a" + │ ├── operator_loc: (4,2)-(4,4) = "*=" + │ ├── value: + │ │ @ IntegerNode (location: (4,5)-(4,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ ├── operator: :* + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (5,0)-(5,6)) + │ ├── name_loc: (5,0)-(5,1) = "a" + │ ├── operator_loc: (5,2)-(5,4) = "/=" + │ ├── value: + │ │ @ IntegerNode (location: (5,5)-(5,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ ├── operator: :/ + │ └── depth: 0 + ├── @ LocalVariableAndWriteNode (location: (6,0)-(6,7)) + │ ├── name_loc: (6,0)-(6,1) = "a" + │ ├── operator_loc: (6,2)-(6,5) = "&&=" + │ ├── value: + │ │ @ CallNode (location: (6,6)-(6,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (6,6)-(6,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── name: :a + │ └── depth: 0 + ├── @ LocalVariableOrWriteNode (location: (7,0)-(7,7)) + │ ├── name_loc: (7,0)-(7,1) = "a" + │ ├── operator_loc: (7,2)-(7,5) = "||=" + │ ├── value: + │ │ @ IntegerNode (location: (7,6)-(7,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── name: :a + │ └── depth: 0 + ├── @ CallNode (location: (8,0)-(8,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (8,0)-(8,9)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (8,1)-(8,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableOrWriteNode (location: (8,1)-(8,8)) + │ │ │ ├── name_loc: (8,1)-(8,2) = "a" + │ │ │ ├── operator_loc: (8,3)-(8,6) = "||=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (8,7)-(8,8)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (8,0)-(8,1) = "(" + │ │ └── closing_loc: (8,8)-(8,9) = ")" + │ ├── call_operator_loc: (8,9)-(8,10) = "." + │ ├── name: :bar + │ ├── message_loc: (8,10)-(8,13) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,17)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ ParenthesesNode (location: (9,0)-(9,10)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (9,1)-(9,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableOrWriteNode (location: (9,1)-(9,9)) + │ │ │ ├── name_loc: (9,1)-(9,2) = "h" + │ │ │ ├── operator_loc: (9,3)-(9,6) = "||=" + │ │ │ ├── value: + │ │ │ │ @ HashNode (location: (9,7)-(9,9)) + │ │ │ │ ├── opening_loc: (9,7)-(9,8) = "{" + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ └── closing_loc: (9,8)-(9,9) = "}" + │ │ │ ├── name: :h + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (9,0)-(9,1) = "(" + │ │ └── closing_loc: (9,9)-(9,10) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :[]= + │ ├── message_loc: (9,10)-(9,13) = "[k]" + │ ├── opening_loc: (9,10)-(9,11) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,11)-(9,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (9,11)-(9,12)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :k + │ │ │ ├── message_loc: (9,11)-(9,12) = "k" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (9,16)-(9,17)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :v + │ │ ├── message_loc: (9,16)-(9,17) = "v" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (9,12)-(9,13) = "]" + │ └── block: ∅ + ├── @ CallOperatorWriteNode (location: (10,0)-(10,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (10,0)-(10,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (10,1)-(10,2) = "." + │ ├── message_loc: (10,2)-(10,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator: :+ + │ ├── operator_loc: (10,4)-(10,6) = "+=" + │ └── value: + │ @ IntegerNode (location: (10,7)-(10,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ CallOperatorWriteNode (location: (11,0)-(11,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (11,0)-(11,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (11,1)-(11,2) = "." + │ ├── message_loc: (11,2)-(11,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator: :- + │ ├── operator_loc: (11,4)-(11,6) = "-=" + │ └── value: + │ @ IntegerNode (location: (11,7)-(11,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ CallOperatorWriteNode (location: (12,0)-(12,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (12,0)-(12,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (12,1)-(12,2) = "." + │ ├── message_loc: (12,2)-(12,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator: :** + │ ├── operator_loc: (12,4)-(12,7) = "**=" + │ └── value: + │ @ IntegerNode (location: (12,8)-(12,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ CallOperatorWriteNode (location: (13,0)-(13,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (13,0)-(13,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (13,1)-(13,2) = "." + │ ├── message_loc: (13,2)-(13,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator: :* + │ ├── operator_loc: (13,4)-(13,6) = "*=" + │ └── value: + │ @ IntegerNode (location: (13,7)-(13,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ CallOperatorWriteNode (location: (14,0)-(14,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (14,0)-(14,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (14,1)-(14,2) = "." + │ ├── message_loc: (14,2)-(14,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator: :/ + │ ├── operator_loc: (14,4)-(14,6) = "/=" + │ └── value: + │ @ IntegerNode (location: (14,7)-(14,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ CallAndWriteNode (location: (15,0)-(15,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (15,0)-(15,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (15,1)-(15,2) = "." + │ ├── message_loc: (15,2)-(15,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator_loc: (15,4)-(15,7) = "&&=" + │ └── value: + │ @ CallNode (location: (15,8)-(15,9)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (15,8)-(15,9) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallOrWriteNode (location: (16,0)-(16,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (16,0)-(16,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: (16,1)-(16,2) = "." + │ ├── message_loc: (16,2)-(16,3) = "b" + │ ├── read_name: :b + │ ├── write_name: :b= + │ ├── operator_loc: (16,4)-(16,7) = "||=" + │ └── value: + │ @ IntegerNode (location: (16,8)-(16,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexOperatorWriteNode (location: (17,0)-(17,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (17,0)-(17,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (17,1)-(17,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,2)-(17,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (17,2)-(17,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (17,2)-(17,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (17,3)-(17,4) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (17,5)-(17,7) = "+=" + │ └── value: + │ @ IntegerNode (location: (17,8)-(17,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexOperatorWriteNode (location: (18,0)-(18,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (18,0)-(18,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (18,1)-(18,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (18,2)-(18,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (18,2)-(18,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (18,2)-(18,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (18,3)-(18,4) = "]" + │ ├── block: ∅ + │ ├── operator: :- + │ ├── operator_loc: (18,5)-(18,7) = "-=" + │ └── value: + │ @ IntegerNode (location: (18,8)-(18,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexOperatorWriteNode (location: (19,0)-(19,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (19,0)-(19,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (19,1)-(19,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,2)-(19,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (19,2)-(19,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (19,2)-(19,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (19,3)-(19,4) = "]" + │ ├── block: ∅ + │ ├── operator: :** + │ ├── operator_loc: (19,5)-(19,8) = "**=" + │ └── value: + │ @ IntegerNode (location: (19,9)-(19,10)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexOperatorWriteNode (location: (20,0)-(20,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (20,0)-(20,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (20,1)-(20,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (20,2)-(20,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (20,2)-(20,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (20,2)-(20,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (20,3)-(20,4) = "]" + │ ├── block: ∅ + │ ├── operator: :* + │ ├── operator_loc: (20,5)-(20,7) = "*=" + │ └── value: + │ @ IntegerNode (location: (20,8)-(20,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexOperatorWriteNode (location: (21,0)-(21,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (21,0)-(21,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (21,1)-(21,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,2)-(21,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (21,2)-(21,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (21,2)-(21,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (21,3)-(21,4) = "]" + │ ├── block: ∅ + │ ├── operator: :/ + │ ├── operator_loc: (21,5)-(21,7) = "/=" + │ └── value: + │ @ IntegerNode (location: (21,8)-(21,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── @ IndexAndWriteNode (location: (22,0)-(22,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (22,0)-(22,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (22,1)-(22,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (22,2)-(22,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (22,2)-(22,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (22,2)-(22,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (22,3)-(22,4) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (22,5)-(22,8) = "&&=" + │ └── value: + │ @ CallNode (location: (22,9)-(22,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (22,9)-(22,10) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ IndexOrWriteNode (location: (23,0)-(23,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (23,0)-(23,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (23,1)-(23,2) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,2)-(23,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (23,2)-(23,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (23,2)-(23,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (23,3)-(23,4) = "]" + │ ├── block: ∅ + │ ├── operator_loc: (23,5)-(23,8) = "||=" + │ └── value: + │ @ IntegerNode (location: (23,9)-(23,10)) + │ ├── flags: decimal + │ └── value: 2 + └── @ CallOperatorWriteNode (location: (24,0)-(24,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (24,0)-(24,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (24,0)-(24,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (24,3)-(24,4) = "." + ├── message_loc: (24,4)-(24,5) = "A" + ├── read_name: :A + ├── write_name: :A= + ├── operator: :+ + ├── operator_loc: (24,6)-(24,8) = "+=" + └── value: + @ IntegerNode (location: (24,9)-(24,10)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/pattern.txt b/test/mri/prism/snapshots/unparser/corpus/literal/pattern.txt new file mode 100644 index 00000000000..5a0b4bb7336 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/pattern.txt @@ -0,0 +1,446 @@ +@ ProgramNode (location: (1,0)-(41,8)) +├── locals: [:a, :x, :y] +└── statements: + @ StatementsNode (location: (1,0)-(41,8)) + └── body: (length: 4) + ├── @ CaseMatchNode (location: (1,0)-(33,3)) + │ ├── predicate: + │ │ @ CallNode (location: (1,5)-(1,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,5)-(1,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 15) + │ │ ├── @ InNode (location: (2,0)-(3,6)) + │ │ │ ├── pattern: + │ │ │ │ @ ArrayPatternNode (location: (2,3)-(2,17)) + │ │ │ │ ├── constant: + │ │ │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ │ └── name: :A + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ IntegerNode (location: (2,5)-(2,6)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ └── @ IntegerNode (location: (2,8)-(2,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (2,11)-(2,13)) + │ │ │ │ │ ├── operator_loc: (2,11)-(2,12) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ LocalVariableTargetNode (location: (2,12)-(2,13)) + │ │ │ │ │ ├── name: :a + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── posts: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (2,15)-(2,16)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 3 + │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "[" + │ │ │ │ └── closing_loc: (2,16)-(2,17) = "]" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,2)-(3,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (3,2)-(3,6)) + │ │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ │ └── then_loc: (2,18)-(2,22) = "then" + │ │ ├── @ InNode (location: (4,0)-(5,3)) + │ │ │ ├── pattern: + │ │ │ │ @ ArrayPatternNode (location: (4,3)-(4,11)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ IntegerNode (location: (4,4)-(4,5)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ └── @ IntegerNode (location: (4,7)-(4,8)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── rest: + │ │ │ │ │ @ ImplicitRestNode (location: (4,8)-(4,9)) + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (4,3)-(4,4) = "[" + │ │ │ │ └── closing_loc: (4,10)-(4,11) = "]" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (5,2)-(5,3)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (5,2)-(5,3)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :y + │ │ │ │ ├── message_loc: (5,2)-(5,3) = "y" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── in_loc: (4,0)-(4,2) = "in" + │ │ │ └── then_loc: (4,12)-(4,16) = "then" + │ │ ├── @ InNode (location: (6,0)-(7,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (6,3)-(6,8)) + │ │ │ │ ├── constant: + │ │ │ │ │ @ ConstantReadNode (location: (6,3)-(6,4)) + │ │ │ │ │ └── name: :A + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (6,5)-(6,7)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (6,5)-(6,7)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (6,5)-(6,6) = "x" + │ │ │ │ │ │ ├── closing_loc: (6,6)-(6,7) = ":" + │ │ │ │ │ │ └── unescaped: "x" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ ImplicitNode (location: (6,5)-(6,6)) + │ │ │ │ │ │ └── value: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (6,5)-(6,6)) + │ │ │ │ │ │ ├── name: :x + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (6,4)-(6,5) = "(" + │ │ │ │ └── closing_loc: (6,7)-(6,8) = ")" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (7,2)-(7,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (7,2)-(7,6)) + │ │ │ ├── in_loc: (6,0)-(6,2) = "in" + │ │ │ └── then_loc: (6,9)-(6,13) = "then" + │ │ ├── @ InNode (location: (8,0)-(9,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (8,3)-(8,8)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ AssocSplatNode (location: (8,4)-(8,7)) + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (8,6)-(8,7)) + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: (8,4)-(8,6) = "**" + │ │ │ │ ├── opening_loc: (8,3)-(8,4) = "{" + │ │ │ │ └── closing_loc: (8,7)-(8,8) = "}" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (9,2)-(9,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (9,2)-(9,6)) + │ │ │ ├── in_loc: (8,0)-(8,2) = "in" + │ │ │ └── then_loc: (8,9)-(8,13) = "then" + │ │ ├── @ InNode (location: (10,0)-(11,6)) + │ │ │ ├── pattern: + │ │ │ │ @ IfNode (location: (10,3)-(10,13)) + │ │ │ │ ├── if_keyword_loc: (10,6)-(10,8) = "if" + │ │ │ │ ├── predicate: + │ │ │ │ │ @ TrueNode (location: (10,9)-(10,13)) + │ │ │ │ ├── then_keyword_loc: ∅ + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (10,3)-(10,5)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ HashPatternNode (location: (10,3)-(10,5)) + │ │ │ │ │ ├── constant: ∅ + │ │ │ │ │ ├── elements: (length: 0) + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── opening_loc: (10,3)-(10,4) = "{" + │ │ │ │ │ └── closing_loc: (10,4)-(10,5) = "}" + │ │ │ │ ├── consequent: ∅ + │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (11,2)-(11,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (11,2)-(11,6)) + │ │ │ ├── in_loc: (10,0)-(10,2) = "in" + │ │ │ └── then_loc: (10,14)-(10,18) = "then" + │ │ ├── @ InNode (location: (12,0)-(13,6)) + │ │ │ ├── pattern: + │ │ │ │ @ ArrayPatternNode (location: (12,3)-(12,12)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ LocalVariableTargetNode (location: (12,4)-(12,5)) + │ │ │ │ │ │ ├── name: :x + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── @ LocalVariableTargetNode (location: (12,7)-(12,8)) + │ │ │ │ │ ├── name: :y + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (12,10)-(12,11)) + │ │ │ │ │ ├── operator_loc: (12,10)-(12,11) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (12,3)-(12,4) = "[" + │ │ │ │ └── closing_loc: (12,11)-(12,12) = "]" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (13,2)-(13,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (13,2)-(13,6)) + │ │ │ ├── in_loc: (12,0)-(12,2) = "in" + │ │ │ └── then_loc: (12,13)-(12,17) = "then" + │ │ ├── @ InNode (location: (14,0)-(15,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (14,3)-(14,16)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 2) + │ │ │ │ │ ├── @ AssocNode (location: (14,4)-(14,8)) + │ │ │ │ │ │ ├── key: + │ │ │ │ │ │ │ @ SymbolNode (location: (14,4)-(14,6)) + │ │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ │ ├── value_loc: (14,4)-(14,5) = "a" + │ │ │ │ │ │ │ ├── closing_loc: (14,5)-(14,6) = ":" + │ │ │ │ │ │ │ └── unescaped: "a" + │ │ │ │ │ │ ├── value: + │ │ │ │ │ │ │ @ IntegerNode (location: (14,7)-(14,8)) + │ │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ │ └── @ AssocNode (location: (14,10)-(14,15)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (14,10)-(14,13)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (14,10)-(14,12) = "aa" + │ │ │ │ │ │ ├── closing_loc: (14,12)-(14,13) = ":" + │ │ │ │ │ │ └── unescaped: "aa" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ IntegerNode (location: (14,14)-(14,15)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 2 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (14,3)-(14,4) = "{" + │ │ │ │ └── closing_loc: (14,15)-(14,16) = "}" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (15,2)-(15,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (15,2)-(15,6)) + │ │ │ ├── in_loc: (14,0)-(14,2) = "in" + │ │ │ └── then_loc: (14,17)-(14,21) = "then" + │ │ ├── @ InNode (location: (16,0)-(17,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (16,3)-(16,5)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (16,3)-(16,4) = "{" + │ │ │ │ └── closing_loc: (16,4)-(16,5) = "}" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (17,2)-(17,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (17,2)-(17,6)) + │ │ │ ├── in_loc: (16,0)-(16,2) = "in" + │ │ │ └── then_loc: (16,6)-(16,10) = "then" + │ │ ├── @ InNode (location: (18,0)-(19,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (18,3)-(18,10)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ NoKeywordsParameterNode (location: (18,4)-(18,9)) + │ │ │ │ │ ├── operator_loc: (18,4)-(18,6) = "**" + │ │ │ │ │ └── keyword_loc: (18,6)-(18,9) = "nil" + │ │ │ │ ├── opening_loc: (18,3)-(18,4) = "{" + │ │ │ │ └── closing_loc: (18,9)-(18,10) = "}" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (19,2)-(19,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (19,2)-(19,6)) + │ │ │ ├── in_loc: (18,0)-(18,2) = "in" + │ │ │ └── then_loc: (18,11)-(18,15) = "then" + │ │ ├── @ InNode (location: (20,0)-(21,6)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (20,3)-(20,11)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (20,4)-(20,10)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (20,4)-(20,8)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: (20,4)-(20,5) = "\"" + │ │ │ │ │ │ ├── value_loc: (20,5)-(20,6) = "a" + │ │ │ │ │ │ ├── closing_loc: (20,6)-(20,8) = "\":" + │ │ │ │ │ │ └── unescaped: "a" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ IntegerNode (location: (20,9)-(20,10)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (20,3)-(20,4) = "{" + │ │ │ │ └── closing_loc: (20,10)-(20,11) = "}" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (21,2)-(21,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (21,2)-(21,6)) + │ │ │ ├── in_loc: (20,0)-(20,2) = "in" + │ │ │ └── then_loc: (20,12)-(20,16) = "then" + │ │ ├── @ InNode (location: (22,0)-(23,6)) + │ │ │ ├── pattern: + │ │ │ │ @ AlternationPatternNode (location: (22,3)-(22,8)) + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (22,3)-(22,4)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (22,7)-(22,8)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ └── operator_loc: (22,5)-(22,6) = "|" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (23,2)-(23,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (23,2)-(23,6)) + │ │ │ ├── in_loc: (22,0)-(22,2) = "in" + │ │ │ └── then_loc: (22,9)-(22,13) = "then" + │ │ ├── @ InNode (location: (24,0)-(25,6)) + │ │ │ ├── pattern: + │ │ │ │ @ CapturePatternNode (location: (24,3)-(24,9)) + │ │ │ │ ├── value: + │ │ │ │ │ @ IntegerNode (location: (24,3)-(24,4)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── target: + │ │ │ │ │ @ LocalVariableTargetNode (location: (24,8)-(24,9)) + │ │ │ │ │ ├── name: :a + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: (24,5)-(24,7) = "=>" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (25,2)-(25,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (25,2)-(25,6)) + │ │ │ ├── in_loc: (24,0)-(24,2) = "in" + │ │ │ └── then_loc: (24,10)-(24,14) = "then" + │ │ ├── @ InNode (location: (26,0)-(27,6)) + │ │ │ ├── pattern: + │ │ │ │ @ PinnedVariableNode (location: (26,3)-(26,5)) + │ │ │ │ ├── variable: + │ │ │ │ │ @ LocalVariableReadNode (location: (26,4)-(26,5)) + │ │ │ │ │ ├── name: :x + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: (26,3)-(26,4) = "^" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (27,2)-(27,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ TrueNode (location: (27,2)-(27,6)) + │ │ │ ├── in_loc: (26,0)-(26,2) = "in" + │ │ │ └── then_loc: (26,6)-(26,10) = "then" + │ │ ├── @ InNode (location: (28,0)-(28,4)) + │ │ │ ├── pattern: + │ │ │ │ @ IntegerNode (location: (28,3)-(28,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── statements: ∅ + │ │ │ ├── in_loc: (28,0)-(28,2) = "in" + │ │ │ └── then_loc: ∅ + │ │ └── @ InNode (location: (29,0)-(30,6)) + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (29,3)-(29,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (30,2)-(30,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ TrueNode (location: (30,2)-(30,6)) + │ │ ├── in_loc: (29,0)-(29,2) = "in" + │ │ └── then_loc: (29,5)-(29,9) = "then" + │ ├── consequent: + │ │ @ ElseNode (location: (31,0)-(33,3)) + │ │ ├── else_keyword_loc: (31,0)-(31,4) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (32,2)-(32,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ TrueNode (location: (32,2)-(32,6)) + │ │ └── end_keyword_loc: (33,0)-(33,3) = "end" + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (33,0)-(33,3) = "end" + ├── @ CaseMatchNode (location: (34,0)-(36,3)) + │ ├── predicate: + │ │ @ CallNode (location: (34,5)-(34,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (34,5)-(34,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (35,0)-(35,17)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (35,3)-(35,17)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (35,3)-(35,4)) + │ │ │ │ └── name: :A + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (35,5)-(35,6)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ IntegerNode (location: (35,8)-(35,9)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (35,11)-(35,13)) + │ │ │ │ ├── operator_loc: (35,11)-(35,12) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (35,12)-(35,13)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (35,15)-(35,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ ├── opening_loc: (35,4)-(35,5) = "[" + │ │ │ └── closing_loc: (35,16)-(35,17) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (35,0)-(35,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (34,0)-(34,4) = "case" + │ └── end_keyword_loc: (36,0)-(36,3) = "end" + ├── @ CaseMatchNode (location: (37,0)-(40,3)) + │ ├── predicate: + │ │ @ CallNode (location: (37,5)-(37,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (37,5)-(37,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (38,0)-(38,4)) + │ │ ├── pattern: + │ │ │ @ ConstantReadNode (location: (38,3)-(38,4)) + │ │ │ └── name: :A + │ │ ├── statements: ∅ + │ │ ├── in_loc: (38,0)-(38,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (39,0)-(40,3)) + │ │ ├── else_keyword_loc: (39,0)-(39,4) = "else" + │ │ ├── statements: ∅ + │ │ └── end_keyword_loc: (40,0)-(40,3) = "end" + │ ├── case_keyword_loc: (37,0)-(37,4) = "case" + │ └── end_keyword_loc: (40,0)-(40,3) = "end" + └── @ MatchPredicateNode (location: (41,0)-(41,8)) + ├── value: + │ @ IntegerNode (location: (41,0)-(41,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── pattern: + │ @ ArrayPatternNode (location: (41,5)-(41,8)) + │ ├── constant: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (41,6)-(41,7)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── opening_loc: (41,5)-(41,6) = "[" + │ └── closing_loc: (41,7)-(41,8) = "]" + └── operator_loc: (41,2)-(41,4) = "in" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/pragma.txt b/test/mri/prism/snapshots/unparser/corpus/literal/pragma.txt new file mode 100644 index 00000000000..08e386b872b --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/pragma.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(4,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,7)) + └── body: (length: 4) + ├── @ SourceEncodingNode (location: (1,0)-(1,12)) + ├── @ SourceFileNode (location: (2,0)-(2,8)) + │ ├── flags: ∅ + │ └── filepath: "unparser/corpus/literal/pragma.txt" + ├── @ SourceLineNode (location: (3,0)-(3,8)) + └── @ CallNode (location: (4,0)-(4,7)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :__dir__ + ├── message_loc: (4,0)-(4,7) = "__dir__" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/range.txt b/test/mri/prism/snapshots/unparser/corpus/literal/range.txt new file mode 100644 index 00000000000..ab015d04fce --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/range.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(4,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,5)) + └── body: (length: 4) + ├── @ ParenthesesNode (location: (1,0)-(1,5)) + │ ├── body: + │ │ @ StatementsNode (location: (1,1)-(1,4)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (1,1)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (1,2)-(1,4) = ".." + │ ├── opening_loc: (1,0)-(1,1) = "(" + │ └── closing_loc: (1,4)-(1,5) = ")" + ├── @ RangeNode (location: (2,0)-(2,4)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (2,1)-(2,3) = ".." + ├── @ ParenthesesNode (location: (3,0)-(3,6)) + │ ├── body: + │ │ @ StatementsNode (location: (3,1)-(3,5)) + │ │ └── body: (length: 1) + │ │ └── @ RangeNode (location: (3,1)-(3,5)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ IntegerNode (location: (3,1)-(3,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (3,2)-(3,5) = "..." + │ ├── opening_loc: (3,0)-(3,1) = "(" + │ └── closing_loc: (3,5)-(3,6) = ")" + └── @ RangeNode (location: (4,0)-(4,5)) + ├── flags: exclude_end + ├── left: + │ @ IntegerNode (location: (4,0)-(4,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── right: + │ @ IntegerNode (location: (4,4)-(4,5)) + │ ├── flags: decimal + │ └── value: 2 + └── operator_loc: (4,1)-(4,4) = "..." diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/rescue.txt b/test/mri/prism/snapshots/unparser/corpus/literal/rescue.txt new file mode 100644 index 00000000000..d84366f3f5b --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/rescue.txt @@ -0,0 +1,101 @@ +@ ProgramNode (location: (1,0)-(3,27)) +├── locals: [:x] +└── statements: + @ StatementsNode (location: (1,0)-(3,27)) + └── body: (length: 3) + ├── @ RescueModifierNode (location: (1,0)-(1,14)) + │ ├── expression: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,4)-(1,10) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,11)-(1,14) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RescueModifierNode (location: (2,0)-(2,21)) + │ ├── expression: + │ │ @ CallNode (location: (2,0)-(2,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (2,0)-(2,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (2,4)-(2,10) = "rescue" + │ └── rescue_expression: + │ @ ReturnNode (location: (2,11)-(2,21)) + │ ├── keyword_loc: (2,11)-(2,17) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (2,18)-(2,21)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (2,18)-(2,21)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (2,18)-(2,21) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ LocalVariableWriteNode (location: (3,0)-(3,27)) + ├── name: :x + ├── depth: 0 + ├── name_loc: (3,0)-(3,1) = "x" + ├── value: + │ @ ParenthesesNode (location: (3,4)-(3,27)) + │ ├── body: + │ │ @ StatementsNode (location: (3,5)-(3,26)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (3,5)-(3,26)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (3,5)-(3,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (3,5)-(3,8) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (3,9)-(3,15) = "rescue" + │ │ └── rescue_expression: + │ │ @ ReturnNode (location: (3,16)-(3,26)) + │ │ ├── keyword_loc: (3,16)-(3,22) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (3,23)-(3,26)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,23)-(3,26)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,23)-(3,26) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (3,4)-(3,5) = "(" + │ └── closing_loc: (3,26)-(3,27) = ")" + └── operator_loc: (3,2)-(3,3) = "=" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/send.txt b/test/mri/prism/snapshots/unparser/corpus/literal/send.txt new file mode 100644 index 00000000000..b7eb064717a --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/send.txt @@ -0,0 +1,2190 @@ +@ ProgramNode (location: (1,0)-(84,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(84,7)) + └── body: (length: 62) + ├── @ ModuleNode (location: (1,0)-(3,3)) + │ ├── locals: [:foo, :a, :_] + │ ├── module_keyword_loc: (1,0)-(1,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,7)-(1,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,22)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableOrWriteNode (location: (2,2)-(2,22)) + │ │ ├── name_loc: (2,2)-(2,5) = "foo" + │ │ ├── operator_loc: (2,6)-(2,9) = "||=" + │ │ ├── value: + │ │ │ @ ParenthesesNode (location: (2,10)-(2,22)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (2,11)-(2,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ MultiWriteNode (location: (2,11)-(2,21)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ LocalVariableTargetNode (location: (2,12)-(2,13)) + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── @ LocalVariableTargetNode (location: (2,15)-(2,16)) + │ │ │ │ │ ├── name: :_ + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (2,11)-(2,12) = "(" + │ │ │ │ ├── rparen_loc: (2,16)-(2,17) = ")" + │ │ │ │ ├── operator_loc: (2,18)-(2,19) = "=" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (2,20)-(2,21)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (2,20)-(2,21) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (2,10)-(2,11) = "(" + │ │ │ └── closing_loc: (2,21)-(2,22) = ")" + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── end_keyword_loc: (3,0)-(3,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (5,0)-(8,3)) + │ ├── locals: [:local] + │ ├── module_keyword_loc: (5,0)-(5,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (5,7)-(5,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (6,2)-(7,11)) + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableWriteNode (location: (6,2)-(6,11)) + │ │ │ ├── name: :local + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (6,2)-(6,7) = "local" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (6,10)-(6,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (6,8)-(6,9) = "=" + │ │ └── @ CallNode (location: (7,2)-(7,11)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (7,2)-(7,7)) + │ │ │ ├── name: :local + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: (7,7)-(7,8) = "." + │ │ ├── name: :bar + │ │ ├── message_loc: (7,8)-(7,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── end_keyword_loc: (8,0)-(8,3) = "end" + │ └── name: :A + ├── @ CallNode (location: (9,0)-(10,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ClassNode (location: (9,0)-(10,3)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (9,0)-(9,5) = "class" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (9,6)-(9,7)) + │ │ │ └── name: :A + │ │ ├── inheritance_operator_loc: ∅ + │ │ ├── superclass: ∅ + │ │ ├── body: ∅ + │ │ ├── end_keyword_loc: (10,0)-(10,3) = "end" + │ │ └── name: :A + │ ├── call_operator_loc: (10,3)-(10,4) = "." + │ ├── name: :bar + │ ├── message_loc: (10,4)-(10,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (11,0)-(12,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ModuleNode (location: (11,0)-(12,3)) + │ │ ├── locals: [] + │ │ ├── module_keyword_loc: (11,0)-(11,6) = "module" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (11,7)-(11,8)) + │ │ │ └── name: :A + │ │ ├── body: ∅ + │ │ ├── end_keyword_loc: (12,0)-(12,3) = "end" + │ │ └── name: :A + │ ├── call_operator_loc: (12,3)-(12,4) = "." + │ ├── name: :bar + │ ├── message_loc: (12,4)-(12,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (13,0)-(15,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ BeginNode (location: (13,0)-(15,3)) + │ │ ├── begin_keyword_loc: (13,0)-(13,5) = "begin" + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (14,0)-(14,6)) + │ │ │ ├── keyword_loc: (14,0)-(14,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (15,0)-(15,3) = "end" + │ ├── call_operator_loc: (15,3)-(15,4) = "." + │ ├── name: :bar + │ ├── message_loc: (15,4)-(15,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (16,0)-(19,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CaseNode (location: (16,0)-(19,3)) + │ │ ├── predicate: + │ │ │ @ ParenthesesNode (location: (16,5)-(17,10)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (16,6)-(17,9)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ DefNode (location: (16,6)-(17,3)) + │ │ │ │ │ ├── name: :foo + │ │ │ │ │ ├── name_loc: (16,10)-(16,13) = "foo" + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── def_keyword_loc: (16,6)-(16,9) = "def" + │ │ │ │ │ ├── operator_loc: ∅ + │ │ │ │ │ ├── lparen_loc: ∅ + │ │ │ │ │ ├── rparen_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ │ └── end_keyword_loc: (17,0)-(17,3) = "end" + │ │ │ │ └── @ SymbolNode (location: (17,5)-(17,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (17,5)-(17,6) = ":" + │ │ │ │ ├── value_loc: (17,6)-(17,9) = "bar" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "bar" + │ │ │ ├── opening_loc: (16,5)-(16,6) = "(" + │ │ │ └── closing_loc: (17,9)-(17,10) = ")" + │ │ ├── conditions: (length: 1) + │ │ │ └── @ WhenNode (location: (18,0)-(18,8)) + │ │ │ ├── keyword_loc: (18,0)-(18,4) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ CallNode (location: (18,5)-(18,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (18,5)-(18,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: ∅ + │ │ ├── consequent: ∅ + │ │ ├── case_keyword_loc: (16,0)-(16,4) = "case" + │ │ └── end_keyword_loc: (19,0)-(19,3) = "end" + │ ├── call_operator_loc: (19,3)-(19,4) = "." + │ ├── name: :baz + │ ├── message_loc: (19,4)-(19,7) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (20,0)-(22,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CaseNode (location: (20,0)-(22,3)) + │ │ ├── predicate: + │ │ │ @ CallNode (location: (20,5)-(20,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (20,5)-(20,8) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── conditions: (length: 1) + │ │ │ └── @ WhenNode (location: (21,0)-(21,8)) + │ │ │ ├── keyword_loc: (21,0)-(21,4) = "when" + │ │ │ ├── conditions: (length: 1) + │ │ │ │ └── @ CallNode (location: (21,5)-(21,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (21,5)-(21,8) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ └── statements: ∅ + │ │ ├── consequent: ∅ + │ │ ├── case_keyword_loc: (20,0)-(20,4) = "case" + │ │ └── end_keyword_loc: (22,0)-(22,3) = "end" + │ ├── call_operator_loc: (22,3)-(22,4) = "." + │ ├── name: :baz + │ ├── message_loc: (22,4)-(22,7) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (23,0)-(24,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ SingletonClassNode (location: (23,0)-(24,3)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (23,0)-(23,5) = "class" + │ │ ├── operator_loc: (23,6)-(23,8) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (23,9)-(23,13)) + │ │ ├── body: ∅ + │ │ └── end_keyword_loc: (24,0)-(24,3) = "end" + │ ├── call_operator_loc: (24,3)-(24,4) = "." + │ ├── name: :bar + │ ├── message_loc: (24,4)-(24,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (25,0)-(26,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ DefNode (location: (25,0)-(26,3)) + │ │ ├── name: :foo + │ │ ├── name_loc: (25,9)-(25,12) = "foo" + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (25,4)-(25,8)) + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ │ ├── operator_loc: (25,8)-(25,9) = "." + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (26,0)-(26,3) = "end" + │ ├── call_operator_loc: (26,3)-(26,4) = "." + │ ├── name: :bar + │ ├── message_loc: (26,4)-(26,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (27,0)-(28,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ DefNode (location: (27,0)-(28,3)) + │ │ ├── name: :foo + │ │ ├── name_loc: (27,4)-(27,7) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (27,0)-(27,3) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (28,0)-(28,3) = "end" + │ ├── call_operator_loc: (28,3)-(28,4) = "." + │ ├── name: :bar + │ ├── message_loc: (28,4)-(28,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(30,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ UntilNode (location: (29,0)-(30,3)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (29,0)-(29,5) = "until" + │ │ ├── closing_loc: (30,0)-(30,3) = "end" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (29,6)-(29,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (29,6)-(29,9) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── statements: ∅ + │ ├── call_operator_loc: (30,3)-(30,4) = "." + │ ├── name: :bar + │ ├── message_loc: (30,4)-(30,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(32,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ WhileNode (location: (31,0)-(32,3)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (31,0)-(31,5) = "while" + │ │ ├── closing_loc: (32,0)-(32,3) = "end" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (31,6)-(31,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (31,6)-(31,9) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── statements: ∅ + │ ├── call_operator_loc: (32,3)-(32,4) = "." + │ ├── name: :bar + │ ├── message_loc: (32,4)-(32,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(34,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (33,0)-(34,1)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :loop + │ │ ├── message_loc: (33,0)-(33,4) = "loop" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (33,5)-(34,1)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (33,5)-(33,6) = "{" + │ │ └── closing_loc: (34,0)-(34,1) = "}" + │ ├── call_operator_loc: (34,1)-(34,2) = "." + │ ├── name: :bar + │ ├── message_loc: (34,2)-(34,5) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(36,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IfNode (location: (35,0)-(36,3)) + │ │ ├── if_keyword_loc: (35,0)-(35,2) = "if" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (35,3)-(35,6)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (35,3)-(35,6) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: (36,0)-(36,3) = "end" + │ ├── call_operator_loc: (36,3)-(36,4) = "." + │ ├── name: :baz + │ ├── message_loc: (36,4)-(36,7) = "baz" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (37,0)-(37,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (37,0)-(37,15)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (37,1)-(37,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (37,1)-(37,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ RegularExpressionNode (location: (37,1)-(37,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (37,1)-(37,2) = "/" + │ │ │ │ ├── content_loc: (37,2)-(37,5) = "bar" + │ │ │ │ ├── closing_loc: (37,5)-(37,6) = "/" + │ │ │ │ └── unescaped: "bar" + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :=~ + │ │ │ ├── message_loc: (37,7)-(37,9) = "=~" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (37,10)-(37,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (37,10)-(37,14)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (37,10)-(37,11) = ":" + │ │ │ │ ├── value_loc: (37,11)-(37,14) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (37,0)-(37,1) = "(" + │ │ └── closing_loc: (37,14)-(37,15) = ")" + │ ├── call_operator_loc: (37,15)-(37,16) = "." + │ ├── name: :foo + │ ├── message_loc: (37,16)-(37,19) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (38,0)-(38,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (38,0)-(38,6)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (38,1)-(38,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ RangeNode (location: (38,1)-(38,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── left: + │ │ │ │ @ IntegerNode (location: (38,1)-(38,2)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── right: + │ │ │ │ @ IntegerNode (location: (38,4)-(38,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── operator_loc: (38,2)-(38,4) = ".." + │ │ ├── opening_loc: (38,0)-(38,1) = "(" + │ │ └── closing_loc: (38,5)-(38,6) = ")" + │ ├── call_operator_loc: (38,6)-(38,7) = "." + │ ├── name: :max + │ ├── message_loc: (38,7)-(38,10) = "max" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (39,0)-(39,14)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (39,1)-(39,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (39,1)-(39,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (39,1)-(39,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (39,1)-(39,4) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :=~ + │ │ │ ├── message_loc: (39,5)-(39,7) = "=~" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (39,8)-(39,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ RegularExpressionNode (location: (39,8)-(39,13)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (39,8)-(39,9) = "/" + │ │ │ │ ├── content_loc: (39,9)-(39,12) = "bar" + │ │ │ │ ├── closing_loc: (39,12)-(39,13) = "/" + │ │ │ │ └── unescaped: "bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (39,0)-(39,1) = "(" + │ │ └── closing_loc: (39,13)-(39,14) = ")" + │ ├── call_operator_loc: (39,14)-(39,15) = "." + │ ├── name: :foo + │ ├── message_loc: (39,15)-(39,18) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (40,0)-(40,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RegularExpressionNode (location: (40,0)-(40,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (40,0)-(40,1) = "/" + │ │ ├── content_loc: (40,1)-(40,4) = "bar" + │ │ ├── closing_loc: (40,4)-(40,5) = "/" + │ │ └── unescaped: "bar" + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (40,6)-(40,8) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (40,9)-(40,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (40,9)-(40,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (40,9)-(40,10) = ":" + │ │ ├── value_loc: (40,10)-(40,13) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(41,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ RegularExpressionNode (location: (41,0)-(41,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (41,0)-(41,1) = "/" + │ │ ├── content_loc: (41,1)-(41,4) = "bar" + │ │ ├── closing_loc: (41,4)-(41,5) = "/" + │ │ └── unescaped: "bar" + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (41,6)-(41,8) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (41,9)-(41,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (41,9)-(41,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (41,9)-(41,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ RangeNode (location: (42,0)-(42,8)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (42,0)-(42,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── right: + │ │ @ CallNode (location: (42,3)-(42,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (42,3)-(42,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── call_operator_loc: (42,4)-(42,5) = "." + │ │ ├── name: :max + │ │ ├── message_loc: (42,5)-(42,8) = "max" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (42,1)-(42,3) = ".." + ├── @ CallNode (location: (43,0)-(43,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ConstantReadNode (location: (43,0)-(43,1)) + │ │ └── name: :A + │ ├── call_operator_loc: (43,1)-(43,2) = "." + │ ├── name: :foo + │ ├── message_loc: (43,2)-(43,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (44,0)-(44,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :FOO + │ ├── message_loc: (44,0)-(44,3) = "FOO" + │ ├── opening_loc: (44,3)-(44,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (44,4)-(44,5) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,4)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (45,0)-(45,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (45,0)-(45,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (45,1)-(45,3) = "&." + │ ├── name: :b + │ ├── message_loc: (45,3)-(45,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (46,0)-(46,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (46,0)-(46,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (46,0)-(46,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (46,1)-(46,2) = "." + │ ├── name: :foo + │ ├── message_loc: (46,2)-(46,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (47,0)-(47,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (47,0)-(47,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (48,0)-(48,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (48,0)-(48,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (48,0)-(48,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<< + │ ├── message_loc: (48,4)-(48,6) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (48,7)-(48,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (48,7)-(48,18)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (48,8)-(48,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (48,8)-(48,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (48,8)-(48,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (48,8)-(48,11) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :* + │ │ │ ├── message_loc: (48,12)-(48,13) = "*" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (48,14)-(48,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (48,14)-(48,17)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (48,14)-(48,17) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (48,7)-(48,8) = "(" + │ │ └── closing_loc: (48,17)-(48,18) = ")" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (49,0)-(49,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (49,0)-(49,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (49,0)-(49,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (49,4)-(49,6) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (49,7)-(49,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ RegularExpressionNode (location: (49,7)-(49,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (49,7)-(49,8) = "/" + │ │ ├── content_loc: (49,8)-(49,11) = "bar" + │ │ ├── closing_loc: (49,11)-(49,12) = "/" + │ │ └── unescaped: "bar" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (50,0)-(50,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (50,0)-(50,3) = "foo" + │ ├── opening_loc: (50,3)-(50,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (50,17)-(50,18) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (50,4)-(50,17)) + │ ├── expression: + │ │ @ ParenthesesNode (location: (50,5)-(50,17)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (50,6)-(50,16)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ OrNode (location: (50,6)-(50,16)) + │ │ │ ├── left: + │ │ │ │ @ CallNode (location: (50,6)-(50,9)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (50,6)-(50,9) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (50,13)-(50,16)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (50,13)-(50,16) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (50,10)-(50,12) = "||" + │ │ ├── opening_loc: (50,5)-(50,6) = "(" + │ │ └── closing_loc: (50,16)-(50,17) = ")" + │ └── operator_loc: (50,4)-(50,5) = "&" + ├── @ CallNode (location: (51,0)-(51,10)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (51,0)-(51,3) = "foo" + │ ├── opening_loc: (51,3)-(51,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (51,10)-(51,11) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (51,4)-(51,10)) + │ ├── expression: + │ │ @ CallNode (location: (51,5)-(51,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (51,5)-(51,10) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (51,4)-(51,5) = "&" + ├── @ CallNode (location: (52,0)-(52,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (52,0)-(52,3) = "foo" + │ ├── opening_loc: (52,3)-(52,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (52,4)-(52,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (52,4)-(52,9)) + │ │ ├── operator_loc: (52,4)-(52,5) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (52,5)-(52,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (52,5)-(52,9) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (52,17)-(52,18) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (52,11)-(52,17)) + │ ├── expression: + │ │ @ CallNode (location: (52,12)-(52,17)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (52,12)-(52,17) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (52,11)-(52,12) = "&" + ├── @ CallNode (location: (53,0)-(53,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (53,0)-(53,3) = "foo" + │ ├── opening_loc: (53,3)-(53,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (53,4)-(53,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (53,4)-(53,14)) + │ │ ├── operator_loc: (53,4)-(53,5) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (53,5)-(53,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :arguments + │ │ ├── message_loc: (53,5)-(53,14) = "arguments" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (53,14)-(53,15) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (54,0)-(54,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (54,0)-(54,3) = "foo" + │ ├── opening_loc: (54,3)-(54,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (54,4)-(54,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (54,4)-(54,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (54,7)-(54,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: (54,8)-(54,9) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (55,0)-(55,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (55,0)-(55,3) = "foo" + │ ├── opening_loc: (55,3)-(55,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (55,4)-(55,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (55,4)-(55,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (55,4)-(55,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (55,7)-(55,8) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (56,0)-(56,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (56,0)-(56,3) = "foo" + │ ├── opening_loc: (56,3)-(56,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (56,4)-(56,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (56,4)-(56,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (56,4)-(56,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ SplatNode (location: (56,9)-(56,14)) + │ │ ├── operator_loc: (56,9)-(56,10) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (56,10)-(56,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (56,10)-(56,14) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (56,14)-(56,15) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (57,0)-(57,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (57,0)-(57,3) = "foo" + │ ├── opening_loc: (57,3)-(57,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (57,4)-(57,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (57,4)-(57,16)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (57,4)-(57,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (57,4)-(57,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (57,8)-(57,10) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (57,11)-(57,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ RegularExpressionNode (location: (57,11)-(57,16)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (57,11)-(57,12) = "/" + │ │ │ ├── content_loc: (57,12)-(57,15) = "bar" + │ │ │ ├── closing_loc: (57,15)-(57,16) = "/" + │ │ │ └── unescaped: "bar" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (57,16)-(57,17) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (58,0)-(58,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (58,0)-(58,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (58,0)-(58,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (58,3)-(58,4) = "." + │ ├── name: :bar + │ ├── message_loc: (58,4)-(58,7) = "bar" + │ ├── opening_loc: (58,7)-(58,8) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (58,12)-(58,13) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (58,8)-(58,12)) + │ ├── expression: + │ │ @ CallNode (location: (58,9)-(58,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (58,9)-(58,12) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (58,8)-(58,9) = "&" + ├── @ CallNode (location: (59,0)-(59,26)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (59,0)-(59,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (59,0)-(59,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (59,3)-(59,4) = "." + │ ├── name: :bar + │ ├── message_loc: (59,4)-(59,7) = "bar" + │ ├── opening_loc: (59,7)-(59,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (59,8)-(59,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ SplatNode (location: (59,8)-(59,13)) + │ │ │ ├── operator_loc: (59,8)-(59,9) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (59,9)-(59,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :arga + │ │ │ ├── message_loc: (59,9)-(59,13) = "arga" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ CallNode (location: (59,15)-(59,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (59,15)-(59,18) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ SplatNode (location: (59,20)-(59,25)) + │ │ ├── operator_loc: (59,20)-(59,21) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (59,21)-(59,25)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :argb + │ │ ├── message_loc: (59,21)-(59,25) = "argb" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (59,25)-(59,26) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (60,0)-(60,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (60,0)-(60,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (60,0)-(60,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (60,3)-(60,4) = "." + │ ├── name: :bar + │ ├── message_loc: (60,4)-(60,7) = "bar" + │ ├── opening_loc: (60,7)-(60,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (60,8)-(60,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (60,8)-(60,13)) + │ │ ├── operator_loc: (60,8)-(60,9) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (60,9)-(60,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (60,9)-(60,13) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (60,13)-(60,14) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (61,0)-(61,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (61,0)-(61,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (61,0)-(61,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (61,3)-(61,4) = "." + │ ├── name: :bar + │ ├── message_loc: (61,4)-(61,7) = "bar" + │ ├── opening_loc: (61,7)-(61,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (61,8)-(61,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ SplatNode (location: (61,8)-(61,13)) + │ │ │ ├── operator_loc: (61,8)-(61,9) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (61,9)-(61,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :args + │ │ │ ├── message_loc: (61,9)-(61,13) = "args" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (61,15)-(61,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (61,15)-(61,18) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (61,18)-(61,19) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (62,0)-(62,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (62,0)-(62,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (62,0)-(62,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (62,3)-(62,4) = "." + │ ├── name: :bar + │ ├── message_loc: (62,4)-(62,7) = "bar" + │ ├── opening_loc: (62,7)-(62,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (62,8)-(62,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (62,8)-(62,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (62,8)-(62,9) = ":" + │ │ ├── value_loc: (62,9)-(62,12) = "baz" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "baz" + │ ├── closing_loc: (62,18)-(62,19) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (62,14)-(62,18)) + │ ├── expression: + │ │ @ CallNode (location: (62,15)-(62,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (62,15)-(62,18) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (62,14)-(62,15) = "&" + ├── @ CallNode (location: (63,0)-(63,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (63,0)-(63,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (63,0)-(63,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (63,3)-(63,4) = "." + │ ├── name: :bar + │ ├── message_loc: (63,4)-(63,7) = "bar" + │ ├── opening_loc: (63,7)-(63,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (63,8)-(63,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (63,8)-(63,16)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (63,8)-(63,16)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (63,8)-(63,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (63,8)-(63,11) = "baz" + │ │ │ ├── closing_loc: (63,11)-(63,12) = ":" + │ │ │ └── unescaped: "baz" + │ │ ├── value: + │ │ │ @ CallNode (location: (63,13)-(63,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :boz + │ │ │ ├── message_loc: (63,13)-(63,16) = "boz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (63,16)-(63,17) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (64,0)-(64,26)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (64,0)-(64,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (64,0)-(64,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (64,3)-(64,4) = "." + │ ├── name: :bar + │ ├── message_loc: (64,4)-(64,7) = "bar" + │ ├── opening_loc: (64,7)-(64,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (64,8)-(64,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (64,8)-(64,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (64,8)-(64,11) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ KeywordHashNode (location: (64,13)-(64,25)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (64,13)-(64,25)) + │ │ ├── key: + │ │ │ @ StringNode (location: (64,13)-(64,18)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: (64,13)-(64,14) = "\"" + │ │ │ ├── content_loc: (64,14)-(64,17) = "baz" + │ │ │ ├── closing_loc: (64,17)-(64,18) = "\"" + │ │ │ └── unescaped: "baz" + │ │ ├── value: + │ │ │ @ CallNode (location: (64,22)-(64,25)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :boz + │ │ │ ├── message_loc: (64,22)-(64,25) = "boz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (64,19)-(64,21) = "=>" + │ ├── closing_loc: (64,25)-(64,26) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (65,0)-(65,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (65,0)-(65,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (65,0)-(65,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (65,3)-(65,4) = "." + │ ├── name: :bar + │ ├── message_loc: (65,4)-(65,7) = "bar" + │ ├── opening_loc: (65,7)-(65,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (65,8)-(65,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (65,8)-(65,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (65,8)-(65,11) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ SplatNode (location: (65,13)-(65,18)) + │ │ ├── operator_loc: (65,13)-(65,14) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (65,14)-(65,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (65,14)-(65,18) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (65,18)-(65,19) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (66,0)-(66,27)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (66,0)-(66,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (66,0)-(66,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (66,3)-(66,4) = "." + │ ├── name: :bar + │ ├── message_loc: (66,4)-(66,7) = "bar" + │ ├── opening_loc: (66,7)-(66,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (66,8)-(66,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (66,8)-(66,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (66,8)-(66,11) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ SplatNode (location: (66,13)-(66,18)) + │ │ ├── operator_loc: (66,13)-(66,14) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (66,14)-(66,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :args + │ │ ├── message_loc: (66,14)-(66,18) = "args" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (66,26)-(66,27) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (66,20)-(66,26)) + │ ├── expression: + │ │ @ CallNode (location: (66,21)-(66,26)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (66,21)-(66,26) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (66,20)-(66,21) = "&" + ├── @ CallNode (location: (67,0)-(67,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (67,0)-(67,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (67,0)-(67,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (67,3)-(67,4) = "." + │ ├── name: :bar + │ ├── message_loc: (67,4)-(67,7) = "bar" + │ ├── opening_loc: (67,7)-(67,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (67,8)-(67,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (67,8)-(67,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (67,8)-(67,11) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ HashNode (location: (67,13)-(67,15)) + │ │ ├── opening_loc: (67,13)-(67,14) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (67,14)-(67,15) = "}" + │ ├── closing_loc: (67,15)-(67,16) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (68,0)-(68,26)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (68,0)-(68,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (68,0)-(68,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (68,3)-(68,4) = "." + │ ├── name: :bar + │ ├── message_loc: (68,4)-(68,7) = "bar" + │ ├── opening_loc: (68,7)-(68,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (68,8)-(68,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ HashNode (location: (68,8)-(68,20)) + │ │ │ ├── opening_loc: (68,8)-(68,9) = "{" + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (68,10)-(68,18)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (68,10)-(68,14)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (68,10)-(68,13) = "foo" + │ │ │ │ │ ├── closing_loc: (68,13)-(68,14) = ":" + │ │ │ │ │ └── unescaped: "foo" + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (68,15)-(68,18)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :boz + │ │ │ │ │ ├── message_loc: (68,15)-(68,18) = "boz" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── closing_loc: (68,19)-(68,20) = "}" + │ │ └── @ CallNode (location: (68,22)-(68,25)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :boz + │ │ ├── message_loc: (68,22)-(68,25) = "boz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (68,25)-(68,26) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (69,0)-(69,12)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (69,0)-(69,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (69,0)-(69,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (69,3)-(69,4) = "." + │ ├── name: :bar= + │ ├── message_loc: (69,4)-(69,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (69,8)-(69,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (69,8)-(69,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (69,8)-(69,9) = ":" + │ │ ├── value_loc: (69,9)-(69,12) = "baz" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "baz" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (70,0)-(70,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (70,0)-(70,3) = "foo" + │ ├── opening_loc: (70,3)-(70,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (70,4)-(70,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (70,4)-(70,8)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (70,4)-(70,8)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (70,4)-(70,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (70,4)-(70,5) = "a" + │ │ │ ├── closing_loc: (70,5)-(70,6) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (70,7)-(70,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (70,7)-(70,8) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (70,8)-(70,9) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (71,0)-(71,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (71,0)-(71,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (71,0)-(71,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (71,3)-(71,4) = "." + │ ├── name: :& + │ ├── message_loc: (71,4)-(71,5) = "&" + │ ├── opening_loc: (71,5)-(71,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (71,6)-(71,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (71,6)-(71,10)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (71,6)-(71,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (71,6)-(71,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (71,6)-(71,7) = "a" + │ │ │ ├── closing_loc: (71,7)-(71,8) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (71,9)-(71,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (71,9)-(71,10) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (71,10)-(71,11) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (72,0)-(72,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (72,0)-(72,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (72,0)-(72,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (72,3)-(72,4) = "." + │ ├── name: :& + │ ├── message_loc: (72,4)-(72,5) = "&" + │ ├── opening_loc: (72,5)-(72,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (72,6)-(72,9)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (72,6)-(72,9)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (72,6)-(72,9)) + │ │ ├── value: + │ │ │ @ CallNode (location: (72,8)-(72,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (72,8)-(72,9) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (72,6)-(72,8) = "**" + │ ├── closing_loc: (72,9)-(72,10) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (73,0)-(73,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (73,0)-(73,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (73,0)-(73,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (73,3)-(73,9) = "[*baz]" + │ ├── opening_loc: (73,3)-(73,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (73,4)-(73,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (73,4)-(73,8)) + │ │ ├── operator_loc: (73,4)-(73,5) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (73,5)-(73,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (73,5)-(73,8) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (73,8)-(73,9) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (74,0)-(74,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (74,0)-(74,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (74,0)-(74,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (74,3)-(74,9) = "[1, 2]" + │ ├── opening_loc: (74,3)-(74,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (74,4)-(74,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (74,4)-(74,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (74,7)-(74,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: (74,8)-(74,9) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (75,0)-(75,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (75,0)-(75,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (75,0)-(75,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :[] + │ ├── message_loc: (75,3)-(75,5) = "[]" + │ ├── opening_loc: (75,3)-(75,4) = "[" + │ ├── arguments: ∅ + │ ├── closing_loc: (75,4)-(75,5) = "]" + │ └── block: ∅ + ├── @ CallNode (location: (76,0)-(76,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: + │ │ @ SelfNode (location: (76,0)-(76,4)) + │ ├── call_operator_loc: (76,4)-(76,5) = "." + │ ├── name: :foo + │ ├── message_loc: (76,5)-(76,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (77,0)-(77,13)) + │ ├── flags: attribute_write, ignore_visibility + │ ├── receiver: + │ │ @ SelfNode (location: (77,0)-(77,4)) + │ ├── call_operator_loc: (77,4)-(77,5) = "." + │ ├── name: :foo= + │ ├── message_loc: (77,5)-(77,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (77,9)-(77,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (77,9)-(77,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (77,9)-(77,10) = ":" + │ │ ├── value_loc: (77,10)-(77,13) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (78,0)-(78,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (78,0)-(78,7)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (78,1)-(78,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (78,1)-(78,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (78,1)-(78,2)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (78,1)-(78,2) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (78,3)-(78,4) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (78,5)-(78,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (78,5)-(78,6)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (78,5)-(78,6) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (78,0)-(78,1) = "(" + │ │ └── closing_loc: (78,6)-(78,7) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :/ + │ ├── message_loc: (78,8)-(78,9) = "/" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (78,10)-(78,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (78,10)-(78,17)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (78,11)-(78,16)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (78,11)-(78,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (78,11)-(78,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (78,11)-(78,12) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :- + │ │ │ ├── message_loc: (78,13)-(78,14) = "-" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (78,15)-(78,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (78,15)-(78,16)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (78,15)-(78,16) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (78,10)-(78,11) = "(" + │ │ └── closing_loc: (78,16)-(78,17) = ")" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (79,0)-(79,19)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (79,0)-(79,7)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (79,1)-(79,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (79,1)-(79,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (79,1)-(79,2)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (79,1)-(79,2) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (79,3)-(79,4) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (79,5)-(79,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (79,5)-(79,6)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (79,5)-(79,6) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (79,0)-(79,1) = "(" + │ │ └── closing_loc: (79,6)-(79,7) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :/ + │ ├── message_loc: (79,8)-(79,9) = "/" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (79,10)-(79,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (79,10)-(79,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (79,10)-(79,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (79,10)-(79,11) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (79,11)-(79,12) = "." + │ │ ├── name: :- + │ │ ├── message_loc: (79,12)-(79,13) = "-" + │ │ ├── opening_loc: (79,13)-(79,14) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (79,14)-(79,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ CallNode (location: (79,14)-(79,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :e + │ │ │ │ ├── message_loc: (79,14)-(79,15) = "e" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ CallNode (location: (79,17)-(79,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :f + │ │ │ ├── message_loc: (79,17)-(79,18) = "f" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (79,18)-(79,19) = ")" + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (80,0)-(80,17)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (80,0)-(80,7)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (80,1)-(80,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (80,1)-(80,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (80,1)-(80,2)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (80,1)-(80,2) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (80,3)-(80,4) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (80,5)-(80,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (80,5)-(80,6)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (80,5)-(80,6) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (80,0)-(80,1) = "(" + │ │ └── closing_loc: (80,6)-(80,7) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :/ + │ ├── message_loc: (80,8)-(80,9) = "/" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (80,10)-(80,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (80,10)-(80,17)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (80,10)-(80,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (80,10)-(80,11) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (80,11)-(80,12) = "." + │ │ ├── name: :- + │ │ ├── message_loc: (80,12)-(80,13) = "-" + │ │ ├── opening_loc: (80,13)-(80,14) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (80,14)-(80,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SplatNode (location: (80,14)-(80,16)) + │ │ │ ├── operator_loc: (80,14)-(80,15) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (80,15)-(80,16)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :f + │ │ │ ├── message_loc: (80,15)-(80,16) = "f" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (80,16)-(80,17) = ")" + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (81,0)-(81,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (81,0)-(81,1) = "x" + │ ├── opening_loc: (81,1)-(81,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (81,2)-(81,7)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (81,2)-(81,7)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (81,2)-(81,7)) + │ │ ├── value: + │ │ │ @ CallNode (location: (81,4)-(81,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (81,4)-(81,7) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (81,2)-(81,4) = "**" + │ ├── closing_loc: (81,7)-(81,8) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (82,0)-(82,6)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (82,0)-(82,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (82,0)-(82,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (82,3)-(82,5) = "&." + │ ├── name: :! + │ ├── message_loc: (82,5)-(82,6) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (83,0)-(83,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (83,0)-(83,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (83,0)-(83,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (83,3)-(83,4) = "." + │ ├── name: :~ + │ ├── message_loc: (83,4)-(83,5) = "~" + │ ├── opening_loc: (83,5)-(83,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (83,6)-(83,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (83,6)-(83,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (83,6)-(83,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (83,7)-(83,8) = ")" + │ └── block: ∅ + └── @ CallNode (location: (84,0)-(84,7)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (84,0)-(84,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (84,0)-(84,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (84,1)-(84,3) = "&." + ├── name: :+ + ├── message_loc: (84,3)-(84,4) = "+" + ├── opening_loc: (84,4)-(84,5) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (84,5)-(84,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (84,5)-(84,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (84,5)-(84,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (84,6)-(84,7) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/since/27.txt b/test/mri/prism/snapshots/unparser/corpus/literal/since/27.txt new file mode 100644 index 00000000000..60edc18604f --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/since/27.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(4,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,5)) + └── body: (length: 2) + ├── @ LambdaNode (location: (1,0)-(3,1)) + │ ├── locals: [:_1, :_2] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,3)-(1,4) = "{" + │ ├── closing_loc: (3,0)-(3,1) = "}" + │ ├── parameters: + │ │ @ NumberedParametersNode (location: (1,0)-(3,1)) + │ │ └── maximum: 2 + │ └── body: + │ @ StatementsNode (location: (2,2)-(2,9)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (2,2)-(2,4)) + │ │ ├── name: :_1 + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (2,5)-(2,6) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,7)-(2,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (2,7)-(2,9)) + │ │ ├── name: :_2 + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ ParenthesesNode (location: (4,0)-(4,5)) + ├── body: + │ @ StatementsNode (location: (4,1)-(4,4)) + │ └── body: (length: 1) + │ └── @ RangeNode (location: (4,1)-(4,4)) + │ ├── flags: ∅ + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (4,3)-(4,4)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (4,1)-(4,3) = ".." + ├── opening_loc: (4,0)-(4,1) = "(" + └── closing_loc: (4,4)-(4,5) = ")" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/since/30.txt b/test/mri/prism/snapshots/unparser/corpus/literal/since/30.txt new file mode 100644 index 00000000000..300dd869f5a --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/since/30.txt @@ -0,0 +1,88 @@ +@ ProgramNode (location: (1,0)-(4,17)) +├── locals: [:a, :foo] +└── statements: + @ StatementsNode (location: (1,0)-(4,17)) + └── body: (length: 4) + ├── @ MatchRequiredNode (location: (1,0)-(1,8)) + │ ├── value: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (1,5)-(1,8)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "[" + │ │ └── closing_loc: (1,7)-(1,8) = "]" + │ └── operator_loc: (1,2)-(1,4) = "=>" + ├── @ MatchRequiredNode (location: (2,0)-(2,8)) + │ ├── value: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,5)-(2,8)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,6)-(2,7)) + │ │ │ ├── operator_loc: (2,6)-(2,7) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,5)-(2,6) = "[" + │ │ └── closing_loc: (2,7)-(2,8) = "]" + │ └── operator_loc: (2,2)-(2,4) = "=>" + ├── @ MatchPredicateNode (location: (3,0)-(3,15)) + │ ├── value: + │ │ @ IntegerNode (location: (3,0)-(3,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── pattern: + │ │ @ FindPatternNode (location: (3,5)-(3,15)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (3,6)-(3,7)) + │ │ │ ├── operator_loc: (3,6)-(3,7) = "*" + │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,9)-(3,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── right: + │ │ │ @ SplatNode (location: (3,13)-(3,14)) + │ │ │ ├── operator_loc: (3,13)-(3,14) = "*" + │ │ │ └── expression: ∅ + │ │ ├── opening_loc: (3,5)-(3,6) = "[" + │ │ └── closing_loc: (3,14)-(3,15) = "]" + │ └── operator_loc: (3,2)-(3,4) = "in" + └── @ MatchPredicateNode (location: (4,0)-(4,17)) + ├── value: + │ @ IntegerNode (location: (4,0)-(4,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── pattern: + │ @ FindPatternNode (location: (4,5)-(4,17)) + │ ├── constant: ∅ + │ ├── left: + │ │ @ SplatNode (location: (4,6)-(4,7)) + │ │ ├── operator_loc: (4,6)-(4,7) = "*" + │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (4,9)-(4,10)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── right: + │ │ @ SplatNode (location: (4,12)-(4,16)) + │ │ ├── operator_loc: (4,12)-(4,13) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (4,13)-(4,16)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── opening_loc: (4,5)-(4,6) = "[" + │ └── closing_loc: (4,16)-(4,17) = "]" + └── operator_loc: (4,2)-(4,4) = "in" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/since/31.txt b/test/mri/prism/snapshots/unparser/corpus/literal/since/31.txt new file mode 100644 index 00000000000..142a56ae832 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/since/31.txt @@ -0,0 +1,90 @@ +@ ProgramNode (location: (1,0)-(7,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,3)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(3,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,9)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,8)-(1,9) = "&" + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (2,2)-(2,5) = "bar" + │ │ ├── opening_loc: (2,5)-(2,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ │ └── block: + │ │ @ BlockArgumentNode (location: (2,6)-(2,7)) + │ │ ├── expression: ∅ + │ │ └── operator_loc: (2,6)-(2,7) = "&" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,9)-(1,10) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ DefNode (location: (5,0)-(7,3)) + ├── name: :foo + ├── name_loc: (5,4)-(5,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (5,8)-(5,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (5,8)-(5,9)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (5,11)-(5,12)) + │ ├── flags: ∅ + │ ├── name: ∅ + │ ├── name_loc: ∅ + │ └── operator_loc: (5,11)-(5,12) = "&" + ├── body: + │ @ StatementsNode (location: (6,2)-(6,7)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (6,2)-(6,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (6,2)-(6,5) = "bar" + │ ├── opening_loc: (6,5)-(6,6) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (6,7)-(6,8) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (6,6)-(6,7)) + │ ├── expression: ∅ + │ └── operator_loc: (6,6)-(6,7) = "&" + ├── locals: [:a] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (5,7)-(5,8) = "(" + ├── rparen_loc: (5,12)-(5,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (7,0)-(7,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/since/32.txt b/test/mri/prism/snapshots/unparser/corpus/literal/since/32.txt new file mode 100644 index 00000000000..ee8dd7f53d1 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/since/32.txt @@ -0,0 +1,108 @@ +@ ProgramNode (location: (1,0)-(7,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,3)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(3,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,20)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :argument + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (1,18)-(1,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: ∅ + │ │ │ ├── name_loc: ∅ + │ │ │ └── operator_loc: (1,18)-(1,20) = "**" + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (2,2)-(2,5) = "bar" + │ │ ├── opening_loc: (2,5)-(2,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,6)-(2,18)) + │ │ │ ├── flags: contains_keyword_splat + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ LocalVariableReadNode (location: (2,6)-(2,14)) + │ │ │ │ ├── name: :argument + │ │ │ │ └── depth: 0 + │ │ │ └── @ KeywordHashNode (location: (2,16)-(2,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocSplatNode (location: (2,16)-(2,18)) + │ │ │ ├── value: ∅ + │ │ │ └── operator_loc: (2,16)-(2,18) = "**" + │ │ ├── closing_loc: (2,18)-(2,19) = ")" + │ │ └── block: ∅ + │ ├── locals: [:argument] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,20)-(1,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ DefNode (location: (5,0)-(7,3)) + ├── name: :foo + ├── name_loc: (5,4)-(5,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (5,8)-(5,19)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (5,8)-(5,16)) + │ │ ├── flags: ∅ + │ │ └── name: :argument + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (5,18)-(5,19)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (5,18)-(5,19) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (6,2)-(6,18)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (6,2)-(6,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (6,2)-(6,5) = "bar" + │ ├── opening_loc: (6,5)-(6,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (6,6)-(6,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (6,6)-(6,14)) + │ │ │ ├── name: :argument + │ │ │ └── depth: 0 + │ │ └── @ SplatNode (location: (6,16)-(6,17)) + │ │ ├── operator_loc: (6,16)-(6,17) = "*" + │ │ └── expression: ∅ + │ ├── closing_loc: (6,17)-(6,18) = ")" + │ └── block: ∅ + ├── locals: [:argument] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (5,7)-(5,8) = "(" + ├── rparen_loc: (5,19)-(5,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (7,0)-(7,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/singletons.txt b/test/mri/prism/snapshots/unparser/corpus/literal/singletons.txt new file mode 100644 index 00000000000..45c06f7b07d --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/singletons.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(4,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,4)) + └── body: (length: 4) + ├── @ FalseNode (location: (1,0)-(1,5)) + ├── @ NilNode (location: (2,0)-(2,3)) + ├── @ SelfNode (location: (3,0)-(3,4)) + └── @ TrueNode (location: (4,0)-(4,4)) diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/super.txt b/test/mri/prism/snapshots/unparser/corpus/literal/super.txt new file mode 100644 index 00000000000..d5a78899197 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/super.txt @@ -0,0 +1,277 @@ +@ ProgramNode (location: (1,0)-(21,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(21,1)) + └── body: (length: 11) + ├── @ ForwardingSuperNode (location: (1,0)-(1,5)) + │ └── block: ∅ + ├── @ SuperNode (location: (2,0)-(2,7)) + │ ├── keyword_loc: (2,0)-(2,5) = "super" + │ ├── lparen_loc: (2,5)-(2,6) = "(" + │ ├── arguments: ∅ + │ ├── rparen_loc: (2,6)-(2,7) = ")" + │ └── block: ∅ + ├── @ SuperNode (location: (3,0)-(3,8)) + │ ├── keyword_loc: (3,0)-(3,5) = "super" + │ ├── lparen_loc: (3,5)-(3,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,6)-(3,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,6)-(3,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rparen_loc: (3,7)-(3,8) = ")" + │ └── block: ∅ + ├── @ SuperNode (location: (4,0)-(4,11)) + │ ├── keyword_loc: (4,0)-(4,5) = "super" + │ ├── lparen_loc: (4,5)-(4,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,6)-(4,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (4,6)-(4,7)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (4,6)-(4,7) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (4,9)-(4,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (4,9)-(4,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rparen_loc: (4,10)-(4,11) = ")" + │ └── block: ∅ + ├── @ SuperNode (location: (5,0)-(5,13)) + │ ├── keyword_loc: (5,0)-(5,5) = "super" + │ ├── lparen_loc: (5,5)-(5,6) = "(" + │ ├── arguments: ∅ + │ ├── rparen_loc: (5,12)-(5,13) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (5,6)-(5,12)) + │ ├── expression: + │ │ @ CallNode (location: (5,7)-(5,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (5,7)-(5,12) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (5,6)-(5,7) = "&" + ├── @ SuperNode (location: (6,0)-(6,16)) + │ ├── keyword_loc: (6,0)-(6,5) = "super" + │ ├── lparen_loc: (6,5)-(6,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (6,6)-(6,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (6,6)-(6,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (6,6)-(6,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rparen_loc: (6,15)-(6,16) = ")" + │ └── block: + │ @ BlockArgumentNode (location: (6,9)-(6,15)) + │ ├── expression: + │ │ @ CallNode (location: (6,10)-(6,15)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :block + │ │ ├── message_loc: (6,10)-(6,15) = "block" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (6,9)-(6,10) = "&" + ├── @ SuperNode (location: (7,0)-(9,2)) + │ ├── keyword_loc: (7,0)-(7,5) = "super" + │ ├── lparen_loc: (7,5)-(7,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(9,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,6)-(9,1)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (7,6)-(7,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (7,8)-(9,1)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (8,2)-(8,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (8,2)-(8,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (8,2)-(8,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (7,8)-(7,9) = "{" + │ │ └── closing_loc: (9,0)-(9,1) = "}" + │ ├── rparen_loc: (9,1)-(9,2) = ")" + │ └── block: ∅ + ├── @ ForwardingSuperNode (location: (10,0)-(12,1)) + │ └── block: + │ @ BlockNode (location: (10,6)-(12,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (11,2)-(11,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (11,2)-(11,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (11,2)-(11,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (10,6)-(10,7) = "{" + │ └── closing_loc: (12,0)-(12,1) = "}" + ├── @ SuperNode (location: (13,0)-(15,1)) + │ ├── keyword_loc: (13,0)-(13,5) = "super" + │ ├── lparen_loc: (13,5)-(13,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,6)-(13,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (13,6)-(13,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (13,6)-(13,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rparen_loc: (13,7)-(13,8) = ")" + │ └── block: + │ @ BlockNode (location: (13,9)-(15,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,2)-(14,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (14,2)-(14,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (14,2)-(14,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (13,9)-(13,10) = "{" + │ └── closing_loc: (15,0)-(15,1) = "}" + ├── @ SuperNode (location: (16,0)-(18,1)) + │ ├── keyword_loc: (16,0)-(16,5) = "super" + │ ├── lparen_loc: (16,5)-(16,6) = "(" + │ ├── arguments: ∅ + │ ├── rparen_loc: (16,6)-(16,7) = ")" + │ └── block: + │ @ BlockNode (location: (16,8)-(18,1)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (17,2)-(17,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (17,2)-(17,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (17,2)-(17,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (16,8)-(16,9) = "{" + │ └── closing_loc: (18,0)-(18,1) = "}" + └── @ SuperNode (location: (19,0)-(21,1)) + ├── keyword_loc: (19,0)-(19,5) = "super" + ├── lparen_loc: (19,5)-(19,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (19,6)-(19,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (19,6)-(19,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (19,6)-(19,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ CallNode (location: (19,9)-(19,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (19,9)-(19,10) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rparen_loc: (19,10)-(19,11) = ")" + └── block: + @ BlockNode (location: (19,12)-(21,1)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (20,2)-(20,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (20,2)-(20,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (20,2)-(20,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (19,12)-(19,13) = "{" + └── closing_loc: (21,0)-(21,1) = "}" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/unary.txt b/test/mri/prism/snapshots/unparser/corpus/literal/unary.txt new file mode 100644 index 00000000000..5e9563d811d --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/unary.txt @@ -0,0 +1,248 @@ +@ ProgramNode (location: (1,0)-(8,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,9)) + └── body: (length: 8) + ├── @ CallNode (location: (1,0)-(1,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,0)-(1,1) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (2,0)-(2,5)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (2,1)-(2,5)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,2)-(2,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :! + │ │ │ ├── message_loc: (2,2)-(2,3) = "!" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (2,1)-(2,2) = "(" + │ │ └── closing_loc: (2,4)-(2,5) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (2,0)-(2,1) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (3,1)-(3,16)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,2)-(3,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,2)-(3,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ ParenthesesNode (location: (3,3)-(3,15)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (3,4)-(3,14)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ OrNode (location: (3,4)-(3,14)) + │ │ │ │ │ ├── left: + │ │ │ │ │ │ @ CallNode (location: (3,4)-(3,7)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :foo + │ │ │ │ │ │ ├── message_loc: (3,4)-(3,7) = "foo" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ ├── right: + │ │ │ │ │ │ @ CallNode (location: (3,11)-(3,14)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :bar + │ │ │ │ │ │ ├── message_loc: (3,11)-(3,14) = "bar" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── operator_loc: (3,8)-(3,10) = "||" + │ │ │ │ ├── opening_loc: (3,3)-(3,4) = "(" + │ │ │ │ └── closing_loc: (3,14)-(3,15) = ")" + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :! + │ │ │ ├── message_loc: (3,2)-(3,3) = "!" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (3,1)-(3,2) = "(" + │ │ └── closing_loc: (3,15)-(3,16) = ")" + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (3,0)-(3,1) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (4,0)-(4,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (4,1)-(4,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ ParenthesesNode (location: (4,1)-(4,5)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (4,2)-(4,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ IntegerNode (location: (4,3)-(4,4)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :! + │ │ │ │ ├── message_loc: (4,2)-(4,3) = "!" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (4,1)-(4,2) = "(" + │ │ │ └── closing_loc: (4,4)-(4,5) = ")" + │ │ ├── call_operator_loc: (4,5)-(4,6) = "." + │ │ ├── name: :baz + │ │ ├── message_loc: (4,6)-(4,9) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (4,0)-(4,1) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,1)-(5,2)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (5,1)-(5,2) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :~ + │ ├── message_loc: (5,0)-(5,1) = "~" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (6,0)-(6,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (6,1)-(6,2)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (6,1)-(6,2) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :-@ + │ ├── message_loc: (6,0)-(6,1) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(7,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (7,1)-(7,2)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (7,1)-(7,2) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+@ + │ ├── message_loc: (7,0)-(7,1) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (8,0)-(8,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (8,1)-(8,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (8,1)-(8,5)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (8,2)-(8,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (8,2)-(8,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (8,3)-(8,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (8,3)-(8,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :-@ + │ │ │ ├── message_loc: (8,2)-(8,3) = "-" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (8,1)-(8,2) = "(" + │ │ └── closing_loc: (8,4)-(8,5) = ")" + │ ├── call_operator_loc: (8,5)-(8,6) = "." + │ ├── name: :foo + │ ├── message_loc: (8,6)-(8,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :-@ + ├── message_loc: (8,0)-(8,1) = "-" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/undef.txt b/test/mri/prism/snapshots/unparser/corpus/literal/undef.txt new file mode 100644 index 00000000000..282cbe8f872 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/undef.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(2,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,16)) + └── body: (length: 2) + ├── @ UndefNode (location: (1,0)-(1,10)) + │ ├── names: (length: 1) + │ │ └── @ SymbolNode (location: (1,6)-(1,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ ├── value_loc: (1,7)-(1,10) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ └── keyword_loc: (1,0)-(1,5) = "undef" + └── @ UndefNode (location: (2,0)-(2,16)) + ├── names: (length: 2) + │ ├── @ SymbolNode (location: (2,6)-(2,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (2,6)-(2,7) = ":" + │ │ ├── value_loc: (2,7)-(2,10) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ └── @ SymbolNode (location: (2,12)-(2,16)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (2,12)-(2,13) = ":" + │ ├── value_loc: (2,13)-(2,16) = "bar" + │ ├── closing_loc: ∅ + │ └── unescaped: "bar" + └── keyword_loc: (2,0)-(2,5) = "undef" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/variables.txt b/test/mri/prism/snapshots/unparser/corpus/literal/variables.txt new file mode 100644 index 00000000000..bf79de385c4 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/variables.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(10,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(10,17)) + └── body: (length: 10) + ├── @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ InstanceVariableReadNode (location: (2,0)-(2,2)) + │ └── name: :@a + ├── @ ClassVariableReadNode (location: (3,0)-(3,3)) + │ └── name: :@@a + ├── @ GlobalVariableReadNode (location: (4,0)-(4,2)) + │ └── name: :$a + ├── @ NumberedReferenceReadNode (location: (5,0)-(5,2)) + │ └── number: 1 + ├── @ BackReferenceReadNode (location: (6,0)-(6,2)) + │ └── name: :$` + ├── @ ConstantReadNode (location: (7,0)-(7,5)) + │ └── name: :CONST + ├── @ ConstantPathNode (location: (8,0)-(8,13)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (8,0)-(8,6)) + │ │ └── name: :SCOPED + │ ├── child: + │ │ @ ConstantReadNode (location: (8,8)-(8,13)) + │ │ └── name: :CONST + │ └── delimiter_loc: (8,6)-(8,8) = "::" + ├── @ ConstantPathNode (location: (9,0)-(9,10)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (9,2)-(9,10)) + │ │ └── name: :TOPLEVEL + │ └── delimiter_loc: (9,0)-(9,2) = "::" + └── @ ConstantPathNode (location: (10,0)-(10,17)) + ├── parent: + │ @ ConstantPathNode (location: (10,0)-(10,10)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (10,2)-(10,10)) + │ │ └── name: :TOPLEVEL + │ └── delimiter_loc: (10,0)-(10,2) = "::" + ├── child: + │ @ ConstantReadNode (location: (10,12)-(10,17)) + │ └── name: :CONST + └── delimiter_loc: (10,10)-(10,12) = "::" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/while.txt b/test/mri/prism/snapshots/unparser/corpus/literal/while.txt new file mode 100644 index 00000000000..0f752f3392d --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/while.txt @@ -0,0 +1,704 @@ +@ ProgramNode (location: (1,0)-(73,3)) +├── locals: [:x] +└── statements: + @ StatementsNode (location: (1,0)-(73,3)) + └── body: (length: 17) + ├── @ ModuleNode (location: (1,0)-(7,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (1,0)-(1,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (1,7)-(1,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(6,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(6,3)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (2,2)-(2,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (2,6)-(6,3)) + │ │ ├── locals: [:bar, :foo] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (2,8)-(2,13)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (2,9)-(2,12)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (2,9)-(2,12)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :bar + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (2,8)-(2,9) = "|" + │ │ │ └── closing_loc: (2,12)-(2,13) = "|" + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,4)-(5,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ WhileNode (location: (3,4)-(5,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── keyword_loc: (3,4)-(3,9) = "while" + │ │ │ ├── closing_loc: (5,4)-(5,7) = "end" + │ │ │ ├── predicate: + │ │ │ │ @ CallNode (location: (3,10)-(3,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (3,10)-(3,13) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (4,6)-(4,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (4,6)-(4,15)) + │ │ │ ├── name: :foo + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (4,6)-(4,9) = "foo" + │ │ │ ├── value: + │ │ │ │ @ LocalVariableReadNode (location: (4,12)-(4,15)) + │ │ │ │ ├── name: :bar + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (4,10)-(4,11) = "=" + │ │ ├── opening_loc: (2,6)-(2,7) = "{" + │ │ └── closing_loc: (6,2)-(6,3) = "}" + │ ├── end_keyword_loc: (7,0)-(7,3) = "end" + │ └── name: :A + ├── @ DefNode (location: (9,0)-(11,3)) + │ ├── name: :foo + │ ├── name_loc: (9,4)-(9,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,2)-(10,28)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (10,2)-(10,28)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (10,12)-(10,17) = "while" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ CallNode (location: (10,18)-(10,28)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (10,18)-(10,21)) + │ │ │ │ ├── name: :foo + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :!= + │ │ │ ├── message_loc: (10,22)-(10,24) = "!=" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (10,25)-(10,28)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (10,25)-(10,28)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (10,25)-(10,28) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (10,2)-(10,11)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (10,2)-(10,11)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (10,2)-(10,5) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (10,8)-(10,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (10,8)-(10,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (10,6)-(10,7) = "=" + │ ├── locals: [:foo] + │ ├── def_keyword_loc: (9,0)-(9,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ ModuleNode (location: (13,0)-(15,3)) + │ ├── locals: [:foo] + │ ├── module_keyword_loc: (13,0)-(13,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (13,7)-(13,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (14,2)-(14,21)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (14,2)-(14,21)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (14,12)-(14,17) = "while" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ LocalVariableReadNode (location: (14,18)-(14,21)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── statements: + │ │ @ StatementsNode (location: (14,2)-(14,11)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (14,2)-(14,11)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (14,2)-(14,5) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (14,8)-(14,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (14,8)-(14,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (14,6)-(14,7) = "=" + │ ├── end_keyword_loc: (15,0)-(15,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (17,0)-(19,3)) + │ ├── locals: [:foo] + │ ├── module_keyword_loc: (17,0)-(17,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (17,7)-(17,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (18,2)-(18,21)) + │ │ └── body: (length: 1) + │ │ └── @ UntilNode (location: (18,2)-(18,21)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (18,12)-(18,17) = "until" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ LocalVariableReadNode (location: (18,18)-(18,21)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── statements: + │ │ @ StatementsNode (location: (18,2)-(18,11)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (18,2)-(18,11)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (18,2)-(18,5) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (18,8)-(18,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (18,8)-(18,11) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (18,6)-(18,7) = "=" + │ ├── end_keyword_loc: (19,0)-(19,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (21,0)-(25,3)) + │ ├── locals: [:foo] + │ ├── module_keyword_loc: (21,0)-(21,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (21,7)-(21,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (22,2)-(24,5)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (22,2)-(24,5)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (22,2)-(22,7) = "while" + │ │ ├── closing_loc: (24,2)-(24,5) = "end" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (22,8)-(22,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (22,8)-(22,11) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (23,4)-(23,13)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (23,4)-(23,13)) + │ │ ├── name: :foo + │ │ ├── depth: 0 + │ │ ├── name_loc: (23,4)-(23,7) = "foo" + │ │ ├── value: + │ │ │ @ CallNode (location: (23,10)-(23,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (23,10)-(23,13) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (23,8)-(23,9) = "=" + │ ├── end_keyword_loc: (25,0)-(25,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (27,0)-(33,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (27,0)-(27,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (27,7)-(27,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (28,2)-(32,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (28,2)-(32,3)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :each + │ │ ├── message_loc: (28,2)-(28,6) = "each" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (28,7)-(32,3)) + │ │ ├── locals: [:baz, :foo] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (28,9)-(28,14)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (28,10)-(28,13)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (28,10)-(28,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :baz + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (28,9)-(28,10) = "|" + │ │ │ └── closing_loc: (28,13)-(28,14) = "|" + │ │ ├── body: + │ │ │ @ StatementsNode (location: (29,4)-(31,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ WhileNode (location: (29,4)-(31,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── keyword_loc: (29,4)-(29,9) = "while" + │ │ │ ├── closing_loc: (31,4)-(31,7) = "end" + │ │ │ ├── predicate: + │ │ │ │ @ CallNode (location: (29,10)-(29,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (29,10)-(29,13) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (30,6)-(30,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (30,6)-(30,15)) + │ │ │ ├── name: :foo + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (30,6)-(30,9) = "foo" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (30,12)-(30,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (30,12)-(30,15) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (30,10)-(30,11) = "=" + │ │ ├── opening_loc: (28,7)-(28,8) = "{" + │ │ └── closing_loc: (32,2)-(32,3) = "}" + │ ├── end_keyword_loc: (33,0)-(33,3) = "end" + │ └── name: :A + ├── @ ModuleNode (location: (35,0)-(41,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (35,0)-(35,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (35,7)-(35,8)) + │ │ └── name: :A + │ ├── body: + │ │ @ StatementsNode (location: (36,2)-(40,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (36,2)-(40,3)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :each + │ │ ├── message_loc: (36,2)-(36,6) = "each" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (36,7)-(40,3)) + │ │ ├── locals: [:foo] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (36,9)-(36,14)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (36,10)-(36,13)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (36,10)-(36,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :foo + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (36,9)-(36,10) = "|" + │ │ │ └── closing_loc: (36,13)-(36,14) = "|" + │ │ ├── body: + │ │ │ @ StatementsNode (location: (37,4)-(39,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ WhileNode (location: (37,4)-(39,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── keyword_loc: (37,4)-(37,9) = "while" + │ │ │ ├── closing_loc: (39,4)-(39,7) = "end" + │ │ │ ├── predicate: + │ │ │ │ @ LocalVariableReadNode (location: (37,10)-(37,13)) + │ │ │ │ ├── name: :foo + │ │ │ │ └── depth: 0 + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (38,6)-(38,15)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (38,6)-(38,15)) + │ │ │ ├── name: :foo + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (38,6)-(38,9) = "foo" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (38,12)-(38,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (38,12)-(38,15) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (38,10)-(38,11) = "=" + │ │ ├── opening_loc: (36,7)-(36,8) = "{" + │ │ └── closing_loc: (40,2)-(40,3) = "}" + │ ├── end_keyword_loc: (41,0)-(41,3) = "end" + │ └── name: :A + ├── @ LocalVariableWriteNode (location: (42,0)-(44,14)) + │ ├── name: :x + │ ├── depth: 0 + │ ├── name_loc: (42,0)-(42,1) = "x" + │ ├── value: + │ │ @ ParenthesesNode (location: (42,4)-(44,14)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (42,5)-(44,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ WhileNode (location: (42,5)-(44,13)) + │ │ │ ├── flags: begin_modifier + │ │ │ ├── keyword_loc: (44,4)-(44,9) = "while" + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── predicate: + │ │ │ │ @ CallNode (location: (44,10)-(44,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (44,10)-(44,13) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── statements: + │ │ │ @ StatementsNode (location: (42,5)-(44,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BeginNode (location: (42,5)-(44,3)) + │ │ │ ├── begin_keyword_loc: (42,5)-(42,10) = "begin" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (43,2)-(43,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (43,2)-(43,5)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── message_loc: (43,2)-(43,5) = "foo" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── rescue_clause: ∅ + │ │ │ ├── else_clause: ∅ + │ │ │ ├── ensure_clause: ∅ + │ │ │ └── end_keyword_loc: (44,0)-(44,3) = "end" + │ │ ├── opening_loc: (42,4)-(42,5) = "(" + │ │ └── closing_loc: (44,13)-(44,14) = ")" + │ └── operator_loc: (42,2)-(42,3) = "=" + ├── @ WhileNode (location: (45,0)-(47,13)) + │ ├── flags: begin_modifier + │ ├── keyword_loc: (47,4)-(47,9) = "while" + │ ├── closing_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (47,10)-(47,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (47,10)-(47,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (45,0)-(47,3)) + │ └── body: (length: 1) + │ └── @ BeginNode (location: (45,0)-(47,3)) + │ ├── begin_keyword_loc: (45,0)-(45,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (46,2)-(46,5)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (46,2)-(46,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (46,2)-(46,5) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (47,0)-(47,3) = "end" + ├── @ UntilNode (location: (48,0)-(51,13)) + │ ├── flags: begin_modifier + │ ├── keyword_loc: (51,4)-(51,9) = "until" + │ ├── closing_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (51,10)-(51,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (51,10)-(51,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (48,0)-(51,3)) + │ └── body: (length: 1) + │ └── @ BeginNode (location: (48,0)-(51,3)) + │ ├── begin_keyword_loc: (48,0)-(48,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (49,2)-(50,5)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (49,2)-(49,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (49,2)-(49,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (50,2)-(50,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (50,2)-(50,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (51,0)-(51,3) = "end" + ├── @ WhileNode (location: (52,0)-(55,13)) + │ ├── flags: begin_modifier + │ ├── keyword_loc: (55,4)-(55,9) = "while" + │ ├── closing_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (55,10)-(55,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (55,10)-(55,13) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (52,0)-(55,3)) + │ └── body: (length: 1) + │ └── @ BeginNode (location: (52,0)-(55,3)) + │ ├── begin_keyword_loc: (52,0)-(52,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (53,2)-(54,5)) + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (53,2)-(53,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (53,2)-(53,5) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (54,2)-(54,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (54,2)-(54,5) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (55,0)-(55,3) = "end" + ├── @ WhileNode (location: (56,0)-(57,3)) + │ ├── flags: ∅ + │ ├── keyword_loc: (56,0)-(56,5) = "while" + │ ├── closing_loc: (57,0)-(57,3) = "end" + │ ├── predicate: + │ │ @ FalseNode (location: (56,6)-(56,11)) + │ └── statements: ∅ + ├── @ WhileNode (location: (58,0)-(60,3)) + │ ├── flags: ∅ + │ ├── keyword_loc: (58,0)-(58,5) = "while" + │ ├── closing_loc: (60,0)-(60,3) = "end" + │ ├── predicate: + │ │ @ FalseNode (location: (58,6)-(58,11)) + │ └── statements: + │ @ StatementsNode (location: (59,2)-(59,3)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (59,2)-(59,3)) + │ ├── flags: decimal + │ └── value: 3 + ├── @ WhileNode (location: (61,0)-(64,3)) + │ ├── flags: ∅ + │ ├── keyword_loc: (61,0)-(61,5) = "while" + │ ├── closing_loc: (64,0)-(64,3) = "end" + │ ├── predicate: + │ │ @ ParenthesesNode (location: (61,6)-(62,2)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (61,7)-(62,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (61,7)-(62,1)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (61,7)-(61,10) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (61,11)-(62,1)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (61,11)-(61,12) = "{" + │ │ │ └── closing_loc: (62,0)-(62,1) = "}" + │ │ ├── opening_loc: (61,6)-(61,7) = "(" + │ │ └── closing_loc: (62,1)-(62,2) = ")" + │ └── statements: + │ @ StatementsNode (location: (63,2)-(63,7)) + │ └── body: (length: 1) + │ └── @ SymbolNode (location: (63,2)-(63,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (63,2)-(63,3) = ":" + │ ├── value_loc: (63,3)-(63,7) = "body" + │ ├── closing_loc: ∅ + │ └── unescaped: "body" + ├── @ UntilNode (location: (65,0)-(66,3)) + │ ├── flags: ∅ + │ ├── keyword_loc: (65,0)-(65,5) = "until" + │ ├── closing_loc: (66,0)-(66,3) = "end" + │ ├── predicate: + │ │ @ FalseNode (location: (65,6)-(65,11)) + │ └── statements: ∅ + ├── @ UntilNode (location: (67,0)-(69,3)) + │ ├── flags: ∅ + │ ├── keyword_loc: (67,0)-(67,5) = "until" + │ ├── closing_loc: (69,0)-(69,3) = "end" + │ ├── predicate: + │ │ @ FalseNode (location: (67,6)-(67,11)) + │ └── statements: + │ @ StatementsNode (location: (68,2)-(68,3)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (68,2)-(68,3)) + │ ├── flags: decimal + │ └── value: 3 + └── @ UntilNode (location: (70,0)-(73,3)) + ├── flags: ∅ + ├── keyword_loc: (70,0)-(70,5) = "until" + ├── closing_loc: (73,0)-(73,3) = "end" + ├── predicate: + │ @ ParenthesesNode (location: (70,6)-(71,2)) + │ ├── body: + │ │ @ StatementsNode (location: (70,7)-(71,1)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (70,7)-(71,1)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (70,7)-(70,10) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (70,11)-(71,1)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (70,11)-(70,12) = "{" + │ │ └── closing_loc: (71,0)-(71,1) = "}" + │ ├── opening_loc: (70,6)-(70,7) = "(" + │ └── closing_loc: (71,1)-(71,2) = ")" + └── statements: + @ StatementsNode (location: (72,2)-(72,7)) + └── body: (length: 1) + └── @ SymbolNode (location: (72,2)-(72,7)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (72,2)-(72,3) = ":" + ├── value_loc: (72,3)-(72,7) = "body" + ├── closing_loc: ∅ + └── unescaped: "body" diff --git a/test/mri/prism/snapshots/unparser/corpus/literal/yield.txt b/test/mri/prism/snapshots/unparser/corpus/literal/yield.txt new file mode 100644 index 00000000000..4d2b272e35e --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/literal/yield.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(3,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,11)) + └── body: (length: 3) + ├── @ YieldNode (location: (1,0)-(1,5)) + │ ├── keyword_loc: (1,0)-(1,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (2,0)-(2,8)) + │ ├── keyword_loc: (2,0)-(2,5) = "yield" + │ ├── lparen_loc: (2,5)-(2,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (2,6)-(2,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,6)-(2,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: (2,7)-(2,8) = ")" + └── @ YieldNode (location: (3,0)-(3,11)) + ├── keyword_loc: (3,0)-(3,5) = "yield" + ├── lparen_loc: (3,5)-(3,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,6)-(3,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (3,6)-(3,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,6)-(3,7) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ CallNode (location: (3,9)-(3,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (3,9)-(3,10) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── rparen_loc: (3,10)-(3,11) = ")" diff --git a/test/mri/prism/snapshots/unparser/corpus/semantic/and.txt b/test/mri/prism/snapshots/unparser/corpus/semantic/and.txt new file mode 100644 index 00000000000..bc9d674e44e --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/semantic/and.txt @@ -0,0 +1,235 @@ +@ ProgramNode (location: (1,0)-(8,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,3)) + └── body: (length: 4) + ├── @ OrNode (location: (1,0)-(1,14)) + │ ├── left: + │ │ @ RangeNode (location: (1,0)-(1,5)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (1,1)-(1,4) = "..." + │ ├── right: + │ │ @ RangeNode (location: (1,9)-(1,14)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (1,9)-(1,10) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (1,13)-(1,14) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (1,10)-(1,13) = "..." + │ └── operator_loc: (1,6)-(1,8) = "or" + ├── @ AndNode (location: (2,0)-(2,15)) + │ ├── left: + │ │ @ RangeNode (location: (2,0)-(2,5)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (2,4)-(2,5) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (2,1)-(2,4) = "..." + │ ├── right: + │ │ @ RangeNode (location: (2,10)-(2,15)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (2,10)-(2,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (2,10)-(2,11) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (2,14)-(2,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (2,14)-(2,15) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (2,11)-(2,14) = "..." + │ └── operator_loc: (2,6)-(2,9) = "and" + ├── @ IfNode (location: (4,0)-(5,3)) + │ ├── if_keyword_loc: (4,0)-(4,2) = "if" + │ ├── predicate: + │ │ @ OrNode (location: (4,3)-(4,17)) + │ │ ├── left: + │ │ │ @ FlipFlopNode (location: (4,3)-(4,8)) + │ │ │ ├── flags: exclude_end + │ │ │ ├── left: + │ │ │ │ @ CallNode (location: (4,3)-(4,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (4,3)-(4,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (4,7)-(4,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (4,7)-(4,8) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (4,4)-(4,7) = "..." + │ │ ├── right: + │ │ │ @ FlipFlopNode (location: (4,12)-(4,17)) + │ │ │ ├── flags: exclude_end + │ │ │ ├── left: + │ │ │ │ @ CallNode (location: (4,12)-(4,13)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (4,12)-(4,13) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── right: + │ │ │ │ @ CallNode (location: (4,16)-(4,17)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (4,16)-(4,17) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (4,13)-(4,16) = "..." + │ │ └── operator_loc: (4,9)-(4,11) = "or" + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + └── @ IfNode (location: (7,0)-(8,3)) + ├── if_keyword_loc: (7,0)-(7,2) = "if" + ├── predicate: + │ @ AndNode (location: (7,3)-(7,18)) + │ ├── left: + │ │ @ FlipFlopNode (location: (7,3)-(7,8)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (7,3)-(7,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (7,3)-(7,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (7,7)-(7,8)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (7,7)-(7,8) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (7,4)-(7,7) = "..." + │ ├── right: + │ │ @ FlipFlopNode (location: (7,13)-(7,18)) + │ │ ├── flags: exclude_end + │ │ ├── left: + │ │ │ @ CallNode (location: (7,13)-(7,14)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (7,13)-(7,14) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (7,17)-(7,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (7,17)-(7,18) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (7,14)-(7,17) = "..." + │ └── operator_loc: (7,9)-(7,12) = "and" + ├── then_keyword_loc: ∅ + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (8,0)-(8,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/semantic/block.txt b/test/mri/prism/snapshots/unparser/corpus/semantic/block.txt new file mode 100644 index 00000000000..b9aa6b21844 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/semantic/block.txt @@ -0,0 +1,191 @@ +@ ProgramNode (location: (1,0)-(26,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(26,3)) + └── body: (length: 6) + ├── @ CallNode (location: (1,0)-(2,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(2,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (2,0)-(2,3) = "end" + ├── @ CallNode (location: (4,0)-(6,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (4,0)-(4,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (4,4)-(6,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (4,4)-(6,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (5,0)-(5,6)) + │ │ │ ├── keyword_loc: (5,0)-(5,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: ∅ + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (6,0)-(6,3) = "end" + │ ├── opening_loc: (4,4)-(4,6) = "do" + │ └── closing_loc: (6,0)-(6,3) = "end" + ├── @ CallNode (location: (8,0)-(11,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (8,0)-(8,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (8,4)-(11,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(10,5)) + │ │ └── body: (length: 2) + │ │ ├── @ RescueModifierNode (location: (9,2)-(9,16)) + │ │ │ ├── expression: + │ │ │ │ @ NilNode (location: (9,2)-(9,5)) + │ │ │ ├── keyword_loc: (9,6)-(9,12) = "rescue" + │ │ │ └── rescue_expression: + │ │ │ @ NilNode (location: (9,13)-(9,16)) + │ │ └── @ NilNode (location: (10,2)-(10,5)) + │ ├── opening_loc: (8,4)-(8,6) = "do" + │ └── closing_loc: (11,0)-(11,3) = "end" + ├── @ CallNode (location: (13,0)-(14,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (13,0)-(13,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,4)-(14,3)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (13,7)-(13,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (13,8)-(13,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (13,7)-(13,8) = "|" + │ │ └── closing_loc: (13,9)-(13,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (13,4)-(13,6) = "do" + │ └── closing_loc: (14,0)-(14,3) = "end" + ├── @ CallNode (location: (16,0)-(20,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (16,0)-(16,3) = "foo" + │ ├── opening_loc: (16,3)-(16,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (16,4)-(16,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (16,4)-(16,10)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (16,4)-(16,10) = "<<-DOC" + │ │ ├── content_loc: (17,0)-(18,0) = " b\n" + │ │ ├── closing_loc: (18,0)-(19,0) = "DOC\n" + │ │ └── unescaped: " b\n" + │ ├── closing_loc: (16,10)-(16,11) = ")" + │ └── block: + │ @ BlockNode (location: (16,12)-(20,3)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (16,15)-(16,18)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (16,16)-(16,17)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (16,16)-(16,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (16,15)-(16,16) = "|" + │ │ └── closing_loc: (16,17)-(16,18) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (19,2)-(19,3)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (19,2)-(19,3)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── opening_loc: (16,12)-(16,14) = "do" + │ └── closing_loc: (20,0)-(20,3) = "end" + └── @ CallNode (location: (22,0)-(26,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (22,0)-(22,3) = "foo" + ├── opening_loc: (22,3)-(22,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (22,4)-(22,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (22,4)-(22,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (22,4)-(22,10) = "<<-DOC" + │ ├── content_loc: (23,0)-(24,0) = " b\n" + │ ├── closing_loc: (24,0)-(25,0) = "DOC\n" + │ └── unescaped: " b\n" + ├── closing_loc: (22,10)-(22,11) = ")" + └── block: + @ BlockNode (location: (22,12)-(26,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (25,2)-(25,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (25,2)-(25,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (25,2)-(25,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (22,12)-(22,14) = "do" + └── closing_loc: (26,0)-(26,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/semantic/def.txt b/test/mri/prism/snapshots/unparser/corpus/semantic/def.txt new file mode 100644 index 00000000000..b44983c2f37 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/semantic/def.txt @@ -0,0 +1,90 @@ +@ ProgramNode (location: (1,0)-(7,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,3)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(3,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,9)) + │ │ └── body: (length: 1) + │ │ └── @ ParenthesesNode (location: (2,2)-(2,9)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,3)-(2,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,3)-(2,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (2,3)-(2,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (2,3)-(2,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :- + │ │ │ ├── message_loc: (2,5)-(2,6) = "-" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,7)-(2,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (2,7)-(2,8)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── message_loc: (2,7)-(2,8) = "b" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (2,2)-(2,3) = "(" + │ │ └── closing_loc: (2,8)-(2,9) = ")" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ DefNode (location: (5,0)-(7,3)) + ├── name: :foo + ├── name_loc: (5,4)-(5,7) = "foo" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (6,2)-(6,20)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (6,2)-(6,20)) + │ ├── expression: + │ │ @ CallNode (location: (6,2)-(6,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (6,2)-(6,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (6,4)-(6,10) = "rescue" + │ └── rescue_expression: + │ @ ConstantReadNode (location: (6,11)-(6,20)) + │ └── name: :Exception + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (7,0)-(7,3) = "end" diff --git a/test/mri/prism/snapshots/unparser/corpus/semantic/dstr.txt b/test/mri/prism/snapshots/unparser/corpus/semantic/dstr.txt new file mode 100644 index 00000000000..5ab954b6d41 --- /dev/null +++ b/test/mri/prism/snapshots/unparser/corpus/semantic/dstr.txt @@ -0,0 +1,570 @@ +@ ProgramNode (location: (1,0)-(127,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(127,11)) + └── body: (length: 33) + ├── @ StringNode (location: (1,0)-(1,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,5) = "<= + ├── name_loc: (11,4)-(11,6) = ">=" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (11,7)-(11,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (11,7)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── name: :other + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (11,16)-(11,28)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (11,16)-(11,28)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :do_something + │ ├── message_loc: (11,16)-(11,28) = "do_something" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [:other] + ├── def_keyword_loc: (11,0)-(11,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (11,6)-(11,7) = "(" + ├── rparen_loc: (11,12)-(11,13) = ")" + ├── equal_loc: (11,14)-(11,15) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/endless_method.txt b/test/mri/prism/snapshots/whitequark/endless_method.txt new file mode 100644 index 00000000000..17d3873b663 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/endless_method.txt @@ -0,0 +1,151 @@ +@ ProgramNode (location: (1,0)-(7,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,22)) + └── body: (length: 4) + ├── @ DefNode (location: (1,0)-(1,14)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,12)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,12)-(1,14)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,8)-(1,9) = ")" + │ ├── equal_loc: (1,10)-(1,11) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (3,0)-(3,18)) + │ ├── name: :inc + │ ├── name_loc: (3,4)-(3,7) = "inc" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (3,8)-(3,9)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (3,8)-(3,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,13)-(3,18)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,13)-(3,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (3,13)-(3,14)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (3,15)-(3,16) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,17)-(3,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,17)-(3,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (3,7)-(3,8) = "(" + │ ├── rparen_loc: (3,9)-(3,10) = ")" + │ ├── equal_loc: (3,11)-(3,12) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (5,0)-(5,18)) + │ ├── name: :foo + │ ├── name_loc: (5,8)-(5,11) = "foo" + │ ├── receiver: + │ │ @ CallNode (location: (5,4)-(5,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (5,4)-(5,7) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,16)-(5,18)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (5,16)-(5,18)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: (5,7)-(5,8) = "." + │ ├── lparen_loc: (5,11)-(5,12) = "(" + │ ├── rparen_loc: (5,12)-(5,13) = ")" + │ ├── equal_loc: (5,14)-(5,15) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (7,0)-(7,22)) + ├── name: :inc + ├── name_loc: (7,8)-(7,11) = "inc" + ├── receiver: + │ @ CallNode (location: (7,4)-(7,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :obj + │ ├── message_loc: (7,4)-(7,7) = "obj" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: + │ @ ParametersNode (location: (7,12)-(7,13)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (7,12)-(7,13)) + │ │ ├── flags: ∅ + │ │ └── name: :x + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (7,17)-(7,22)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (7,17)-(7,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (7,17)-(7,18)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (7,19)-(7,20) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,21)-(7,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (7,21)-(7,22)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [:x] + ├── def_keyword_loc: (7,0)-(7,3) = "def" + ├── operator_loc: (7,7)-(7,8) = "." + ├── lparen_loc: (7,11)-(7,12) = "(" + ├── rparen_loc: (7,13)-(7,14) = ")" + ├── equal_loc: (7,15)-(7,16) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/endless_method_command_syntax.txt b/test/mri/prism/snapshots/whitequark/endless_method_command_syntax.txt new file mode 100644 index 00000000000..334fb39d615 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/endless_method_command_syntax.txt @@ -0,0 +1,392 @@ +@ ProgramNode (location: (1,0)-(15,62)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(15,62)) + └── body: (length: 8) + ├── @ DefNode (location: (1,0)-(1,22)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,10)-(1,22)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,22)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (1,10)-(1,14) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,15)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (1,15)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,15)-(1,16) = "\"" + │ │ │ ├── content_loc: (1,16)-(1,21) = "Hello" + │ │ │ ├── closing_loc: (1,21)-(1,22) = "\"" + │ │ │ └── unescaped: "Hello" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (1,8)-(1,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (3,0)-(3,24)) + │ ├── name: :foo + │ ├── name_loc: (3,4)-(3,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,12)-(3,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,12)-(3,24)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (3,12)-(3,16) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,17)-(3,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (3,17)-(3,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (3,17)-(3,18) = "\"" + │ │ │ ├── content_loc: (3,18)-(3,23) = "Hello" + │ │ │ ├── closing_loc: (3,23)-(3,24) = "\"" + │ │ │ └── unescaped: "Hello" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (3,7)-(3,8) = "(" + │ ├── rparen_loc: (3,8)-(3,9) = ")" + │ ├── equal_loc: (3,10)-(3,11) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (5,0)-(5,19)) + │ ├── name: :foo + │ ├── name_loc: (5,4)-(5,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (5,8)-(5,9)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (5,8)-(5,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,13)-(5,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,13)-(5,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (5,13)-(5,17) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,18)-(5,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (5,18)-(5,19)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (5,7)-(5,8) = "(" + │ ├── rparen_loc: (5,9)-(5,10) = ")" + │ ├── equal_loc: (5,11)-(5,12) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (7,0)-(7,26)) + │ ├── name: :foo + │ ├── name_loc: (7,8)-(7,11) = "foo" + │ ├── receiver: + │ │ @ CallNode (location: (7,4)-(7,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (7,4)-(7,7) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,14)-(7,26)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,14)-(7,26)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (7,14)-(7,18) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,19)-(7,26)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (7,19)-(7,26)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (7,19)-(7,20) = "\"" + │ │ │ ├── content_loc: (7,20)-(7,25) = "Hello" + │ │ │ ├── closing_loc: (7,25)-(7,26) = "\"" + │ │ │ └── unescaped: "Hello" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: (7,7)-(7,8) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (7,12)-(7,13) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (9,0)-(9,28)) + │ ├── name: :foo + │ ├── name_loc: (9,8)-(9,11) = "foo" + │ ├── receiver: + │ │ @ CallNode (location: (9,4)-(9,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (9,4)-(9,7) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,16)-(9,28)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (9,16)-(9,28)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (9,16)-(9,20) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,21)-(9,28)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (9,21)-(9,28)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (9,21)-(9,22) = "\"" + │ │ │ ├── content_loc: (9,22)-(9,27) = "Hello" + │ │ │ ├── closing_loc: (9,27)-(9,28) = "\"" + │ │ │ └── unescaped: "Hello" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (9,0)-(9,3) = "def" + │ ├── operator_loc: (9,7)-(9,8) = "." + │ ├── lparen_loc: (9,11)-(9,12) = "(" + │ ├── rparen_loc: (9,12)-(9,13) = ")" + │ ├── equal_loc: (9,14)-(9,15) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (11,0)-(11,23)) + │ ├── name: :foo + │ ├── name_loc: (11,8)-(11,11) = "foo" + │ ├── receiver: + │ │ @ CallNode (location: (11,4)-(11,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (11,4)-(11,7) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (11,12)-(11,13)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (11,12)-(11,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (11,17)-(11,23)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (11,17)-(11,23)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (11,17)-(11,21) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,22)-(11,23)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (11,22)-(11,23)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (11,0)-(11,3) = "def" + │ ├── operator_loc: (11,7)-(11,8) = "." + │ ├── lparen_loc: (11,11)-(11,12) = "(" + │ ├── rparen_loc: (11,13)-(11,14) = ")" + │ ├── equal_loc: (11,15)-(11,16) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (13,0)-(13,60)) + │ ├── name: :rescued + │ ├── name_loc: (13,4)-(13,11) = "rescued" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (13,12)-(13,13)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (13,12)-(13,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (13,17)-(13,60)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (13,17)-(13,60)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (13,17)-(13,37)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (13,17)-(13,22) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (13,23)-(13,37)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (13,23)-(13,37)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (13,23)-(13,24) = "\"" + │ │ │ │ ├── content_loc: (13,24)-(13,36) = "to be caught" + │ │ │ │ ├── closing_loc: (13,36)-(13,37) = "\"" + │ │ │ │ └── unescaped: "to be caught" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (13,38)-(13,44) = "rescue" + │ │ └── rescue_expression: + │ │ @ InterpolatedStringNode (location: (13,45)-(13,60)) + │ │ ├── opening_loc: (13,45)-(13,46) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (13,46)-(13,55)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (13,46)-(13,55) = "instance " + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "instance " + │ │ │ └── @ EmbeddedStatementsNode (location: (13,55)-(13,59)) + │ │ │ ├── opening_loc: (13,55)-(13,57) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (13,57)-(13,58)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (13,57)-(13,58)) + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ └── closing_loc: (13,58)-(13,59) = "}" + │ │ └── closing_loc: (13,59)-(13,60) = "\"" + │ ├── locals: [:x] + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (13,11)-(13,12) = "(" + │ ├── rparen_loc: (13,13)-(13,14) = ")" + │ ├── equal_loc: (13,15)-(13,16) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (15,0)-(15,62)) + ├── name: :rescued + ├── name_loc: (15,9)-(15,16) = "rescued" + ├── receiver: + │ @ SelfNode (location: (15,4)-(15,8)) + ├── parameters: + │ @ ParametersNode (location: (15,17)-(15,18)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (15,17)-(15,18)) + │ │ ├── flags: ∅ + │ │ └── name: :x + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (15,22)-(15,62)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (15,22)-(15,62)) + │ ├── expression: + │ │ @ CallNode (location: (15,22)-(15,42)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (15,22)-(15,27) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,28)-(15,42)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (15,28)-(15,42)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (15,28)-(15,29) = "\"" + │ │ │ ├── content_loc: (15,29)-(15,41) = "to be caught" + │ │ │ ├── closing_loc: (15,41)-(15,42) = "\"" + │ │ │ └── unescaped: "to be caught" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (15,43)-(15,49) = "rescue" + │ └── rescue_expression: + │ @ InterpolatedStringNode (location: (15,50)-(15,62)) + │ ├── opening_loc: (15,50)-(15,51) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (15,51)-(15,57)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (15,51)-(15,57) = "class " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "class " + │ │ └── @ EmbeddedStatementsNode (location: (15,57)-(15,61)) + │ │ ├── opening_loc: (15,57)-(15,59) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (15,59)-(15,60)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (15,59)-(15,60)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ └── closing_loc: (15,60)-(15,61) = "}" + │ └── closing_loc: (15,61)-(15,62) = "\"" + ├── locals: [:x] + ├── def_keyword_loc: (15,0)-(15,3) = "def" + ├── operator_loc: (15,8)-(15,9) = "." + ├── lparen_loc: (15,16)-(15,17) = "(" + ├── rparen_loc: (15,18)-(15,19) = ")" + ├── equal_loc: (15,20)-(15,21) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt b/test/mri/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt new file mode 100644 index 00000000000..64a3ffa2520 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,11)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,8)-(1,11)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,15)-(1,23)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,15)-(1,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,15)-(1,18) = "bar" + │ ├── opening_loc: (1,18)-(1,19) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,19)-(1,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (1,19)-(1,22)) + │ ├── closing_loc: (1,22)-(1,23) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,11)-(1,12) = ")" + ├── equal_loc: (1,13)-(1,14) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt b/test/mri/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt new file mode 100644 index 00000000000..2284b243549 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(3,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,25)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(1,20)) + │ ├── name: :m + │ ├── name_loc: (1,4)-(1,5) = "m" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,10)-(1,20)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,10)-(1,20)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_loc: (1,12)-(1,18) = "rescue" + │ │ └── rescue_expression: + │ │ @ IntegerNode (location: (1,19)-(1,20)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ ├── rparen_loc: (1,6)-(1,7) = ")" + │ ├── equal_loc: (1,8)-(1,9) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (3,0)-(3,25)) + ├── name: :m + ├── name_loc: (3,9)-(3,10) = "m" + ├── receiver: + │ @ SelfNode (location: (3,4)-(3,8)) + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (3,15)-(3,25)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (3,15)-(3,25)) + │ ├── expression: + │ │ @ IntegerNode (location: (3,15)-(3,16)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_loc: (3,17)-(3,23) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (3,24)-(3,25)) + │ ├── flags: decimal + │ └── value: 2 + ├── locals: [] + ├── def_keyword_loc: (3,0)-(3,3) = "def" + ├── operator_loc: (3,8)-(3,9) = "." + ├── lparen_loc: (3,10)-(3,11) = "(" + ├── rparen_loc: (3,11)-(3,12) = ")" + ├── equal_loc: (3,13)-(3,14) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/endless_method_without_args.txt b/test/mri/prism/snapshots/whitequark/endless_method_without_args.txt new file mode 100644 index 00000000000..a7a9c93ef34 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/endless_method_without_args.txt @@ -0,0 +1,89 @@ +@ ProgramNode (location: (1,0)-(7,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,28)) + └── body: (length: 4) + ├── @ DefNode (location: (1,0)-(1,12)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,10)-(1,12)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,10)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (1,8)-(1,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (3,0)-(3,23)) + │ ├── name: :foo + │ ├── name_loc: (3,4)-(3,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,10)-(3,23)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (3,10)-(3,23)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (3,10)-(3,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── keyword_loc: (3,13)-(3,19) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (3,20)-(3,23)) + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (3,8)-(3,9) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (5,0)-(5,17)) + │ ├── name: :foo + │ ├── name_loc: (5,9)-(5,12) = "foo" + │ ├── receiver: + │ │ @ SelfNode (location: (5,4)-(5,8)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,15)-(5,17)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (5,15)-(5,17)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── locals: [] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: (5,8)-(5,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (5,13)-(5,14) = "=" + │ └── end_keyword_loc: ∅ + └── @ DefNode (location: (7,0)-(7,28)) + ├── name: :foo + ├── name_loc: (7,9)-(7,12) = "foo" + ├── receiver: + │ @ SelfNode (location: (7,4)-(7,8)) + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (7,15)-(7,28)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (7,15)-(7,28)) + │ ├── expression: + │ │ @ IntegerNode (location: (7,15)-(7,17)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── keyword_loc: (7,18)-(7,24) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (7,25)-(7,28)) + ├── locals: [] + ├── def_keyword_loc: (7,0)-(7,3) = "def" + ├── operator_loc: (7,8)-(7,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (7,13)-(7,14) = "=" + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ensure.txt b/test/mri/prism/snapshots/whitequark/ensure.txt new file mode 100644 index 00000000000..a48d2370e8d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ensure.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,29)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (1,13)-(1,29)) + │ ├── ensure_keyword_loc: (1,13)-(1,19) = "ensure" + │ ├── statements: + │ │ @ StatementsNode (location: (1,21)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,21)-(1,24)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,21)-(1,24) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (1,26)-(1,29) = "end" + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ensure_empty.txt b/test/mri/prism/snapshots/whitequark/ensure_empty.txt new file mode 100644 index 00000000000..0bab5d80c36 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ensure_empty.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,16)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (1,6)-(1,16)) + │ ├── ensure_keyword_loc: (1,6)-(1,12) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (1,13)-(1,16) = "end" + └── end_keyword_loc: (1,13)-(1,16) = "end" diff --git a/test/mri/prism/snapshots/whitequark/false.txt b/test/mri/prism/snapshots/whitequark/false.txt new file mode 100644 index 00000000000..00562f703a9 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/false.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ FalseNode (location: (1,0)-(1,5)) diff --git a/test/mri/prism/snapshots/whitequark/float.txt b/test/mri/prism/snapshots/whitequark/float.txt new file mode 100644 index 00000000000..5e6a597db7d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/float.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ FloatNode (location: (1,0)-(1,5)) + │ └── value: -1.33 + └── @ FloatNode (location: (3,0)-(3,4)) + └── value: 1.33 diff --git a/test/mri/prism/snapshots/whitequark/for.txt b/test/mri/prism/snapshots/whitequark/for.txt new file mode 100644 index 00000000000..fec8bdfd64f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/for.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(3,22)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(3,22)) + └── body: (length: 2) + ├── @ ForNode (location: (1,0)-(1,24)) + │ ├── index: + │ │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── collection: + │ │ @ CallNode (location: (1,9)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,9)-(1,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,16)-(1,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,16)-(1,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,16)-(1,17) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,18)-(1,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (1,18)-(1,19)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── for_keyword_loc: (1,0)-(1,3) = "for" + │ ├── in_keyword_loc: (1,6)-(1,8) = "in" + │ ├── do_keyword_loc: (1,13)-(1,15) = "do" + │ └── end_keyword_loc: (1,21)-(1,24) = "end" + └── @ ForNode (location: (3,0)-(3,22)) + ├── index: + │ @ LocalVariableTargetNode (location: (3,4)-(3,5)) + │ ├── name: :a + │ └── depth: 0 + ├── collection: + │ @ CallNode (location: (3,9)-(3,12)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,9)-(3,12) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── statements: + │ @ StatementsNode (location: (3,14)-(3,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,14)-(3,17)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (3,14)-(3,15) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,16)-(3,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (3,16)-(3,17)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── for_keyword_loc: (3,0)-(3,3) = "for" + ├── in_keyword_loc: (3,6)-(3,8) = "in" + ├── do_keyword_loc: ∅ + └── end_keyword_loc: (3,19)-(3,22) = "end" diff --git a/test/mri/prism/snapshots/whitequark/for_mlhs.txt b/test/mri/prism/snapshots/whitequark/for_mlhs.txt new file mode 100644 index 00000000000..42d8fa22585 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/for_mlhs.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ ForNode (location: (1,0)-(1,28)) + ├── index: + │ @ MultiTargetNode (location: (1,4)-(1,8)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ └── rparen_loc: ∅ + ├── collection: + │ @ CallNode (location: (1,12)-(1,15)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,12)-(1,15) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── statements: + │ @ StatementsNode (location: (1,17)-(1,23)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,17)-(1,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (1,17)-(1,18) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,19)-(1,23)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,19)-(1,20)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,22)-(1,23)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── for_keyword_loc: (1,0)-(1,3) = "for" + ├── in_keyword_loc: (1,9)-(1,11) = "in" + ├── do_keyword_loc: ∅ + └── end_keyword_loc: (1,25)-(1,28) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forward_arg.txt b/test/mri/prism/snapshots/whitequark/forward_arg.txt new file mode 100644 index 00000000000..17504c64e02 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forward_arg.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,27)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,11)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,8)-(1,11)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,14)-(1,22)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,14)-(1,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,14)-(1,17) = "bar" + │ ├── opening_loc: (1,17)-(1,18) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,18)-(1,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (1,18)-(1,21)) + │ ├── closing_loc: (1,21)-(1,22) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,11)-(1,12) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,24)-(1,27) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forward_arg_with_open_args.txt b/test/mri/prism/snapshots/whitequark/forward_arg_with_open_args.txt new file mode 100644 index 00000000000..7e58260b582 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forward_arg_with_open_args.txt @@ -0,0 +1,404 @@ +@ ProgramNode (location: (1,0)-(27,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(27,28)) + └── body: (length: 10) + ├── @ ParenthesesNode (location: (1,0)-(3,4)) + │ ├── body: + │ │ @ StatementsNode (location: (1,1)-(3,3)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (1,1)-(3,3)) + │ │ ├── name: :foo + │ │ ├── name_loc: (1,5)-(1,8) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,9)-(1,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: + │ │ │ │ @ ForwardingParameterNode (location: (1,9)-(1,12)) + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,2)-(2,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,10)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (2,2)-(2,5) = "bar" + │ │ │ ├── opening_loc: (2,5)-(2,6) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,6)-(2,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ ForwardingArgumentsNode (location: (2,6)-(2,9)) + │ │ │ ├── closing_loc: (2,9)-(2,10) = ")" + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (1,1)-(1,4) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (3,0)-(3,3) = "end" + │ ├── opening_loc: (1,0)-(1,1) = "(" + │ └── closing_loc: (3,3)-(3,4) = ")" + ├── @ ParenthesesNode (location: (5,0)-(5,28)) + │ ├── body: + │ │ @ StatementsNode (location: (5,1)-(5,27)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (5,1)-(5,27)) + │ │ ├── name: :foo + │ │ ├── name_loc: (5,5)-(5,8) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,9)-(5,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: + │ │ │ │ @ ForwardingParameterNode (location: (5,9)-(5,12)) + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (5,14)-(5,22)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (5,14)-(5,22)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (5,14)-(5,17) = "bar" + │ │ │ ├── opening_loc: (5,17)-(5,18) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,18)-(5,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ ForwardingArgumentsNode (location: (5,18)-(5,21)) + │ │ │ ├── closing_loc: (5,21)-(5,22) = ")" + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (5,1)-(5,4) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (5,24)-(5,27) = "end" + │ ├── opening_loc: (5,0)-(5,1) = "(" + │ └── closing_loc: (5,27)-(5,28) = ")" + ├── @ DefNode (location: (7,0)-(8,3)) + │ ├── name: :foo + │ ├── name_loc: (7,4)-(7,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (7,8)-(7,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (7,8)-(7,11)) + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,0)-(8,3) = "end" + ├── @ DefNode (location: (10,0)-(10,26)) + │ ├── name: :foo + │ ├── name_loc: (10,4)-(10,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (10,8)-(10,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (10,8)-(10,11)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,13)-(10,21)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (10,13)-(10,21)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (10,13)-(10,16) = "bar" + │ │ ├── opening_loc: (10,16)-(10,17) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,17)-(10,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (10,17)-(10,20)) + │ │ ├── closing_loc: (10,20)-(10,21) = ")" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (10,0)-(10,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (10,23)-(10,26) = "end" + ├── @ DefNode (location: (12,0)-(14,3)) + │ ├── name: :foo + │ ├── name_loc: (12,4)-(12,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (12,8)-(12,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (12,8)-(12,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (12,11)-(12,14)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (13,2)-(13,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (13,2)-(13,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (13,2)-(13,5) = "bar" + │ │ ├── opening_loc: (13,5)-(13,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,6)-(13,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (13,6)-(13,9)) + │ │ ├── closing_loc: (13,9)-(13,10) = ")" + │ │ └── block: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (12,0)-(12,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ DefNode (location: (16,0)-(16,29)) + │ ├── name: :foo + │ ├── name_loc: (16,4)-(16,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (16,8)-(16,14)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (16,8)-(16,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (16,11)-(16,14)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (16,16)-(16,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (16,16)-(16,24)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (16,16)-(16,19) = "bar" + │ │ ├── opening_loc: (16,19)-(16,20) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (16,20)-(16,23)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (16,20)-(16,23)) + │ │ ├── closing_loc: (16,23)-(16,24) = ")" + │ │ └── block: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (16,0)-(16,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (16,26)-(16,29) = "end" + ├── @ DefNode (location: (18,0)-(19,3)) + │ ├── name: :foo + │ ├── name_loc: (18,4)-(18,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (18,8)-(18,21)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (18,8)-(18,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (18,11)-(18,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (18,11)-(18,12) = "b" + │ │ │ ├── operator_loc: (18,13)-(18,14) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (18,15)-(18,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (18,18)-(18,21)) + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :b] + │ ├── def_keyword_loc: (18,0)-(18,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ DefNode (location: (21,0)-(23,3)) + │ ├── name: :foo + │ ├── name_loc: (21,4)-(21,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (21,8)-(21,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (21,8)-(21,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (21,8)-(21,9) = "b" + │ │ │ ├── operator_loc: (21,10)-(21,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (21,12)-(21,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (21,15)-(21,18)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (22,2)-(22,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (22,2)-(22,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (22,2)-(22,5) = "bar" + │ │ ├── opening_loc: (22,5)-(22,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (22,6)-(22,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (22,6)-(22,9)) + │ │ ├── closing_loc: (22,9)-(22,10) = ")" + │ │ └── block: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (21,0)-(21,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ DefNode (location: (25,0)-(25,33)) + │ ├── name: :foo + │ ├── name_loc: (25,4)-(25,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (25,8)-(25,18)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (25,8)-(25,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (25,8)-(25,9) = "b" + │ │ │ ├── operator_loc: (25,10)-(25,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (25,12)-(25,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (25,15)-(25,18)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (25,20)-(25,28)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (25,20)-(25,28)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (25,20)-(25,23) = "bar" + │ │ ├── opening_loc: (25,23)-(25,24) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (25,24)-(25,27)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (25,24)-(25,27)) + │ │ ├── closing_loc: (25,27)-(25,28) = ")" + │ │ └── block: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (25,30)-(25,33) = "end" + └── @ DefNode (location: (27,0)-(27,28)) + ├── name: :foo + ├── name_loc: (27,4)-(27,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (27,8)-(27,14)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (27,8)-(27,9)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (27,11)-(27,14)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (27,16)-(27,24)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (27,16)-(27,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (27,16)-(27,19) = "bar" + │ ├── opening_loc: (27,19)-(27,20) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,20)-(27,23)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (27,20)-(27,23)) + │ ├── closing_loc: (27,23)-(27,24) = ")" + │ └── block: ∅ + ├── locals: [:a] + ├── def_keyword_loc: (27,0)-(27,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (27,7)-(27,8) = "(" + ├── rparen_loc: (27,14)-(27,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (27,25)-(27,28) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forward_args_legacy.txt b/test/mri/prism/snapshots/whitequark/forward_args_legacy.txt new file mode 100644 index 00000000000..f46967ba500 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forward_args_legacy.txt @@ -0,0 +1,99 @@ +@ ProgramNode (location: (1,0)-(5,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,29)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(1,27)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (1,8)-(1,11)) + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,14)-(1,22)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,14)-(1,22)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,14)-(1,17) = "bar" + │ │ ├── opening_loc: (1,17)-(1,18) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,18)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ForwardingArgumentsNode (location: (1,18)-(1,21)) + │ │ ├── closing_loc: (1,21)-(1,22) = ")" + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,11)-(1,12) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,24)-(1,27) = "end" + ├── @ DefNode (location: (3,0)-(3,17)) + │ ├── name: :foo + │ ├── name_loc: (3,4)-(3,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (3,8)-(3,11)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ ForwardingParameterNode (location: (3,8)-(3,11)) + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (3,7)-(3,8) = "(" + │ ├── rparen_loc: (3,11)-(3,12) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,14)-(3,17) = "end" + └── @ DefNode (location: (5,0)-(5,29)) + ├── name: :foo + ├── name_loc: (5,4)-(5,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (5,8)-(5,11)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (5,8)-(5,11)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (5,14)-(5,24)) + │ └── body: (length: 1) + │ └── @ SuperNode (location: (5,14)-(5,24)) + │ ├── keyword_loc: (5,14)-(5,19) = "super" + │ ├── lparen_loc: (5,19)-(5,20) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,20)-(5,23)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (5,20)-(5,23)) + │ ├── rparen_loc: (5,23)-(5,24) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (5,7)-(5,8) = "(" + ├── rparen_loc: (5,11)-(5,12) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (5,26)-(5,29) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt b/test/mri/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt new file mode 100644 index 00000000000..c06818a98ba --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,45)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,45)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,20)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ + │ │ └── name: :argument + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,18)-(1,20)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,18)-(1,20) = "**" + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,23)-(1,40)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,23)-(1,40)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,23)-(1,26) = "bar" + │ ├── opening_loc: (1,26)-(1,27) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,27)-(1,39)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,27)-(1,35)) + │ │ │ ├── name: :argument + │ │ │ └── depth: 0 + │ │ └── @ KeywordHashNode (location: (1,37)-(1,39)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (1,37)-(1,39)) + │ │ ├── value: ∅ + │ │ └── operator_loc: (1,37)-(1,39) = "**" + │ ├── closing_loc: (1,39)-(1,40) = ")" + │ └── block: ∅ + ├── locals: [:argument] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,20)-(1,21) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,42)-(1,45) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt b/test/mri/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt new file mode 100644 index 00000000000..367fad7fec8 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,43)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,43)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,19)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ + │ │ └── name: :argument + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,18)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,18)-(1,19) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,22)-(1,38)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,22)-(1,38)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,22)-(1,25) = "bar" + │ ├── opening_loc: (1,25)-(1,26) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,26)-(1,37)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,26)-(1,34)) + │ │ │ ├── name: :argument + │ │ │ └── depth: 0 + │ │ └── @ SplatNode (location: (1,36)-(1,37)) + │ │ ├── operator_loc: (1,36)-(1,37) = "*" + │ │ └── expression: ∅ + │ ├── closing_loc: (1,37)-(1,38) = ")" + │ └── block: ∅ + ├── locals: [:argument] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,40)-(1,43) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg.txt b/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg.txt new file mode 100644 index 00000000000..adaf111fd76 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,25)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,8)-(1,10) = "**" + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,13)-(1,20)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,13)-(1,16) = "bar" + │ ├── opening_loc: (1,16)-(1,17) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,17)-(1,19)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,17)-(1,19)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (1,17)-(1,19)) + │ │ ├── value: ∅ + │ │ └── operator_loc: (1,17)-(1,19) = "**" + │ ├── closing_loc: (1,19)-(1,20) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,22)-(1,25) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt b/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt new file mode 100644 index 00000000000..a03421455ca --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt @@ -0,0 +1,63 @@ +@ ProgramNode (location: (1,0)-(1,41)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,41)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,41)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,8)-(1,10) = "**" + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,13)-(1,36)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,36)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,13)-(1,16) = "bar" + │ ├── opening_loc: (1,16)-(1,17) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,17)-(1,35)) + │ │ ├── flags: contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,17)-(1,35)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 2) + │ │ ├── @ AssocSplatNode (location: (1,17)-(1,19)) + │ │ │ ├── value: ∅ + │ │ │ └── operator_loc: (1,17)-(1,19) = "**" + │ │ └── @ AssocNode (location: (1,21)-(1,35)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,21)-(1,30)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,21)-(1,29) = "from_foo" + │ │ │ ├── closing_loc: (1,29)-(1,30) = ":" + │ │ │ └── unescaped: "from_foo" + │ │ ├── value: + │ │ │ @ TrueNode (location: (1,31)-(1,35)) + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (1,35)-(1,36) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,38)-(1,41) = "end" diff --git a/test/mri/prism/snapshots/whitequark/forwarded_restarg.txt b/test/mri/prism/snapshots/whitequark/forwarded_restarg.txt new file mode 100644 index 00000000000..17ff8894afa --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/forwarded_restarg.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,9)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,12)-(1,18)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,12)-(1,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,12)-(1,15) = "bar" + │ ├── opening_loc: (1,15)-(1,16) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,16)-(1,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SplatNode (location: (1,16)-(1,17)) + │ │ ├── operator_loc: (1,16)-(1,17) = "*" + │ │ └── expression: ∅ + │ ├── closing_loc: (1,17)-(1,18) = ")" + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/test/mri/prism/snapshots/whitequark/gvar.txt b/test/mri/prism/snapshots/whitequark/gvar.txt new file mode 100644 index 00000000000..f4401c4389b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/gvar.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ GlobalVariableReadNode (location: (1,0)-(1,4)) + └── name: :$foo diff --git a/test/mri/prism/snapshots/whitequark/gvasgn.txt b/test/mri/prism/snapshots/whitequark/gvasgn.txt new file mode 100644 index 00000000000..fc044054d88 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/gvasgn.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ GlobalVariableWriteNode (location: (1,0)-(1,9)) + ├── name: :$var + ├── name_loc: (1,0)-(1,4) = "$var" + ├── value: + │ @ IntegerNode (location: (1,7)-(1,9)) + │ ├── flags: decimal + │ └── value: 10 + └── operator_loc: (1,5)-(1,6) = "=" diff --git a/test/mri/prism/snapshots/whitequark/hash_empty.txt b/test/mri/prism/snapshots/whitequark/hash_empty.txt new file mode 100644 index 00000000000..38a2c15a9ad --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_empty.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,3)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 0) + └── closing_loc: (1,2)-(1,3) = "}" diff --git a/test/mri/prism/snapshots/whitequark/hash_hashrocket.txt b/test/mri/prism/snapshots/whitequark/hash_hashrocket.txt new file mode 100644 index 00000000000..e661a7b0480 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_hashrocket.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,25)) + └── body: (length: 2) + ├── @ HashNode (location: (1,0)-(1,10)) + │ ├── opening_loc: (1,0)-(1,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,2)-(1,8)) + │ │ ├── key: + │ │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (1,4)-(1,6) = "=>" + │ └── closing_loc: (1,9)-(1,10) = "}" + └── @ HashNode (location: (3,0)-(3,25)) + ├── opening_loc: (3,0)-(3,1) = "{" + ├── elements: (length: 2) + │ ├── @ AssocNode (location: (3,2)-(3,8)) + │ │ ├── key: + │ │ │ @ IntegerNode (location: (3,2)-(3,3)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,7)-(3,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (3,4)-(3,6) = "=>" + │ └── @ AssocNode (location: (3,10)-(3,23)) + │ ├── key: + │ │ @ SymbolNode (location: (3,10)-(3,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,10)-(3,11) = ":" + │ │ ├── value_loc: (3,11)-(3,14) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── value: + │ │ @ StringNode (location: (3,18)-(3,23)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (3,18)-(3,19) = "\"" + │ │ ├── content_loc: (3,19)-(3,22) = "bar" + │ │ ├── closing_loc: (3,22)-(3,23) = "\"" + │ │ └── unescaped: "bar" + │ └── operator_loc: (3,15)-(3,17) = "=>" + └── closing_loc: (3,24)-(3,25) = "}" diff --git a/test/mri/prism/snapshots/whitequark/hash_kwsplat.txt b/test/mri/prism/snapshots/whitequark/hash_kwsplat.txt new file mode 100644 index 00000000000..a5d12174cc4 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_kwsplat.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,17)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 2) + │ ├── @ AssocNode (location: (1,2)-(1,8)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,2)-(1,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,2)-(1,5) = "foo" + │ │ │ ├── closing_loc: (1,5)-(1,6) = ":" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── @ AssocSplatNode (location: (1,10)-(1,15)) + │ ├── value: + │ │ @ CallNode (location: (1,12)-(1,15)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,12)-(1,15) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,10)-(1,12) = "**" + └── closing_loc: (1,16)-(1,17) = "}" diff --git a/test/mri/prism/snapshots/whitequark/hash_label.txt b/test/mri/prism/snapshots/whitequark/hash_label.txt new file mode 100644 index 00000000000..fdf7a21ed0c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_label.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,8)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,5) = "foo" + │ │ ├── closing_loc: (1,5)-(1,6) = ":" + │ │ └── unescaped: "foo" + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: ∅ + └── closing_loc: (1,9)-(1,10) = "}" diff --git a/test/mri/prism/snapshots/whitequark/hash_label_end.txt b/test/mri/prism/snapshots/whitequark/hash_label_end.txt new file mode 100644 index 00000000000..88b70d38e2c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_label_end.txt @@ -0,0 +1,100 @@ +@ ProgramNode (location: (1,0)-(5,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,22)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,0)-(1,1) = "f" + │ ├── opening_loc: (1,1)-(1,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IfNode (location: (1,2)-(1,11)) + │ │ ├── if_keyword_loc: ∅ + │ │ ├── predicate: + │ │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: (1,4)-(1,5) = "?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,6)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,6)-(1,7) = "\"" + │ │ │ ├── content_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: (1,8)-(1,9) = "\"" + │ │ │ └── unescaped: "a" + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (1,9)-(1,11)) + │ │ │ ├── else_keyword_loc: (1,9)-(1,10) = ":" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── end_keyword_loc: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: (1,11)-(1,12) = ")" + │ └── block: ∅ + ├── @ HashNode (location: (3,0)-(3,12)) + │ ├── opening_loc: (3,0)-(3,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (3,2)-(3,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,2)-(3,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (3,2)-(3,3) = "'" + │ │ │ ├── value_loc: (3,3)-(3,6) = "foo" + │ │ │ ├── closing_loc: (3,6)-(3,8) = "':" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,9)-(3,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── closing_loc: (3,11)-(3,12) = "}" + └── @ HashNode (location: (5,0)-(5,22)) + ├── opening_loc: (5,0)-(5,1) = "{" + ├── elements: (length: 2) + │ ├── @ AssocNode (location: (5,2)-(5,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,2)-(5,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (5,2)-(5,3) = "'" + │ │ │ ├── value_loc: (5,3)-(5,6) = "foo" + │ │ │ ├── closing_loc: (5,6)-(5,8) = "':" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,9)-(5,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── @ AssocNode (location: (5,12)-(5,21)) + │ ├── key: + │ │ @ SymbolNode (location: (5,12)-(5,18)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (5,12)-(5,13) = "'" + │ │ ├── value_loc: (5,13)-(5,16) = "bar" + │ │ ├── closing_loc: (5,16)-(5,18) = "':" + │ │ └── unescaped: "bar" + │ ├── value: + │ │ @ HashNode (location: (5,19)-(5,21)) + │ │ ├── opening_loc: (5,19)-(5,20) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (5,20)-(5,21) = "}" + │ └── operator_loc: ∅ + └── closing_loc: (5,21)-(5,22) = "}" diff --git a/test/mri/prism/snapshots/whitequark/hash_pair_value_omission.txt b/test/mri/prism/snapshots/whitequark/hash_pair_value_omission.txt new file mode 100644 index 00000000000..455ba48407a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/hash_pair_value_omission.txt @@ -0,0 +1,97 @@ +@ ProgramNode (location: (1,0)-(5,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,7)) + └── body: (length: 3) + ├── @ HashNode (location: (1,0)-(1,6)) + │ ├── opening_loc: (1,0)-(1,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,1)-(1,5)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,1)-(1,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,1)-(1,4) = "BAR" + │ │ │ ├── closing_loc: (1,4)-(1,5) = ":" + │ │ │ └── unescaped: "BAR" + │ │ ├── value: + │ │ │ @ ImplicitNode (location: (1,1)-(1,5)) + │ │ │ └── value: + │ │ │ @ ConstantReadNode (location: (1,1)-(1,5)) + │ │ │ └── name: :BAR + │ │ └── operator_loc: ∅ + │ └── closing_loc: (1,5)-(1,6) = "}" + ├── @ HashNode (location: (3,0)-(3,8)) + │ ├── opening_loc: (3,0)-(3,1) = "{" + │ ├── elements: (length: 2) + │ │ ├── @ AssocNode (location: (3,1)-(3,3)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (3,1)-(3,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (3,1)-(3,2) = "a" + │ │ │ │ ├── closing_loc: (3,2)-(3,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (3,1)-(3,3)) + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (3,1)-(3,3)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (3,1)-(3,2) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: ∅ + │ │ └── @ AssocNode (location: (3,5)-(3,7)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,5)-(3,7)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (3,5)-(3,6) = "b" + │ │ │ ├── closing_loc: (3,6)-(3,7) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ ImplicitNode (location: (3,5)-(3,7)) + │ │ │ └── value: + │ │ │ @ CallNode (location: (3,5)-(3,7)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,5)-(3,6) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: ∅ + │ └── closing_loc: (3,7)-(3,8) = "}" + └── @ HashNode (location: (5,0)-(5,7)) + ├── opening_loc: (5,0)-(5,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (5,1)-(5,6)) + │ ├── key: + │ │ @ SymbolNode (location: (5,1)-(5,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (5,1)-(5,5) = "puts" + │ │ ├── closing_loc: (5,5)-(5,6) = ":" + │ │ └── unescaped: "puts" + │ ├── value: + │ │ @ ImplicitNode (location: (5,1)-(5,6)) + │ │ └── value: + │ │ @ CallNode (location: (5,1)-(5,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (5,1)-(5,5) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: ∅ + └── closing_loc: (5,6)-(5,7) = "}" diff --git a/test/mri/prism/snapshots/whitequark/heredoc.txt b/test/mri/prism/snapshots/whitequark/heredoc.txt new file mode 100644 index 00000000000..86543097ee1 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/heredoc.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(11,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,8)) + └── body: (length: 3) + ├── @ StringNode (location: (1,0)-(1,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,8) = "<<'HERE'" + │ ├── content_loc: (2,0)-(4,0) = "foo\nbar\n" + │ ├── closing_loc: (4,0)-(5,0) = "HERE\n" + │ └── unescaped: "foo\nbar\n" + ├── @ StringNode (location: (6,0)-(6,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (6,0)-(6,6) = "<bar)" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :=~ + │ │ ├── message_loc: (1,16)-(1,18) = "=~" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,19)-(1,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (1,19)-(1,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,19)-(1,20) = "'" + │ │ │ ├── content_loc: (1,20)-(1,23) = "bar" + │ │ │ ├── closing_loc: (1,23)-(1,24) = "'" + │ │ │ └── unescaped: "bar" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,4)-(1,9)) + │ ├── name: :match + │ └── depth: 0 + └── @ LocalVariableReadNode (location: (1,26)-(1,31)) + ├── name: :match + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/lvasgn.txt b/test/mri/prism/snapshots/whitequark/lvasgn.txt new file mode 100644 index 00000000000..be35c005875 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/lvasgn.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [:var] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,8)) + │ ├── name: :var + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,3) = "var" + │ ├── value: + │ │ @ IntegerNode (location: (1,6)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (1,4)-(1,5) = "=" + └── @ LocalVariableReadNode (location: (1,10)-(1,13)) + ├── name: :var + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/masgn.txt b/test/mri/prism/snapshots/whitequark/masgn.txt new file mode 100644 index 00000000000..32e46bfdf7a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(5,20)) +├── locals: [:foo, :bar, :baz] +└── statements: + @ StatementsNode (location: (1,0)-(5,20)) + └── body: (length: 3) + ├── @ MultiWriteNode (location: (1,0)-(1,17)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,4)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (1,6)-(1,9)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (1,0)-(1,1) = "(" + │ ├── rparen_loc: (1,9)-(1,10) = ")" + │ ├── operator_loc: (1,11)-(1,12) = "=" + │ └── value: + │ @ ArrayNode (location: (1,13)-(1,17)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (1,16)-(1,17)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── @ MultiWriteNode (location: (3,0)-(3,15)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,3)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (3,5)-(3,8)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (3,9)-(3,10) = "=" + │ └── value: + │ @ ArrayNode (location: (3,11)-(3,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ IntegerNode (location: (3,11)-(3,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (3,14)-(3,15)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── @ MultiWriteNode (location: (5,0)-(5,20)) + ├── lefts: (length: 3) + │ ├── @ LocalVariableTargetNode (location: (5,0)-(5,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (5,5)-(5,8)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (5,10)-(5,13)) + │ ├── name: :baz + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (5,14)-(5,15) = "=" + └── value: + @ ArrayNode (location: (5,16)-(5,20)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (5,16)-(5,17)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (5,19)-(5,20)) + │ ├── flags: decimal + │ └── value: 2 + ├── opening_loc: ∅ + └── closing_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/masgn_attr.txt b/test/mri/prism/snapshots/whitequark/masgn_attr.txt new file mode 100644 index 00000000000..f4f4276597f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn_attr.txt @@ -0,0 +1,82 @@ +@ ProgramNode (location: (1,0)-(5,18)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(5,18)) + └── body: (length: 3) + ├── @ MultiWriteNode (location: (1,0)-(1,17)) + │ ├── lefts: (length: 2) + │ │ ├── @ CallTargetNode (location: (1,0)-(1,6)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: + │ │ │ │ @ SelfNode (location: (1,0)-(1,4)) + │ │ │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ │ │ ├── name: :A= + │ │ │ └── message_loc: (1,5)-(1,6) = "A" + │ │ └── @ LocalVariableTargetNode (location: (1,8)-(1,11)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (1,12)-(1,13) = "=" + │ └── value: + │ @ LocalVariableReadNode (location: (1,14)-(1,17)) + │ ├── name: :foo + │ └── depth: 0 + ├── @ MultiWriteNode (location: (3,0)-(3,24)) + │ ├── lefts: (length: 2) + │ │ ├── @ CallTargetNode (location: (3,0)-(3,6)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: + │ │ │ │ @ SelfNode (location: (3,0)-(3,4)) + │ │ │ ├── call_operator_loc: (3,4)-(3,5) = "." + │ │ │ ├── name: :a= + │ │ │ └── message_loc: (3,5)-(3,6) = "a" + │ │ └── @ IndexTargetNode (location: (3,8)-(3,18)) + │ │ ├── flags: attribute_write, ignore_visibility + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (3,8)-(3,12)) + │ │ ├── opening_loc: (3,12)-(3,13) = "[" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,13)-(3,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (3,13)-(3,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (3,16)-(3,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: (3,17)-(3,18) = "]" + │ │ └── block: ∅ + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (3,19)-(3,20) = "=" + │ └── value: + │ @ LocalVariableReadNode (location: (3,21)-(3,24)) + │ ├── name: :foo + │ └── depth: 0 + └── @ MultiWriteNode (location: (5,0)-(5,18)) + ├── lefts: (length: 2) + │ ├── @ CallTargetNode (location: (5,0)-(5,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (5,0)-(5,4)) + │ │ ├── call_operator_loc: (5,4)-(5,6) = "::" + │ │ ├── name: :a= + │ │ └── message_loc: (5,6)-(5,7) = "a" + │ └── @ LocalVariableTargetNode (location: (5,9)-(5,12)) + │ ├── name: :foo + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (5,13)-(5,14) = "=" + └── value: + @ LocalVariableReadNode (location: (5,15)-(5,18)) + ├── name: :foo + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/masgn_cmd.txt b/test/mri/prism/snapshots/whitequark/masgn_cmd.txt new file mode 100644 index 00000000000..1c62658ab2b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn_cmd.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [:foo, :bar] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,16)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) + │ ├── name: :bar + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ CallNode (location: (1,11)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (1,11)-(1,12) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,13)-(1,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,13)-(1,16)) + │ ├── name: :foo + │ └── depth: 0 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/masgn_const.txt b/test/mri/prism/snapshots/whitequark/masgn_const.txt new file mode 100644 index 00000000000..56169deb17b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn_const.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(3,18)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(3,18)) + └── body: (length: 2) + ├── @ MultiWriteNode (location: (1,0)-(1,14)) + │ ├── lefts: (length: 2) + │ │ ├── @ ConstantPathTargetNode (location: (1,0)-(1,3)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ │ │ └── name: :A + │ │ │ └── delimiter_loc: (1,0)-(1,2) = "::" + │ │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (1,9)-(1,10) = "=" + │ └── value: + │ @ LocalVariableReadNode (location: (1,11)-(1,14)) + │ ├── name: :foo + │ └── depth: 0 + └── @ MultiWriteNode (location: (3,0)-(3,18)) + ├── lefts: (length: 2) + │ ├── @ ConstantPathTargetNode (location: (3,0)-(3,7)) + │ │ ├── parent: + │ │ │ @ SelfNode (location: (3,0)-(3,4)) + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (3,6)-(3,7)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (3,4)-(3,6) = "::" + │ └── @ LocalVariableTargetNode (location: (3,9)-(3,12)) + │ ├── name: :foo + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (3,13)-(3,14) = "=" + └── value: + @ LocalVariableReadNode (location: (3,15)-(3,18)) + ├── name: :foo + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/masgn_nested.txt b/test/mri/prism/snapshots/whitequark/masgn_nested.txt new file mode 100644 index 00000000000..3e4602472fd --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn_nested.txt @@ -0,0 +1,66 @@ +@ ProgramNode (location: (1,0)-(3,15)) +├── locals: [:b, :a, :c] +└── statements: + @ StatementsNode (location: (1,0)-(3,15)) + └── body: (length: 2) + ├── @ MultiWriteNode (location: (1,0)-(1,13)) + │ ├── lefts: (length: 1) + │ │ └── @ MultiTargetNode (location: (1,1)-(1,6)) + │ │ ├── lefts: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (1,2)-(1,3)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ ImplicitRestNode (location: (1,3)-(1,4)) + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: (1,1)-(1,2) = "(" + │ │ └── rparen_loc: (1,5)-(1,6) = ")" + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (1,0)-(1,1) = "(" + │ ├── rparen_loc: (1,6)-(1,7) = ")" + │ ├── operator_loc: (1,8)-(1,9) = "=" + │ └── value: + │ @ CallNode (location: (1,10)-(1,13)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,10)-(1,13) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ MultiWriteNode (location: (3,0)-(3,15)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ MultiTargetNode (location: (3,3)-(3,9)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (3,4)-(3,5)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (3,7)-(3,8)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (3,3)-(3,4) = "(" + │ └── rparen_loc: (3,8)-(3,9) = ")" + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (3,10)-(3,11) = "=" + └── value: + @ CallNode (location: (3,12)-(3,15)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (3,12)-(3,15) = "foo" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/masgn_splat.txt b/test/mri/prism/snapshots/whitequark/masgn_splat.txt new file mode 100644 index 00000000000..0db040a3ab3 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/masgn_splat.txt @@ -0,0 +1,284 @@ +@ ProgramNode (location: (1,0)-(19,16)) +├── locals: [:c, :d, :b, :a] +└── statements: + @ StatementsNode (location: (1,0)-(19,16)) + └── body: (length: 10) + ├── @ MultiWriteNode (location: (1,0)-(1,7)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (1,0)-(1,1)) + │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (1,2)-(1,3) = "=" + │ └── value: + │ @ CallNode (location: (1,4)-(1,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,4)-(1,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (3,0)-(3,13)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (3,0)-(3,1)) + │ │ ├── operator_loc: (3,0)-(3,1) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (3,3)-(3,4)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (3,6)-(3,7)) + │ │ ├── name: :d + │ │ └── depth: 0 + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (3,8)-(3,9) = "=" + │ └── value: + │ @ CallNode (location: (3,10)-(3,13)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,10)-(3,13) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (5,0)-(5,8)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (5,0)-(5,2)) + │ │ ├── operator_loc: (5,0)-(5,1) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (5,1)-(5,2)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (5,3)-(5,4) = "=" + │ └── value: + │ @ CallNode (location: (5,5)-(5,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (5,5)-(5,8) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (7,0)-(7,11)) + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (7,0)-(7,2)) + │ │ ├── operator_loc: (7,0)-(7,1) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (7,1)-(7,2)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rights: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (7,4)-(7,5)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (7,6)-(7,7) = "=" + │ └── value: + │ @ CallNode (location: (7,8)-(7,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (7,8)-(7,11) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (9,0)-(9,18)) + │ ├── lefts: (length: 2) + │ │ ├── @ InstanceVariableTargetNode (location: (9,0)-(9,4)) + │ │ │ └── name: :@foo + │ │ └── @ ClassVariableTargetNode (location: (9,6)-(9,11)) + │ │ └── name: :@@bar + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (9,12)-(9,13) = "=" + │ └── value: + │ @ ArrayNode (location: (9,14)-(9,18)) + │ ├── flags: contains_splat + │ ├── elements: (length: 1) + │ │ └── @ SplatNode (location: (9,14)-(9,18)) + │ │ ├── operator_loc: (9,14)-(9,15) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (9,15)-(9,18)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (9,15)-(9,18) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + ├── @ MultiWriteNode (location: (11,0)-(11,10)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (11,0)-(11,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (11,3)-(11,4)) + │ │ ├── operator_loc: (11,3)-(11,4) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (11,5)-(11,6) = "=" + │ └── value: + │ @ CallNode (location: (11,7)-(11,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (11,7)-(11,10) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (13,0)-(13,13)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (13,0)-(13,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (13,3)-(13,4)) + │ │ ├── operator_loc: (13,3)-(13,4) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (13,6)-(13,7)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (13,8)-(13,9) = "=" + │ └── value: + │ @ CallNode (location: (13,10)-(13,13)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (13,10)-(13,13) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (15,0)-(15,11)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (15,0)-(15,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (15,3)-(15,5)) + │ │ ├── operator_loc: (15,3)-(15,4) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (15,4)-(15,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (15,6)-(15,7) = "=" + │ └── value: + │ @ CallNode (location: (15,8)-(15,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (15,8)-(15,11) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ MultiWriteNode (location: (17,0)-(17,14)) + │ ├── lefts: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (17,0)-(17,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (17,3)-(17,5)) + │ │ ├── operator_loc: (17,3)-(17,4) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (17,4)-(17,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rights: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (17,7)-(17,8)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (17,9)-(17,10) = "=" + │ └── value: + │ @ CallNode (location: (17,11)-(17,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (17,11)-(17,14) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ MultiWriteNode (location: (19,0)-(19,16)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (19,0)-(19,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (19,3)-(19,4)) + │ ├── name: :b + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (19,5)-(19,6) = "=" + └── value: + @ ArrayNode (location: (19,7)-(19,16)) + ├── flags: contains_splat + ├── elements: (length: 2) + │ ├── @ SplatNode (location: (19,7)-(19,11)) + │ │ ├── operator_loc: (19,7)-(19,8) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (19,8)-(19,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (19,8)-(19,11) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ CallNode (location: (19,13)-(19,16)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (19,13)-(19,16) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: ∅ + └── closing_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/method_definition_in_while_cond.txt b/test/mri/prism/snapshots/whitequark/method_definition_in_while_cond.txt new file mode 100644 index 00000000000..963686b73ec --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/method_definition_in_while_cond.txt @@ -0,0 +1,199 @@ +@ ProgramNode (location: (1,0)-(7,47)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,47)) + └── body: (length: 4) + ├── @ WhileNode (location: (1,0)-(1,45)) + │ ├── flags: ∅ + │ ├── keyword_loc: (1,0)-(1,5) = "while" + │ ├── closing_loc: (1,42)-(1,45) = "end" + │ ├── predicate: + │ │ @ DefNode (location: (1,6)-(1,33)) + │ │ ├── name: :foo + │ │ ├── name_loc: (1,10)-(1,13) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,14)-(1,28)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,14)-(1,28)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "a" + │ │ │ │ ├── operator_loc: (1,16)-(1,17) = "=" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (1,18)-(1,28)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :tap + │ │ │ │ ├── message_loc: (1,18)-(1,21) = "tap" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (1,22)-(1,28)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: ∅ + │ │ │ │ ├── opening_loc: (1,22)-(1,24) = "do" + │ │ │ │ └── closing_loc: (1,25)-(1,28) = "end" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: ∅ + │ │ ├── locals: [:a] + │ │ ├── def_keyword_loc: (1,6)-(1,9) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (1,30)-(1,33) = "end" + │ └── statements: + │ @ StatementsNode (location: (1,35)-(1,40)) + │ └── body: (length: 1) + │ └── @ BreakNode (location: (1,35)-(1,40)) + │ ├── arguments: ∅ + │ └── keyword_loc: (1,35)-(1,40) = "break" + ├── @ WhileNode (location: (3,0)-(3,42)) + │ ├── flags: ∅ + │ ├── keyword_loc: (3,0)-(3,5) = "while" + │ ├── closing_loc: (3,39)-(3,42) = "end" + │ ├── predicate: + │ │ @ DefNode (location: (3,6)-(3,30)) + │ │ ├── name: :foo + │ │ ├── name_loc: (3,10)-(3,13) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,15)-(3,25)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,15)-(3,25)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :tap + │ │ │ ├── message_loc: (3,15)-(3,18) = "tap" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (3,19)-(3,25)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (3,19)-(3,21) = "do" + │ │ │ └── closing_loc: (3,22)-(3,25) = "end" + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (3,6)-(3,9) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (3,27)-(3,30) = "end" + │ └── statements: + │ @ StatementsNode (location: (3,32)-(3,37)) + │ └── body: (length: 1) + │ └── @ BreakNode (location: (3,32)-(3,37)) + │ ├── arguments: ∅ + │ └── keyword_loc: (3,32)-(3,37) = "break" + ├── @ WhileNode (location: (5,0)-(5,50)) + │ ├── flags: ∅ + │ ├── keyword_loc: (5,0)-(5,5) = "while" + │ ├── closing_loc: (5,47)-(5,50) = "end" + │ ├── predicate: + │ │ @ DefNode (location: (5,6)-(5,38)) + │ │ ├── name: :foo + │ │ ├── name_loc: (5,15)-(5,18) = "foo" + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (5,10)-(5,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,19)-(5,33)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (5,19)-(5,33)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (5,19)-(5,20) = "a" + │ │ │ │ ├── operator_loc: (5,21)-(5,22) = "=" + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (5,23)-(5,33)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :tap + │ │ │ │ ├── message_loc: (5,23)-(5,26) = "tap" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (5,27)-(5,33)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: ∅ + │ │ │ │ ├── opening_loc: (5,27)-(5,29) = "do" + │ │ │ │ └── closing_loc: (5,30)-(5,33) = "end" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: ∅ + │ │ ├── locals: [:a] + │ │ ├── def_keyword_loc: (5,6)-(5,9) = "def" + │ │ ├── operator_loc: (5,14)-(5,15) = "." + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (5,35)-(5,38) = "end" + │ └── statements: + │ @ StatementsNode (location: (5,40)-(5,45)) + │ └── body: (length: 1) + │ └── @ BreakNode (location: (5,40)-(5,45)) + │ ├── arguments: ∅ + │ └── keyword_loc: (5,40)-(5,45) = "break" + └── @ WhileNode (location: (7,0)-(7,47)) + ├── flags: ∅ + ├── keyword_loc: (7,0)-(7,5) = "while" + ├── closing_loc: (7,44)-(7,47) = "end" + ├── predicate: + │ @ DefNode (location: (7,6)-(7,35)) + │ ├── name: :foo + │ ├── name_loc: (7,15)-(7,18) = "foo" + │ ├── receiver: + │ │ @ SelfNode (location: (7,10)-(7,14)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,20)-(7,30)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,20)-(7,30)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :tap + │ │ ├── message_loc: (7,20)-(7,23) = "tap" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (7,24)-(7,30)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (7,24)-(7,26) = "do" + │ │ └── closing_loc: (7,27)-(7,30) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (7,6)-(7,9) = "def" + │ ├── operator_loc: (7,14)-(7,15) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (7,32)-(7,35) = "end" + └── statements: + @ StatementsNode (location: (7,37)-(7,42)) + └── body: (length: 1) + └── @ BreakNode (location: (7,37)-(7,42)) + ├── arguments: ∅ + └── keyword_loc: (7,37)-(7,42) = "break" diff --git a/test/mri/prism/snapshots/whitequark/module.txt b/test/mri/prism/snapshots/whitequark/module.txt new file mode 100644 index 00000000000..87348c4ec93 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/module.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ModuleNode (location: (1,0)-(1,15)) + ├── locals: [] + ├── module_keyword_loc: (1,0)-(1,6) = "module" + ├── constant_path: + │ @ ConstantReadNode (location: (1,7)-(1,10)) + │ └── name: :Foo + ├── body: ∅ + ├── end_keyword_loc: (1,12)-(1,15) = "end" + └── name: :Foo diff --git a/test/mri/prism/snapshots/whitequark/multiple_pattern_matches.txt b/test/mri/prism/snapshots/whitequark/multiple_pattern_matches.txt new file mode 100644 index 00000000000..afa3517e116 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/multiple_pattern_matches.txt @@ -0,0 +1,173 @@ +@ ProgramNode (location: (1,0)-(5,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(5,12)) + └── body: (length: 4) + ├── @ MatchRequiredNode (location: (1,0)-(1,12)) + │ ├── value: + │ │ @ HashNode (location: (1,0)-(1,6)) + │ │ ├── opening_loc: (1,0)-(1,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (1,1)-(1,5)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (1,1)-(1,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (1,1)-(1,2) = "a" + │ │ │ │ ├── closing_loc: (1,2)-(1,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (1,5)-(1,6) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (1,10)-(1,12)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (1,10)-(1,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (1,10)-(1,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (1,10)-(1,11) = "a" + │ │ │ │ ├── closing_loc: (1,11)-(1,12) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (1,10)-(1,11)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (1,7)-(1,9) = "=>" + ├── @ MatchRequiredNode (location: (2,0)-(2,12)) + │ ├── value: + │ │ @ HashNode (location: (2,0)-(2,6)) + │ │ ├── opening_loc: (2,0)-(2,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,1)-(2,5)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,1)-(2,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,1)-(2,2) = "a" + │ │ │ │ ├── closing_loc: (2,2)-(2,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (2,4)-(2,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (2,5)-(2,6) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,10)-(2,12)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,10)-(2,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,10)-(2,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,10)-(2,11) = "a" + │ │ │ │ ├── closing_loc: (2,11)-(2,12) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (2,10)-(2,11)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,10)-(2,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (2,7)-(2,9) = "=>" + ├── @ MatchPredicateNode (location: (4,0)-(4,12)) + │ ├── value: + │ │ @ HashNode (location: (4,0)-(4,6)) + │ │ ├── opening_loc: (4,0)-(4,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (4,1)-(4,5)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (4,1)-(4,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (4,1)-(4,2) = "a" + │ │ │ │ ├── closing_loc: (4,2)-(4,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (4,4)-(4,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (4,5)-(4,6) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (4,10)-(4,12)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (4,10)-(4,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (4,10)-(4,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (4,10)-(4,11) = "a" + │ │ │ │ ├── closing_loc: (4,11)-(4,12) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (4,10)-(4,11)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (4,10)-(4,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (4,7)-(4,9) = "in" + └── @ MatchPredicateNode (location: (5,0)-(5,12)) + ├── value: + │ @ HashNode (location: (5,0)-(5,6)) + │ ├── opening_loc: (5,0)-(5,1) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,1)-(5,5)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,1)-(5,3)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (5,1)-(5,2) = "a" + │ │ │ ├── closing_loc: (5,2)-(5,3) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,4)-(5,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 0 + │ │ └── operator_loc: ∅ + │ └── closing_loc: (5,5)-(5,6) = "}" + ├── pattern: + │ @ HashPatternNode (location: (5,10)-(5,12)) + │ ├── constant: ∅ + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,10)-(5,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,10)-(5,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (5,10)-(5,11) = "a" + │ │ │ ├── closing_loc: (5,11)-(5,12) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ ImplicitNode (location: (5,10)-(5,11)) + │ │ │ └── value: + │ │ │ @ LocalVariableTargetNode (location: (5,10)-(5,11)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── operator_loc: ∅ + │ ├── rest: ∅ + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── operator_loc: (5,7)-(5,9) = "in" diff --git a/test/mri/prism/snapshots/whitequark/newline_in_hash_argument.txt b/test/mri/prism/snapshots/whitequark/newline_in_hash_argument.txt new file mode 100644 index 00000000000..d5e89d87f9c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/newline_in_hash_argument.txt @@ -0,0 +1,163 @@ +@ ProgramNode (location: (1,0)-(14,1)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(14,1)) + └── body: (length: 3) + ├── @ CaseMatchNode (location: (1,0)-(8,3)) + │ ├── predicate: + │ │ @ CallNode (location: (1,5)-(1,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,5)-(1,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── conditions: (length: 2) + │ │ ├── @ InNode (location: (2,0)-(4,4)) + │ │ │ ├── pattern: + │ │ │ │ @ HashPatternNode (location: (2,3)-(2,5)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (2,3)-(2,5)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (2,3)-(2,4) = "a" + │ │ │ │ │ │ ├── closing_loc: (2,4)-(2,5) = ":" + │ │ │ │ │ │ └── unescaped: "a" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ ImplicitNode (location: (2,3)-(2,4)) + │ │ │ │ │ │ └── value: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (2,3)-(2,4)) + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ └── closing_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,0)-(4,4)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (3,0)-(3,1)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 0 + │ │ │ │ └── @ TrueNode (location: (4,0)-(4,4)) + │ │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ │ └── then_loc: ∅ + │ │ └── @ InNode (location: (5,0)-(7,4)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (5,3)-(5,7)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (5,3)-(5,7)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (5,3)-(5,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (5,3)-(5,4) = "\"" + │ │ │ │ │ ├── value_loc: (5,4)-(5,5) = "b" + │ │ │ │ │ ├── closing_loc: (5,5)-(5,7) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (5,4)-(5,5)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (5,4)-(5,5)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (6,0)-(7,4)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ IntegerNode (location: (6,0)-(6,1)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 0 + │ │ │ └── @ TrueNode (location: (7,0)-(7,4)) + │ │ ├── in_loc: (5,0)-(5,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (8,0)-(8,3) = "end" + ├── @ CallNode (location: (10,0)-(11,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (10,0)-(10,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (10,0)-(10,3) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (10,3)-(10,4) = "." + │ ├── name: :set + │ ├── message_loc: (10,4)-(10,7) = "set" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (10,8)-(11,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (10,8)-(11,1)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (10,8)-(11,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (10,8)-(10,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (10,8)-(10,9) = "\"" + │ │ │ ├── value_loc: (10,9)-(10,12) = "foo" + │ │ │ ├── closing_loc: (10,12)-(10,14) = "\":" + │ │ │ └── unescaped: "foo" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (11,0)-(11,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (13,0)-(14,1)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (13,0)-(13,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :obj + │ ├── message_loc: (13,0)-(13,3) = "obj" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (13,3)-(13,4) = "." + ├── name: :set + ├── message_loc: (13,4)-(13,7) = "set" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (13,8)-(14,1)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (13,8)-(14,1)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (13,8)-(14,1)) + │ ├── key: + │ │ @ SymbolNode (location: (13,8)-(13,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (13,8)-(13,11) = "foo" + │ │ ├── closing_loc: (13,11)-(13,12) = ":" + │ │ └── unescaped: "foo" + │ ├── value: + │ │ @ IntegerNode (location: (14,0)-(14,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/next.txt b/test/mri/prism/snapshots/whitequark/next.txt new file mode 100644 index 00000000000..b58c2de4fb4 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/next.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(7,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,9)) + └── body: (length: 4) + ├── @ NextNode (location: (1,0)-(1,4)) + │ ├── arguments: ∅ + │ └── keyword_loc: (1,0)-(1,4) = "next" + ├── @ NextNode (location: (3,0)-(3,8)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,5)-(3,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,5)-(3,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,5)-(3,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── keyword_loc: (3,0)-(3,4) = "next" + ├── @ NextNode (location: (5,0)-(5,6)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,4)-(5,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (5,4)-(5,6)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (5,4)-(5,5) = "(" + │ │ └── closing_loc: (5,5)-(5,6) = ")" + │ └── keyword_loc: (5,0)-(5,4) = "next" + └── @ NextNode (location: (7,0)-(7,9)) + ├── arguments: + │ @ ArgumentsNode (location: (7,4)-(7,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (7,4)-(7,9)) + │ ├── body: + │ │ @ StatementsNode (location: (7,5)-(7,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,5)-(7,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,5)-(7,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (7,4)-(7,5) = "(" + │ └── closing_loc: (7,8)-(7,9) = ")" + └── keyword_loc: (7,0)-(7,4) = "next" diff --git a/test/mri/prism/snapshots/whitequark/next_block.txt b/test/mri/prism/snapshots/whitequark/next_block.txt new file mode 100644 index 00000000000..f1d65a44ed0 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/next_block.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ NextNode (location: (1,0)-(1,19)) + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,5)-(1,19)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun + │ ├── message_loc: (1,5)-(1,8) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,9)-(1,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,13)-(1,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,13)-(1,15) = "do" + │ └── closing_loc: (1,16)-(1,19) = "end" + └── keyword_loc: (1,0)-(1,4) = "next" diff --git a/test/mri/prism/snapshots/whitequark/nil.txt b/test/mri/prism/snapshots/whitequark/nil.txt new file mode 100644 index 00000000000..15774c02fd0 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/nil.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ NilNode (location: (1,0)-(1,3)) diff --git a/test/mri/prism/snapshots/whitequark/nil_expression.txt b/test/mri/prism/snapshots/whitequark/nil_expression.txt new file mode 100644 index 00000000000..74211156111 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/nil_expression.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(3,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,9)) + └── body: (length: 2) + ├── @ ParenthesesNode (location: (1,0)-(1,2)) + │ ├── body: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "(" + │ └── closing_loc: (1,1)-(1,2) = ")" + └── @ BeginNode (location: (3,0)-(3,9)) + ├── begin_keyword_loc: (3,0)-(3,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (3,6)-(3,9) = "end" diff --git a/test/mri/prism/snapshots/whitequark/non_lvar_injecting_match.txt b/test/mri/prism/snapshots/whitequark/non_lvar_injecting_match.txt new file mode 100644 index 00000000000..2df571e8dc1 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/non_lvar_injecting_match.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,28)) + ├── flags: ∅ + ├── receiver: + │ @ InterpolatedRegularExpressionNode (location: (1,0)-(1,19)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "/" + │ ├── parts: (length: 2) + │ │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,5)) + │ │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ │ └── @ StringNode (location: (1,5)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,5)-(1,18) = "(?bar)" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "(?bar)" + │ └── closing_loc: (1,18)-(1,19) = "/" + ├── call_operator_loc: ∅ + ├── name: :=~ + ├── message_loc: (1,20)-(1,22) = "=~" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,23)-(1,28)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,23)-(1,28)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,23)-(1,24) = "'" + │ ├── content_loc: (1,24)-(1,27) = "bar" + │ ├── closing_loc: (1,27)-(1,28) = "'" + │ └── unescaped: "bar" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/not.txt b/test/mri/prism/snapshots/whitequark/not.txt new file mode 100644 index 00000000000..0a6d60e5023 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/not.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,4)-(1,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,0)-(1,3) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,5)) + │ ├── flags: ∅ + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (3,0)-(3,3) = "not" + │ ├── opening_loc: (3,3)-(3,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (3,4)-(3,5) = ")" + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,8)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,4)-(5,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,4)-(5,7) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (5,0)-(5,3) = "not" + ├── opening_loc: (5,3)-(5,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (5,7)-(5,8) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/not_cmd.txt b/test/mri/prism/snapshots/whitequark/not_cmd.txt new file mode 100644 index 00000000000..3b111272c6e --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/not_cmd.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,4)-(1,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,4)-(1,5) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,6)-(1,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/not_masgn__24.txt b/test/mri/prism/snapshots/whitequark/not_masgn__24.txt new file mode 100644 index 00000000000..90124c38667 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/not_masgn__24.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── receiver: + │ @ ParenthesesNode (location: (1,1)-(1,13)) + │ ├── body: + │ │ @ StatementsNode (location: (1,2)-(1,12)) + │ │ └── body: (length: 1) + │ │ └── @ MultiWriteNode (location: (1,2)-(1,12)) + │ │ ├── lefts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (1,5)-(1,6)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ └── value: + │ │ @ CallNode (location: (1,9)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,9)-(1,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,1)-(1,2) = "(" + │ └── closing_loc: (1,12)-(1,13) = ")" + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/nth_ref.txt b/test/mri/prism/snapshots/whitequark/nth_ref.txt new file mode 100644 index 00000000000..1d386d518ba --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/nth_ref.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ NumberedReferenceReadNode (location: (1,0)-(1,3)) + └── number: 10 diff --git a/test/mri/prism/snapshots/whitequark/numbered_args_after_27.txt b/test/mri/prism/snapshots/whitequark/numbered_args_after_27.txt new file mode 100644 index 00000000000..56419adccda --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/numbered_args_after_27.txt @@ -0,0 +1,143 @@ +@ ProgramNode (location: (1,0)-(7,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,13)) + └── body: (length: 4) + ├── @ LambdaNode (location: (1,0)-(1,17)) + │ ├── locals: [:_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,3)-(1,5) = "do" + │ ├── closing_loc: (1,14)-(1,17) = "end" + │ ├── parameters: + │ │ @ NumberedParametersNode (location: (1,0)-(1,17)) + │ │ └── maximum: 9 + │ └── body: + │ @ StatementsNode (location: (1,6)-(1,13)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,13)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (1,6)-(1,8)) + │ │ ├── name: :_1 + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (1,9)-(1,10) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,11)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,11)-(1,13)) + │ │ ├── name: :_9 + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ LambdaNode (location: (3,0)-(3,13)) + │ ├── locals: [:_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9] + │ ├── operator_loc: (3,0)-(3,2) = "->" + │ ├── opening_loc: (3,3)-(3,4) = "{" + │ ├── closing_loc: (3,12)-(3,13) = "}" + │ ├── parameters: + │ │ @ NumberedParametersNode (location: (3,0)-(3,13)) + │ │ └── maximum: 9 + │ └── body: + │ @ StatementsNode (location: (3,5)-(3,12)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,5)-(3,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (3,5)-(3,7)) + │ │ ├── name: :_1 + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (3,8)-(3,9) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,10)-(3,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (3,10)-(3,12)) + │ │ ├── name: :_9 + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,16)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (5,0)-(5,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,2)-(5,16)) + │ ├── locals: [:_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9] + │ ├── parameters: + │ │ @ NumberedParametersNode (location: (5,2)-(5,16)) + │ │ └── maximum: 9 + │ ├── body: + │ │ @ StatementsNode (location: (5,5)-(5,12)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,5)-(5,12)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (5,5)-(5,7)) + │ │ │ ├── name: :_1 + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (5,8)-(5,9) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,10)-(5,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (5,10)-(5,12)) + │ │ │ ├── name: :_9 + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (5,2)-(5,4) = "do" + │ └── closing_loc: (5,13)-(5,16) = "end" + └── @ CallNode (location: (7,0)-(7,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (7,0)-(7,1) = "m" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (7,2)-(7,13)) + ├── locals: [:_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9] + ├── parameters: + │ @ NumberedParametersNode (location: (7,2)-(7,13)) + │ └── maximum: 9 + ├── body: + │ @ StatementsNode (location: (7,4)-(7,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (7,4)-(7,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (7,4)-(7,6)) + │ │ ├── name: :_1 + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (7,7)-(7,8) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,9)-(7,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (7,9)-(7,11)) + │ │ ├── name: :_9 + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (7,2)-(7,3) = "{" + └── closing_loc: (7,12)-(7,13) = "}" diff --git a/test/mri/prism/snapshots/whitequark/numparam_outside_block.txt b/test/mri/prism/snapshots/whitequark/numparam_outside_block.txt new file mode 100644 index 00000000000..d79aedf7f96 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/numparam_outside_block.txt @@ -0,0 +1,114 @@ +@ ProgramNode (location: (1,0)-(9,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,17)) + └── body: (length: 5) + ├── @ CallNode (location: (1,0)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :_1 + │ ├── message_loc: (1,0)-(1,2) = "_1" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ SingletonClassNode (location: (3,0)-(3,21)) + │ ├── locals: [] + │ ├── class_keyword_loc: (3,0)-(3,5) = "class" + │ ├── operator_loc: (3,6)-(3,8) = "<<" + │ ├── expression: + │ │ @ CallNode (location: (3,9)-(3,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,9)-(3,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,14)-(3,16)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,14)-(3,16)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :_1 + │ │ ├── message_loc: (3,14)-(3,16) = "_1" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (3,18)-(3,21) = "end" + ├── @ ClassNode (location: (5,0)-(5,16)) + │ ├── locals: [] + │ ├── class_keyword_loc: (5,0)-(5,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (5,6)-(5,7)) + │ │ └── name: :A + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,9)-(5,11)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,9)-(5,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :_1 + │ │ ├── message_loc: (5,9)-(5,11) = "_1" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── end_keyword_loc: (5,13)-(5,16) = "end" + │ └── name: :A + ├── @ DefNode (location: (7,0)-(7,19)) + │ ├── name: :m + │ ├── name_loc: (7,9)-(7,10) = "m" + │ ├── receiver: + │ │ @ SelfNode (location: (7,4)-(7,8)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,12)-(7,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,12)-(7,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :_1 + │ │ ├── message_loc: (7,12)-(7,14) = "_1" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: (7,8)-(7,9) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (7,16)-(7,19) = "end" + └── @ ModuleNode (location: (9,0)-(9,17)) + ├── locals: [] + ├── module_keyword_loc: (9,0)-(9,6) = "module" + ├── constant_path: + │ @ ConstantReadNode (location: (9,7)-(9,8)) + │ └── name: :A + ├── body: + │ @ StatementsNode (location: (9,10)-(9,12)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (9,10)-(9,12)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :_1 + │ ├── message_loc: (9,10)-(9,12) = "_1" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── end_keyword_loc: (9,14)-(9,17) = "end" + └── name: :A diff --git a/test/mri/prism/snapshots/whitequark/op_asgn.txt b/test/mri/prism/snapshots/whitequark/op_asgn.txt new file mode 100644 index 00000000000..8f24a35ad0d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/op_asgn.txt @@ -0,0 +1,74 @@ +@ ProgramNode (location: (1,0)-(5,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,11)) + └── body: (length: 3) + ├── @ CallOperatorWriteNode (location: (1,0)-(1,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── message_loc: (1,4)-(1,5) = "A" + │ ├── read_name: :A + │ ├── write_name: :A= + │ ├── operator: :+ + │ ├── operator_loc: (1,6)-(1,8) = "+=" + │ └── value: + │ @ IntegerNode (location: (1,9)-(1,10)) + │ ├── flags: decimal + │ └── value: 1 + ├── @ CallOperatorWriteNode (location: (3,0)-(3,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ ├── message_loc: (3,4)-(3,5) = "a" + │ ├── read_name: :a + │ ├── write_name: :a= + │ ├── operator: :+ + │ ├── operator_loc: (3,6)-(3,8) = "+=" + │ └── value: + │ @ IntegerNode (location: (3,9)-(3,10)) + │ ├── flags: decimal + │ └── value: 1 + └── @ CallOperatorWriteNode (location: (5,0)-(5,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,0)-(5,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,0)-(5,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (5,3)-(5,5) = "::" + ├── message_loc: (5,5)-(5,6) = "a" + ├── read_name: :a + ├── write_name: :a= + ├── operator: :+ + ├── operator_loc: (5,7)-(5,9) = "+=" + └── value: + @ IntegerNode (location: (5,10)-(5,11)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/whitequark/op_asgn_cmd.txt b/test/mri/prism/snapshots/whitequark/op_asgn_cmd.txt new file mode 100644 index 00000000000..109c2fd2edd --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/op_asgn_cmd.txt @@ -0,0 +1,178 @@ +@ ProgramNode (location: (1,0)-(7,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,15)) + └── body: (length: 4) + ├── @ CallOperatorWriteNode (location: (1,0)-(1,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── message_loc: (1,4)-(1,5) = "A" + │ ├── read_name: :A + │ ├── write_name: :A= + │ ├── operator: :+ + │ ├── operator_loc: (1,6)-(1,8) = "+=" + │ └── value: + │ @ CallNode (location: (1,9)-(1,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,9)-(1,10) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,11)-(1,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,11)-(1,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,11)-(1,14) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallOperatorWriteNode (location: (3,0)-(3,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ ├── message_loc: (3,4)-(3,5) = "a" + │ ├── read_name: :a + │ ├── write_name: :a= + │ ├── operator: :+ + │ ├── operator_loc: (3,6)-(3,8) = "+=" + │ └── value: + │ @ CallNode (location: (3,9)-(3,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (3,9)-(3,10) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,11)-(3,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,11)-(3,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,11)-(3,14) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathOperatorWriteNode (location: (5,0)-(5,15)) + │ ├── target: + │ │ @ ConstantPathNode (location: (5,0)-(5,6)) + │ │ ├── parent: + │ │ │ @ CallNode (location: (5,0)-(5,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (5,0)-(5,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (5,5)-(5,6)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (5,3)-(5,5) = "::" + │ ├── operator_loc: (5,7)-(5,9) = "+=" + │ ├── value: + │ │ @ CallNode (location: (5,10)-(5,15)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :m + │ │ ├── message_loc: (5,10)-(5,11) = "m" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,12)-(5,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (5,12)-(5,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (5,12)-(5,15) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator: :+ + └── @ CallOperatorWriteNode (location: (7,0)-(7,15)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (7,0)-(7,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,0)-(7,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (7,3)-(7,5) = "::" + ├── message_loc: (7,5)-(7,6) = "a" + ├── read_name: :a + ├── write_name: :a= + ├── operator: :+ + ├── operator_loc: (7,7)-(7,9) = "+=" + └── value: + @ CallNode (location: (7,10)-(7,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (7,10)-(7,11) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (7,12)-(7,15)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (7,12)-(7,15)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,12)-(7,15) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/op_asgn_index.txt b/test/mri/prism/snapshots/whitequark/op_asgn_index.txt new file mode 100644 index 00000000000..fe077fae13f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/op_asgn_index.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ IndexOperatorWriteNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,8)-(1,9) = "]" + ├── block: ∅ + ├── operator: :+ + ├── operator_loc: (1,10)-(1,12) = "+=" + └── value: + @ IntegerNode (location: (1,13)-(1,14)) + ├── flags: decimal + └── value: 2 diff --git a/test/mri/prism/snapshots/whitequark/op_asgn_index_cmd.txt b/test/mri/prism/snapshots/whitequark/op_asgn_index_cmd.txt new file mode 100644 index 00000000000..87082aad947 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/op_asgn_index_cmd.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ IndexOperatorWriteNode (location: (1,0)-(1,18)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,8)-(1,9) = "]" + ├── block: ∅ + ├── operator: :+ + ├── operator_loc: (1,10)-(1,12) = "+=" + └── value: + @ CallNode (location: (1,13)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (1,13)-(1,14) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,15)-(1,18)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,15)-(1,18)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,15)-(1,18) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/optarg.txt b/test/mri/prism/snapshots/whitequark/optarg.txt new file mode 100644 index 00000000000..695ed827ad5 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/optarg.txt @@ -0,0 +1,74 @@ +@ ProgramNode (location: (1,0)-(3,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,24)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(1,18)) + │ ├── name: :f + │ ├── name_loc: (1,4)-(1,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,13)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── name_loc: (1,6)-(1,9) = "foo" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:foo] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,15)-(1,18) = "end" + └── @ DefNode (location: (3,0)-(3,24)) + ├── name: :f + ├── name_loc: (3,4)-(3,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (3,6)-(3,18)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 2) + │ │ ├── @ OptionalParameterNode (location: (3,6)-(3,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── name_loc: (3,6)-(3,9) = "foo" + │ │ │ ├── operator_loc: (3,9)-(3,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (3,10)-(3,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ OptionalParameterNode (location: (3,13)-(3,18)) + │ │ ├── flags: ∅ + │ │ ├── name: :bar + │ │ ├── name_loc: (3,13)-(3,16) = "bar" + │ │ ├── operator_loc: (3,16)-(3,17) = "=" + │ │ └── value: + │ │ @ IntegerNode (location: (3,17)-(3,18)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:foo, :bar] + ├── def_keyword_loc: (3,0)-(3,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (3,5)-(3,6) = "(" + ├── rparen_loc: (3,18)-(3,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (3,21)-(3,24) = "end" diff --git a/test/mri/prism/snapshots/whitequark/or.txt b/test/mri/prism/snapshots/whitequark/or.txt new file mode 100644 index 00000000000..439146b8dbe --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/or.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(3,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,10)) + └── body: (length: 2) + ├── @ OrNode (location: (1,0)-(1,10)) + │ ├── left: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,7)-(1,10) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,4)-(1,6) = "or" + └── @ OrNode (location: (3,0)-(3,10)) + ├── left: + │ @ CallNode (location: (3,0)-(3,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: + │ @ CallNode (location: (3,7)-(3,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,7)-(3,10) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (3,4)-(3,6) = "||" diff --git a/test/mri/prism/snapshots/whitequark/or_asgn.txt b/test/mri/prism/snapshots/whitequark/or_asgn.txt new file mode 100644 index 00000000000..c0ded24b933 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/or_asgn.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(3,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,15)) + └── body: (length: 2) + ├── @ CallOrWriteNode (location: (1,0)-(1,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── message_loc: (1,4)-(1,5) = "a" + │ ├── read_name: :a + │ ├── write_name: :a= + │ ├── operator_loc: (1,6)-(1,9) = "||=" + │ └── value: + │ @ IntegerNode (location: (1,10)-(1,11)) + │ ├── flags: decimal + │ └── value: 1 + └── @ IndexOrWriteNode (location: (3,0)-(3,15)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (3,0)-(3,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── opening_loc: (3,3)-(3,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (3,4)-(3,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (3,4)-(3,5)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ └── @ IntegerNode (location: (3,7)-(3,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (3,8)-(3,9) = "]" + ├── block: ∅ + ├── operator_loc: (3,10)-(3,13) = "||=" + └── value: + @ IntegerNode (location: (3,14)-(3,15)) + ├── flags: decimal + └── value: 2 diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_272.txt b/test/mri/prism/snapshots/whitequark/parser_bug_272.txt new file mode 100644 index 00000000000..f158f255b93 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_272.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ └── name: :@b + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,15)) + ├── locals: [:c] + ├── parameters: + │ @ BlockParametersNode (location: (1,8)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,9)-(1,10)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,8)-(1,9) = "|" + │ └── closing_loc: (1,10)-(1,11) = "|" + ├── body: ∅ + ├── opening_loc: (1,5)-(1,7) = "do" + └── closing_loc: (1,12)-(1,15) = "end" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_490.txt b/test/mri/prism/snapshots/whitequark/parser_bug_490.txt new file mode 100644 index 00000000000..9e4cd2bd15d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_490.txt @@ -0,0 +1,106 @@ +@ ProgramNode (location: (1,0)-(5,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,45)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(1,39)) + │ ├── name: :m + │ ├── name_loc: (1,4)-(1,5) = "m" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,7)-(1,34)) + │ │ └── body: (length: 1) + │ │ └── @ SingletonClassNode (location: (1,7)-(1,34)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (1,7)-(1,12) = "class" + │ │ ├── operator_loc: (1,13)-(1,15) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (1,16)-(1,20)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,22)-(1,29)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantWriteNode (location: (1,22)-(1,29)) + │ │ │ ├── name: :A + │ │ │ ├── name_loc: (1,22)-(1,23) = "A" + │ │ │ ├── value: + │ │ │ │ @ NilNode (location: (1,26)-(1,29)) + │ │ │ └── operator_loc: (1,24)-(1,25) = "=" + │ │ └── end_keyword_loc: (1,31)-(1,34) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,36)-(1,39) = "end" + ├── @ DefNode (location: (3,0)-(3,44)) + │ ├── name: :m + │ ├── name_loc: (3,4)-(3,5) = "m" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,7)-(3,39)) + │ │ └── body: (length: 1) + │ │ └── @ SingletonClassNode (location: (3,7)-(3,39)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (3,7)-(3,12) = "class" + │ │ ├── operator_loc: (3,13)-(3,15) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (3,16)-(3,20)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,22)-(3,34)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ClassNode (location: (3,22)-(3,34)) + │ │ │ ├── locals: [] + │ │ │ ├── class_keyword_loc: (3,22)-(3,27) = "class" + │ │ │ ├── constant_path: + │ │ │ │ @ ConstantReadNode (location: (3,28)-(3,29)) + │ │ │ │ └── name: :C + │ │ │ ├── inheritance_operator_loc: ∅ + │ │ │ ├── superclass: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── end_keyword_loc: (3,31)-(3,34) = "end" + │ │ │ └── name: :C + │ │ └── end_keyword_loc: (3,36)-(3,39) = "end" + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,41)-(3,44) = "end" + └── @ DefNode (location: (5,0)-(5,45)) + ├── name: :m + ├── name_loc: (5,4)-(5,5) = "m" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (5,7)-(5,40)) + │ └── body: (length: 1) + │ └── @ SingletonClassNode (location: (5,7)-(5,40)) + │ ├── locals: [] + │ ├── class_keyword_loc: (5,7)-(5,12) = "class" + │ ├── operator_loc: (5,13)-(5,15) = "<<" + │ ├── expression: + │ │ @ SelfNode (location: (5,16)-(5,20)) + │ ├── body: + │ │ @ StatementsNode (location: (5,22)-(5,35)) + │ │ └── body: (length: 1) + │ │ └── @ ModuleNode (location: (5,22)-(5,35)) + │ │ ├── locals: [] + │ │ ├── module_keyword_loc: (5,22)-(5,28) = "module" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (5,29)-(5,30)) + │ │ │ └── name: :M + │ │ ├── body: ∅ + │ │ ├── end_keyword_loc: (5,32)-(5,35) = "end" + │ │ └── name: :M + │ └── end_keyword_loc: (5,37)-(5,40) = "end" + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,42)-(5,45) = "end" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_507.txt b/test/mri/prism/snapshots/whitequark/parser_bug_507.txt new file mode 100644 index 00000000000..7e5fc9ee35b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_507.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [:m] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,19)) + ├── name: :m + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "m" + ├── value: + │ @ LambdaNode (location: (1,4)-(1,19)) + │ ├── locals: [:args] + │ ├── operator_loc: (1,4)-(1,6) = "->" + │ ├── opening_loc: (1,13)-(1,15) = "do" + │ ├── closing_loc: (1,16)-(1,19) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,7)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,7)-(1,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,7)-(1,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :args + │ │ │ │ ├── name_loc: (1,8)-(1,12) = "args" + │ │ │ │ └── operator_loc: (1,7)-(1,8) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: ∅ + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_518.txt b/test/mri/prism/snapshots/whitequark/parser_bug_518.txt new file mode 100644 index 00000000000..b63fbb8284e --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_518.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ ClassNode (location: (1,0)-(2,3)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ └── name: :A + ├── inheritance_operator_loc: (1,8)-(1,9) = "<" + ├── superclass: + │ @ ConstantReadNode (location: (1,10)-(1,11)) + │ └── name: :B + ├── body: ∅ + ├── end_keyword_loc: (2,0)-(2,3) = "end" + └── name: :A diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_525.txt b/test/mri/prism/snapshots/whitequark/parser_bug_525.txt new file mode 100644 index 00000000000..a69b8a207f0 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_525.txt @@ -0,0 +1,65 @@ +@ ProgramNode (location: (1,0)-(1,32)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,32)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,32)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m1 + ├── message_loc: (1,0)-(1,2) = "m1" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,3)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,3)-(1,11)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,3)-(1,11)) + │ ├── key: + │ │ @ SymbolNode (location: (1,3)-(1,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,3)-(1,4) = ":" + │ │ ├── value_loc: (1,4)-(1,5) = "k" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "k" + │ ├── value: + │ │ @ CallNode (location: (1,9)-(1,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :m2 + │ │ ├── message_loc: (1,9)-(1,11) = "m2" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,12)-(1,32)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,16)-(1,27)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,16)-(1,27)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m3 + │ ├── message_loc: (1,16)-(1,18) = "m3" + │ ├── opening_loc: (1,18)-(1,19) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (1,19)-(1,20) = ")" + │ └── block: + │ @ BlockNode (location: (1,21)-(1,27)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,21)-(1,23) = "do" + │ └── closing_loc: (1,24)-(1,27) = "end" + ├── opening_loc: (1,12)-(1,14) = "do" + └── closing_loc: (1,29)-(1,32) = "end" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_604.txt b/test/mri/prism/snapshots/whitequark/parser_bug_604.txt new file mode 100644 index 00000000000..2577e3bc552 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_604.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (1,0)-(1,1) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (1,4)-(1,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,8)-(1,14)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,8)-(1,10) = "do" + └── closing_loc: (1,11)-(1,14) = "end" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_640.txt b/test/mri/prism/snapshots/whitequark/parser_bug_640.txt new file mode 100644 index 00000000000..a9d3f957e83 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_640.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,6)) + ├── opening_loc: (1,0)-(1,6) = "<<~FOO" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(3,0) = " baz\\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "baz" + │ └── @ StringNode (location: (3,0)-(4,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (3,0)-(4,0) = " qux\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "qux\n" + └── closing_loc: (4,0)-(5,0) = "FOO\n" diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_645.txt b/test/mri/prism/snapshots/whitequark/parser_bug_645.txt new file mode 100644 index 00000000000..5700f3c3db4 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_645.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,14)) + ├── locals: [:arg] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,12)-(1,13) = "{" + ├── closing_loc: (1,13)-(1,14) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,11)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,10)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,4)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :arg + │ │ │ ├── name_loc: (1,4)-(1,7) = "arg" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ HashNode (location: (1,8)-(1,10)) + │ │ │ ├── opening_loc: (1,8)-(1,9) = "{" + │ │ │ ├── elements: (length: 0) + │ │ │ └── closing_loc: (1,9)-(1,10) = "}" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ └── closing_loc: (1,10)-(1,11) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/parser_bug_830.txt b/test/mri/prism/snapshots/whitequark/parser_bug_830.txt new file mode 100644 index 00000000000..e52b291d6a1 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_bug_830.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,4)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,3) = "\\(" + ├── closing_loc: (1,3)-(1,4) = "/" + └── unescaped: "\\(" diff --git a/test/mri/prism/snapshots/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt b/test/mri/prism/snapshots/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt new file mode 100644 index 00000000000..d974435534f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,7)) + ├── opening_loc: (1,0)-(1,7) = "<<~HERE" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (2,2)-(2,5)) + │ │ ├── opening_loc: (2,2)-(2,4) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (2,4)-(2,5) = "}" + │ └── @ StringNode (location: (2,5)-(3,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,5)-(3,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (3,0)-(4,0) = "HERE\n" diff --git a/test/mri/prism/snapshots/whitequark/parser_slash_slash_n_escaping_in_literals.txt b/test/mri/prism/snapshots/whitequark/parser_slash_slash_n_escaping_in_literals.txt new file mode 100644 index 00000000000..080d4d0e7d4 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/parser_slash_slash_n_escaping_in_literals.txt @@ -0,0 +1,139 @@ +@ ProgramNode (location: (1,0)-(62,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(62,2)) + └── body: (length: 19) + ├── @ StringNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(2,1) = "a\\\nb" + │ ├── closing_loc: (2,1)-(2,2) = "\"" + │ └── unescaped: "ab" + ├── @ ArrayNode (location: (4,0)-(5,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ SymbolNode (location: (4,3)-(5,1)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (4,3)-(5,1) = "a\\\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── opening_loc: (4,0)-(4,3) = "%I{" + │ └── closing_loc: (5,1)-(5,2) = "}" + ├── @ StringNode (location: (7,0)-(8,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(7,3) = "%Q{" + │ ├── content_loc: (7,3)-(8,1) = "a\\\nb" + │ ├── closing_loc: (8,1)-(8,2) = "}" + │ └── unescaped: "ab" + ├── @ ArrayNode (location: (10,0)-(11,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (10,3)-(11,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (10,3)-(11,1) = "a\\\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── opening_loc: (10,0)-(10,3) = "%W{" + │ └── closing_loc: (11,1)-(11,2) = "}" + ├── @ ArrayNode (location: (13,0)-(14,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ SymbolNode (location: (13,3)-(14,1)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (13,3)-(14,1) = "a\\\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── opening_loc: (13,0)-(13,3) = "%i{" + │ └── closing_loc: (14,1)-(14,2) = "}" + ├── @ StringNode (location: (16,0)-(17,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (16,0)-(16,3) = "%q{" + │ ├── content_loc: (16,3)-(17,1) = "a\\\nb" + │ ├── closing_loc: (17,1)-(17,2) = "}" + │ └── unescaped: "a\\\nb" + ├── @ RegularExpressionNode (location: (19,0)-(20,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (19,0)-(19,3) = "%r{" + │ ├── content_loc: (19,3)-(20,1) = "a\\\nb" + │ ├── closing_loc: (20,1)-(20,2) = "}" + │ └── unescaped: "ab" + ├── @ SymbolNode (location: (22,0)-(23,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (22,0)-(22,3) = "%s{" + │ ├── value_loc: (22,3)-(23,1) = "a\\\nb" + │ ├── closing_loc: (23,1)-(23,2) = "}" + │ └── unescaped: "a\\\nb" + ├── @ ArrayNode (location: (25,0)-(26,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (25,3)-(26,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (25,3)-(26,1) = "a\\\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── opening_loc: (25,0)-(25,3) = "%w{" + │ └── closing_loc: (26,1)-(26,2) = "}" + ├── @ XStringNode (location: (28,0)-(29,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (28,0)-(28,3) = "%x{" + │ ├── content_loc: (28,3)-(29,1) = "a\\\nb" + │ ├── closing_loc: (29,1)-(29,2) = "}" + │ └── unescaped: "ab" + ├── @ StringNode (location: (31,0)-(32,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (31,0)-(31,2) = "%{" + │ ├── content_loc: (31,2)-(32,1) = "a\\\nb" + │ ├── closing_loc: (32,1)-(32,2) = "}" + │ └── unescaped: "ab" + ├── @ StringNode (location: (34,0)-(35,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (34,0)-(34,1) = "'" + │ ├── content_loc: (34,1)-(35,1) = "a\\\nb" + │ ├── closing_loc: (35,1)-(35,2) = "'" + │ └── unescaped: "a\\\nb" + ├── @ RegularExpressionNode (location: (37,0)-(38,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (37,0)-(37,1) = "/" + │ ├── content_loc: (37,1)-(38,1) = "a\\\nb" + │ ├── closing_loc: (38,1)-(38,2) = "/" + │ └── unescaped: "ab" + ├── @ SymbolNode (location: (40,0)-(41,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (40,0)-(40,2) = ":\"" + │ ├── value_loc: (40,2)-(41,1) = "a\\\nb" + │ ├── closing_loc: (41,1)-(41,2) = "\"" + │ └── unescaped: "ab" + ├── @ SymbolNode (location: (43,0)-(44,2)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (43,0)-(43,2) = ":'" + │ ├── value_loc: (43,2)-(44,1) = "a\\\nb" + │ ├── closing_loc: (44,1)-(44,2) = "'" + │ └── unescaped: "a\\\nb" + ├── @ StringNode (location: (46,0)-(46,9)) + │ ├── flags: ∅ + │ ├── opening_loc: (46,0)-(46,9) = "<<-\"HERE\"" + │ ├── content_loc: (47,0)-(49,0) = "a\\\nb\n" + │ ├── closing_loc: (49,0)-(50,0) = "HERE\n" + │ └── unescaped: "ab\n" + ├── @ StringNode (location: (51,0)-(51,9)) + │ ├── flags: ∅ + │ ├── opening_loc: (51,0)-(51,9) = "<<-'HERE'" + │ ├── content_loc: (52,0)-(54,0) = "a\\\nb\n" + │ ├── closing_loc: (54,0)-(55,0) = "HERE\n" + │ └── unescaped: "a\\\nb\n" + ├── @ XStringNode (location: (56,0)-(56,9)) + │ ├── flags: ∅ + │ ├── opening_loc: (56,0)-(56,9) = "<<-`HERE`" + │ ├── content_loc: (57,0)-(59,0) = "a\\\nb\n" + │ ├── closing_loc: (59,0)-(60,0) = "HERE\n" + │ └── unescaped: "ab\n" + └── @ XStringNode (location: (61,0)-(62,2)) + ├── flags: ∅ + ├── opening_loc: (61,0)-(61,1) = "`" + ├── content_loc: (61,1)-(62,1) = "a\\\nb" + ├── closing_loc: (62,1)-(62,2) = "`" + └── unescaped: "ab" diff --git a/test/mri/prism/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt b/test/mri/prism/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt new file mode 100644 index 00000000000..6f315780adf --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,8)-(3,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,8)-(3,11)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,8)-(3,11)) + ├── predicate: + │ @ ArrayNode (location: (1,13)-(1,51)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ SourceFileNode (location: (1,14)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── filepath: "whitequark/pattern_matching__FILE__LINE_literals.txt" + │ │ ├── @ CallNode (location: (1,24)-(1,36)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ SourceLineNode (location: (1,24)-(1,32)) + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (1,33)-(1,34) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,35)-(1,36)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,35)-(1,36)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ SourceEncodingNode (location: (1,38)-(1,50)) + │ ├── opening_loc: (1,13)-(1,14) = "[" + │ └── closing_loc: (1,50)-(1,51) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,10)-(2,47)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,13)-(2,47)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ SourceFileNode (location: (2,14)-(2,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── filepath: "whitequark/pattern_matching__FILE__LINE_literals.txt" + │ │ │ ├── @ SourceLineNode (location: (2,24)-(2,32)) + │ │ │ └── @ SourceEncodingNode (location: (2,34)-(2,46)) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,13)-(2,14) = "[" + │ │ └── closing_loc: (2,46)-(2,47) = "]" + │ ├── statements: ∅ + │ ├── in_loc: (2,10)-(2,12) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,8)-(1,12) = "case" + └── end_keyword_loc: (3,8)-(3,11) = "end" diff --git a/test/mri/prism/snapshots/whitequark/pattern_matching_blank_else.txt b/test/mri/prism/snapshots/whitequark/pattern_matching_blank_else.txt new file mode 100644 index 00000000000..6015c000a98 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/pattern_matching_blank_else.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(1,26)) + ├── predicate: + │ @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── conditions: (length: 1) + │ └── @ InNode (location: (1,8)-(1,15)) + │ ├── pattern: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── statements: + │ │ @ StatementsNode (location: (1,14)-(1,15)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── in_loc: (1,8)-(1,10) = "in" + │ └── then_loc: ∅ + ├── consequent: + │ @ ElseNode (location: (1,17)-(1,26)) + │ ├── else_keyword_loc: (1,17)-(1,21) = "else" + │ ├── statements: ∅ + │ └── end_keyword_loc: (1,23)-(1,26) = "end" + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,23)-(1,26) = "end" diff --git a/test/mri/prism/snapshots/whitequark/pattern_matching_else.txt b/test/mri/prism/snapshots/whitequark/pattern_matching_else.txt new file mode 100644 index 00000000000..7f83aafe993 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/pattern_matching_else.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(1,29)) + ├── predicate: + │ @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── conditions: (length: 1) + │ └── @ InNode (location: (1,8)-(1,15)) + │ ├── pattern: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── statements: + │ │ @ StatementsNode (location: (1,14)-(1,15)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ ├── in_loc: (1,8)-(1,10) = "in" + │ └── then_loc: ∅ + ├── consequent: + │ @ ElseNode (location: (1,17)-(1,29)) + │ ├── else_keyword_loc: (1,17)-(1,21) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (1,23)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,23)-(1,24)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ └── end_keyword_loc: (1,26)-(1,29) = "end" + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/mri/prism/snapshots/whitequark/pattern_matching_single_line.txt b/test/mri/prism/snapshots/whitequark/pattern_matching_single_line.txt new file mode 100644 index 00000000000..2396172dce7 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/pattern_matching_single_line.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(3,11)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(3,11)) + └── body: (length: 4) + ├── @ MatchRequiredNode (location: (1,0)-(1,8)) + │ ├── value: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (1,5)-(1,8)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "[" + │ │ └── closing_loc: (1,7)-(1,8) = "]" + │ └── operator_loc: (1,2)-(1,4) = "=>" + ├── @ LocalVariableReadNode (location: (1,10)-(1,11)) + │ ├── name: :a + │ └── depth: 0 + ├── @ MatchPredicateNode (location: (3,0)-(3,8)) + │ ├── value: + │ │ @ IntegerNode (location: (3,0)-(3,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (3,5)-(3,8)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (3,6)-(3,7)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (3,5)-(3,6) = "[" + │ │ └── closing_loc: (3,7)-(3,8) = "]" + │ └── operator_loc: (3,2)-(3,4) = "in" + └── @ LocalVariableReadNode (location: (3,10)-(3,11)) + ├── name: :a + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt b/test/mri/prism/snapshots/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt new file mode 100644 index 00000000000..757a7780c25 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt @@ -0,0 +1,249 @@ +@ ProgramNode (location: (1,0)-(11,34)) +├── locals: [:a, :b, :value] +└── statements: + @ StatementsNode (location: (1,0)-(11,34)) + └── body: (length: 12) + ├── @ MatchRequiredNode (location: (1,0)-(1,14)) + │ ├── value: + │ │ @ ArrayNode (location: (1,0)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (1,0)-(1,1) = "[" + │ │ └── closing_loc: (1,5)-(1,6) = "]" + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (1,10)-(1,14)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (1,13)-(1,14)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (1,7)-(1,9) = "=>" + ├── @ LocalVariableReadNode (location: (1,16)-(1,17)) + │ ├── name: :a + │ └── depth: 0 + ├── @ MatchPredicateNode (location: (3,0)-(3,14)) + │ ├── value: + │ │ @ ArrayNode (location: (3,0)-(3,6)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (3,1)-(3,2)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (3,4)-(3,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (3,0)-(3,1) = "[" + │ │ └── closing_loc: (3,5)-(3,6) = "]" + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (3,10)-(3,14)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (3,10)-(3,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (3,13)-(3,14)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (3,7)-(3,9) = "in" + ├── @ LocalVariableReadNode (location: (3,16)-(3,17)) + │ ├── name: :a + │ └── depth: 0 + ├── @ MatchRequiredNode (location: (5,0)-(5,12)) + │ ├── value: + │ │ @ HashNode (location: (5,0)-(5,6)) + │ │ ├── opening_loc: (5,0)-(5,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,1)-(5,5)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,1)-(5,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (5,1)-(5,2) = "a" + │ │ │ │ ├── closing_loc: (5,2)-(5,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (5,4)-(5,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (5,5)-(5,6) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (5,10)-(5,12)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,10)-(5,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,10)-(5,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (5,10)-(5,11) = "a" + │ │ │ │ ├── closing_loc: (5,11)-(5,12) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (5,10)-(5,11)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (5,10)-(5,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (5,7)-(5,9) = "=>" + ├── @ LocalVariableReadNode (location: (5,14)-(5,15)) + │ ├── name: :a + │ └── depth: 0 + ├── @ MatchPredicateNode (location: (7,0)-(7,12)) + │ ├── value: + │ │ @ HashNode (location: (7,0)-(7,6)) + │ │ ├── opening_loc: (7,0)-(7,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,1)-(7,5)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (7,1)-(7,3)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (7,1)-(7,2) = "a" + │ │ │ │ ├── closing_loc: (7,2)-(7,3) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (7,4)-(7,5)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (7,5)-(7,6) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (7,10)-(7,12)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,10)-(7,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (7,10)-(7,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (7,10)-(7,11) = "a" + │ │ │ │ ├── closing_loc: (7,11)-(7,12) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (7,10)-(7,11)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (7,10)-(7,11)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (7,7)-(7,9) = "in" + ├── @ LocalVariableReadNode (location: (7,14)-(7,15)) + │ ├── name: :a + │ └── depth: 0 + ├── @ MatchRequiredNode (location: (9,0)-(9,27)) + │ ├── value: + │ │ @ HashNode (location: (9,0)-(9,13)) + │ │ ├── opening_loc: (9,0)-(9,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (9,1)-(9,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (9,1)-(9,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (9,1)-(9,4) = "key" + │ │ │ │ ├── closing_loc: (9,4)-(9,5) = ":" + │ │ │ │ └── unescaped: "key" + │ │ │ ├── value: + │ │ │ │ @ SymbolNode (location: (9,6)-(9,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (9,6)-(9,7) = ":" + │ │ │ │ ├── value_loc: (9,7)-(9,12) = "value" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "value" + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (9,12)-(9,13) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (9,17)-(9,27)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (9,17)-(9,27)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (9,17)-(9,21)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (9,17)-(9,20) = "key" + │ │ │ │ ├── closing_loc: (9,20)-(9,21) = ":" + │ │ │ │ └── unescaped: "key" + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (9,22)-(9,27)) + │ │ │ │ ├── name: :value + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (9,14)-(9,16) = "=>" + ├── @ LocalVariableReadNode (location: (9,29)-(9,34)) + │ ├── name: :value + │ └── depth: 0 + ├── @ MatchPredicateNode (location: (11,0)-(11,27)) + │ ├── value: + │ │ @ HashNode (location: (11,0)-(11,13)) + │ │ ├── opening_loc: (11,0)-(11,1) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (11,1)-(11,12)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (11,1)-(11,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (11,1)-(11,4) = "key" + │ │ │ │ ├── closing_loc: (11,4)-(11,5) = ":" + │ │ │ │ └── unescaped: "key" + │ │ │ ├── value: + │ │ │ │ @ SymbolNode (location: (11,6)-(11,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (11,6)-(11,7) = ":" + │ │ │ │ ├── value_loc: (11,7)-(11,12) = "value" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "value" + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (11,12)-(11,13) = "}" + │ ├── pattern: + │ │ @ HashPatternNode (location: (11,17)-(11,27)) + │ │ ├── constant: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (11,17)-(11,27)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (11,17)-(11,21)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (11,17)-(11,20) = "key" + │ │ │ │ ├── closing_loc: (11,20)-(11,21) = ":" + │ │ │ │ └── unescaped: "key" + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (11,22)-(11,27)) + │ │ │ │ ├── name: :value + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── operator_loc: (11,14)-(11,16) = "in" + └── @ LocalVariableReadNode (location: (11,29)-(11,34)) + ├── name: :value + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/postexe.txt b/test/mri/prism/snapshots/whitequark/postexe.txt new file mode 100644 index 00000000000..6f273270639 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/postexe.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ PostExecutionNode (location: (1,0)-(1,9)) + ├── statements: + │ @ StatementsNode (location: (1,6)-(1,7)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── keyword_loc: (1,0)-(1,3) = "END" + ├── opening_loc: (1,4)-(1,5) = "{" + └── closing_loc: (1,8)-(1,9) = "}" diff --git a/test/mri/prism/snapshots/whitequark/preexe.txt b/test/mri/prism/snapshots/whitequark/preexe.txt new file mode 100644 index 00000000000..5e4b88d0966 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/preexe.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ PreExecutionNode (location: (1,0)-(1,11)) + ├── statements: + │ @ StatementsNode (location: (1,8)-(1,9)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── keyword_loc: (1,0)-(1,5) = "BEGIN" + ├── opening_loc: (1,6)-(1,7) = "{" + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/mri/prism/snapshots/whitequark/procarg0.txt b/test/mri/prism/snapshots/whitequark/procarg0.txt new file mode 100644 index 00000000000..378c7e5b36e --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/procarg0.txt @@ -0,0 +1,78 @@ +@ ProgramNode (location: (1,0)-(3,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,11)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,0)-(1,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:foo, :bar] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,9)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :foo + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :bar + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + └── @ CallNode (location: (3,0)-(3,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (3,0)-(3,1) = "m" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (3,2)-(3,11)) + ├── locals: [:foo] + ├── parameters: + │ @ BlockParametersNode (location: (3,4)-(3,9)) + │ ├── parameters: + │ │ @ ParametersNode (location: (3,5)-(3,8)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (3,5)-(3,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :foo + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (3,4)-(3,5) = "|" + │ └── closing_loc: (3,8)-(3,9) = "|" + ├── body: ∅ + ├── opening_loc: (3,2)-(3,3) = "{" + └── closing_loc: (3,10)-(3,11) = "}" diff --git a/test/mri/prism/snapshots/whitequark/range_exclusive.txt b/test/mri/prism/snapshots/whitequark/range_exclusive.txt new file mode 100644 index 00000000000..f74077ce677 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/range_exclusive.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,5)) + ├── flags: exclude_end + ├── left: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── right: + │ @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + └── operator_loc: (1,1)-(1,4) = "..." diff --git a/test/mri/prism/snapshots/whitequark/range_inclusive.txt b/test/mri/prism/snapshots/whitequark/range_inclusive.txt new file mode 100644 index 00000000000..18363120338 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/range_inclusive.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── left: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── right: + │ @ IntegerNode (location: (1,3)-(1,4)) + │ ├── flags: decimal + │ └── value: 2 + └── operator_loc: (1,1)-(1,3) = ".." diff --git a/test/mri/prism/snapshots/whitequark/rational.txt b/test/mri/prism/snapshots/whitequark/rational.txt new file mode 100644 index 00000000000..90bbd17929b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rational.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 2) + ├── @ RationalNode (location: (1,0)-(1,5)) + │ └── numeric: + │ @ FloatNode (location: (1,0)-(1,4)) + │ └── value: 42.1 + └── @ RationalNode (location: (3,0)-(3,3)) + └── numeric: + @ IntegerNode (location: (3,0)-(3,2)) + ├── flags: decimal + └── value: 42 diff --git a/test/mri/prism/snapshots/whitequark/redo.txt b/test/mri/prism/snapshots/whitequark/redo.txt new file mode 100644 index 00000000000..48d3da9d52d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/redo.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RedoNode (location: (1,0)-(1,4)) diff --git a/test/mri/prism/snapshots/whitequark/regex_interp.txt b/test/mri/prism/snapshots/whitequark/regex_interp.txt new file mode 100644 index 00000000000..ee8caf22b9e --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/regex_interp.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ InterpolatedRegularExpressionNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "/" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,4) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── @ EmbeddedStatementsNode (location: (1,4)-(1,10)) + │ │ ├── opening_loc: (1,4)-(1,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,6)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,6)-(1,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,9)-(1,10) = "}" + │ └── @ StringNode (location: (1,10)-(1,13)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,10)-(1,13) = "baz" + │ ├── closing_loc: ∅ + │ └── unescaped: "baz" + └── closing_loc: (1,13)-(1,14) = "/" diff --git a/test/mri/prism/snapshots/whitequark/regex_plain.txt b/test/mri/prism/snapshots/whitequark/regex_plain.txt new file mode 100644 index 00000000000..df771f7a21d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/regex_plain.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,10)) + ├── flags: ignore_case, multi_line, forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,7) = "source" + ├── closing_loc: (1,7)-(1,10) = "/im" + └── unescaped: "source" diff --git a/test/mri/prism/snapshots/whitequark/resbody_list.txt b/test/mri/prism/snapshots/whitequark/resbody_list.txt new file mode 100644 index 00000000000..52fcfd02e01 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/resbody_list.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,39)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,39)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,39)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,34)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 1) + │ │ └── @ ConstantReadNode (location: (1,20)-(1,29)) + │ │ └── name: :Exception + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,31)-(1,34)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,31)-(1,34)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,31)-(1,34) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,36)-(1,39) = "end" diff --git a/test/mri/prism/snapshots/whitequark/resbody_list_mrhs.txt b/test/mri/prism/snapshots/whitequark/resbody_list_mrhs.txt new file mode 100644 index 00000000000..d48ddb120df --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/resbody_list_mrhs.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,44)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,44)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,44)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,39)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 2) + │ │ ├── @ ConstantReadNode (location: (1,20)-(1,29)) + │ │ │ └── name: :Exception + │ │ └── @ CallNode (location: (1,31)-(1,34)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,31)-(1,34) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,36)-(1,39)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,36)-(1,39)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,36)-(1,39) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,41)-(1,44) = "end" diff --git a/test/mri/prism/snapshots/whitequark/resbody_list_var.txt b/test/mri/prism/snapshots/whitequark/resbody_list_var.txt new file mode 100644 index 00000000000..85efb1a3dee --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/resbody_list_var.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,39)) +├── locals: [:ex] +└── statements: + @ StatementsNode (location: (1,0)-(1,39)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,39)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,34)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 1) + │ │ └── @ CallNode (location: (1,20)-(1,23)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,20)-(1,23) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── operator_loc: (1,24)-(1,26) = "=>" + │ ├── reference: + │ │ @ LocalVariableTargetNode (location: (1,27)-(1,29)) + │ │ ├── name: :ex + │ │ └── depth: 0 + │ ├── statements: + │ │ @ StatementsNode (location: (1,31)-(1,34)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,31)-(1,34)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,31)-(1,34) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,36)-(1,39) = "end" diff --git a/test/mri/prism/snapshots/whitequark/resbody_var.txt b/test/mri/prism/snapshots/whitequark/resbody_var.txt new file mode 100644 index 00000000000..e12d921c75a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/resbody_var.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(3,35)) +├── locals: [:ex] +└── statements: + @ StatementsNode (location: (1,0)-(3,35)) + └── body: (length: 2) + ├── @ BeginNode (location: (1,0)-(1,36)) + │ ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (1,7)-(1,11)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,7)-(1,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (1,7)-(1,11) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (1,13)-(1,31)) + │ │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: (1,20)-(1,22) = "=>" + │ │ ├── reference: + │ │ │ @ InstanceVariableTargetNode (location: (1,23)-(1,26)) + │ │ │ └── name: :@ex + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,28)-(1,31)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,28)-(1,31)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,28)-(1,31) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (1,33)-(1,36) = "end" + └── @ BeginNode (location: (3,0)-(3,35)) + ├── begin_keyword_loc: (3,0)-(3,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (3,7)-(3,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,7)-(3,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (3,7)-(3,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (3,13)-(3,30)) + │ ├── keyword_loc: (3,13)-(3,19) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: (3,20)-(3,22) = "=>" + │ ├── reference: + │ │ @ LocalVariableTargetNode (location: (3,23)-(3,25)) + │ │ ├── name: :ex + │ │ └── depth: 0 + │ ├── statements: + │ │ @ StatementsNode (location: (3,27)-(3,30)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,27)-(3,30)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,27)-(3,30) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (3,32)-(3,35) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue.txt b/test/mri/prism/snapshots/whitequark/rescue.txt new file mode 100644 index 00000000000..28c4f11e672 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,29)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,24)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,21)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,21)-(1,24)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,21)-(1,24) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue_else.txt b/test/mri/prism/snapshots/whitequark/rescue_else.txt new file mode 100644 index 00000000000..36b01a7ef69 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_else.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,40)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,40)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,40)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,24)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,21)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,21)-(1,24)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,21)-(1,24) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (1,26)-(1,40)) + │ ├── else_keyword_loc: (1,26)-(1,30) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (1,32)-(1,35)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,32)-(1,35)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,32)-(1,35) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (1,37)-(1,40) = "end" + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,37)-(1,40) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue_else_ensure.txt b/test/mri/prism/snapshots/whitequark/rescue_else_ensure.txt new file mode 100644 index 00000000000..d97821931b2 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_else_ensure.txt @@ -0,0 +1,75 @@ +@ ProgramNode (location: (1,0)-(1,51)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,51)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,51)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,24)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,21)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,21)-(1,24)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (1,21)-(1,24) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (1,26)-(1,42)) + │ ├── else_keyword_loc: (1,26)-(1,30) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (1,31)-(1,34)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,31)-(1,34)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,31)-(1,34) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (1,36)-(1,42) = "ensure" + ├── ensure_clause: + │ @ EnsureNode (location: (1,36)-(1,51)) + │ ├── ensure_keyword_loc: (1,36)-(1,42) = "ensure" + │ ├── statements: + │ │ @ StatementsNode (location: (1,44)-(1,47)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,44)-(1,47)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,44)-(1,47) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (1,48)-(1,51) = "end" + └── end_keyword_loc: (1,48)-(1,51) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue_ensure.txt b/test/mri/prism/snapshots/whitequark/rescue_ensure.txt new file mode 100644 index 00000000000..f6cddbcc5e3 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_ensure.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,42)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,7)-(1,11)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,7)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,7)-(1,11) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,13)-(1,24)) + │ ├── keyword_loc: (1,13)-(1,19) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,21)-(1,24)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,21)-(1,24)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (1,21)-(1,24) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (1,26)-(1,42)) + │ ├── ensure_keyword_loc: (1,26)-(1,32) = "ensure" + │ ├── statements: + │ │ @ StatementsNode (location: (1,34)-(1,37)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,34)-(1,37)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,34)-(1,37) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (1,39)-(1,42) = "end" + └── end_keyword_loc: (1,39)-(1,42) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue_in_lambda_block.txt b/test/mri/prism/snapshots/whitequark/rescue_in_lambda_block.txt new file mode 100644 index 00000000000..2ab854cdd77 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_in_lambda_block.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,17)) + ├── locals: [] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,3)-(1,5) = "do" + ├── closing_loc: (1,14)-(1,17) = "end" + ├── parameters: ∅ + └── body: + @ BeginNode (location: (1,3)-(1,17)) + ├── begin_keyword_loc: ∅ + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (1,6)-(1,12)) + │ ├── keyword_loc: (1,6)-(1,12) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/mri/prism/snapshots/whitequark/rescue_mod.txt b/test/mri/prism/snapshots/whitequark/rescue_mod.txt new file mode 100644 index 00000000000..cd4f0fff45f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_mod.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ RescueModifierNode (location: (1,0)-(1,15)) + ├── expression: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,0)-(1,4) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── keyword_loc: (1,5)-(1,11) = "rescue" + └── rescue_expression: + @ CallNode (location: (1,12)-(1,15)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bar + ├── message_loc: (1,12)-(1,15) = "bar" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/rescue_mod_asgn.txt b/test/mri/prism/snapshots/whitequark/rescue_mod_asgn.txt new file mode 100644 index 00000000000..ee094138e52 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_mod_asgn.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,21)) + ├── name: :foo + ├── depth: 0 + ├── name_loc: (1,0)-(1,3) = "foo" + ├── value: + │ @ RescueModifierNode (location: (1,6)-(1,21)) + │ ├── expression: + │ │ @ CallNode (location: (1,6)-(1,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (1,6)-(1,10) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,11)-(1,17) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (1,18)-(1,21)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,18)-(1,21) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (1,4)-(1,5) = "=" diff --git a/test/mri/prism/snapshots/whitequark/rescue_mod_masgn.txt b/test/mri/prism/snapshots/whitequark/rescue_mod_masgn.txt new file mode 100644 index 00000000000..dbe289702fc --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_mod_masgn.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [:foo, :bar] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,29)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) + │ ├── name: :bar + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ RescueModifierNode (location: (1,11)-(1,29)) + ├── expression: + │ @ CallNode (location: (1,11)-(1,15)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,11)-(1,15) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── keyword_loc: (1,16)-(1,22) = "rescue" + └── rescue_expression: + @ ArrayNode (location: (1,23)-(1,29)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,24)-(1,25)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,27)-(1,28)) + │ ├── flags: decimal + │ └── value: 2 + ├── opening_loc: (1,23)-(1,24) = "[" + └── closing_loc: (1,28)-(1,29) = "]" diff --git a/test/mri/prism/snapshots/whitequark/rescue_mod_op_assign.txt b/test/mri/prism/snapshots/whitequark/rescue_mod_op_assign.txt new file mode 100644 index 00000000000..b269104f308 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_mod_op_assign.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ LocalVariableOperatorWriteNode (location: (1,0)-(1,22)) + ├── name_loc: (1,0)-(1,3) = "foo" + ├── operator_loc: (1,4)-(1,6) = "+=" + ├── value: + │ @ RescueModifierNode (location: (1,7)-(1,22)) + │ ├── expression: + │ │ @ CallNode (location: (1,7)-(1,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (1,7)-(1,11) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,12)-(1,18) = "rescue" + │ └── rescue_expression: + │ @ CallNode (location: (1,19)-(1,22)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,19)-(1,22) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── name: :foo + ├── operator: :+ + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/rescue_without_begin_end.txt b/test/mri/prism/snapshots/whitequark/rescue_without_begin_end.txt new file mode 100644 index 00000000000..4281442ab23 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/rescue_without_begin_end.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :meth + ├── message_loc: (1,0)-(1,4) = "meth" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,30)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ BeginNode (location: (1,5)-(1,30)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (1,9)-(1,12)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,9)-(1,12) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (1,14)-(1,25)) + │ │ ├── keyword_loc: (1,14)-(1,20) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,22)-(1,25)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,22)-(1,25)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,22)-(1,25) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (1,27)-(1,30) = "end" + ├── opening_loc: (1,5)-(1,7) = "do" + └── closing_loc: (1,27)-(1,30) = "end" diff --git a/test/mri/prism/snapshots/whitequark/restarg_named.txt b/test/mri/prism/snapshots/whitequark/restarg_named.txt new file mode 100644 index 00000000000..fab9dd9a79b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/restarg_named.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,16)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (1,7)-(1,10) = "foo" + │ │ └── operator_loc: (1,6)-(1,7) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:foo] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,13)-(1,16) = "end" diff --git a/test/mri/prism/snapshots/whitequark/restarg_unnamed.txt b/test/mri/prism/snapshots/whitequark/restarg_unnamed.txt new file mode 100644 index 00000000000..077230f7baa --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/restarg_unnamed.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,7)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,6)-(1,7) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,7)-(1,8) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/mri/prism/snapshots/whitequark/retry.txt b/test/mri/prism/snapshots/whitequark/retry.txt new file mode 100644 index 00000000000..671c3695146 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/retry.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ RetryNode (location: (1,0)-(1,5)) diff --git a/test/mri/prism/snapshots/whitequark/return.txt b/test/mri/prism/snapshots/whitequark/return.txt new file mode 100644 index 00000000000..ddfbae85c8b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/return.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(7,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,11)) + └── body: (length: 4) + ├── @ ReturnNode (location: (1,0)-(1,6)) + │ ├── keyword_loc: (1,0)-(1,6) = "return" + │ └── arguments: ∅ + ├── @ ReturnNode (location: (3,0)-(3,10)) + │ ├── keyword_loc: (3,0)-(3,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (3,7)-(3,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (3,7)-(3,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,7)-(3,10) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ReturnNode (location: (5,0)-(5,8)) + │ ├── keyword_loc: (5,0)-(5,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (5,6)-(5,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (5,6)-(5,8)) + │ ├── body: ∅ + │ ├── opening_loc: (5,6)-(5,7) = "(" + │ └── closing_loc: (5,7)-(5,8) = ")" + └── @ ReturnNode (location: (7,0)-(7,11)) + ├── keyword_loc: (7,0)-(7,6) = "return" + └── arguments: + @ ArgumentsNode (location: (7,6)-(7,11)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ ParenthesesNode (location: (7,6)-(7,11)) + ├── body: + │ @ StatementsNode (location: (7,7)-(7,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (7,7)-(7,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,7)-(7,10) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (7,6)-(7,7) = "(" + └── closing_loc: (7,10)-(7,11) = ")" diff --git a/test/mri/prism/snapshots/whitequark/return_block.txt b/test/mri/prism/snapshots/whitequark/return_block.txt new file mode 100644 index 00000000000..5b8141e4f33 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/return_block.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ ReturnNode (location: (1,0)-(1,21)) + ├── keyword_loc: (1,0)-(1,6) = "return" + └── arguments: + @ ArgumentsNode (location: (1,7)-(1,21)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ CallNode (location: (1,7)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,7)-(1,10) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,11)-(1,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,11)-(1,14) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,15)-(1,21)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,15)-(1,17) = "do" + └── closing_loc: (1,18)-(1,21) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_10279.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_10279.txt new file mode 100644 index 00000000000..66684350a42 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_10279.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,24)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,1)-(1,23)) + │ ├── key: + │ │ @ SymbolNode (location: (1,1)-(1,3)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,1)-(1,2) = "a" + │ │ ├── closing_loc: (1,2)-(1,3) = ":" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ IfNode (location: (1,4)-(1,23)) + │ │ ├── if_keyword_loc: (1,4)-(1,6) = "if" + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (1,7)-(1,11)) + │ │ ├── then_keyword_loc: (1,12)-(1,16) = "then" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,17)-(1,19)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,17)-(1,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: (1,20)-(1,23) = "end" + │ └── operator_loc: ∅ + └── closing_loc: (1,23)-(1,24) = "}" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_10653.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_10653.txt new file mode 100644 index 00000000000..400a8c2861a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_10653.txt @@ -0,0 +1,173 @@ +@ ProgramNode (location: (1,0)-(5,31)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,31)) + └── body: (length: 3) + ├── @ IfNode (location: (1,0)-(1,33)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ FalseNode (location: (1,0)-(1,5)) + │ ├── then_keyword_loc: (1,6)-(1,7) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,8)-(1,20)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,8)-(1,20)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (1,8)-(1,13) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,14)-(1,20)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,14)-(1,16) = "do" + │ │ └── closing_loc: (1,17)-(1,20) = "end" + │ ├── consequent: + │ │ @ ElseNode (location: (1,21)-(1,33)) + │ │ ├── else_keyword_loc: (1,21)-(1,22) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,23)-(1,33)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,23)-(1,33)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :tap + │ │ │ ├── message_loc: (1,23)-(1,26) = "tap" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (1,27)-(1,33)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (1,27)-(1,29) = "do" + │ │ │ └── closing_loc: (1,30)-(1,33) = "end" + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + ├── @ IfNode (location: (3,0)-(3,25)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ FalseNode (location: (3,0)-(3,5)) + │ ├── then_keyword_loc: (3,6)-(3,7) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (3,8)-(3,16)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,8)-(3,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (3,8)-(3,13) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (3,14)-(3,16)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (3,14)-(3,15) = "{" + │ │ └── closing_loc: (3,15)-(3,16) = "}" + │ ├── consequent: + │ │ @ ElseNode (location: (3,17)-(3,25)) + │ │ ├── else_keyword_loc: (3,17)-(3,18) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,19)-(3,25)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,19)-(3,25)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :tap + │ │ │ ├── message_loc: (3,19)-(3,22) = "tap" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (3,23)-(3,25)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (3,23)-(3,24) = "{" + │ │ │ └── closing_loc: (3,24)-(3,25) = "}" + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ IfNode (location: (5,0)-(5,31)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ TrueNode (location: (5,0)-(5,4)) + ├── then_keyword_loc: (5,5)-(5,6) = "?" + ├── statements: + │ @ StatementsNode (location: (5,7)-(5,27)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (5,7)-(5,27)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ IntegerNode (location: (5,7)-(5,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── call_operator_loc: (5,8)-(5,9) = "." + │ ├── name: :tap + │ ├── message_loc: (5,9)-(5,12) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,13)-(5,27)) + │ ├── locals: [:n] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (5,16)-(5,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,17)-(5,18)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :n + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (5,16)-(5,17) = "|" + │ │ └── closing_loc: (5,18)-(5,19) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (5,20)-(5,23)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,20)-(5,23)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (5,20)-(5,21) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,22)-(5,23)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (5,22)-(5,23)) + │ │ │ ├── name: :n + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (5,13)-(5,15) = "do" + │ └── closing_loc: (5,24)-(5,27) = "end" + ├── consequent: + │ @ ElseNode (location: (5,28)-(5,31)) + │ ├── else_keyword_loc: (5,28)-(5,29) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (5,30)-(5,31)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (5,30)-(5,31)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11107.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11107.txt new file mode 100644 index 00000000000..36ece50d887 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11107.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,24)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,24)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,7)-(1,9) = "do" + │ ├── closing_loc: (1,21)-(1,24) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,6)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ └── closing_loc: (1,5)-(1,6) = ")" + │ └── body: + │ @ StatementsNode (location: (1,10)-(1,20)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,10)-(1,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,10)-(1,11) = "a" + │ ├── opening_loc: (1,11)-(1,12) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (1,12)-(1,13) = ")" + │ └── block: + │ @ BlockNode (location: (1,14)-(1,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,14)-(1,16) = "do" + │ └── closing_loc: (1,17)-(1,20) = "end" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11380.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11380.txt new file mode 100644 index 00000000000..b7a7ef9a983 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11380.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,28)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,21)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ LambdaNode (location: (1,2)-(1,15)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (1,2)-(1,4) = "->" + │ │ ├── opening_loc: (1,5)-(1,6) = "{" + │ │ ├── closing_loc: (1,14)-(1,15) = "}" + │ │ ├── parameters: ∅ + │ │ └── body: + │ │ @ StatementsNode (location: (1,7)-(1,13)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (1,7)-(1,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,7)-(1,8) = ":" + │ │ ├── value_loc: (1,8)-(1,13) = "hello" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "hello" + │ └── @ KeywordHashNode (location: (1,17)-(1,21)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,17)-(1,21)) + │ ├── key: + │ │ @ SymbolNode (location: (1,17)-(1,19)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,17)-(1,18) = "a" + │ │ ├── closing_loc: (1,18)-(1,19) = ":" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ IntegerNode (location: (1,20)-(1,21)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,22)-(1,28)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,22)-(1,24) = "do" + └── closing_loc: (1,25)-(1,28) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11873.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11873.txt new file mode 100644 index 00000000000..2999662cc43 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11873.txt @@ -0,0 +1,767 @@ +@ ProgramNode (location: (1,0)-(23,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(23,22)) + └── body: (length: 12) + ├── @ CallNode (location: (1,0)-(1,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ │ ├── opening_loc: (1,3)-(1,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (1,6)-(1,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ StringNode (location: (1,10)-(1,13)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,10)-(1,11) = "\"" + │ │ ├── content_loc: (1,11)-(1,12) = "x" + │ │ ├── closing_loc: (1,12)-(1,13) = "\"" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,14)-(1,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,14)-(1,16) = "do" + │ └── closing_loc: (1,17)-(1,20) = "end" + ├── @ CallNode (location: (3,0)-(3,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (3,0)-(3,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (3,2)-(3,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,2)-(3,3) = "b" + │ │ │ ├── opening_loc: (3,3)-(3,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,4)-(3,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,4)-(3,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (3,4)-(3,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (3,6)-(3,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (3,6)-(3,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (3,7)-(3,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RegularExpressionNode (location: (3,10)-(3,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (3,10)-(3,11) = "/" + │ │ ├── content_loc: (3,11)-(3,12) = "x" + │ │ ├── closing_loc: (3,12)-(3,13) = "/" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,14)-(3,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (3,14)-(3,16) = "do" + │ └── closing_loc: (3,17)-(3,20) = "end" + ├── @ CallNode (location: (5,0)-(5,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (5,0)-(5,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(5,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (5,2)-(5,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (5,2)-(5,3) = "b" + │ │ │ ├── opening_loc: (5,3)-(5,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,4)-(5,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (5,4)-(5,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (5,4)-(5,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (5,6)-(5,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (5,6)-(5,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (5,7)-(5,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RegularExpressionNode (location: (5,10)-(5,14)) + │ │ ├── flags: multi_line, forced_us_ascii_encoding + │ │ ├── opening_loc: (5,10)-(5,11) = "/" + │ │ ├── content_loc: (5,11)-(5,12) = "x" + │ │ ├── closing_loc: (5,12)-(5,14) = "/m" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,15)-(5,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (5,15)-(5,17) = "do" + │ └── closing_loc: (5,18)-(5,21) = "end" + ├── @ CallNode (location: (7,0)-(7,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (7,0)-(7,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,2)-(7,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (7,2)-(7,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (7,2)-(7,3) = "b" + │ │ │ ├── opening_loc: (7,3)-(7,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (7,4)-(7,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (7,4)-(7,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (7,4)-(7,5) = "c" + │ │ │ │ ├── opening_loc: (7,5)-(7,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (7,6)-(7,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (7,6)-(7,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (7,6)-(7,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (7,7)-(7,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (7,8)-(7,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ StringNode (location: (7,11)-(7,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (7,11)-(7,12) = "\"" + │ │ ├── content_loc: (7,12)-(7,13) = "x" + │ │ ├── closing_loc: (7,13)-(7,14) = "\"" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,15)-(7,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (7,15)-(7,17) = "do" + │ └── closing_loc: (7,18)-(7,21) = "end" + ├── @ CallNode (location: (9,0)-(9,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (9,0)-(9,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,2)-(9,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (9,2)-(9,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (9,2)-(9,3) = "b" + │ │ │ ├── opening_loc: (9,3)-(9,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,4)-(9,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (9,4)-(9,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (9,4)-(9,5) = "c" + │ │ │ │ ├── opening_loc: (9,5)-(9,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (9,6)-(9,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (9,6)-(9,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (9,6)-(9,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (9,7)-(9,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (9,8)-(9,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RegularExpressionNode (location: (9,11)-(9,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,11)-(9,12) = "/" + │ │ ├── content_loc: (9,12)-(9,13) = "x" + │ │ ├── closing_loc: (9,13)-(9,14) = "/" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (9,15)-(9,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (9,15)-(9,17) = "do" + │ └── closing_loc: (9,18)-(9,21) = "end" + ├── @ CallNode (location: (11,0)-(11,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (11,0)-(11,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,2)-(11,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (11,2)-(11,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (11,2)-(11,3) = "b" + │ │ │ ├── opening_loc: (11,3)-(11,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (11,4)-(11,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (11,4)-(11,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (11,4)-(11,5) = "c" + │ │ │ │ ├── opening_loc: (11,5)-(11,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (11,6)-(11,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (11,6)-(11,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (11,6)-(11,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (11,7)-(11,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (11,8)-(11,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RegularExpressionNode (location: (11,11)-(11,15)) + │ │ ├── flags: multi_line, forced_us_ascii_encoding + │ │ ├── opening_loc: (11,11)-(11,12) = "/" + │ │ ├── content_loc: (11,12)-(11,13) = "x" + │ │ ├── closing_loc: (11,13)-(11,15) = "/m" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (11,16)-(11,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (11,16)-(11,18) = "do" + │ └── closing_loc: (11,19)-(11,22) = "end" + ├── @ CallNode (location: (13,0)-(13,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (13,0)-(13,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,2)-(13,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (13,2)-(13,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (13,2)-(13,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (13,3)-(13,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (13,4)-(13,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (13,4)-(13,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (13,4)-(13,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (13,6)-(13,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (13,6)-(13,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (13,6)-(13,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (13,3)-(13,4) = "{" + │ │ │ └── closing_loc: (13,7)-(13,8) = "}" + │ │ └── @ StringNode (location: (13,10)-(13,13)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (13,10)-(13,11) = "\"" + │ │ ├── content_loc: (13,11)-(13,12) = "x" + │ │ ├── closing_loc: (13,12)-(13,13) = "\"" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,14)-(13,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (13,14)-(13,16) = "do" + │ └── closing_loc: (13,17)-(13,20) = "end" + ├── @ CallNode (location: (15,0)-(15,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (15,0)-(15,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,2)-(15,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (15,2)-(15,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (15,2)-(15,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (15,3)-(15,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (15,4)-(15,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (15,4)-(15,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (15,4)-(15,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (15,6)-(15,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (15,6)-(15,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (15,6)-(15,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (15,3)-(15,4) = "{" + │ │ │ └── closing_loc: (15,7)-(15,8) = "}" + │ │ └── @ RegularExpressionNode (location: (15,10)-(15,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (15,10)-(15,11) = "/" + │ │ ├── content_loc: (15,11)-(15,12) = "x" + │ │ ├── closing_loc: (15,12)-(15,13) = "/" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (15,14)-(15,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (15,14)-(15,16) = "do" + │ └── closing_loc: (15,17)-(15,20) = "end" + ├── @ CallNode (location: (17,0)-(17,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (17,0)-(17,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,2)-(17,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (17,2)-(17,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (17,2)-(17,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (17,3)-(17,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (17,4)-(17,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (17,4)-(17,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (17,4)-(17,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (17,6)-(17,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (17,6)-(17,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (17,6)-(17,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (17,3)-(17,4) = "{" + │ │ │ └── closing_loc: (17,7)-(17,8) = "}" + │ │ └── @ RegularExpressionNode (location: (17,10)-(17,14)) + │ │ ├── flags: multi_line, forced_us_ascii_encoding + │ │ ├── opening_loc: (17,10)-(17,11) = "/" + │ │ ├── content_loc: (17,11)-(17,12) = "x" + │ │ ├── closing_loc: (17,12)-(17,14) = "/m" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,15)-(17,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (17,15)-(17,17) = "do" + │ └── closing_loc: (17,18)-(17,21) = "end" + ├── @ CallNode (location: (19,0)-(19,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (19,0)-(19,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,2)-(19,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (19,2)-(19,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (19,2)-(19,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (19,3)-(19,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (19,4)-(19,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (19,4)-(19,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (19,4)-(19,5) = "c" + │ │ │ │ ├── opening_loc: (19,5)-(19,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (19,6)-(19,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (19,6)-(19,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (19,6)-(19,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (19,3)-(19,4) = "{" + │ │ │ └── closing_loc: (19,8)-(19,9) = "}" + │ │ └── @ StringNode (location: (19,11)-(19,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (19,11)-(19,12) = "\"" + │ │ ├── content_loc: (19,12)-(19,13) = "x" + │ │ ├── closing_loc: (19,13)-(19,14) = "\"" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,15)-(19,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (19,15)-(19,17) = "do" + │ └── closing_loc: (19,18)-(19,21) = "end" + ├── @ CallNode (location: (21,0)-(21,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (21,0)-(21,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,2)-(21,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (21,2)-(21,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (21,2)-(21,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (21,3)-(21,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (21,4)-(21,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (21,4)-(21,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (21,4)-(21,5) = "c" + │ │ │ │ ├── opening_loc: (21,5)-(21,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (21,6)-(21,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (21,6)-(21,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (21,6)-(21,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (21,7)-(21,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (21,3)-(21,4) = "{" + │ │ │ └── closing_loc: (21,8)-(21,9) = "}" + │ │ └── @ RegularExpressionNode (location: (21,11)-(21,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (21,11)-(21,12) = "/" + │ │ ├── content_loc: (21,12)-(21,13) = "x" + │ │ ├── closing_loc: (21,13)-(21,14) = "/" + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (21,15)-(21,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (21,15)-(21,17) = "do" + │ └── closing_loc: (21,18)-(21,21) = "end" + └── @ CallNode (location: (23,0)-(23,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (23,0)-(23,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (23,2)-(23,15)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (23,2)-(23,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (23,2)-(23,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (23,3)-(23,9)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (23,4)-(23,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (23,4)-(23,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (23,4)-(23,5) = "c" + │ │ │ ├── opening_loc: (23,5)-(23,6) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (23,6)-(23,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (23,6)-(23,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (23,6)-(23,7) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (23,7)-(23,8) = ")" + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (23,3)-(23,4) = "{" + │ │ └── closing_loc: (23,8)-(23,9) = "}" + │ └── @ RegularExpressionNode (location: (23,11)-(23,15)) + │ ├── flags: multi_line, forced_us_ascii_encoding + │ ├── opening_loc: (23,11)-(23,12) = "/" + │ ├── content_loc: (23,12)-(23,13) = "x" + │ ├── closing_loc: (23,13)-(23,15) = "/m" + │ └── unescaped: "x" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (23,16)-(23,22)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (23,16)-(23,18) = "do" + └── closing_loc: (23,19)-(23,22) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11873_a.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11873_a.txt new file mode 100644 index 00000000000..93418e64483 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11873_a.txt @@ -0,0 +1,1231 @@ +@ ProgramNode (location: (1,0)-(39,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(39,20)) + └── body: (length: 20) + ├── @ CallNode (location: (1,0)-(1,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ │ ├── opening_loc: (1,3)-(1,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (1,6)-(1,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,12)-(1,18)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,12)-(1,14) = "do" + │ └── closing_loc: (1,15)-(1,18) = "end" + ├── @ CallNode (location: (3,0)-(3,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (3,0)-(3,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (3,2)-(3,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,2)-(3,3) = "b" + │ │ │ ├── opening_loc: (3,3)-(3,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,4)-(3,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,4)-(3,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (3,4)-(3,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (3,6)-(3,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (3,6)-(3,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (3,7)-(3,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ FloatNode (location: (3,10)-(3,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,14)-(3,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (3,14)-(3,16) = "do" + │ └── closing_loc: (3,17)-(3,20) = "end" + ├── @ CallNode (location: (5,0)-(5,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (5,0)-(5,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(5,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (5,2)-(5,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (5,2)-(5,3) = "b" + │ │ │ ├── opening_loc: (5,3)-(5,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,4)-(5,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (5,4)-(5,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (5,4)-(5,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (5,6)-(5,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (5,6)-(5,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (5,7)-(5,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ ImaginaryNode (location: (5,10)-(5,14)) + │ │ └── numeric: + │ │ @ FloatNode (location: (5,10)-(5,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,15)-(5,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (5,15)-(5,17) = "do" + │ └── closing_loc: (5,18)-(5,21) = "end" + ├── @ CallNode (location: (7,0)-(7,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (7,0)-(7,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,2)-(7,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (7,2)-(7,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (7,2)-(7,3) = "b" + │ │ │ ├── opening_loc: (7,3)-(7,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (7,4)-(7,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (7,4)-(7,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (7,4)-(7,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (7,6)-(7,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (7,6)-(7,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (7,6)-(7,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (7,7)-(7,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RationalNode (location: (7,10)-(7,14)) + │ │ └── numeric: + │ │ @ FloatNode (location: (7,10)-(7,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,15)-(7,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (7,15)-(7,17) = "do" + │ └── closing_loc: (7,18)-(7,21) = "end" + ├── @ CallNode (location: (9,0)-(9,19)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (9,0)-(9,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,2)-(9,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (9,2)-(9,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (9,2)-(9,3) = "b" + │ │ │ ├── opening_loc: (9,3)-(9,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,4)-(9,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (9,4)-(9,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (9,4)-(9,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (9,6)-(9,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (9,6)-(9,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (9,6)-(9,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (9,7)-(9,8) = ")" + │ │ │ └── block: ∅ + │ │ └── @ SymbolNode (location: (9,10)-(9,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (9,10)-(9,11) = ":" + │ │ ├── value_loc: (9,11)-(9,12) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (9,13)-(9,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (9,13)-(9,15) = "do" + │ └── closing_loc: (9,16)-(9,19) = "end" + ├── @ CallNode (location: (11,0)-(11,19)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (11,0)-(11,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,2)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (11,2)-(11,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (11,2)-(11,3) = "b" + │ │ │ ├── opening_loc: (11,3)-(11,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (11,4)-(11,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (11,4)-(11,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (11,4)-(11,5) = "c" + │ │ │ │ ├── opening_loc: (11,5)-(11,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (11,6)-(11,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (11,6)-(11,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (11,6)-(11,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (11,7)-(11,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (11,8)-(11,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ IntegerNode (location: (11,11)-(11,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (11,13)-(11,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (11,13)-(11,15) = "do" + │ └── closing_loc: (11,16)-(11,19) = "end" + ├── @ CallNode (location: (13,0)-(13,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (13,0)-(13,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,2)-(13,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (13,2)-(13,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (13,2)-(13,3) = "b" + │ │ │ ├── opening_loc: (13,3)-(13,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (13,4)-(13,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (13,4)-(13,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (13,4)-(13,5) = "c" + │ │ │ │ ├── opening_loc: (13,5)-(13,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (13,6)-(13,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (13,6)-(13,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (13,6)-(13,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (13,7)-(13,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (13,8)-(13,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ FloatNode (location: (13,11)-(13,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,15)-(13,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (13,15)-(13,17) = "do" + │ └── closing_loc: (13,18)-(13,21) = "end" + ├── @ CallNode (location: (15,0)-(15,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (15,0)-(15,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,2)-(15,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (15,2)-(15,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (15,2)-(15,3) = "b" + │ │ │ ├── opening_loc: (15,3)-(15,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (15,4)-(15,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (15,4)-(15,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (15,4)-(15,5) = "c" + │ │ │ │ ├── opening_loc: (15,5)-(15,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (15,6)-(15,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (15,6)-(15,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (15,6)-(15,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (15,7)-(15,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (15,8)-(15,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ ImaginaryNode (location: (15,11)-(15,15)) + │ │ └── numeric: + │ │ @ FloatNode (location: (15,11)-(15,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (15,16)-(15,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (15,16)-(15,18) = "do" + │ └── closing_loc: (15,19)-(15,22) = "end" + ├── @ CallNode (location: (17,0)-(17,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (17,0)-(17,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,2)-(17,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (17,2)-(17,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (17,2)-(17,3) = "b" + │ │ │ ├── opening_loc: (17,3)-(17,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (17,4)-(17,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (17,4)-(17,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (17,4)-(17,5) = "c" + │ │ │ │ ├── opening_loc: (17,5)-(17,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (17,6)-(17,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (17,6)-(17,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (17,6)-(17,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (17,7)-(17,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (17,8)-(17,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ RationalNode (location: (17,11)-(17,15)) + │ │ └── numeric: + │ │ @ FloatNode (location: (17,11)-(17,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,16)-(17,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (17,16)-(17,18) = "do" + │ └── closing_loc: (17,19)-(17,22) = "end" + ├── @ CallNode (location: (19,0)-(19,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (19,0)-(19,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,2)-(19,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (19,2)-(19,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (19,2)-(19,3) = "b" + │ │ │ ├── opening_loc: (19,3)-(19,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (19,4)-(19,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (19,4)-(19,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (19,4)-(19,5) = "c" + │ │ │ │ ├── opening_loc: (19,5)-(19,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (19,6)-(19,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (19,6)-(19,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (19,6)-(19,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (19,8)-(19,9) = ")" + │ │ │ └── block: ∅ + │ │ └── @ SymbolNode (location: (19,11)-(19,13)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (19,11)-(19,12) = ":" + │ │ ├── value_loc: (19,12)-(19,13) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,14)-(19,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (19,14)-(19,16) = "do" + │ └── closing_loc: (19,17)-(19,20) = "end" + ├── @ CallNode (location: (21,0)-(21,18)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (21,0)-(21,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,2)-(21,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (21,2)-(21,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (21,2)-(21,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (21,3)-(21,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (21,4)-(21,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (21,4)-(21,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (21,4)-(21,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (21,6)-(21,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (21,6)-(21,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (21,6)-(21,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (21,3)-(21,4) = "{" + │ │ │ └── closing_loc: (21,7)-(21,8) = "}" + │ │ └── @ IntegerNode (location: (21,10)-(21,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (21,12)-(21,18)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (21,12)-(21,14) = "do" + │ └── closing_loc: (21,15)-(21,18) = "end" + ├── @ CallNode (location: (23,0)-(23,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (23,0)-(23,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,2)-(23,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (23,2)-(23,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (23,2)-(23,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (23,3)-(23,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (23,4)-(23,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (23,4)-(23,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (23,4)-(23,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (23,6)-(23,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (23,6)-(23,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (23,6)-(23,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (23,3)-(23,4) = "{" + │ │ │ └── closing_loc: (23,7)-(23,8) = "}" + │ │ └── @ FloatNode (location: (23,10)-(23,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (23,14)-(23,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (23,14)-(23,16) = "do" + │ └── closing_loc: (23,17)-(23,20) = "end" + ├── @ CallNode (location: (25,0)-(25,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (25,0)-(25,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (25,2)-(25,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (25,2)-(25,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (25,2)-(25,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (25,3)-(25,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (25,4)-(25,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (25,4)-(25,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (25,4)-(25,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (25,6)-(25,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (25,6)-(25,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (25,6)-(25,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (25,3)-(25,4) = "{" + │ │ │ └── closing_loc: (25,7)-(25,8) = "}" + │ │ └── @ ImaginaryNode (location: (25,10)-(25,14)) + │ │ └── numeric: + │ │ @ FloatNode (location: (25,10)-(25,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (25,15)-(25,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (25,15)-(25,17) = "do" + │ └── closing_loc: (25,18)-(25,21) = "end" + ├── @ CallNode (location: (27,0)-(27,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (27,0)-(27,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,2)-(27,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (27,2)-(27,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (27,2)-(27,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (27,3)-(27,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (27,4)-(27,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (27,4)-(27,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (27,4)-(27,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (27,6)-(27,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (27,6)-(27,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (27,6)-(27,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (27,3)-(27,4) = "{" + │ │ │ └── closing_loc: (27,7)-(27,8) = "}" + │ │ └── @ RationalNode (location: (27,10)-(27,14)) + │ │ └── numeric: + │ │ @ FloatNode (location: (27,10)-(27,13)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (27,15)-(27,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (27,15)-(27,17) = "do" + │ └── closing_loc: (27,18)-(27,21) = "end" + ├── @ CallNode (location: (29,0)-(29,19)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (29,0)-(29,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (29,2)-(29,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (29,2)-(29,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (29,2)-(29,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (29,3)-(29,8)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (29,4)-(29,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (29,4)-(29,7)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (29,4)-(29,5) = "c" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (29,6)-(29,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (29,6)-(29,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (29,6)-(29,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (29,3)-(29,4) = "{" + │ │ │ └── closing_loc: (29,7)-(29,8) = "}" + │ │ └── @ SymbolNode (location: (29,10)-(29,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (29,10)-(29,11) = ":" + │ │ ├── value_loc: (29,11)-(29,12) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (29,13)-(29,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (29,13)-(29,15) = "do" + │ └── closing_loc: (29,16)-(29,19) = "end" + ├── @ CallNode (location: (31,0)-(31,19)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (31,0)-(31,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,2)-(31,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (31,2)-(31,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (31,2)-(31,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (31,3)-(31,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (31,4)-(31,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (31,4)-(31,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (31,4)-(31,5) = "c" + │ │ │ │ ├── opening_loc: (31,5)-(31,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (31,6)-(31,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (31,6)-(31,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (31,6)-(31,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (31,7)-(31,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (31,3)-(31,4) = "{" + │ │ │ └── closing_loc: (31,8)-(31,9) = "}" + │ │ └── @ IntegerNode (location: (31,11)-(31,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (31,13)-(31,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (31,13)-(31,15) = "do" + │ └── closing_loc: (31,16)-(31,19) = "end" + ├── @ CallNode (location: (33,0)-(33,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (33,0)-(33,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,2)-(33,14)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (33,2)-(33,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (33,2)-(33,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (33,3)-(33,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (33,4)-(33,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (33,4)-(33,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (33,4)-(33,5) = "c" + │ │ │ │ ├── opening_loc: (33,5)-(33,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (33,6)-(33,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (33,6)-(33,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (33,6)-(33,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (33,7)-(33,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (33,3)-(33,4) = "{" + │ │ │ └── closing_loc: (33,8)-(33,9) = "}" + │ │ └── @ FloatNode (location: (33,11)-(33,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (33,15)-(33,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (33,15)-(33,17) = "do" + │ └── closing_loc: (33,18)-(33,21) = "end" + ├── @ CallNode (location: (35,0)-(35,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (35,0)-(35,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,2)-(35,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (35,2)-(35,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (35,2)-(35,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (35,3)-(35,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (35,4)-(35,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (35,4)-(35,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (35,4)-(35,5) = "c" + │ │ │ │ ├── opening_loc: (35,5)-(35,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (35,6)-(35,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (35,6)-(35,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (35,7)-(35,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (35,3)-(35,4) = "{" + │ │ │ └── closing_loc: (35,8)-(35,9) = "}" + │ │ └── @ ImaginaryNode (location: (35,11)-(35,15)) + │ │ └── numeric: + │ │ @ FloatNode (location: (35,11)-(35,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (35,16)-(35,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (35,16)-(35,18) = "do" + │ └── closing_loc: (35,19)-(35,22) = "end" + ├── @ CallNode (location: (37,0)-(37,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (37,0)-(37,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,2)-(37,15)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (37,2)-(37,9)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (37,2)-(37,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (37,3)-(37,9)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (37,4)-(37,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (37,4)-(37,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :c + │ │ │ │ ├── message_loc: (37,4)-(37,5) = "c" + │ │ │ │ ├── opening_loc: (37,5)-(37,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (37,6)-(37,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (37,6)-(37,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :d + │ │ │ │ │ ├── message_loc: (37,6)-(37,7) = "d" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (37,7)-(37,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (37,3)-(37,4) = "{" + │ │ │ └── closing_loc: (37,8)-(37,9) = "}" + │ │ └── @ RationalNode (location: (37,11)-(37,15)) + │ │ └── numeric: + │ │ @ FloatNode (location: (37,11)-(37,14)) + │ │ └── value: 1.0 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (37,16)-(37,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (37,16)-(37,18) = "do" + │ └── closing_loc: (37,19)-(37,22) = "end" + └── @ CallNode (location: (39,0)-(39,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (39,0)-(39,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (39,2)-(39,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (39,2)-(39,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (39,2)-(39,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (39,3)-(39,9)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (39,4)-(39,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (39,4)-(39,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (39,4)-(39,5) = "c" + │ │ │ ├── opening_loc: (39,5)-(39,6) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (39,6)-(39,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (39,6)-(39,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :d + │ │ │ │ ├── message_loc: (39,6)-(39,7) = "d" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (39,7)-(39,8) = ")" + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (39,3)-(39,4) = "{" + │ │ └── closing_loc: (39,8)-(39,9) = "}" + │ └── @ SymbolNode (location: (39,11)-(39,13)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (39,11)-(39,12) = ":" + │ ├── value_loc: (39,12)-(39,13) = "e" + │ ├── closing_loc: ∅ + │ └── unescaped: "e" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (39,14)-(39,20)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (39,14)-(39,16) = "do" + └── closing_loc: (39,17)-(39,20) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11873_b.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11873_b.txt new file mode 100644 index 00000000000..6aa8e55e54a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11873_b.txt @@ -0,0 +1,98 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,18)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,2)-(1,3) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,3)-(1,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,4)-(1,12)) + │ │ │ └── body: (length: 2) + │ │ │ ├── @ CallNode (location: (1,4)-(1,8)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :p + │ │ │ │ ├── message_loc: (1,4)-(1,5) = "p" + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :p + │ │ │ │ │ ├── message_loc: (1,6)-(1,7) = "p" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ │ └── block: ∅ + │ │ │ └── @ CallNode (location: (1,9)-(1,12)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :p + │ │ │ ├── message_loc: (1,9)-(1,10) = "p" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,11)-(1,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :p + │ │ │ │ ├── message_loc: (1,11)-(1,12) = "p" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (1,3)-(1,4) = "{" + │ │ └── closing_loc: (1,12)-(1,13) = "}" + │ └── @ CallNode (location: (1,15)-(1,18)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (1,15)-(1,18) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,19)-(1,25)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,19)-(1,21) = "do" + └── closing_loc: (1,22)-(1,25) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11989.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11989.txt new file mode 100644 index 00000000000..fe17087e53a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11989.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,2)-(1,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,2)-(1,8) = "<<~\"E\"" + │ ├── content_loc: (2,0)-(3,0) = " x\\n y\n" + │ ├── closing_loc: (3,0)-(4,0) = "E\n" + │ └── unescaped: "x\n y\n" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_11990.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_11990.txt new file mode 100644 index 00000000000..43c04e55a23 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_11990.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,12)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InterpolatedStringNode (location: (1,2)-(1,12)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,2)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,2)-(1,6) = "<<~E" + │ │ │ ├── content_loc: (2,0)-(3,0) = " x\n" + │ │ │ ├── closing_loc: (3,0)-(4,0) = "E\n" + │ │ │ └── unescaped: "x\n" + │ │ └── @ StringNode (location: (1,7)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,7)-(1,8) = "\"" + │ │ ├── content_loc: (1,8)-(1,11) = " y" + │ │ ├── closing_loc: (1,11)-(1,12) = "\"" + │ │ └── unescaped: " y" + │ └── closing_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_12073.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_12073.txt new file mode 100644 index 00000000000..9db30f6fec1 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_12073.txt @@ -0,0 +1,96 @@ +@ ProgramNode (location: (1,0)-(3,34)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(3,34)) + └── body: (length: 3) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,2)-(1,3) = "=" + ├── @ CallNode (location: (1,7)-(1,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,7)-(1,8) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,9)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,9)-(1,13)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,9)-(1,13)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,9)-(1,10) = "b" + │ │ │ ├── closing_loc: (1,10)-(1,11) = ":" + │ │ │ └── unescaped: "b" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ DefNode (location: (3,0)-(3,34)) + ├── name: :foo + ├── name_loc: (3,4)-(3,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (3,8)-(3,13)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (3,8)-(3,13)) + │ │ ├── flags: ∅ + │ │ └── name: :raise + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (3,15)-(3,29)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,15)-(3,29)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :raise + │ ├── message_loc: (3,15)-(3,20) = "raise" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,21)-(3,29)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ ConstantPathNode (location: (3,21)-(3,25)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (3,21)-(3,22)) + │ │ │ │ └── name: :A + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (3,24)-(3,25)) + │ │ │ │ └── name: :B + │ │ │ └── delimiter_loc: (3,22)-(3,24) = "::" + │ │ └── @ StringNode (location: (3,27)-(3,29)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (3,27)-(3,28) = "'" + │ │ ├── content_loc: (3,28)-(3,28) = "" + │ │ ├── closing_loc: (3,28)-(3,29) = "'" + │ │ └── unescaped: "" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [:raise] + ├── def_keyword_loc: (3,0)-(3,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (3,31)-(3,34) = "end" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_12402.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_12402.txt new file mode 100644 index 00000000000..df5aea00c35 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_12402.txt @@ -0,0 +1,567 @@ +@ ProgramNode (location: (1,0)-(27,31)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(27,31)) + └── body: (length: 14) + ├── @ LocalVariableOperatorWriteNode (location: (1,0)-(1,27)) + │ ├── name_loc: (1,0)-(1,3) = "foo" + │ ├── operator_loc: (1,4)-(1,6) = "+=" + │ ├── value: + │ │ @ RescueModifierNode (location: (1,7)-(1,27)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (1,7)-(1,16)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (1,7)-(1,12) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,13)-(1,16)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (1,13)-(1,16) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (1,17)-(1,23) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (1,24)-(1,27)) + │ ├── name: :foo + │ ├── operator: :+ + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (3,0)-(3,28)) + │ ├── name_loc: (3,0)-(3,3) = "foo" + │ ├── operator_loc: (3,4)-(3,6) = "+=" + │ ├── value: + │ │ @ RescueModifierNode (location: (3,7)-(3,28)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (3,7)-(3,17)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (3,7)-(3,12) = "raise" + │ │ │ ├── opening_loc: (3,12)-(3,13) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,13)-(3,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,13)-(3,16)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (3,13)-(3,16) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (3,16)-(3,17) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (3,18)-(3,24) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (3,25)-(3,28)) + │ ├── name: :foo + │ ├── operator: :+ + │ └── depth: 0 + ├── @ LocalVariableWriteNode (location: (5,0)-(5,26)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (5,0)-(5,3) = "foo" + │ ├── value: + │ │ @ RescueModifierNode (location: (5,6)-(5,26)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (5,6)-(5,15)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (5,6)-(5,11) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,12)-(5,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (5,12)-(5,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (5,12)-(5,15) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (5,16)-(5,22) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (5,23)-(5,26)) + │ └── operator_loc: (5,4)-(5,5) = "=" + ├── @ LocalVariableWriteNode (location: (7,0)-(7,27)) + │ ├── name: :foo + │ ├── depth: 0 + │ ├── name_loc: (7,0)-(7,3) = "foo" + │ ├── value: + │ │ @ RescueModifierNode (location: (7,6)-(7,27)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (7,6)-(7,16)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (7,6)-(7,11) = "raise" + │ │ │ ├── opening_loc: (7,11)-(7,12) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (7,12)-(7,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (7,12)-(7,15)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (7,12)-(7,15) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: (7,15)-(7,16) = ")" + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (7,17)-(7,23) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (7,24)-(7,27)) + │ └── operator_loc: (7,4)-(7,5) = "=" + ├── @ CallOperatorWriteNode (location: (9,0)-(9,29)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (9,0)-(9,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (9,3)-(9,4) = "." + │ ├── message_loc: (9,4)-(9,5) = "C" + │ ├── read_name: :C + │ ├── write_name: :C= + │ ├── operator: :+ + │ ├── operator_loc: (9,6)-(9,8) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (9,9)-(9,29)) + │ ├── expression: + │ │ @ CallNode (location: (9,9)-(9,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (9,9)-(9,14) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,15)-(9,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (9,15)-(9,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (9,15)-(9,18) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (9,19)-(9,25) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (9,26)-(9,29)) + ├── @ CallOperatorWriteNode (location: (11,0)-(11,30)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (11,0)-(11,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (11,3)-(11,4) = "." + │ ├── message_loc: (11,4)-(11,5) = "C" + │ ├── read_name: :C + │ ├── write_name: :C= + │ ├── operator: :+ + │ ├── operator_loc: (11,6)-(11,8) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (11,9)-(11,30)) + │ ├── expression: + │ │ @ CallNode (location: (11,9)-(11,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (11,9)-(11,14) = "raise" + │ │ ├── opening_loc: (11,14)-(11,15) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,15)-(11,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (11,15)-(11,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (11,15)-(11,18) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (11,18)-(11,19) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (11,20)-(11,26) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (11,27)-(11,30)) + ├── @ CallOperatorWriteNode (location: (13,0)-(13,29)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (13,0)-(13,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (13,3)-(13,4) = "." + │ ├── message_loc: (13,4)-(13,5) = "m" + │ ├── read_name: :m + │ ├── write_name: :m= + │ ├── operator: :+ + │ ├── operator_loc: (13,6)-(13,8) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (13,9)-(13,29)) + │ ├── expression: + │ │ @ CallNode (location: (13,9)-(13,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (13,9)-(13,14) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,15)-(13,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (13,15)-(13,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (13,15)-(13,18) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (13,19)-(13,25) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (13,26)-(13,29)) + ├── @ CallOperatorWriteNode (location: (15,0)-(15,30)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (15,0)-(15,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (15,3)-(15,4) = "." + │ ├── message_loc: (15,4)-(15,5) = "m" + │ ├── read_name: :m + │ ├── write_name: :m= + │ ├── operator: :+ + │ ├── operator_loc: (15,6)-(15,8) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (15,9)-(15,30)) + │ ├── expression: + │ │ @ CallNode (location: (15,9)-(15,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (15,9)-(15,14) = "raise" + │ │ ├── opening_loc: (15,14)-(15,15) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (15,15)-(15,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (15,15)-(15,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (15,15)-(15,18) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (15,18)-(15,19) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (15,20)-(15,26) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (15,27)-(15,30)) + ├── @ ConstantPathOrWriteNode (location: (17,0)-(17,31)) + │ ├── target: + │ │ @ ConstantPathNode (location: (17,0)-(17,6)) + │ │ ├── parent: + │ │ │ @ LocalVariableReadNode (location: (17,0)-(17,3)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (17,5)-(17,6)) + │ │ │ └── name: :C + │ │ └── delimiter_loc: (17,3)-(17,5) = "::" + │ ├── operator_loc: (17,7)-(17,10) = "||=" + │ └── value: + │ @ RescueModifierNode (location: (17,11)-(17,31)) + │ ├── expression: + │ │ @ CallNode (location: (17,11)-(17,20)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (17,11)-(17,16) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (17,17)-(17,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (17,17)-(17,20)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (17,17)-(17,20) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (17,21)-(17,27) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (17,28)-(17,31)) + ├── @ ConstantPathOrWriteNode (location: (19,0)-(19,32)) + │ ├── target: + │ │ @ ConstantPathNode (location: (19,0)-(19,6)) + │ │ ├── parent: + │ │ │ @ LocalVariableReadNode (location: (19,0)-(19,3)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (19,5)-(19,6)) + │ │ │ └── name: :C + │ │ └── delimiter_loc: (19,3)-(19,5) = "::" + │ ├── operator_loc: (19,7)-(19,10) = "||=" + │ └── value: + │ @ RescueModifierNode (location: (19,11)-(19,32)) + │ ├── expression: + │ │ @ CallNode (location: (19,11)-(19,21)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (19,11)-(19,16) = "raise" + │ │ ├── opening_loc: (19,16)-(19,17) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (19,17)-(19,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (19,17)-(19,20)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (19,17)-(19,20) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (19,20)-(19,21) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (19,22)-(19,28) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (19,29)-(19,32)) + ├── @ CallOperatorWriteNode (location: (21,0)-(21,30)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (21,0)-(21,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (21,3)-(21,5) = "::" + │ ├── message_loc: (21,5)-(21,6) = "m" + │ ├── read_name: :m + │ ├── write_name: :m= + │ ├── operator: :+ + │ ├── operator_loc: (21,7)-(21,9) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (21,10)-(21,30)) + │ ├── expression: + │ │ @ CallNode (location: (21,10)-(21,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (21,10)-(21,15) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (21,16)-(21,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (21,16)-(21,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (21,16)-(21,19) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (21,20)-(21,26) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (21,27)-(21,30)) + ├── @ CallOperatorWriteNode (location: (23,0)-(23,31)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (23,0)-(23,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: (23,3)-(23,5) = "::" + │ ├── message_loc: (23,5)-(23,6) = "m" + │ ├── read_name: :m + │ ├── write_name: :m= + │ ├── operator: :+ + │ ├── operator_loc: (23,7)-(23,9) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (23,10)-(23,31)) + │ ├── expression: + │ │ @ CallNode (location: (23,10)-(23,20)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (23,10)-(23,15) = "raise" + │ │ ├── opening_loc: (23,15)-(23,16) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (23,16)-(23,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (23,16)-(23,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (23,16)-(23,19) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: (23,19)-(23,20) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (23,21)-(23,27) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (23,28)-(23,31)) + ├── @ IndexOperatorWriteNode (location: (25,0)-(25,30)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (25,0)-(25,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── opening_loc: (25,3)-(25,4) = "[" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (25,4)-(25,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (25,4)-(25,5)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── closing_loc: (25,5)-(25,6) = "]" + │ ├── block: ∅ + │ ├── operator: :+ + │ ├── operator_loc: (25,7)-(25,9) = "+=" + │ └── value: + │ @ RescueModifierNode (location: (25,10)-(25,30)) + │ ├── expression: + │ │ @ CallNode (location: (25,10)-(25,19)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (25,10)-(25,15) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (25,16)-(25,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (25,16)-(25,19)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (25,16)-(25,19) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (25,20)-(25,26) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (25,27)-(25,30)) + └── @ IndexOperatorWriteNode (location: (27,0)-(27,31)) + ├── flags: ∅ + ├── receiver: + │ @ LocalVariableReadNode (location: (27,0)-(27,3)) + │ ├── name: :foo + │ └── depth: 0 + ├── call_operator_loc: ∅ + ├── opening_loc: (27,3)-(27,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (27,4)-(27,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (27,4)-(27,5)) + │ ├── flags: decimal + │ └── value: 0 + ├── closing_loc: (27,5)-(27,6) = "]" + ├── block: ∅ + ├── operator: :+ + ├── operator_loc: (27,7)-(27,9) = "+=" + └── value: + @ RescueModifierNode (location: (27,10)-(27,31)) + ├── expression: + │ @ CallNode (location: (27,10)-(27,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :raise + │ ├── message_loc: (27,10)-(27,15) = "raise" + │ ├── opening_loc: (27,15)-(27,16) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,16)-(27,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (27,16)-(27,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (27,16)-(27,19) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (27,19)-(27,20) = ")" + │ └── block: ∅ + ├── keyword_loc: (27,21)-(27,27) = "rescue" + └── rescue_expression: + @ NilNode (location: (27,28)-(27,31)) diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_12669.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_12669.txt new file mode 100644 index 00000000000..86b021351b8 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_12669.txt @@ -0,0 +1,133 @@ +@ ProgramNode (location: (1,0)-(7,16)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(7,16)) + └── body: (length: 4) + ├── @ LocalVariableOperatorWriteNode (location: (1,0)-(1,18)) + │ ├── name_loc: (1,0)-(1,1) = "a" + │ ├── operator_loc: (1,2)-(1,4) = "+=" + │ ├── value: + │ │ @ LocalVariableOperatorWriteNode (location: (1,5)-(1,18)) + │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ ├── operator_loc: (1,7)-(1,9) = "+=" + │ │ ├── value: + │ │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (1,10)-(1,15) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,16)-(1,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (1,16)-(1,18)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (1,16)-(1,17) = ":" + │ │ │ │ ├── value_loc: (1,17)-(1,18) = "x" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── name: :b + │ │ ├── operator: :+ + │ │ └── depth: 0 + │ ├── name: :a + │ ├── operator: :+ + │ └── depth: 0 + ├── @ LocalVariableOperatorWriteNode (location: (3,0)-(3,17)) + │ ├── name_loc: (3,0)-(3,1) = "a" + │ ├── operator_loc: (3,2)-(3,4) = "+=" + │ ├── value: + │ │ @ LocalVariableWriteNode (location: (3,5)-(3,17)) + │ │ ├── name: :b + │ │ ├── depth: 0 + │ │ ├── name_loc: (3,5)-(3,6) = "b" + │ │ ├── value: + │ │ │ @ CallNode (location: (3,9)-(3,17)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (3,9)-(3,14) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,15)-(3,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (3,15)-(3,17)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (3,15)-(3,16) = ":" + │ │ │ │ ├── value_loc: (3,16)-(3,17) = "x" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (3,7)-(3,8) = "=" + │ ├── name: :a + │ ├── operator: :+ + │ └── depth: 0 + ├── @ LocalVariableWriteNode (location: (5,0)-(5,17)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (5,0)-(5,1) = "a" + │ ├── value: + │ │ @ LocalVariableOperatorWriteNode (location: (5,4)-(5,17)) + │ │ ├── name_loc: (5,4)-(5,5) = "b" + │ │ ├── operator_loc: (5,6)-(5,8) = "+=" + │ │ ├── value: + │ │ │ @ CallNode (location: (5,9)-(5,17)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :raise + │ │ │ ├── message_loc: (5,9)-(5,14) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,15)-(5,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (5,15)-(5,17)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (5,15)-(5,16) = ":" + │ │ │ │ ├── value_loc: (5,16)-(5,17) = "x" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── name: :b + │ │ ├── operator: :+ + │ │ └── depth: 0 + │ └── operator_loc: (5,2)-(5,3) = "=" + └── @ LocalVariableWriteNode (location: (7,0)-(7,16)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (7,0)-(7,1) = "a" + ├── value: + │ @ LocalVariableWriteNode (location: (7,4)-(7,16)) + │ ├── name: :b + │ ├── depth: 0 + │ ├── name_loc: (7,4)-(7,5) = "b" + │ ├── value: + │ │ @ CallNode (location: (7,8)-(7,16)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (7,8)-(7,13) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,14)-(7,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SymbolNode (location: (7,14)-(7,16)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (7,14)-(7,15) = ":" + │ │ │ ├── value_loc: (7,15)-(7,16) = "x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "x" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (7,6)-(7,7) = "=" + └── operator_loc: (7,2)-(7,3) = "=" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_12686.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_12686.txt new file mode 100644 index 00000000000..427c96bbe0b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_12686.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,2)-(1,16)) + │ ├── body: + │ │ @ StatementsNode (location: (1,3)-(1,15)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,3)-(1,15)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :g + │ │ │ ├── message_loc: (1,3)-(1,4) = "g" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (1,5)-(1,11) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (1,12)-(1,15)) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,15)-(1,16) = ")" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_13547.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_13547.txt new file mode 100644 index 00000000000..eae9587ea0d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_13547.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,0)-(1,4) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,4)-(1,6) = "[]" + ├── opening_loc: (1,4)-(1,5) = "[" + ├── arguments: ∅ + ├── closing_loc: (1,5)-(1,6) = "]" + └── block: + @ BlockNode (location: (1,7)-(1,9)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,8)-(1,9) = "}" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_14690.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_14690.txt new file mode 100644 index 00000000000..36629797db7 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_14690.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,23)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :let + ├── message_loc: (1,0)-(1,3) = "let" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,6)) + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,5)-(1,6) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,23)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,21)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,9)-(1,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,9)-(1,10) = "m" + │ ├── opening_loc: (1,10)-(1,11) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,11)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,11)-(1,12) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (1,12)-(1,13) = ")" + │ └── block: + │ @ BlockNode (location: (1,14)-(1,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,14)-(1,16) = "do" + │ └── closing_loc: (1,18)-(1,21) = "end" + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,22)-(1,23) = "}" diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_15789.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_15789.txt new file mode 100644 index 00000000000..db8bc1401f6 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_15789.txt @@ -0,0 +1,120 @@ +@ ProgramNode (location: (1,0)-(3,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,19)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,0)-(1,1) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,20)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LambdaNode (location: (1,2)-(1,20)) + │ │ ├── locals: [:a] + │ │ ├── operator_loc: (1,2)-(1,4) = "->" + │ │ ├── opening_loc: (1,17)-(1,18) = "{" + │ │ ├── closing_loc: (1,19)-(1,20) = "}" + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── optionals: (length: 1) + │ │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ │ └── value: + │ │ │ │ │ @ LambdaNode (location: (1,9)-(1,15)) + │ │ │ │ │ ├── locals: [:_1] + │ │ │ │ │ ├── operator_loc: (1,9)-(1,11) = "->" + │ │ │ │ │ ├── opening_loc: (1,11)-(1,12) = "{" + │ │ │ │ │ ├── closing_loc: (1,14)-(1,15) = "}" + │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ @ NumberedParametersNode (location: (1,9)-(1,15)) + │ │ │ │ │ │ └── maximum: 1 + │ │ │ │ │ └── body: + │ │ │ │ │ @ StatementsNode (location: (1,12)-(1,14)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ LocalVariableReadNode (location: (1,12)-(1,14)) + │ │ │ │ │ ├── name: :_1 + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ │ └── closing_loc: (1,15)-(1,16) = ")" + │ │ └── body: + │ │ @ StatementsNode (location: (1,18)-(1,19)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,18)-(1,19)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (3,0)-(3,1) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (3,2)-(3,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (3,2)-(3,19)) + │ ├── locals: [:a] + │ ├── operator_loc: (3,2)-(3,4) = "->" + │ ├── opening_loc: (3,16)-(3,17) = "{" + │ ├── closing_loc: (3,18)-(3,19) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (3,4)-(3,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (3,5)-(3,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ OptionalKeywordParameterNode (location: (3,5)-(3,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (3,5)-(3,7) = "a:" + │ │ │ │ └── value: + │ │ │ │ @ LambdaNode (location: (3,8)-(3,14)) + │ │ │ │ ├── locals: [:_1] + │ │ │ │ ├── operator_loc: (3,8)-(3,10) = "->" + │ │ │ │ ├── opening_loc: (3,10)-(3,11) = "{" + │ │ │ │ ├── closing_loc: (3,13)-(3,14) = "}" + │ │ │ │ ├── parameters: + │ │ │ │ │ @ NumberedParametersNode (location: (3,8)-(3,14)) + │ │ │ │ │ └── maximum: 1 + │ │ │ │ └── body: + │ │ │ │ @ StatementsNode (location: (3,11)-(3,13)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (3,11)-(3,13)) + │ │ │ │ ├── name: :_1 + │ │ │ │ └── depth: 0 + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (3,4)-(3,5) = "(" + │ │ └── closing_loc: (3,14)-(3,15) = ")" + │ └── body: + │ @ StatementsNode (location: (3,17)-(3,18)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (3,17)-(3,18)) + │ ├── name: :a + │ └── depth: 0 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ruby_bug_9669.txt b/test/mri/prism/snapshots/whitequark/ruby_bug_9669.txt new file mode 100644 index 00000000000..a73000bed0f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ruby_bug_9669.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(8,1)) +├── locals: [:o] +└── statements: + @ StatementsNode (location: (1,0)-(8,1)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(3,3)) + │ ├── name: :a + │ ├── name_loc: (1,4)-(1,5) = "a" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ └── name_loc: (1,6)-(1,8) = "b:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,0)-(2,6)) + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (2,0)-(2,6)) + │ │ ├── keyword_loc: (2,0)-(2,6) = "return" + │ │ └── arguments: ∅ + │ ├── locals: [:b] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ LocalVariableWriteNode (location: (5,0)-(8,1)) + ├── name: :o + ├── depth: 0 + ├── name_loc: (5,0)-(5,1) = "o" + ├── value: + │ @ HashNode (location: (5,4)-(8,1)) + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (6,0)-(7,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (6,0)-(6,2)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (6,0)-(6,1) = "a" + │ │ │ ├── closing_loc: (6,1)-(6,2) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (7,0)-(7,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: ∅ + │ └── closing_loc: (8,0)-(8,1) = "}" + └── operator_loc: (5,2)-(5,3) = "=" diff --git a/test/mri/prism/snapshots/whitequark/sclass.txt b/test/mri/prism/snapshots/whitequark/sclass.txt new file mode 100644 index 00000000000..53188a7b8a7 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/sclass.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ SingletonClassNode (location: (1,0)-(1,22)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── operator_loc: (1,6)-(1,8) = "<<" + ├── expression: + │ @ CallNode (location: (1,9)-(1,12)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,9)-(1,12) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,14)-(1,17)) + │ └── body: (length: 1) + │ └── @ NilNode (location: (1,14)-(1,17)) + └── end_keyword_loc: (1,19)-(1,22) = "end" diff --git a/test/mri/prism/snapshots/whitequark/self.txt b/test/mri/prism/snapshots/whitequark/self.txt new file mode 100644 index 00000000000..c69f8fa8c59 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/self.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ SelfNode (location: (1,0)-(1,4)) diff --git a/test/mri/prism/snapshots/whitequark/send_attr_asgn.txt b/test/mri/prism/snapshots/whitequark/send_attr_asgn.txt new file mode 100644 index 00000000000..392ae5587eb --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_attr_asgn.txt @@ -0,0 +1,106 @@ +@ ProgramNode (location: (1,0)-(7,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,10)) + └── body: (length: 4) + ├── @ CallNode (location: (1,0)-(1,9)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :A= + │ ├── message_loc: (1,4)-(1,5) = "A" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,9)) + │ ├── flags: attribute_write + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ ├── name: :a= + │ ├── message_loc: (3,4)-(3,5) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,8)-(3,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (3,8)-(3,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ConstantPathWriteNode (location: (5,0)-(5,10)) + │ ├── target: + │ │ @ ConstantPathNode (location: (5,0)-(5,6)) + │ │ ├── parent: + │ │ │ @ CallNode (location: (5,0)-(5,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (5,0)-(5,3) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (5,5)-(5,6)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (5,3)-(5,5) = "::" + │ ├── operator_loc: (5,7)-(5,8) = "=" + │ └── value: + │ @ IntegerNode (location: (5,9)-(5,10)) + │ ├── flags: decimal + │ └── value: 1 + └── @ CallNode (location: (7,0)-(7,10)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (7,0)-(7,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,0)-(7,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (7,3)-(7,5) = "::" + ├── name: :a= + ├── message_loc: (7,5)-(7,6) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (7,9)-(7,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (7,9)-(7,10)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_attr_asgn_conditional.txt b/test/mri/prism/snapshots/whitequark/send_attr_asgn_conditional.txt new file mode 100644 index 00000000000..3cec95ae7cd --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_attr_asgn_conditional.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: safe_navigation, attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :b= + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_binary_op.txt b/test/mri/prism/snapshots/whitequark/send_binary_op.txt new file mode 100644 index 00000000000..540a7681dca --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_binary_op.txt @@ -0,0 +1,551 @@ +@ ProgramNode (location: (1,0)-(41,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(41,7)) + └── body: (length: 21) + ├── @ CallNode (location: (1,0)-(1,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :!= + │ ├── message_loc: (1,4)-(1,6) = "!=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :!~ + │ ├── message_loc: (3,4)-(3,6) = "!~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,7)-(3,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (3,7)-(3,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,0)-(5,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (5,0)-(5,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :% + │ ├── message_loc: (5,4)-(5,5) = "%" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(7,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (7,0)-(7,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (7,0)-(7,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :& + │ ├── message_loc: (7,4)-(7,5) = "&" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(7,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (7,6)-(7,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (9,0)-(9,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (9,0)-(9,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :* + │ ├── message_loc: (9,4)-(9,5) = "*" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,6)-(9,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (9,6)-(9,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (11,0)-(11,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (11,0)-(11,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (11,0)-(11,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :** + │ ├── message_loc: (11,4)-(11,6) = "**" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,7)-(11,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (11,7)-(11,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (13,0)-(13,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (13,0)-(13,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (13,0)-(13,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (13,4)-(13,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,6)-(13,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (13,6)-(13,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (15,0)-(15,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (15,0)-(15,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (15,0)-(15,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :- + │ ├── message_loc: (15,4)-(15,5) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,6)-(15,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (15,6)-(15,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (17,0)-(17,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (17,0)-(17,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (17,0)-(17,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :/ + │ ├── message_loc: (17,4)-(17,5) = "/" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,6)-(17,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (17,6)-(17,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (19,0)-(19,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (19,0)-(19,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (19,0)-(19,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :< + │ ├── message_loc: (19,4)-(19,5) = "<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (19,6)-(19,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (19,6)-(19,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (21,0)-(21,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (21,0)-(21,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (21,0)-(21,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<< + │ ├── message_loc: (21,4)-(21,6) = "<<" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (21,7)-(21,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (21,7)-(21,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (23,0)-(23,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (23,0)-(23,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (23,0)-(23,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<= + │ ├── message_loc: (23,4)-(23,6) = "<=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (23,7)-(23,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (23,7)-(23,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (25,0)-(25,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (25,0)-(25,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (25,0)-(25,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :<=> + │ ├── message_loc: (25,4)-(25,7) = "<=>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (25,8)-(25,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (25,8)-(25,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (27,0)-(27,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (27,0)-(27,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (27,0)-(27,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :== + │ ├── message_loc: (27,4)-(27,6) = "==" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (27,7)-(27,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (27,7)-(27,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (29,0)-(29,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (29,0)-(29,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (29,0)-(29,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :=== + │ ├── message_loc: (29,4)-(29,7) = "===" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (29,8)-(29,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (29,8)-(29,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (31,0)-(31,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (31,0)-(31,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (31,0)-(31,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :=~ + │ ├── message_loc: (31,4)-(31,6) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (31,7)-(31,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (31,7)-(31,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (33,0)-(33,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (33,0)-(33,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (33,0)-(33,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :> + │ ├── message_loc: (33,4)-(33,5) = ">" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (33,6)-(33,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (33,6)-(33,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (35,0)-(35,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (35,0)-(35,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (35,0)-(35,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :>= + │ ├── message_loc: (35,4)-(35,6) = ">=" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (35,7)-(35,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (35,7)-(35,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (37,0)-(37,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (37,0)-(37,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (37,0)-(37,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :>> + │ ├── message_loc: (37,4)-(37,6) = ">>" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,7)-(37,8)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (37,7)-(37,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (39,0)-(39,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (39,0)-(39,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (39,0)-(39,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :^ + │ ├── message_loc: (39,4)-(39,5) = "^" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (39,6)-(39,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (39,6)-(39,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (41,0)-(41,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (41,0)-(41,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (41,0)-(41,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :| + ├── message_loc: (41,4)-(41,5) = "|" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (41,6)-(41,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (41,6)-(41,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_block_chain_cmd.txt b/test/mri/prism/snapshots/whitequark/send_block_chain_cmd.txt new file mode 100644 index 00000000000..4013888882b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_block_chain_cmd.txt @@ -0,0 +1,325 @@ +@ ProgramNode (location: (1,0)-(13,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,23)) + └── body: (length: 7) + ├── @ CallNode (location: (1,0)-(1,21)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (1,0)-(1,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,7)-(1,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,7)-(1,9) = "do" + │ │ └── closing_loc: (1,10)-(1,13) = "end" + │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ ├── name: :fun + │ ├── message_loc: (1,14)-(1,17) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,18)-(1,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,18)-(1,21)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,18)-(1,21) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,28)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (3,0)-(3,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,5)-(3,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,5)-(3,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (3,7)-(3,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (3,7)-(3,9) = "do" + │ │ └── closing_loc: (3,10)-(3,13) = "end" + │ ├── call_operator_loc: (3,13)-(3,14) = "." + │ ├── name: :fun + │ ├── message_loc: (3,14)-(3,17) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,18)-(3,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,18)-(3,21)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,18)-(3,21) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,22)-(3,28)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (3,22)-(3,24) = "do" + │ └── closing_loc: (3,25)-(3,28) = "end" + ├── @ CallNode (location: (5,0)-(5,20)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,0)-(5,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (5,0)-(5,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,5)-(5,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,5)-(5,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (5,7)-(5,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (5,7)-(5,9) = "do" + │ │ └── closing_loc: (5,10)-(5,13) = "end" + │ ├── call_operator_loc: (5,13)-(5,14) = "." + │ ├── name: :fun + │ ├── message_loc: (5,14)-(5,17) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,18)-(5,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (5,18)-(5,19) = "{" + │ └── closing_loc: (5,19)-(5,20) = "}" + ├── @ CallNode (location: (7,0)-(7,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (7,0)-(7,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (7,0)-(7,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,5)-(7,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,5)-(7,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (7,7)-(7,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (7,7)-(7,9) = "do" + │ │ └── closing_loc: (7,10)-(7,13) = "end" + │ ├── call_operator_loc: (7,13)-(7,14) = "." + │ ├── name: :fun + │ ├── message_loc: (7,14)-(7,17) = "fun" + │ ├── opening_loc: (7,17)-(7,18) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,18)-(7,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,18)-(7,21)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (7,18)-(7,21) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (7,21)-(7,22) = ")" + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,25)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (9,0)-(9,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (9,0)-(9,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,5)-(9,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (9,5)-(9,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (9,7)-(9,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (9,7)-(9,9) = "do" + │ │ └── closing_loc: (9,10)-(9,13) = "end" + │ ├── call_operator_loc: (9,13)-(9,14) = "." + │ ├── name: :fun + │ ├── message_loc: (9,14)-(9,17) = "fun" + │ ├── opening_loc: (9,17)-(9,18) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,18)-(9,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (9,18)-(9,21)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (9,18)-(9,21) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (9,21)-(9,22) = ")" + │ └── block: + │ @ BlockNode (location: (9,23)-(9,25)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (9,23)-(9,24) = "{" + │ └── closing_loc: (9,24)-(9,25) = "}" + ├── @ CallNode (location: (11,0)-(11,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (11,0)-(11,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :meth + │ │ ├── message_loc: (11,0)-(11,4) = "meth" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (11,5)-(11,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (11,5)-(11,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (11,7)-(11,13)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (11,7)-(11,9) = "do" + │ │ └── closing_loc: (11,10)-(11,13) = "end" + │ ├── call_operator_loc: (11,13)-(11,15) = "::" + │ ├── name: :fun + │ ├── message_loc: (11,15)-(11,18) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,19)-(11,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (11,19)-(11,22)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (11,19)-(11,22) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (13,0)-(13,23)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (13,0)-(13,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (13,0)-(13,4) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,5)-(13,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (13,5)-(13,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,7)-(13,13)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (13,7)-(13,9) = "do" + │ └── closing_loc: (13,10)-(13,13) = "end" + ├── call_operator_loc: (13,13)-(13,15) = "::" + ├── name: :fun + ├── message_loc: (13,15)-(13,18) = "fun" + ├── opening_loc: (13,18)-(13,19) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (13,19)-(13,22)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (13,19)-(13,22)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (13,19)-(13,22) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (13,22)-(13,23) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_block_conditional.txt b/test/mri/prism/snapshots/whitequark/send_block_conditional.txt new file mode 100644 index 00000000000..826d3c8464b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_block_conditional.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,3)-(1,5) = "&." + ├── name: :bar + ├── message_loc: (1,5)-(1,8) = "bar" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,9)-(1,11)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,9)-(1,10) = "{" + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/mri/prism/snapshots/whitequark/send_call.txt b/test/mri/prism/snapshots/whitequark/send_call.txt new file mode 100644 index 00000000000..48063e01212 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_call.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: (1,6)-(1,7) = ")" + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,8)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (3,0)-(3,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (3,3)-(3,5) = "::" + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (3,5)-(3,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (3,6)-(3,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (3,7)-(3,8) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_conditional.txt b/test/mri/prism/snapshots/whitequark/send_conditional.txt new file mode 100644 index 00000000000..7b402d9ef2f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_conditional.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_index.txt b/test/mri/prism/snapshots/whitequark/send_index.txt new file mode 100644 index 00000000000..6c9e08f2eac --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_index.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,3)-(1,9) = "[1, 2]" + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_index_asgn.txt b/test/mri/prism/snapshots/whitequark/send_index_asgn.txt new file mode 100644 index 00000000000..9d2e6efcb67 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_index_asgn.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,3)-(1,9) = "[1, 2]" + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ ├── flags: decimal + │ └── value: 3 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_index_asgn_legacy.txt b/test/mri/prism/snapshots/whitequark/send_index_asgn_legacy.txt new file mode 100644 index 00000000000..9d2e6efcb67 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_index_asgn_legacy.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,3)-(1,9) = "[1, 2]" + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ ├── flags: decimal + │ └── value: 3 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_index_cmd.txt b/test/mri/prism/snapshots/whitequark/send_index_cmd.txt new file mode 100644 index 00000000000..0a41fd051dc --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_index_cmd.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,3)-(1,10) = "[m bar]" + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,4)-(1,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,4)-(1,5) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,6)-(1,9) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (1,9)-(1,10) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_index_legacy.txt b/test/mri/prism/snapshots/whitequark/send_index_legacy.txt new file mode 100644 index 00000000000..6c9e08f2eac --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_index_legacy.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,3)-(1,9) = "[1, 2]" + ├── opening_loc: (1,3)-(1,4) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_lambda.txt b/test/mri/prism/snapshots/whitequark/send_lambda.txt new file mode 100644 index 00000000000..bf217005393 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_lambda.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(5,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,5)) + └── body: (length: 3) + ├── @ LambdaNode (location: (1,0)-(1,8)) + │ ├── locals: [] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── closing_loc: (1,7)-(1,8) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,3)-(1,4)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,3)-(1,4)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: ∅ + │ │ │ │ ├── name_loc: ∅ + │ │ │ │ └── operator_loc: (1,3)-(1,4) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: ∅ + ├── @ LambdaNode (location: (3,0)-(3,9)) + │ ├── locals: [] + │ ├── operator_loc: (3,0)-(3,2) = "->" + │ ├── opening_loc: (3,3)-(3,5) = "do" + │ ├── closing_loc: (3,6)-(3,9) = "end" + │ ├── parameters: ∅ + │ └── body: ∅ + └── @ LambdaNode (location: (5,0)-(5,5)) + ├── locals: [] + ├── operator_loc: (5,0)-(5,2) = "->" + ├── opening_loc: (5,2)-(5,3) = "{" + ├── closing_loc: (5,4)-(5,5) = "}" + ├── parameters: ∅ + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_lambda_args.txt b/test/mri/prism/snapshots/whitequark/send_lambda_args.txt new file mode 100644 index 00000000000..f61f622bdd9 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_lambda_args.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(3,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,9)) + └── body: (length: 2) + ├── @ LambdaNode (location: (1,0)-(1,10)) + │ ├── locals: [:a] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,7)-(1,8) = "{" + │ ├── closing_loc: (1,9)-(1,10) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,3)-(1,6)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,4)-(1,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,3)-(1,4) = "(" + │ │ └── closing_loc: (1,5)-(1,6) = ")" + │ └── body: ∅ + └── @ LambdaNode (location: (3,0)-(3,9)) + ├── locals: [:a] + ├── operator_loc: (3,0)-(3,2) = "->" + ├── opening_loc: (3,6)-(3,7) = "{" + ├── closing_loc: (3,8)-(3,9) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (3,2)-(3,5)) + │ ├── parameters: + │ │ @ ParametersNode (location: (3,3)-(3,4)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (3,3)-(3,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (3,2)-(3,3) = "(" + │ └── closing_loc: (3,4)-(3,5) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_lambda_args_noparen.txt b/test/mri/prism/snapshots/whitequark/send_lambda_args_noparen.txt new file mode 100644 index 00000000000..747656af6bc --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_lambda_args_noparen.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(3,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,9)) + └── body: (length: 2) + ├── @ LambdaNode (location: (1,0)-(1,11)) + │ ├── locals: [:a] + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (1,8)-(1,9) = "{" + │ ├── closing_loc: (1,10)-(1,11) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,3)-(1,7)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,3)-(1,7)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ OptionalKeywordParameterNode (location: (1,3)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,3)-(1,5) = "a:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ └── body: ∅ + └── @ LambdaNode (location: (3,0)-(3,9)) + ├── locals: [:a] + ├── operator_loc: (3,0)-(3,2) = "->" + ├── opening_loc: (3,6)-(3,7) = "{" + ├── closing_loc: (3,8)-(3,9) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (3,3)-(3,5)) + │ ├── parameters: + │ │ @ ParametersNode (location: (3,3)-(3,5)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ RequiredKeywordParameterNode (location: (3,3)-(3,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ └── name_loc: (3,3)-(3,5) = "a:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_lambda_args_shadow.txt b/test/mri/prism/snapshots/whitequark/send_lambda_args_shadow.txt new file mode 100644 index 00000000000..34a63ec5031 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_lambda_args_shadow.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,19)) + ├── locals: [:a, :foo, :bar] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,16)-(1,17) = "{" + ├── closing_loc: (1,18)-(1,19) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,15)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,4)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 2) + │ │ ├── @ BlockLocalVariableNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :foo + │ │ └── @ BlockLocalVariableNode (location: (1,11)-(1,14)) + │ │ ├── flags: ∅ + │ │ └── name: :bar + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,14)-(1,15) = ")" + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_lambda_legacy.txt b/test/mri/prism/snapshots/whitequark/send_lambda_legacy.txt new file mode 100644 index 00000000000..3a64e941b6c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_lambda_legacy.txt @@ -0,0 +1,12 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,5)) + ├── locals: [] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,2)-(1,3) = "{" + ├── closing_loc: (1,4)-(1,5) = "}" + ├── parameters: ∅ + └── body: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_op_asgn_conditional.txt b/test/mri/prism/snapshots/whitequark/send_op_asgn_conditional.txt new file mode 100644 index 00000000000..05966fc5a30 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_op_asgn_conditional.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallAndWriteNode (location: (1,0)-(1,10)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── operator_loc: (1,5)-(1,8) = "&&=" + └── value: + @ IntegerNode (location: (1,9)-(1,10)) + ├── flags: decimal + └── value: 1 diff --git a/test/mri/prism/snapshots/whitequark/send_plain.txt b/test/mri/prism/snapshots/whitequark/send_plain.txt new file mode 100644 index 00000000000..be57bee5a08 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_plain.txt @@ -0,0 +1,65 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :fun + │ ├── message_loc: (1,4)-(1,7) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,5) = "::" + │ ├── name: :Fun + │ ├── message_loc: (3,5)-(3,8) = "Fun" + │ ├── opening_loc: (3,8)-(3,9) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (3,9)-(3,10) = ")" + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,8)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,0)-(5,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,0)-(5,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (5,3)-(5,5) = "::" + ├── name: :fun + ├── message_loc: (5,5)-(5,8) = "fun" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_plain_cmd.txt b/test/mri/prism/snapshots/whitequark/send_plain_cmd.txt new file mode 100644 index 00000000000..59236e114d4 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_plain_cmd.txt @@ -0,0 +1,104 @@ +@ ProgramNode (location: (1,0)-(5,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,12)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :fun + │ ├── message_loc: (1,4)-(1,7) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,8)-(1,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,8)-(1,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,5) = "::" + │ ├── name: :Fun + │ ├── message_loc: (3,5)-(3,8) = "Fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,9)-(3,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,9)-(3,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,9)-(3,12) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,12)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,0)-(5,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,0)-(5,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (5,3)-(5,5) = "::" + ├── name: :fun + ├── message_loc: (5,5)-(5,8) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (5,9)-(5,12)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (5,9)-(5,12)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (5,9)-(5,12) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_self.txt b/test/mri/prism/snapshots/whitequark/send_self.txt new file mode 100644 index 00000000000..41fd822110c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_self.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(5,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,6)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun + │ ├── message_loc: (1,0)-(1,3) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun! + │ ├── message_loc: (3,0)-(3,4) = "fun!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (5,0)-(5,3) = "fun" + ├── opening_loc: (5,3)-(5,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (5,4)-(5,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (5,4)-(5,5)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (5,5)-(5,6) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/send_self_block.txt b/test/mri/prism/snapshots/whitequark/send_self_block.txt new file mode 100644 index 00000000000..c92935603b7 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_self_block.txt @@ -0,0 +1,75 @@ +@ ProgramNode (location: (1,0)-(7,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,10)) + └── body: (length: 4) + ├── @ CallNode (location: (1,0)-(1,10)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun + │ ├── message_loc: (1,0)-(1,3) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(1,10)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (1,7)-(1,10) = "end" + ├── @ CallNode (location: (3,0)-(3,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun + │ ├── message_loc: (3,0)-(3,3) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,4)-(3,7)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (3,4)-(3,5) = "{" + │ └── closing_loc: (3,6)-(3,7) = "}" + ├── @ CallNode (location: (5,0)-(5,9)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :fun + │ ├── message_loc: (5,0)-(5,3) = "fun" + │ ├── opening_loc: (5,3)-(5,4) = "(" + │ ├── arguments: ∅ + │ ├── closing_loc: (5,4)-(5,5) = ")" + │ └── block: + │ @ BlockNode (location: (5,6)-(5,9)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (5,6)-(5,7) = "{" + │ └── closing_loc: (5,8)-(5,9) = "}" + └── @ CallNode (location: (7,0)-(7,10)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (7,0)-(7,3) = "fun" + ├── opening_loc: (7,3)-(7,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (7,4)-(7,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (7,4)-(7,5)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (7,5)-(7,6) = ")" + └── block: + @ BlockNode (location: (7,7)-(7,10)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (7,7)-(7,8) = "{" + └── closing_loc: (7,9)-(7,10) = "}" diff --git a/test/mri/prism/snapshots/whitequark/send_unary_op.txt b/test/mri/prism/snapshots/whitequark/send_unary_op.txt new file mode 100644 index 00000000000..8ca1de79681 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/send_unary_op.txt @@ -0,0 +1,65 @@ +@ ProgramNode (location: (1,0)-(5,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,4)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,1)-(1,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,1)-(1,4) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+@ + │ ├── message_loc: (1,0)-(1,1) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,4)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,1)-(3,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,1)-(3,4) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :-@ + │ ├── message_loc: (3,0)-(3,1) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,4)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,1)-(5,4)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,1)-(5,4) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :~ + ├── message_loc: (5,0)-(5,1) = "~" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/slash_newline_in_heredocs.txt b/test/mri/prism/snapshots/whitequark/slash_newline_in_heredocs.txt new file mode 100644 index 00000000000..8d6fce2ba96 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/slash_newline_in_heredocs.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(8,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,4)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,4)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,4) = "<<-E" + │ ├── content_loc: (2,0)-(5,0) = " 1 \\\n 2\n 3\n" + │ ├── closing_loc: (5,0)-(6,0) = "E\n" + │ └── unescaped: " 1 2\n 3\n" + └── @ InterpolatedStringNode (location: (8,0)-(8,4)) + ├── opening_loc: (8,0)-(8,4) = "<<~E" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (9,0)-(10,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (9,0)-(10,0) = " 1 \\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "1 " + │ ├── @ StringNode (location: (10,0)-(11,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (10,0)-(11,0) = " 2\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "2\n" + │ └── @ StringNode (location: (11,0)-(12,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (11,0)-(12,0) = " 3\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "3\n" + └── closing_loc: (12,0)-(13,0) = "E\n" diff --git a/test/mri/prism/snapshots/whitequark/space_args_arg.txt b/test/mri/prism/snapshots/whitequark/space_args_arg.txt new file mode 100644 index 00000000000..55750d2b615 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_arg.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,0)-(1,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,7)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,6)-(1,7) = ")" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/space_args_arg_block.txt b/test/mri/prism/snapshots/whitequark/space_args_arg_block.txt new file mode 100644 index 00000000000..a6224bcca10 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_arg_block.txt @@ -0,0 +1,109 @@ +@ ProgramNode (location: (1,0)-(5,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,10)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,14)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,0)-(1,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :fun + │ ├── message_loc: (1,4)-(1,7) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (1,8)-(1,11)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,9)-(1,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,12)-(1,14)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,12)-(1,13) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── @ CallNode (location: (3,0)-(3,15)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,0)-(3,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,0)-(3,3) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (3,3)-(3,5) = "::" + │ ├── name: :fun + │ ├── message_loc: (3,5)-(3,8) = "fun" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,9)-(3,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (3,9)-(3,12)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,10)-(3,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,10)-(3,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (3,9)-(3,10) = "(" + │ │ └── closing_loc: (3,11)-(3,12) = ")" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,13)-(3,15)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (3,13)-(3,14) = "{" + │ └── closing_loc: (3,14)-(3,15) = "}" + └── @ CallNode (location: (5,0)-(5,10)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (5,0)-(5,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (5,4)-(5,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (5,4)-(5,7)) + │ ├── body: + │ │ @ StatementsNode (location: (5,5)-(5,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (5,5)-(5,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (5,4)-(5,5) = "(" + │ └── closing_loc: (5,6)-(5,7) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (5,8)-(5,10)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (5,8)-(5,9) = "{" + └── closing_loc: (5,9)-(5,10) = "}" diff --git a/test/mri/prism/snapshots/whitequark/space_args_arg_call.txt b/test/mri/prism/snapshots/whitequark/space_args_arg_call.txt new file mode 100644 index 00000000000..767b099a8bb --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_arg_call.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,0)-(1,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ParenthesesNode (location: (1,4)-(1,7)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ ├── call_operator_loc: (1,7)-(1,8) = "." + │ ├── name: :to_i + │ ├── message_loc: (1,8)-(1,12) = "to_i" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/space_args_arg_newline.txt b/test/mri/prism/snapshots/whitequark/space_args_arg_newline.txt new file mode 100644 index 00000000000..7727a5ddd9a --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_arg_newline.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,1)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,0)-(1,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(2,1)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(2,1)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (2,0)-(2,1) = ")" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/space_args_block.txt b/test/mri/prism/snapshots/whitequark/space_args_block.txt new file mode 100644 index 00000000000..62b549a674c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_block.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,0)-(1,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,6)) + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,5)-(1,6) = ")" + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,9)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,8)-(1,9) = "}" diff --git a/test/mri/prism/snapshots/whitequark/space_args_cmd.txt b/test/mri/prism/snapshots/whitequark/space_args_cmd.txt new file mode 100644 index 00000000000..8a75bef6a88 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/space_args_cmd.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :fun + ├── message_loc: (1,0)-(1,3) = "fun" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,11)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,5)-(1,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :f + │ │ ├── message_loc: (1,5)-(1,6) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,7)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,7)-(1,10) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,10)-(1,11) = ")" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/string___FILE__.txt b/test/mri/prism/snapshots/whitequark/string___FILE__.txt new file mode 100644 index 00000000000..a12499a6310 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/string___FILE__.txt @@ -0,0 +1,8 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ SourceFileNode (location: (1,0)-(1,8)) + ├── flags: ∅ + └── filepath: "whitequark/string___FILE__.txt" diff --git a/test/mri/prism/snapshots/whitequark/string_concat.txt b/test/mri/prism/snapshots/whitequark/string_concat.txt new file mode 100644 index 00000000000..38ea0c745dd --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/string_concat.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,14)) + ├── opening_loc: ∅ + ├── parts: (length: 2) + │ ├── @ InterpolatedStringNode (location: (1,0)-(1,8)) + │ │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (1,1)-(1,4) = "foo" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "foo" + │ │ │ └── @ EmbeddedVariableNode (location: (1,4)-(1,7)) + │ │ │ ├── operator_loc: (1,4)-(1,5) = "#" + │ │ │ └── variable: + │ │ │ @ InstanceVariableReadNode (location: (1,5)-(1,7)) + │ │ │ └── name: :@a + │ │ └── closing_loc: (1,7)-(1,8) = "\"" + │ └── @ StringNode (location: (1,9)-(1,14)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,9)-(1,10) = "\"" + │ ├── content_loc: (1,10)-(1,13) = "bar" + │ ├── closing_loc: (1,13)-(1,14) = "\"" + │ └── unescaped: "bar" + └── closing_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/string_dvar.txt b/test/mri/prism/snapshots/whitequark/string_dvar.txt new file mode 100644 index 00000000000..123b36e01d9 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/string_dvar.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,14)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 5) + │ ├── @ EmbeddedVariableNode (location: (1,1)-(1,4)) + │ │ ├── operator_loc: (1,1)-(1,2) = "#" + │ │ └── variable: + │ │ @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ │ └── name: :@a + │ ├── @ StringNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,4)-(1,5) = " " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " " + │ ├── @ EmbeddedVariableNode (location: (1,5)-(1,9)) + │ │ ├── operator_loc: (1,5)-(1,6) = "#" + │ │ └── variable: + │ │ @ ClassVariableReadNode (location: (1,6)-(1,9)) + │ │ └── name: :@@a + │ ├── @ StringNode (location: (1,9)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,9)-(1,10) = " " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " " + │ └── @ EmbeddedVariableNode (location: (1,10)-(1,13)) + │ ├── operator_loc: (1,10)-(1,11) = "#" + │ └── variable: + │ @ GlobalVariableReadNode (location: (1,11)-(1,13)) + │ └── name: :$a + └── closing_loc: (1,13)-(1,14) = "\"" diff --git a/test/mri/prism/snapshots/whitequark/string_interp.txt b/test/mri/prism/snapshots/whitequark/string_interp.txt new file mode 100644 index 00000000000..a83323a0868 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/string_interp.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,14)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,4) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── @ EmbeddedStatementsNode (location: (1,4)-(1,10)) + │ │ ├── opening_loc: (1,4)-(1,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,6)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,6)-(1,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,9)-(1,10) = "}" + │ └── @ StringNode (location: (1,10)-(1,13)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,10)-(1,13) = "baz" + │ ├── closing_loc: ∅ + │ └── unescaped: "baz" + └── closing_loc: (1,13)-(1,14) = "\"" diff --git a/test/mri/prism/snapshots/whitequark/string_plain.txt b/test/mri/prism/snapshots/whitequark/string_plain.txt new file mode 100644 index 00000000000..7534ac1844b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/string_plain.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,3) = "%q(" + │ ├── content_loc: (1,3)-(1,9) = "foobar" + │ ├── closing_loc: (1,9)-(1,10) = ")" + │ └── unescaped: "foobar" + └── @ StringNode (location: (3,0)-(3,8)) + ├── flags: ∅ + ├── opening_loc: (3,0)-(3,1) = "'" + ├── content_loc: (3,1)-(3,7) = "foobar" + ├── closing_loc: (3,7)-(3,8) = "'" + └── unescaped: "foobar" diff --git a/test/mri/prism/snapshots/whitequark/super.txt b/test/mri/prism/snapshots/whitequark/super.txt new file mode 100644 index 00000000000..132b4912e4c --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/super.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(5,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,10)) + └── body: (length: 3) + ├── @ SuperNode (location: (1,0)-(1,9)) + │ ├── keyword_loc: (1,0)-(1,5) = "super" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,6)-(1,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── rparen_loc: ∅ + │ └── block: ∅ + ├── @ SuperNode (location: (3,0)-(3,7)) + │ ├── keyword_loc: (3,0)-(3,5) = "super" + │ ├── lparen_loc: (3,5)-(3,6) = "(" + │ ├── arguments: ∅ + │ ├── rparen_loc: (3,6)-(3,7) = ")" + │ └── block: ∅ + └── @ SuperNode (location: (5,0)-(5,10)) + ├── keyword_loc: (5,0)-(5,5) = "super" + ├── lparen_loc: (5,5)-(5,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (5,6)-(5,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (5,6)-(5,9)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,6)-(5,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rparen_loc: (5,9)-(5,10) = ")" + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/super_block.txt b/test/mri/prism/snapshots/whitequark/super_block.txt new file mode 100644 index 00000000000..d9ce7b86be8 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/super_block.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(3,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,21)) + └── body: (length: 2) + ├── @ ForwardingSuperNode (location: (1,0)-(1,12)) + │ └── block: + │ @ BlockNode (location: (1,6)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,6)-(1,8) = "do" + │ └── closing_loc: (1,9)-(1,12) = "end" + └── @ SuperNode (location: (3,0)-(3,21)) + ├── keyword_loc: (3,0)-(3,5) = "super" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (3,6)-(3,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (3,6)-(3,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,6)-(3,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ CallNode (location: (3,11)-(3,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,11)-(3,14) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rparen_loc: ∅ + └── block: + @ BlockNode (location: (3,15)-(3,21)) + ├── locals: [] + ├── parameters: ∅ + ├── body: ∅ + ├── opening_loc: (3,15)-(3,17) = "do" + └── closing_loc: (3,18)-(3,21) = "end" diff --git a/test/mri/prism/snapshots/whitequark/symbol_interp.txt b/test/mri/prism/snapshots/whitequark/symbol_interp.txt new file mode 100644 index 00000000000..c108adddc73 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/symbol_interp.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ InterpolatedSymbolNode (location: (1,0)-(1,15)) + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,2)-(1,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,2)-(1,5) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── @ EmbeddedStatementsNode (location: (1,5)-(1,11)) + │ │ ├── opening_loc: (1,5)-(1,7) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,7)-(1,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,7)-(1,10) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,10)-(1,11) = "}" + │ └── @ StringNode (location: (1,11)-(1,14)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,11)-(1,14) = "baz" + │ ├── closing_loc: ∅ + │ └── unescaped: "baz" + └── closing_loc: (1,14)-(1,15) = "\"" diff --git a/test/mri/prism/snapshots/whitequark/symbol_plain.txt b/test/mri/prism/snapshots/whitequark/symbol_plain.txt new file mode 100644 index 00000000000..a2466600f57 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/symbol_plain.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ SymbolNode (location: (1,0)-(1,6)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,0)-(1,2) = ":'" + │ ├── value_loc: (1,2)-(1,5) = "foo" + │ ├── closing_loc: (1,5)-(1,6) = "'" + │ └── unescaped: "foo" + └── @ SymbolNode (location: (3,0)-(3,4)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (3,0)-(3,1) = ":" + ├── value_loc: (3,1)-(3,4) = "foo" + ├── closing_loc: ∅ + └── unescaped: "foo" diff --git a/test/mri/prism/snapshots/whitequark/ternary.txt b/test/mri/prism/snapshots/whitequark/ternary.txt new file mode 100644 index 00000000000..fa637ffb4e0 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ternary.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,11)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (1,4)-(1,5) = "?" + ├── statements: + │ @ StatementsNode (location: (1,6)-(1,7)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── consequent: + │ @ ElseNode (location: (1,8)-(1,11)) + │ ├── else_keyword_loc: (1,8)-(1,9) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/ternary_ambiguous_symbol.txt b/test/mri/prism/snapshots/whitequark/ternary_ambiguous_symbol.txt new file mode 100644 index 00000000000..833afcff42b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/ternary_ambiguous_symbol.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [:t] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,3)) + │ ├── name: :t + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,1) = "t" + │ ├── value: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,1)-(1,2) = "=" + └── @ IfNode (location: (1,4)-(1,13)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ ParenthesesNode (location: (1,4)-(1,9)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,5)-(1,8)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,5)-(1,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,8)-(1,9) = ")" + ├── then_keyword_loc: (1,9)-(1,10) = "?" + ├── statements: + │ @ StatementsNode (location: (1,10)-(1,11)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,10)-(1,11)) + │ ├── name: :t + │ └── depth: 0 + ├── consequent: + │ @ ElseNode (location: (1,11)-(1,13)) + │ ├── else_keyword_loc: (1,11)-(1,12) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (1,12)-(1,13)) + │ │ └── body: (length: 1) + │ │ └── @ ConstantReadNode (location: (1,12)-(1,13)) + │ │ └── name: :T + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/trailing_forward_arg.txt b/test/mri/prism/snapshots/whitequark/trailing_forward_arg.txt new file mode 100644 index 00000000000..e12dad132bb --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/trailing_forward_arg.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,40)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,40)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,40)) + ├── name: :foo + ├── name_loc: (1,4)-(1,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,17)) + │ ├── requireds: (length: 2) + │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── name: :b + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,14)-(1,17)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,35)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,35)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,20)-(1,23) = "bar" + │ ├── opening_loc: (1,23)-(1,24) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,24)-(1,34)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ LocalVariableReadNode (location: (1,24)-(1,25)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── @ IntegerNode (location: (1,27)-(1,29)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ └── @ ForwardingArgumentsNode (location: (1,31)-(1,34)) + │ ├── closing_loc: (1,34)-(1,35) = ")" + │ └── block: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,17)-(1,18) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,37)-(1,40) = "end" diff --git a/test/mri/prism/snapshots/whitequark/true.txt b/test/mri/prism/snapshots/whitequark/true.txt new file mode 100644 index 00000000000..3e1ceef586d --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/true.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ TrueNode (location: (1,0)-(1,4)) diff --git a/test/mri/prism/snapshots/whitequark/unary_num_pow_precedence.txt b/test/mri/prism/snapshots/whitequark/unary_num_pow_precedence.txt new file mode 100644 index 00000000000..e14b0567e74 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/unary_num_pow_precedence.txt @@ -0,0 +1,80 @@ +@ ProgramNode (location: (1,0)-(5,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,10)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ FloatNode (location: (1,0)-(1,4)) + │ │ └── value: 2.0 + │ ├── call_operator_loc: ∅ + │ ├── name: :** + │ ├── message_loc: (1,5)-(1,7) = "**" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (3,1)-(3,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (3,1)-(3,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :** + │ │ ├── message_loc: (3,3)-(3,5) = "**" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,6)-(3,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,6)-(3,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 10 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :-@ + │ ├── message_loc: (3,0)-(3,1) = "-" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (5,1)-(5,10)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ FloatNode (location: (5,1)-(5,4)) + │ │ └── value: 2.0 + │ ├── call_operator_loc: ∅ + │ ├── name: :** + │ ├── message_loc: (5,5)-(5,7) = "**" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,8)-(5,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,8)-(5,10)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :-@ + ├── message_loc: (5,0)-(5,1) = "-" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/undef.txt b/test/mri/prism/snapshots/whitequark/undef.txt new file mode 100644 index 00000000000..5e6b5c7b769 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/undef.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ UndefNode (location: (1,0)-(1,27)) + ├── names: (length: 3) + │ ├── @ SymbolNode (location: (1,6)-(1,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,6)-(1,9) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── @ SymbolNode (location: (1,11)-(1,15)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,11)-(1,12) = ":" + │ │ ├── value_loc: (1,12)-(1,15) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ InterpolatedSymbolNode (location: (1,17)-(1,27)) + │ ├── opening_loc: (1,17)-(1,19) = ":\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,19)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (1,19)-(1,22) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ EmbeddedStatementsNode (location: (1,22)-(1,26)) + │ │ ├── opening_loc: (1,22)-(1,24) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,24)-(1,25)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,24)-(1,25)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── closing_loc: (1,25)-(1,26) = "}" + │ └── closing_loc: (1,26)-(1,27) = "\"" + └── keyword_loc: (1,0)-(1,5) = "undef" diff --git a/test/mri/prism/snapshots/whitequark/unless.txt b/test/mri/prism/snapshots/whitequark/unless.txt new file mode 100644 index 00000000000..a3bbbe69c81 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/unless.txt @@ -0,0 +1,63 @@ +@ ProgramNode (location: (1,0)-(3,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,20)) + └── body: (length: 2) + ├── @ UnlessNode (location: (1,0)-(1,24)) + │ ├── keyword_loc: (1,0)-(1,6) = "unless" + │ ├── predicate: + │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,7)-(1,10) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,11)-(1,15) = "then" + │ ├── statements: + │ │ @ StatementsNode (location: (1,16)-(1,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,16)-(1,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,16)-(1,19) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (1,21)-(1,24) = "end" + └── @ UnlessNode (location: (3,0)-(3,20)) + ├── keyword_loc: (3,0)-(3,6) = "unless" + ├── predicate: + │ @ CallNode (location: (3,7)-(3,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,7)-(3,10) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (3,12)-(3,15)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,12)-(3,15)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,12)-(3,15) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (3,17)-(3,20) = "end" diff --git a/test/mri/prism/snapshots/whitequark/unless_else.txt b/test/mri/prism/snapshots/whitequark/unless_else.txt new file mode 100644 index 00000000000..f4f95379e50 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/unless_else.txt @@ -0,0 +1,95 @@ +@ ProgramNode (location: (1,0)-(3,30)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,30)) + └── body: (length: 2) + ├── @ UnlessNode (location: (1,0)-(1,34)) + │ ├── keyword_loc: (1,0)-(1,6) = "unless" + │ ├── predicate: + │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,7)-(1,10) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,11)-(1,15) = "then" + │ ├── statements: + │ │ @ StatementsNode (location: (1,16)-(1,19)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,16)-(1,19)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,16)-(1,19) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── consequent: + │ │ @ ElseNode (location: (1,21)-(1,34)) + │ │ ├── else_keyword_loc: (1,21)-(1,25) = "else" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,26)-(1,29)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,26)-(1,29)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (1,26)-(1,29) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: (1,31)-(1,34) = "end" + │ └── end_keyword_loc: (1,31)-(1,34) = "end" + └── @ UnlessNode (location: (3,0)-(3,30)) + ├── keyword_loc: (3,0)-(3,6) = "unless" + ├── predicate: + │ @ CallNode (location: (3,7)-(3,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,7)-(3,10) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (3,12)-(3,15)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (3,12)-(3,15)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,12)-(3,15) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: + │ @ ElseNode (location: (3,17)-(3,30)) + │ ├── else_keyword_loc: (3,17)-(3,21) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (3,22)-(3,25)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,22)-(3,25)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :baz + │ │ ├── message_loc: (3,22)-(3,25) = "baz" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── end_keyword_loc: (3,27)-(3,30) = "end" + └── end_keyword_loc: (3,27)-(3,30) = "end" diff --git a/test/mri/prism/snapshots/whitequark/unless_mod.txt b/test/mri/prism/snapshots/whitequark/unless_mod.txt new file mode 100644 index 00000000000..d4dfda6b2ce --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/unless_mod.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ UnlessNode (location: (1,0)-(1,14)) + ├── keyword_loc: (1,4)-(1,10) = "unless" + ├── predicate: + │ @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,11)-(1,14) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,0)-(1,3) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + └── end_keyword_loc: ∅ diff --git a/test/mri/prism/snapshots/whitequark/until.txt b/test/mri/prism/snapshots/whitequark/until.txt new file mode 100644 index 00000000000..e5f60a2cf7b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/until.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(3,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,19)) + └── body: (length: 2) + ├── @ UntilNode (location: (1,0)-(1,21)) + │ ├── flags: ∅ + │ ├── keyword_loc: (1,0)-(1,5) = "until" + │ ├── closing_loc: (1,18)-(1,21) = "end" + │ ├── predicate: + │ │ @ CallNode (location: (1,6)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,6)-(1,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (1,13)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,17)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,13)-(1,17) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ UntilNode (location: (3,0)-(3,19)) + ├── flags: ∅ + ├── keyword_loc: (3,0)-(3,5) = "until" + ├── closing_loc: (3,16)-(3,19) = "end" + ├── predicate: + │ @ CallNode (location: (3,6)-(3,9)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,6)-(3,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (3,11)-(3,15)) + └── body: (length: 1) + └── @ CallNode (location: (3,11)-(3,15)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :meth + ├── message_loc: (3,11)-(3,15) = "meth" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/until_mod.txt b/test/mri/prism/snapshots/whitequark/until_mod.txt new file mode 100644 index 00000000000..0b7e2360b55 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/until_mod.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ UntilNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── keyword_loc: (1,5)-(1,10) = "until" + ├── closing_loc: ∅ + ├── predicate: + │ @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,11)-(1,14) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :meth + ├── message_loc: (1,0)-(1,4) = "meth" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/until_post.txt b/test/mri/prism/snapshots/whitequark/until_post.txt new file mode 100644 index 00000000000..5b282c363ba --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/until_post.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ UntilNode (location: (1,0)-(1,24)) + ├── flags: begin_modifier + ├── keyword_loc: (1,15)-(1,20) = "until" + ├── closing_loc: ∅ + ├── predicate: + │ @ CallNode (location: (1,21)-(1,24)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,21)-(1,24) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,14)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,6)-(1,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,6)-(1,10) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,11)-(1,14) = "end" diff --git a/test/mri/prism/snapshots/whitequark/var_and_asgn.txt b/test/mri/prism/snapshots/whitequark/var_and_asgn.txt new file mode 100644 index 00000000000..a3c90f804cf --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/var_and_asgn.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ LocalVariableAndWriteNode (location: (1,0)-(1,7)) + ├── name_loc: (1,0)-(1,1) = "a" + ├── operator_loc: (1,2)-(1,5) = "&&=" + ├── value: + │ @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── name: :a + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/var_op_asgn.txt b/test/mri/prism/snapshots/whitequark/var_op_asgn.txt new file mode 100644 index 00000000000..f423a62dee9 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/var_op_asgn.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(7,23)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(7,23)) + └── body: (length: 4) + ├── @ ClassVariableOperatorWriteNode (location: (1,0)-(1,11)) + │ ├── name: :@@var + │ ├── name_loc: (1,0)-(1,5) = "@@var" + │ ├── operator_loc: (1,6)-(1,8) = "|=" + │ ├── value: + │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator: :| + ├── @ InstanceVariableOperatorWriteNode (location: (3,0)-(3,7)) + │ ├── name: :@a + │ ├── name_loc: (3,0)-(3,2) = "@a" + │ ├── operator_loc: (3,3)-(3,5) = "|=" + │ ├── value: + │ │ @ IntegerNode (location: (3,6)-(3,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator: :| + ├── @ LocalVariableOperatorWriteNode (location: (5,0)-(5,6)) + │ ├── name_loc: (5,0)-(5,1) = "a" + │ ├── operator_loc: (5,2)-(5,4) = "+=" + │ ├── value: + │ │ @ IntegerNode (location: (5,5)-(5,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── name: :a + │ ├── operator: :+ + │ └── depth: 0 + └── @ DefNode (location: (7,0)-(7,23)) + ├── name: :a + ├── name_loc: (7,4)-(7,5) = "a" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (7,7)-(7,18)) + │ └── body: (length: 1) + │ └── @ ClassVariableOperatorWriteNode (location: (7,7)-(7,18)) + │ ├── name: :@@var + │ ├── name_loc: (7,7)-(7,12) = "@@var" + │ ├── operator_loc: (7,13)-(7,15) = "|=" + │ ├── value: + │ │ @ IntegerNode (location: (7,16)-(7,18)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator: :| + ├── locals: [] + ├── def_keyword_loc: (7,0)-(7,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (7,20)-(7,23) = "end" diff --git a/test/mri/prism/snapshots/whitequark/var_op_asgn_cmd.txt b/test/mri/prism/snapshots/whitequark/var_op_asgn_cmd.txt new file mode 100644 index 00000000000..d56c099c7ee --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/var_op_asgn_cmd.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableOperatorWriteNode (location: (1,0)-(1,12)) + ├── name_loc: (1,0)-(1,3) = "foo" + ├── operator_loc: (1,4)-(1,6) = "+=" + ├── value: + │ @ CallNode (location: (1,7)-(1,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (1,7)-(1,8) = "m" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,9)-(1,12)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── name: :foo + ├── operator: :+ + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/var_or_asgn.txt b/test/mri/prism/snapshots/whitequark/var_or_asgn.txt new file mode 100644 index 00000000000..a0531d2c306 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/var_or_asgn.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ LocalVariableOrWriteNode (location: (1,0)-(1,7)) + ├── name_loc: (1,0)-(1,1) = "a" + ├── operator_loc: (1,2)-(1,5) = "||=" + ├── value: + │ @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── name: :a + └── depth: 0 diff --git a/test/mri/prism/snapshots/whitequark/when_multi.txt b/test/mri/prism/snapshots/whitequark/when_multi.txt new file mode 100644 index 00000000000..1c399b642dc --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/when_multi.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,37)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,37)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,37)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,5)-(1,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,10)-(1,32)) + │ ├── keyword_loc: (1,10)-(1,14) = "when" + │ ├── conditions: (length: 2) + │ │ ├── @ StringNode (location: (1,15)-(1,20)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: (1,15)-(1,16) = "'" + │ │ │ ├── content_loc: (1,16)-(1,19) = "bar" + │ │ │ ├── closing_loc: (1,19)-(1,20) = "'" + │ │ │ └── unescaped: "bar" + │ │ └── @ StringNode (location: (1,22)-(1,27)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: (1,22)-(1,23) = "'" + │ │ ├── content_loc: (1,23)-(1,26) = "baz" + │ │ ├── closing_loc: (1,26)-(1,27) = "'" + │ │ └── unescaped: "baz" + │ ├── then_keyword_loc: ∅ + │ └── statements: + │ @ StatementsNode (location: (1,29)-(1,32)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,29)-(1,32)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,29)-(1,32) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,34)-(1,37) = "end" diff --git a/test/mri/prism/snapshots/whitequark/when_splat.txt b/test/mri/prism/snapshots/whitequark/when_splat.txt new file mode 100644 index 00000000000..351631714e0 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/when_splat.txt @@ -0,0 +1,72 @@ +@ ProgramNode (location: (1,0)-(1,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,43)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,43)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,5)-(1,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 2) + │ ├── @ WhenNode (location: (1,10)-(1,27)) + │ │ ├── keyword_loc: (1,10)-(1,14) = "when" + │ │ ├── conditions: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,15)-(1,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ SplatNode (location: (1,18)-(1,22)) + │ │ │ ├── operator_loc: (1,18)-(1,19) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (1,19)-(1,22)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (1,19)-(1,22) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: ∅ + │ │ └── statements: + │ │ @ StatementsNode (location: (1,24)-(1,27)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,24)-(1,27)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,24)-(1,27) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ WhenNode (location: (1,29)-(1,38)) + │ ├── keyword_loc: (1,29)-(1,33) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ SplatNode (location: (1,34)-(1,38)) + │ │ ├── operator_loc: (1,34)-(1,35) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (1,35)-(1,38)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,35)-(1,38) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: ∅ + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,40)-(1,43) = "end" diff --git a/test/mri/prism/snapshots/whitequark/when_then.txt b/test/mri/prism/snapshots/whitequark/when_then.txt new file mode 100644 index 00000000000..eb6f261ba43 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/when_then.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,34)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,34)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,34)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,5)-(1,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,10)-(1,29)) + │ ├── keyword_loc: (1,10)-(1,14) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ StringNode (location: (1,15)-(1,20)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: (1,15)-(1,16) = "'" + │ │ ├── content_loc: (1,16)-(1,19) = "bar" + │ │ ├── closing_loc: (1,19)-(1,20) = "'" + │ │ └── unescaped: "bar" + │ ├── then_keyword_loc: (1,21)-(1,25) = "then" + │ └── statements: + │ @ StatementsNode (location: (1,26)-(1,29)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,26)-(1,29)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (1,26)-(1,29) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,31)-(1,34) = "end" diff --git a/test/mri/prism/snapshots/whitequark/while.txt b/test/mri/prism/snapshots/whitequark/while.txt new file mode 100644 index 00000000000..72f9971fe55 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/while.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(3,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,19)) + └── body: (length: 2) + ├── @ WhileNode (location: (1,0)-(1,21)) + │ ├── flags: ∅ + │ ├── keyword_loc: (1,0)-(1,5) = "while" + │ ├── closing_loc: (1,18)-(1,21) = "end" + │ ├── predicate: + │ │ @ CallNode (location: (1,6)-(1,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (1,6)-(1,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── statements: + │ @ StatementsNode (location: (1,13)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,17)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,13)-(1,17) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ WhileNode (location: (3,0)-(3,19)) + ├── flags: ∅ + ├── keyword_loc: (3,0)-(3,5) = "while" + ├── closing_loc: (3,16)-(3,19) = "end" + ├── predicate: + │ @ CallNode (location: (3,6)-(3,9)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,6)-(3,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (3,11)-(3,15)) + └── body: (length: 1) + └── @ CallNode (location: (3,11)-(3,15)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :meth + ├── message_loc: (3,11)-(3,15) = "meth" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/while_mod.txt b/test/mri/prism/snapshots/whitequark/while_mod.txt new file mode 100644 index 00000000000..50a8f84d813 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/while_mod.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ WhileNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── keyword_loc: (1,5)-(1,10) = "while" + ├── closing_loc: ∅ + ├── predicate: + │ @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,11)-(1,14) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :meth + ├── message_loc: (1,0)-(1,4) = "meth" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/mri/prism/snapshots/whitequark/while_post.txt b/test/mri/prism/snapshots/whitequark/while_post.txt new file mode 100644 index 00000000000..63c6c84a247 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/while_post.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ WhileNode (location: (1,0)-(1,24)) + ├── flags: begin_modifier + ├── keyword_loc: (1,15)-(1,20) = "while" + ├── closing_loc: ∅ + ├── predicate: + │ @ CallNode (location: (1,21)-(1,24)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,21)-(1,24) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(1,14)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (1,6)-(1,10)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :meth + │ ├── message_loc: (1,6)-(1,10) = "meth" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (1,11)-(1,14) = "end" diff --git a/test/mri/prism/snapshots/whitequark/xstring_interp.txt b/test/mri/prism/snapshots/whitequark/xstring_interp.txt new file mode 100644 index 00000000000..e9543098c2b --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/xstring_interp.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ InterpolatedXStringNode (location: (1,0)-(1,14)) + ├── opening_loc: (1,0)-(1,1) = "`" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,4) = "foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── @ EmbeddedStatementsNode (location: (1,4)-(1,10)) + │ │ ├── opening_loc: (1,4)-(1,6) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,6)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (1,6)-(1,9) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,9)-(1,10) = "}" + │ └── @ StringNode (location: (1,10)-(1,13)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,10)-(1,13) = "baz" + │ ├── closing_loc: ∅ + │ └── unescaped: "baz" + └── closing_loc: (1,13)-(1,14) = "`" diff --git a/test/mri/prism/snapshots/whitequark/xstring_plain.txt b/test/mri/prism/snapshots/whitequark/xstring_plain.txt new file mode 100644 index 00000000000..97084286d98 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/xstring_plain.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ XStringNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "`" + ├── content_loc: (1,1)-(1,7) = "foobar" + ├── closing_loc: (1,7)-(1,8) = "`" + └── unescaped: "foobar" diff --git a/test/mri/prism/snapshots/whitequark/yield.txt b/test/mri/prism/snapshots/whitequark/yield.txt new file mode 100644 index 00000000000..2b37dd479f9 --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/yield.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(7,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,10)) + └── body: (length: 4) + ├── @ YieldNode (location: (1,0)-(1,5)) + │ ├── keyword_loc: (1,0)-(1,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (3,0)-(3,9)) + │ ├── keyword_loc: (3,0)-(3,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,6)-(3,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,6)-(3,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (3,6)-(3,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (5,0)-(5,7)) + │ ├── keyword_loc: (5,0)-(5,5) = "yield" + │ ├── lparen_loc: (5,5)-(5,6) = "(" + │ ├── arguments: ∅ + │ └── rparen_loc: (5,6)-(5,7) = ")" + └── @ YieldNode (location: (7,0)-(7,10)) + ├── keyword_loc: (7,0)-(7,5) = "yield" + ├── lparen_loc: (7,5)-(7,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (7,6)-(7,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (7,6)-(7,9)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,6)-(7,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── rparen_loc: (7,9)-(7,10) = ")" diff --git a/test/mri/prism/snapshots/whitequark/zsuper.txt b/test/mri/prism/snapshots/whitequark/zsuper.txt new file mode 100644 index 00000000000..9c28128d06f --- /dev/null +++ b/test/mri/prism/snapshots/whitequark/zsuper.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ForwardingSuperNode (location: (1,0)-(1,5)) + └── block: ∅ diff --git a/test/mri/prism/snapshots/xstring.txt b/test/mri/prism/snapshots/xstring.txt new file mode 100644 index 00000000000..04b4cbf6ea7 --- /dev/null +++ b/test/mri/prism/snapshots/xstring.txt @@ -0,0 +1,67 @@ +@ ProgramNode (location: (1,0)-(13,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,4)) + └── body: (length: 6) + ├── @ XStringNode (location: (1,0)-(1,7)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,3) = "%x[" + │ ├── content_loc: (1,3)-(1,6) = "foo" + │ ├── closing_loc: (1,6)-(1,7) = "]" + │ └── unescaped: "foo" + ├── @ InterpolatedXStringNode (location: (3,0)-(3,16)) + │ ├── opening_loc: (3,0)-(3,1) = "`" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (3,1)-(3,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,1)-(3,5) = "foo " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo " + │ │ ├── @ EmbeddedStatementsNode (location: (3,5)-(3,11)) + │ │ │ ├── opening_loc: (3,5)-(3,7) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,7)-(3,10)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,7)-(3,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (3,7)-(3,10) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (3,10)-(3,11) = "}" + │ │ └── @ StringNode (location: (3,11)-(3,15)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,11)-(3,15) = " baz" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " baz" + │ └── closing_loc: (3,15)-(3,16) = "`" + ├── @ XStringNode (location: (5,0)-(5,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (5,0)-(5,1) = "`" + │ ├── content_loc: (5,1)-(5,4) = "foo" + │ ├── closing_loc: (5,4)-(5,5) = "`" + │ └── unescaped: "foo" + ├── @ XStringNode (location: (7,0)-(9,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (7,0)-(7,3) = "%x{" + │ ├── content_loc: (7,3)-(9,0) = "\n foo\n" + │ ├── closing_loc: (9,0)-(9,1) = "}" + │ └── unescaped: "\n foo\n" + ├── @ XStringNode (location: (11,0)-(11,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (11,0)-(11,1) = "`" + │ ├── content_loc: (11,1)-(11,1) = "" + │ ├── closing_loc: (11,1)-(11,2) = "`" + │ └── unescaped: "" + └── @ XStringNode (location: (13,0)-(13,4)) + ├── flags: ∅ + ├── opening_loc: (13,0)-(13,3) = "%x{" + ├── content_loc: (13,3)-(13,3) = "" + ├── closing_loc: (13,3)-(13,4) = "}" + └── unescaped: "" diff --git a/test/mri/prism/snapshots/xstring_with_backslash.txt b/test/mri/prism/snapshots/xstring_with_backslash.txt new file mode 100644 index 00000000000..7e0fa1ab5f9 --- /dev/null +++ b/test/mri/prism/snapshots/xstring_with_backslash.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ XStringNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "`" + ├── content_loc: (1,1)-(1,5) = "f\\oo" + ├── closing_loc: (1,5)-(1,6) = "`" + └── unescaped: "foo" diff --git a/test/mri/prism/snapshots/yield.txt b/test/mri/prism/snapshots/yield.txt new file mode 100644 index 00000000000..896dbac13f0 --- /dev/null +++ b/test/mri/prism/snapshots/yield.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(7,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,14)) + └── body: (length: 4) + ├── @ YieldNode (location: (1,0)-(1,5)) + │ ├── keyword_loc: (1,0)-(1,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (3,0)-(3,7)) + │ ├── keyword_loc: (3,0)-(3,5) = "yield" + │ ├── lparen_loc: (3,5)-(3,6) = "(" + │ ├── arguments: ∅ + │ └── rparen_loc: (3,6)-(3,7) = ")" + ├── @ YieldNode (location: (5,0)-(5,8)) + │ ├── keyword_loc: (5,0)-(5,5) = "yield" + │ ├── lparen_loc: (5,5)-(5,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── rparen_loc: (5,7)-(5,8) = ")" + └── @ YieldNode (location: (7,0)-(7,14)) + ├── keyword_loc: (7,0)-(7,5) = "yield" + ├── lparen_loc: (7,5)-(7,6) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (7,6)-(7,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (7,6)-(7,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (7,9)-(7,10)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (7,12)-(7,13)) + │ ├── flags: decimal + │ └── value: 3 + └── rparen_loc: (7,13)-(7,14) = ")" diff --git a/test/mri/prism/static_inspect_test.rb b/test/mri/prism/static_inspect_test.rb new file mode 100644 index 00000000000..41301693e3b --- /dev/null +++ b/test/mri/prism/static_inspect_test.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if Prism::BACKEND == :FFI + +module Prism + class StaticInspectTest < TestCase + def test_false + assert_equal "false", static_inspect("false") + end + + def test_float + assert_equal "0.25", static_inspect("0.25") + assert_equal "5.125", static_inspect("5.125") + + assert_equal "0.0", static_inspect("0.0") + assert_equal "-0.0", static_inspect("-0.0") + + assert_equal "1.0e+100", static_inspect("1e100") + assert_equal "-1.0e+100", static_inspect("-1e100") + + assert_equal "Infinity", static_inspect("1e1000") + assert_equal "-Infinity", static_inspect("-1e1000") + end + + def test_imaginary + assert_equal "(0+1i)", static_inspect("1i") + assert_equal "(0-1i)", static_inspect("-1i") + end + + def test_integer + assert_equal "1000", static_inspect("1_0_0_0") + assert_equal "10000000000000000000000000000", static_inspect("1_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0") + end + + def test_nil + assert_equal "nil", static_inspect("nil") + end + + def test_rational + assert_equal "(0/1)", static_inspect("0r") + assert_equal "(1/1)", static_inspect("1r") + assert_equal "(1/1)", static_inspect("1.0r") + assert_equal "(77777/1000)", static_inspect("77.777r") + end + + def test_regular_expression + assert_equal "/.*/", static_inspect("/.*/") + assert_equal "/.*/i", static_inspect("/.*/i") + assert_equal "/.*/", static_inspect("/.*/u") + assert_equal "/.*/n", static_inspect("/.*/un") + end + + def test_source_encoding + assert_equal "#", static_inspect("__ENCODING__") + assert_equal "#", static_inspect("__ENCODING__", encoding: "Shift_JIS") + end + + def test_source_file + assert_equal __FILE__.inspect, static_inspect("__FILE__", filepath: __FILE__, frozen_string_literal: true) + end + + def test_source_line + assert_equal "1", static_inspect("__LINE__") + assert_equal "5", static_inspect("__LINE__", line: 5) + end + + def test_string + assert_equal "\"\"", static_inspect('""', frozen_string_literal: true) + assert_equal "\"Hello, World!\"", static_inspect('"Hello, World!"', frozen_string_literal: true) + assert_equal "\"\\a\"", static_inspect("\"\\a\"", frozen_string_literal: true) + end + + def test_symbol + assert_equal ":foo", static_inspect(":foo") + assert_equal ":foo", static_inspect("%s[foo]") + end + + def test_true + assert_equal "true", static_inspect("true") + end + + private + + def static_inspect(source, **options) + Debug.static_inspect(source, **options) + end + end +end diff --git a/test/mri/prism/static_literals_test.rb b/test/mri/prism/static_literals_test.rb new file mode 100644 index 00000000000..26699319741 --- /dev/null +++ b/test/mri/prism/static_literals_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class StaticLiteralsTest < TestCase + def test_static_literals + assert_warning("1") + assert_warning("0xA", "10", "10") + assert_warning("0o10", "8", "8") + assert_warning("0b10", "2", "2") + assert_warning("1_000", "1000", "1000") + assert_warning((2**32).to_s(10), "0x#{(2**32).to_s(16)}", (2**32).to_s(10)) + assert_warning((2**64).to_s(10), "0x#{(2**64).to_s(16)}", (2**64).to_s(10)) + + refute_warning("1", "-1") + refute_warning((2**32).to_s(10), "-0x#{(2**32).to_s(16)}") + refute_warning((2**64).to_s(10), "-0x#{(2**64).to_s(16)}") + + assert_warning("__LINE__", "2", "2") + assert_warning("3", "__LINE__", "3") + + assert_warning("1.0") + assert_warning("1e2", "100.0", "100.0") + + assert_warning("1r", "1r", "(1/1)") + assert_warning("1.0r", "1.0r", "(1/1)") + + assert_warning("1i", "1i", "(0+1i)") + assert_warning("1.0i", "1.0i", "(0+1.0i)") + + assert_warning("1ri", "1ri", "(0+(1/1)*i)") + assert_warning("1.0ri", "1.0ri", "(0+(1/1)*i)") + + assert_warning("\"#{__FILE__}\"") + assert_warning("\"foo\"") + + assert_warning("/foo/") + + refute_warning("/foo/", "/foo/i") + + assert_warning(":foo") + assert_warning("%s[foo]", ":foo", ":foo") + + assert_warning("true") + assert_warning("false") + assert_warning("nil") + assert_warning("__ENCODING__", "__ENCODING__", "#") + end + + private + + def parse_warnings(left, right) + warnings = [] + + warnings << Prism.parse(<<~RUBY, filepath: __FILE__).warnings.first + { + #{left} => 1, + #{right} => 2 + } + RUBY + + warnings << Prism.parse(<<~RUBY, filepath: __FILE__).warnings.first + case foo + when #{left} + when #{right} + end + RUBY + + warnings + end + + def assert_warning(left, right = left, message = left) + hash_keys, when_clauses = parse_warnings(left, right) + + assert_include hash_keys.message, message + assert_include hash_keys.message, "line 3" + assert_include when_clauses.message, "line 3" + end + + def refute_warning(left, right) + assert_empty parse_warnings(left, right).compact + end + end +end diff --git a/test/mri/prism/test_helper.rb b/test/mri/prism/test_helper.rb new file mode 100644 index 00000000000..28b0725d6f0 --- /dev/null +++ b/test/mri/prism/test_helper.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +require "prism" +require "ripper" +require "pp" +require "test/unit" +require "tempfile" + +puts "Using prism backend: #{Prism::BACKEND}" if ENV["PRISM_FFI_BACKEND"] + +# It is useful to have a diff even if the strings to compare are big +# However, ruby/ruby does not have a version of Test::Unit with access to +# max_diff_target_string_size +if defined?(Test::Unit::Assertions::AssertionMessage) + Test::Unit::Assertions::AssertionMessage.max_diff_target_string_size = 5000 +end + +module Prism + class TestCase < ::Test::Unit::TestCase + private + + def assert_raises(*args, &block) + raise "Use assert_raise instead" + end + + def assert_equal_nodes(expected, actual, compare_location: true, parent: nil) + assert_equal expected.class, actual.class + + case expected + when Array + assert_equal( + expected.size, + actual.size, + -> { "Arrays were different sizes. Parent: #{parent.pretty_inspect}" } + ) + + expected.zip(actual).each do |(expected_element, actual_element)| + assert_equal_nodes( + expected_element, + actual_element, + compare_location: compare_location, + parent: actual + ) + end + when SourceFileNode + expected_deconstruct = expected.deconstruct_keys(nil) + actual_deconstruct = actual.deconstruct_keys(nil) + assert_equal expected_deconstruct.keys, actual_deconstruct.keys + + # Filepaths can be different if test suites were run on different + # machines. We accommodate for this by comparing the basenames, and not + # the absolute filepaths. + expected_filepath = expected_deconstruct.delete(:filepath) + actual_filepath = actual_deconstruct.delete(:filepath) + + assert_equal expected_deconstruct, actual_deconstruct + assert_equal File.basename(expected_filepath), File.basename(actual_filepath) + when Node + deconstructed_expected = expected.deconstruct_keys(nil) + deconstructed_actual = actual.deconstruct_keys(nil) + assert_equal deconstructed_expected.keys, deconstructed_actual.keys + + deconstructed_expected.each_key do |key| + assert_equal_nodes( + deconstructed_expected[key], + deconstructed_actual[key], + compare_location: compare_location, + parent: actual + ) + end + when Location + assert_operator actual.start_offset, :<=, actual.end_offset, -> { + "start_offset > end_offset for #{actual.inspect}, parent is #{parent.pretty_inspect}" + } + + if compare_location + assert_equal( + expected.start_offset, + actual.start_offset, + -> { "Start locations were different. Parent: #{parent.pretty_inspect}" } + ) + + assert_equal( + expected.end_offset, + actual.end_offset, + -> { "End locations were different. Parent: #{parent.pretty_inspect}" } + ) + end + else + assert_equal expected, actual + end + end + end +end diff --git a/test/mri/prism/unescape_test.rb b/test/mri/prism/unescape_test.rb new file mode 100644 index 00000000000..2a352c52347 --- /dev/null +++ b/test/mri/prism/unescape_test.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +return if RUBY_VERSION < "3.1.0" || Prism::BACKEND == :FFI + +module Prism + class UnescapeTest < TestCase + module Context + class Base + attr_reader :left, :right + + def initialize(left, right) + @left = left + @right = right + end + + def name + "#{left}#{right}".delete("\n") + end + + private + + def code(escape) + "#{left}\\#{escape}#{right}".b + end + + def ruby(escape) + previous, $VERBOSE = $VERBOSE, nil + + begin + yield eval(code(escape)) + rescue SyntaxError + :error + ensure + $VERBOSE = previous + end + end + + def prism(escape) + result = Prism.parse(code(escape)) + + if result.success? + yield result.value.statements.body.first + else + :error + end + end + + def `(command) + command + end + end + + class List < Base + def ruby_result(escape) + ruby(escape) { |value| value.first.to_s } + end + + def prism_result(escape) + prism(escape) { |node| node.elements.first.unescaped } + end + end + + class Symbol < Base + def ruby_result(escape) + ruby(escape, &:to_s) + end + + def prism_result(escape) + prism(escape, &:unescaped) + end + end + + class String < Base + def ruby_result(escape) + ruby(escape, &:itself) + end + + def prism_result(escape) + prism(escape, &:unescaped) + end + end + + class Heredoc < Base + def ruby_result(escape) + ruby(escape, &:itself) + end + + def prism_result(escape) + prism(escape) do |node| + case node.type + when :interpolated_string_node, :interpolated_x_string_node + node.parts.flat_map(&:unescaped).join + else + node.unescaped + end + end + end + end + + class RegExp < Base + def ruby_result(escape) + ruby(escape, &:source) + end + + def prism_result(escape) + prism(escape, &:unescaped) + end + end + end + + def test_char; assert_context(Context::String.new("?", "")); end + def test_sqte; assert_context(Context::String.new("'", "'")); end + def test_dqte; assert_context(Context::String.new("\"", "\"")); end + def test_lwrq; assert_context(Context::String.new("%q[", "]")); end + def test_uprq; assert_context(Context::String.new("%Q[", "]")); end + def test_dstr; assert_context(Context::String.new("%[", "]")); end + def test_xstr; assert_context(Context::String.new("`", "`")); end + def test_lwrx; assert_context(Context::String.new("%x[", "]")); end + def test_h0_1; assert_context(Context::String.new("<")); end + def test_uprw; assert_context(Context::List.new("%W[", "]")); end + def test_lwri; assert_context(Context::List.new("%i[", "]")); end + def test_upri; assert_context(Context::List.new("%I[", "]")); end + def test_lwrs; assert_context(Context::Symbol.new("%s[", "]")); end + def test_sym1; assert_context(Context::Symbol.new(":'", "'")); end + def test_sym2; assert_context(Context::Symbol.new(":\"", "\"")); end + def test_reg1; assert_context(Context::RegExp.new("/", "/")); end + def test_reg2; assert_context(Context::RegExp.new("%r[", "]")); end + def test_reg3; assert_context(Context::RegExp.new("%r<", ">")); end + def test_reg4; assert_context(Context::RegExp.new("%r{", "}")); end + def test_reg5; assert_context(Context::RegExp.new("%r(", ")")); end + def test_reg6; assert_context(Context::RegExp.new("%r|", "|")); end + + private + + def assert_context(context) + octal = [*("0".."7")] + hex = [*("a".."f"), *("A".."F"), *("0".."9")] + + (0...256).each do |ord| + # I think this might be a bug in Ruby. + next if context.name == "?" && ord == 0xFF + + # We don't currently support scanning for the number of capture groups + # to validate backreferences so these are all going to fail. + next if (context.name == "//" || context.name.start_with?("%r")) && ord.chr.start_with?(/\d/) + + # \a \b \c ... + assert_unescape(context, ord.chr) + end + + # \\r\n + assert_unescape(context, "\r\n") + + # We don't currently support scanning for the number of capture groups to + # validate backreferences so these are all going to fail. + if context.name != "//" && !context.name.start_with?("%r") + # \00 \01 \02 ... + octal.product(octal).each { |digits| assert_unescape(context, digits.join) } + + # \000 \001 \002 ... + octal.product(octal).product(octal).each { |digits| assert_unescape(context, digits.join) } + end + + # \x0 \x1 \x2 ... + hex.each { |digit| assert_unescape(context, "x#{digit}") } + + # \x00 \x01 \x02 ... + hex.product(hex).each { |digits| assert_unescape(context, "x#{digits.join}") } + + # \u0000 \u0001 \u0002 ... + assert_unescape(context, "u#{["5"].concat(hex.sample(3)).join}") + + # The behavior of whitespace in the middle of these escape sequences + # changed in Ruby 3.3.0, so we only want to test against latest. + if RUBY_VERSION >= "3.3.0" + # \u{00 00} ... + assert_unescape(context, "u{00#{["5"].concat(hex.sample(3)).join} \t\v 00#{["5"].concat(hex.sample(3)).join}}") + end + + (0...128).each do |ord| + chr = ord.chr + next if chr == "\\" || !chr.match?(/[[:print:]]/) + + # \C-a \C-b \C-c ... + assert_unescape(context, "C-#{chr}") + + # \ca \cb \cc ... + assert_unescape(context, "c#{chr}") + + # \M-a \M-b \M-c ... + assert_unescape(context, "M-#{chr}") + + # \M-\C-a \M-\C-b \M-\C-c ... + assert_unescape(context, "M-\\C-#{chr}") + + # \M-\ca \M-\cb \M-\cc ... + assert_unescape(context, "M-\\c#{chr}") + + # \c\M-a \c\M-b \c\M-c ... + assert_unescape(context, "c\\M-#{chr}") + end + end + + def assert_unescape(context, escape) + expected = context.ruby_result(escape) + actual = context.prism_result(escape) + + message = -> do + "Expected #{context.name} to unescape #{escape.inspect} to " \ + "#{expected.inspect}, but got #{actual.inspect}" + end + + if expected == :error || actual == :error + assert_equal expected, actual, message + else + assert_equal expected.bytes, actual.bytes, message + end + end + end +end diff --git a/test/mri/prism/version_test.rb b/test/mri/prism/version_test.rb new file mode 100644 index 00000000000..29ee6b224cc --- /dev/null +++ b/test/mri/prism/version_test.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +module Prism + class VersionTest < TestCase + def test_version_is_set + refute_nil VERSION + end + end +end diff --git a/test/mri/prism/warnings_test.rb b/test/mri/prism/warnings_test.rb new file mode 100644 index 00000000000..4da2af626a2 --- /dev/null +++ b/test/mri/prism/warnings_test.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +return if RUBY_VERSION < "3.1" + +require_relative "test_helper" +require "stringio" + +module Prism + class WarningsTest < TestCase + def test_ambiguous_uminus + assert_warning("a -b", "ambiguous first argument") + end + + def test_ambiguous_uplus + assert_warning("a +b", "ambiguous first argument") + end + + def test_ambiguous_ustar + assert_warning("a *b", "argument prefix") + end + + def test_ambiguous_regexp + assert_warning("a /b/", "wrap regexp in parentheses") + end + + def test_equal_in_conditional + assert_warning("if a = 1; end", "should be ==") + end + + def test_dot_dot_dot_eol + assert_warning("foo...", "... at EOL") + assert_warning("def foo(...) = bar ...", "... at EOL") + + assert_warning("foo... #", "... at EOL") + assert_warning("foo... \t\v\f\n", "... at EOL") + + refute_warning("p foo...bar") + refute_warning("p foo... bar") + end + + def test_END_in_method + assert_warning("def foo; END {}; end", "END in method") + end + + def test_duplicated_hash_key + assert_warning("{ a: 1, a: 2 }", "duplicated and overwritten") + end + + def test_duplicated_when_clause + assert_warning("case 1; when 1, 1; end", "clause with line") + end + + def test_float_out_of_range + assert_warning("1.0e100000", "out of range") + end + + def test_integer_in_flip_flop + assert_warning("1 if 2..foo", "integer") + end + + def test_keyword_eol + assert_warning("if\ntrue; end", "end of line") + assert_warning("if true\nelsif\nfalse; end", "end of line") + end + + def test_string_in_predicate + assert_warning("if 'foo'; end", "string") + assert_warning("if \"\#{foo}\"; end", "string") + assert_warning("if __FILE__; end", "string") + end + + def test_symbol_in_predicate + assert_warning("if :foo; end", "symbol") + assert_warning("if :\"\#{foo}\"; end", "symbol") + end + + def test_literal_in_predicate + assert_warning("if __LINE__; end", "literal") + assert_warning("if __ENCODING__; end", "literal") + assert_warning("if 1; end", "literal") + assert_warning("if 1.0; end", "literal") + assert_warning("if 1r; end", "literal") + assert_warning("if 1i; end", "literal") + end + + def test_regexp_in_predicate + assert_warning("if /foo/; end", "regex") + assert_warning("if /foo\#{bar}/; end", "regex") + end + + private + + def assert_warning(source, message) + warnings = Prism.parse(source).warnings + + assert_equal 1, warnings.length + assert_include warnings.first.message, message + + if defined?(RubyVM::AbstractSyntaxTree) + assert_include capture_warning { RubyVM::AbstractSyntaxTree.parse(source) }, message + end + end + + def refute_warning(source) + assert_empty Prism.parse(source).warnings + + if defined?(RubyVM::AbstractSyntaxTree) + assert_empty capture_warning { RubyVM::AbstractSyntaxTree.parse(source) } + end + end + + def capture_warning + stderr, $stderr, verbose, $VERBOSE = $stderr, StringIO.new, $VERBOSE, true + + begin + yield + $stderr.string + ensure + $stderr, $VERBOSE = stderr, verbose + end + end + end +end diff --git a/test/mri/psych/test_numeric.rb b/test/mri/psych/test_numeric.rb index 9c75c016cd4..4c012e4562e 100644 --- a/test/mri/psych/test_numeric.rb +++ b/test/mri/psych/test_numeric.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true require_relative 'helper' -require 'bigdecimal' +begin + require 'bigdecimal' +rescue LoadError +end module Psych ### @@ -29,13 +32,13 @@ def test_non_float_with_0 def test_big_decimal_tag decimal = BigDecimal("12.34") assert_match "!ruby/object:BigDecimal", Psych.dump(decimal) - end + end if defined?(BigDecimal) def test_big_decimal_round_trip decimal = BigDecimal("12.34") $DEBUG = false assert_cycle decimal - end + end if defined?(BigDecimal) def test_does_not_attempt_numeric str = Psych.load('--- 4 roses') diff --git a/test/mri/psych/test_object_references.rb b/test/mri/psych/test_object_references.rb index 269d72242e0..86bb9034b9b 100644 --- a/test/mri/psych/test_object_references.rb +++ b/test/mri/psych/test_object_references.rb @@ -39,7 +39,7 @@ def assert_reference_trip obj rescue Psych::DisallowedClass data = Psych.unsafe_load yml end - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_float_references @@ -49,7 +49,7 @@ def test_float_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_binary_references @@ -60,7 +60,7 @@ def test_binary_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_regexp_references @@ -70,7 +70,7 @@ def test_regexp_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end end end diff --git a/test/mri/psych/test_parser.rb b/test/mri/psych/test_parser.rb index 3b67a8eab14..c1e0abb89d0 100644 --- a/test/mri/psych/test_parser.rb +++ b/test/mri/psych/test_parser.rb @@ -384,6 +384,25 @@ def test_event_location [:end_stream, [2, 0, 2, 0]]], events end + if Psych::Parser.method_defined?(:code_point_limit) + def test_code_point_limit + yaml = "foo: bar\n" * 500_000 + assert_raise(org.snakeyaml.engine.v2.exceptions.YamlEngineException) do + Psych.load(yaml) + end + + assert_nothing_raised do + begin + old_code_point_limit, Psych::Parser.code_point_limit = Psych::Parser::code_point_limit, 5_000_000 + + Psych.load(yaml) + ensure + Psych::Parser.code_point_limit = old_code_point_limit + end + end + end + end + def assert_called call, with = nil, parser = @parser if with call = parser.handler.calls.find { |x| diff --git a/test/mri/psych/test_psych.rb b/test/mri/psych/test_psych.rb index c977e799e34..42586a87793 100644 --- a/test/mri/psych/test_psych.rb +++ b/test/mri/psych/test_psych.rb @@ -430,6 +430,32 @@ def test_safe_dump_symbols assert_match(/\A--- :foo\n(?:\.\.\.\n)?\z/, Psych.safe_dump(:foo, permitted_symbols: [:foo])) end + def test_safe_dump_stringify_names + yaml = <<-eoyml +--- +foo: + bar: bar + 'no': special escapes + 123: number +eoyml + + payload = Psych.safe_dump({ + foo: { + bar: "bar", + no: "special escapes", + 123 => "number" + } + }, stringify_names: true) + assert_equal yaml, payload + + assert_equal("---\nfoo: :bar\n", Psych.safe_dump({foo: :bar}, stringify_names: true, permitted_symbols: [:bar])) + + error = assert_raise Psych::DisallowedClass do + Psych.safe_dump({foo: :bar}, stringify_names: true) + end + assert_equal "Tried to dump unspecified class: Symbol(:bar)", error.message + end + def test_safe_dump_aliases x = [] x << x diff --git a/test/mri/psych/test_scalar_scanner.rb b/test/mri/psych/test_scalar_scanner.rb index 145db58fd95..02b923afe21 100644 --- a/test/mri/psych/test_scalar_scanner.rb +++ b/test/mri/psych/test_scalar_scanner.rb @@ -150,7 +150,7 @@ def test_scan_int_commas_and_underscores end def test_scan_strict_int_commas_and_underscores - # this test is to ensure adherance to YML spec using the 'strict_integer' option + # this test is to ensure adherence to YML spec using the 'strict_integer' option scanner = Psych::ScalarScanner.new ClassLoader.new, strict_integer: true assert_equal 123_456_789, scanner.tokenize('123_456_789') assert_equal '123,456,789', scanner.tokenize('123,456,789') diff --git a/test/mri/psych/test_set.rb b/test/mri/psych/test_set.rb index 87944d839ea..b4968d34252 100644 --- a/test/mri/psych/test_set.rb +++ b/test/mri/psych/test_set.rb @@ -46,5 +46,12 @@ def test_set_self_reference @set['self'] = @set assert_cycle(@set) end + + def test_stringify_names + @set[:symbol] = :value + + assert_match(/^:symbol: :value/, Psych.dump(@set)) + assert_match(/^symbol: :value/, Psych.dump(@set, stringify_names: true)) + end end end diff --git a/test/mri/psych/test_string.rb b/test/mri/psych/test_string.rb index 0dc34b3083d..84ae5cbb451 100644 --- a/test/mri/psych/test_string.rb +++ b/test/mri/psych/test_string.rb @@ -17,17 +17,17 @@ def initialize end end - # 'y' and 'n' are kind of ambiguous. Syck treated y and n literals in + # 'y', 'Y', 'n', 'N' are kind of ambiguous. Syck treated those literals in # YAML documents as strings. But this is not what the YAML 1.1 spec says. # YAML 1.1 says they should be treated as booleans. When we're dumping # documents, we know it's a string, so adding quotes will eliminate the # "ambiguity" in the emitted document - def test_y_is_quoted - assert_match(/"y"/, Psych.dump("y")) - end - def test_n_is_quoted - assert_match(/"n"/, Psych.dump("n")) + def test_all_yaml_1_1_booleans_are_quoted + yaml_1_1_booleans = %w[y Y yes Yes YES n N no No NO true True TRUE false False FALSE on On ON off Off OFF] # from https://yaml.org/type/bool.html + yaml_1_1_booleans.each do |boolean| + assert_match(/"#{boolean}"|'#{boolean}'/, Psych.dump(boolean)) + end end def test_string_with_newline diff --git a/test/mri/psych/visitors/test_emitter.rb b/test/mri/psych/visitors/test_emitter.rb index 70adbb9ca0a..8bcf5491cab 100644 --- a/test/mri/psych/visitors/test_emitter.rb +++ b/test/mri/psych/visitors/test_emitter.rb @@ -61,9 +61,9 @@ def test_document_implicit_end @visitor.accept s - assert_match(/key: value/, @io.string) + assert_include(@io.string, "key: value") assert_equal @io.string, s.yaml - assert(/\.\.\./ !~ s.yaml) + assert_not_include(s.yaml, "...") end def test_scalar @@ -76,7 +76,7 @@ def test_scalar @visitor.accept s - assert_match(/hello/, @io.string) + assert_include(@io.string, "hello") assert_equal @io.string, s.yaml end @@ -90,8 +90,8 @@ def test_scalar_with_tag @visitor.accept s - assert_match(/str/, @io.string) - assert_match(/hello/, @io.string) + assert_include(@io.string, "str") + assert_include(@io.string, "hello") assert_equal @io.string, s.yaml end @@ -107,7 +107,7 @@ def test_sequence @visitor.accept s - assert_match(/- hello/, @io.string) + assert_include(@io.string, "- hello") assert_equal @io.string, s.yaml end @@ -122,7 +122,7 @@ def test_mapping @visitor.accept s - assert_match(/key: value/, @io.string) + assert_include(@io.string, "key: value") assert_equal @io.string, s.yaml end @@ -137,7 +137,7 @@ def test_alias @visitor.accept s - assert_match(/&A key: \*A/, @io.string) + assert_include(@io.string, "&A key: \*A") assert_equal @io.string, s.yaml end end diff --git a/test/mri/psych/visitors/test_to_ruby.rb b/test/mri/psych/visitors/test_to_ruby.rb index 3d4608b903d..89c36766519 100644 --- a/test/mri/psych/visitors/test_to_ruby.rb +++ b/test/mri/psych/visitors/test_to_ruby.rb @@ -319,7 +319,7 @@ def test_alias list = seq.to_ruby assert_equal %w{ foo foo }, list - assert_equal list[0].object_id, list[1].object_id + assert_same list[0], list[1] end def test_mapping_with_str_tag diff --git a/test/mri/psych/visitors/test_yaml_tree.rb b/test/mri/psych/visitors/test_yaml_tree.rb index 4c48670f2f4..01e685134ae 100644 --- a/test/mri/psych/visitors/test_yaml_tree.rb +++ b/test/mri/psych/visitors/test_yaml_tree.rb @@ -34,7 +34,7 @@ def test_yaml_tree_can_take_an_emitter v << "hello world" v.finish - assert_match "hello world", io.string + assert_include io.string, "hello world" end def test_binary_formatting @@ -167,9 +167,9 @@ def test_float end def test_string - assert_match(/'017'/, Psych.dump({'a' => '017'})) - assert_match(/'019'/, Psych.dump({'a' => '019'})) - assert_match(/'01818'/, Psych.dump({'a' => '01818'})) + assert_include(Psych.dump({'a' => '017'}), "'017'") + assert_include(Psych.dump({'a' => '019'}), "'019'") + assert_include(Psych.dump({'a' => '01818'}), "'01818'") end # http://yaml.org/type/null.html diff --git a/test/mri/racc/assets/cadenza.y b/test/mri/racc/assets/cadenza.y deleted file mode 100644 index 1940ead2251..00000000000 --- a/test/mri/racc/assets/cadenza.y +++ /dev/null @@ -1,170 +0,0 @@ -# This grammar is released under an MIT license -# Author: William Howard (http://github.com/whoward) -# Source: https://github.com/whoward/cadenza/blob/master/src/cadenza.y - -class Cadenza::RaccParser - -/* expect this many shift/reduce conflicts */ -expect 37 - -rule - target - : document - | /* none */ { result = nil } - ; - - parameter_list - : logical_expression { result = [val[0]] } - | parameter_list ',' logical_expression { result = val[0].push(val[2]) } - ; - - /* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */ - primary_expression - : IDENTIFIER { result = VariableNode.new(val[0].value) } - | IDENTIFIER parameter_list { result = VariableNode.new(val[0].value, val[1]) } - | INTEGER { result = ConstantNode.new(val[0].value) } - | REAL { result = ConstantNode.new(val[0].value) } - | STRING { result = ConstantNode.new(val[0].value) } - | '(' filtered_expression ')' { result = val[1] } - ; - - multiplicative_expression - : primary_expression - | multiplicative_expression '*' primary_expression { result = OperationNode.new(val[0], "*", val[2]) } - | multiplicative_expression '/' primary_expression { result = OperationNode.new(val[0], "/", val[2]) } - ; - - additive_expression - : multiplicative_expression - | additive_expression '+' multiplicative_expression { result = OperationNode.new(val[0], "+", val[2]) } - | additive_expression '-' multiplicative_expression { result = OperationNode.new(val[0], "-", val[2]) } - ; - - boolean_expression - : additive_expression - | boolean_expression OP_EQ additive_expression { result = OperationNode.new(val[0], "==", val[2]) } - | boolean_expression OP_NEQ additive_expression { result = OperationNode.new(val[0], "!=", val[2]) } - | boolean_expression OP_LEQ additive_expression { result = OperationNode.new(val[0], "<=", val[2]) } - | boolean_expression OP_GEQ additive_expression { result = OperationNode.new(val[0], ">=", val[2]) } - | boolean_expression '>' additive_expression { result = OperationNode.new(val[0], ">", val[2]) } - | boolean_expression '<' additive_expression { result = OperationNode.new(val[0], "<", val[2]) } - ; - - inverse_expression - : boolean_expression - | NOT boolean_expression { result = BooleanInverseNode.new(val[1]) } - ; - - logical_expression - : inverse_expression - | logical_expression AND inverse_expression { result = OperationNode.new(val[0], "and", val[2]) } - | logical_expression OR inverse_expression { result = OperationNode.new(val[0], "or", val[2]) } - ; - - filter - : IDENTIFIER { result = FilterNode.new(val[0].value) } - | IDENTIFIER ':' parameter_list { result = FilterNode.new(val[0].value, val[2]) } - ; - - filter_list - : filter { result = [val[0]] } - | filter_list '|' filter { result = val[0].push(val[2]) } - ; - - filtered_expression - : logical_expression - | logical_expression '|' filter_list { result = FilteredValueNode.new(val[0], val[2]) } - ; - - inject_statement - : VAR_OPEN filtered_expression VAR_CLOSE { result = val[1] } - ; - - if_tag - : STMT_OPEN IF logical_expression STMT_CLOSE { open_scope!; result = val[2] } - | STMT_OPEN UNLESS logical_expression STMT_CLOSE { open_scope!; result = BooleanInverseNode.new(val[2]) } - ; - - else_tag - : STMT_OPEN ELSE STMT_CLOSE { result = close_scope!; open_scope! } - ; - - end_if_tag - : STMT_OPEN ENDIF STMT_CLOSE { result = close_scope! } - | STMT_OPEN ENDUNLESS STMT_CLOSE { result = close_scope! } - ; - - if_block - : if_tag end_if_tag { result = IfNode.new(val[0], val[1]) } - | if_tag document end_if_tag { result = IfNode.new(val[0], val[2]) } - | if_tag else_tag document end_if_tag { result = IfNode.new(val[0], val[1], val[3]) } - | if_tag document else_tag end_if_tag { result = IfNode.new(val[0], val[2], val[3]) } - | if_tag document else_tag document end_if_tag { result = IfNode.new(val[0], val[2], val[4]) } - ; - - for_tag - : STMT_OPEN FOR IDENTIFIER IN filtered_expression STMT_CLOSE { open_scope!; result = [val[2].value, val[4]] } - ; - - end_for_tag - : STMT_OPEN ENDFOR STMT_CLOSE { result = close_scope! } - ; - - /* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */ - for_block - : for_tag end_for_tag { result = ForNode.new(VariableNode.new(val[0].first), val[0].last, val[1]) } - | for_tag document end_for_tag { result = ForNode.new(VariableNode.new(val[0].first), val[0].last, val[2]) } - ; - - block_tag - : STMT_OPEN BLOCK IDENTIFIER STMT_CLOSE { result = open_block_scope!(val[2].value) } - ; - - end_block_tag - : STMT_OPEN ENDBLOCK STMT_CLOSE { result = close_block_scope! } - ; - - /* this has a shift/reduce conflict but since Racc will shift in this case it is the correct behavior */ - block_block - : block_tag end_block_tag { result = BlockNode.new(val[0], val[1]) } - | block_tag document end_block_tag { result = BlockNode.new(val[0], val[2]) } - ; - - generic_block_tag - : STMT_OPEN IDENTIFIER STMT_CLOSE { open_scope!; result = [val[1].value, []] } - | STMT_OPEN IDENTIFIER parameter_list STMT_CLOSE { open_scope!; result = [val[1].value, val[2]] } - ; - - end_generic_block_tag - : STMT_OPEN END STMT_CLOSE { result = close_scope! } - ; - - generic_block - : generic_block_tag document end_generic_block_tag { result = GenericBlockNode.new(val[0].first, val[2], val[0].last) } - ; - - extends_statement - : STMT_OPEN EXTENDS STRING STMT_CLOSE { result = val[2].value } - | STMT_OPEN EXTENDS IDENTIFIER STMT_CLOSE { result = VariableNode.new(val[2].value) } - ; - - document_component - : TEXT_BLOCK { result = TextNode.new(val[0].value) } - | inject_statement - | if_block - | for_block - | generic_block - | block_block - ; - - document - : document_component { push val[0] } - | document document_component { push val[1] } - | extends_statement { document.extends = val[0] } - | document extends_statement { document.extends = val[1] } - ; - ----- header ---- -# racc_parser.rb : generated by racc - ----- inner ---- diff --git a/test/mri/racc/assets/cast.y b/test/mri/racc/assets/cast.y deleted file mode 100644 index d180c09e141..00000000000 --- a/test/mri/racc/assets/cast.y +++ /dev/null @@ -1,926 +0,0 @@ -# The MIT License -# -# Copyright (c) George Ogata -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -class C::Parser -# shift/reduce conflict on "if (c) if (c) ; else ; else ;" -expect 1 -rule - -# A.2.4 External definitions - -# Returns TranslationUnit -translation_unit - : external_declaration {result = TranslationUnit.new_at(val[0].pos, NodeChain[val[0]])} - | translation_unit external_declaration {result = val[0]; result.entities << val[1]} - -# Returns Declaration|FunctionDef -external_declaration - : function_definition {result = val[0]} - | declaration {result = val[0]} - -# Returns FunctionDef -function_definition - : declaration_specifiers declarator declaration_list compound_statement {result = make_function_def(val[0][0], val[0][1], val[1], val[2], val[3])} - | declaration_specifiers declarator compound_statement {result = make_function_def(val[0][0], val[0][1], val[1], nil , val[2])} - -# Returns [Declaration] -declaration_list - : declaration {result = [val[0]]} - | declaration_list declaration {result = val[0] << val[1]} - -# A.2.3 Statements - -# Returns Statement -statement - : labeled_statement {result = val[0]} - | compound_statement {result = val[0]} - | expression_statement {result = val[0]} - | selection_statement {result = val[0]} - | iteration_statement {result = val[0]} - | jump_statement {result = val[0]} - -# Returns Statement -labeled_statement - : identifier COLON statement {val[2].labels.unshift(PlainLabel.new_at(val[0].pos, val[0].val)); result = val[2]} - | CASE constant_expression COLON statement {val[3].labels.unshift(Case .new_at(val[0].pos, val[1] )); result = val[3]} - | DEFAULT COLON statement {val[2].labels.unshift(Default .new_at(val[0].pos )); result = val[2]} - # type names can also be used as labels - | typedef_name COLON statement {val[2].labels.unshift(PlainLabel.new_at(val[0].pos, val[0].name)); result = val[2]} - -# Returns Block -compound_statement - : LBRACE block_item_list RBRACE {result = Block.new_at(val[0].pos, val[1])} - | LBRACE RBRACE {result = Block.new_at(val[0].pos )} - -# Returns NodeChain[Declaration|Statement] -block_item_list - : block_item {result = NodeChain[val[0]]} - | block_item_list block_item {result = val[0] << val[1]} - -# Returns Declaration|Statement -block_item - : declaration {result = val[0]} - | statement {result = val[0]} - -# Returns ExpressionStatement -expression_statement - : expression SEMICOLON {result = ExpressionStatement.new_at(val[0].pos, val[0])} - | SEMICOLON {result = ExpressionStatement.new_at(val[0].pos )} - -# Returns Statement -selection_statement - : IF LPAREN expression RPAREN statement {result = If .new_at(val[0].pos, val[2], val[4] )} - | IF LPAREN expression RPAREN statement ELSE statement {result = If .new_at(val[0].pos, val[2], val[4], val[6])} - | SWITCH LPAREN expression RPAREN statement {result = Switch.new_at(val[0].pos, val[2], val[4] )} - -# Returns Statement -iteration_statement - : WHILE LPAREN expression RPAREN statement {result = While.new_at(val[0].pos, val[2], val[4] )} - | DO statement WHILE LPAREN expression RPAREN SEMICOLON {result = While.new_at(val[0].pos, val[4], val[1], :do => true )} - | FOR LPAREN expression SEMICOLON expression SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, val[2], val[4], val[6], val[8])} - | FOR LPAREN expression SEMICOLON expression SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, val[2], val[4], nil , val[7])} - | FOR LPAREN expression SEMICOLON SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, val[2], nil , val[5], val[7])} - | FOR LPAREN expression SEMICOLON SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, val[2], nil , nil , val[6])} - | FOR LPAREN SEMICOLON expression SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, nil , val[3], val[5], val[7])} - | FOR LPAREN SEMICOLON expression SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, nil , val[3], nil , val[6])} - | FOR LPAREN SEMICOLON SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, nil , nil , val[4], val[6])} - | FOR LPAREN SEMICOLON SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, nil , nil , nil , val[5])} - | FOR LPAREN declaration expression SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, val[2], val[3], val[5], val[7])} - | FOR LPAREN declaration expression SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, val[2], val[3], nil , val[6])} - | FOR LPAREN declaration SEMICOLON expression RPAREN statement {result = For.new_at(val[0].pos, val[2], nil , val[4], val[6])} - | FOR LPAREN declaration SEMICOLON RPAREN statement {result = For.new_at(val[0].pos, val[2], nil , nil , val[5])} - -# Returns Statement -jump_statement - : GOTO identifier SEMICOLON {result = Goto .new_at(val[0].pos, val[1].val)} - | CONTINUE SEMICOLON {result = Continue.new_at(val[0].pos )} - | BREAK SEMICOLON {result = Break .new_at(val[0].pos )} - | RETURN expression SEMICOLON {result = Return .new_at(val[0].pos, val[1] )} - | RETURN SEMICOLON {result = Return .new_at(val[0].pos )} - # type names can also be used as labels - | GOTO typedef_name SEMICOLON {result = Goto .new_at(val[0].pos, val[1].name)} - -# A.2.2 Declarations - -# Returns Declaration -declaration - : declaration_specifiers init_declarator_list SEMICOLON {result = make_declaration(val[0][0], val[0][1], val[1])} - | declaration_specifiers SEMICOLON {result = make_declaration(val[0][0], val[0][1], NodeArray[])} - -# Returns {Pos, [Symbol]} -declaration_specifiers - : storage_class_specifier declaration_specifiers {val[1][1] << val[0][1]; result = val[1]} - | storage_class_specifier {result = [val[0][0], [val[0][1]]]} - | type_specifier declaration_specifiers {val[1][1] << val[0][1]; result = val[1]} - | type_specifier {result = [val[0][0], [val[0][1]]]} - | type_qualifier declaration_specifiers {val[1][1] << val[0][1]; result = val[1]} - | type_qualifier {result = [val[0][0], [val[0][1]]]} - | function_specifier declaration_specifiers {val[1][1] << val[0][1]; result = val[1]} - | function_specifier {result = [val[0][0], [val[0][1]]]} - -# Returns NodeArray[Declarator] -init_declarator_list - : init_declarator {result = NodeArray[val[0]]} - | init_declarator_list COMMA init_declarator {result = val[0] << val[2]} - -# Returns Declarator -init_declarator - : declarator {result = val[0]} - | declarator EQ initializer {val[0].init = val[2]; result = val[0]} - -# Returns [Pos, Symbol] -storage_class_specifier - : TYPEDEF {result = [val[0].pos, :typedef ]} - | EXTERN {result = [val[0].pos, :extern ]} - | STATIC {result = [val[0].pos, :static ]} - | AUTO {result = [val[0].pos, :auto ]} - | REGISTER {result = [val[0].pos, :register]} - -# Returns [Pos, Type|Symbol] -type_specifier - : VOID {result = [val[0].pos, :void ]} - | CHAR {result = [val[0].pos, :char ]} - | SHORT {result = [val[0].pos, :short ]} - | INT {result = [val[0].pos, :int ]} - | LONG {result = [val[0].pos, :long ]} - | FLOAT {result = [val[0].pos, :float ]} - | DOUBLE {result = [val[0].pos, :double ]} - | SIGNED {result = [val[0].pos, :signed ]} - | UNSIGNED {result = [val[0].pos, :unsigned ]} - | BOOL {result = [val[0].pos, :_Bool ]} - | COMPLEX {result = [val[0].pos, :_Complex ]} - | IMAGINARY {result = [val[0].pos, :_Imaginary]} - | struct_or_union_specifier {result = [val[0].pos, val[0] ]} - | enum_specifier {result = [val[0].pos, val[0] ]} - | typedef_name {result = [val[0].pos, val[0] ]} - -# Returns Struct|Union -struct_or_union_specifier - : struct_or_union identifier LBRACE struct_declaration_list RBRACE {result = val[0][1].new_at(val[0][0], val[1].val, val[3])} - | struct_or_union LBRACE struct_declaration_list RBRACE {result = val[0][1].new_at(val[0][0], nil , val[2])} - | struct_or_union identifier {result = val[0][1].new_at(val[0][0], val[1].val, nil )} - # type names can also be used as struct identifiers - | struct_or_union typedef_name LBRACE struct_declaration_list RBRACE {result = val[0][1].new_at(val[0][0], val[1].name, val[3])} - | struct_or_union typedef_name {result = val[0][1].new_at(val[0][0], val[1].name, nil )} - -# Returns [Pos, Class] -struct_or_union - : STRUCT {result = [val[0].pos, Struct]} - | UNION {result = [val[0].pos, Union ]} - -# Returns NodeArray[Declaration] -struct_declaration_list - : struct_declaration {result = NodeArray[val[0]]} - | struct_declaration_list struct_declaration {val[0] << val[1]; result = val[0]} - -# Returns Declaration -struct_declaration - : specifier_qualifier_list struct_declarator_list SEMICOLON {result = make_declaration(val[0][0], val[0][1], val[1])} - -# Returns {Pos, [Symbol]} -specifier_qualifier_list - : type_specifier specifier_qualifier_list {val[1][1] << val[0][1]; result = val[1]} - | type_specifier {result = [val[0][0], [val[0][1]]]} - | type_qualifier specifier_qualifier_list {val[1][1] << val[0][1]; result = val[1]} - | type_qualifier {result = [val[0][0], [val[0][1]]]} - -# Returns NodeArray[Declarator] -struct_declarator_list - : struct_declarator {result = NodeArray[val[0]]} - | struct_declarator_list COMMA struct_declarator {result = val[0] << val[2]} - -# Returns Declarator -struct_declarator - : declarator {result = val[0]} - | declarator COLON constant_expression {result = val[0]; val[0].num_bits = val[2]} - | COLON constant_expression {result = Declarator.new_at(val[0].pos, :num_bits => val[1])} - -# Returns Enum -enum_specifier - : ENUM identifier LBRACE enumerator_list RBRACE {result = Enum.new_at(val[0].pos, val[1].val, val[3])} - | ENUM LBRACE enumerator_list RBRACE {result = Enum.new_at(val[0].pos, nil , val[2])} - | ENUM identifier LBRACE enumerator_list COMMA RBRACE {result = Enum.new_at(val[0].pos, val[1].val, val[3])} - | ENUM LBRACE enumerator_list COMMA RBRACE {result = Enum.new_at(val[0].pos, nil , val[2])} - | ENUM identifier {result = Enum.new_at(val[0].pos, val[1].val, nil )} - # type names can also be used as enum names - | ENUM typedef_name LBRACE enumerator_list RBRACE {result = Enum.new_at(val[0].pos, val[1].name, val[3])} - | ENUM typedef_name LBRACE enumerator_list COMMA RBRACE {result = Enum.new_at(val[0].pos, val[1].name, val[3])} - | ENUM typedef_name {result = Enum.new_at(val[0].pos, val[1].name, nil )} - -# Returns NodeArray[Enumerator] -enumerator_list - : enumerator {result = NodeArray[val[0]]} - | enumerator_list COMMA enumerator {result = val[0] << val[2]} - -# Returns Enumerator -enumerator - : enumeration_constant {result = Enumerator.new_at(val[0].pos, val[0].val, nil )} - | enumeration_constant EQ constant_expression {result = Enumerator.new_at(val[0].pos, val[0].val, val[2])} - -# Returns [Pos, Symbol] -type_qualifier - : CONST {result = [val[0].pos, :const ]} - | RESTRICT {result = [val[0].pos, :restrict]} - | VOLATILE {result = [val[0].pos, :volatile]} - -# Returns [Pos, Symbol] -function_specifier - : INLINE {result = [val[0].pos, :inline]} - -# Returns Declarator -declarator - : pointer direct_declarator {result = add_decl_type(val[1], val[0])} - | direct_declarator {result = val[0]} - -# Returns Declarator -direct_declarator - : identifier {result = Declarator.new_at(val[0].pos, nil, val[0].val)} - | LPAREN declarator RPAREN {result = val[1]} - | direct_declarator LBRACKET type_qualifier_list assignment_expression RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET type_qualifier_list RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET assignment_expression RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos, nil, val[2]))} - | direct_declarator LBRACKET RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} - | direct_declarator LBRACKET STATIC type_qualifier_list assignment_expression RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET STATIC assignment_expression RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET type_qualifier_list MUL RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LBRACKET MUL RBRACKET {result = add_decl_type(val[0], Array.new_at(val[0].pos ))} # TODO - | direct_declarator LPAREN parameter_type_list RPAREN {result = add_decl_type(val[0], Function.new_at(val[0].pos, nil, param_list(*val[2]), :var_args => val[2][1]))} - | direct_declarator LPAREN identifier_list RPAREN {result = add_decl_type(val[0], Function.new_at(val[0].pos, nil, val[2]))} - | direct_declarator LPAREN RPAREN {result = add_decl_type(val[0], Function.new_at(val[0].pos ))} - -# Returns Pointer -pointer - : MUL type_qualifier_list {result = add_type_quals(Pointer.new_at(val[0].pos), val[1][1]) } - | MUL {result = Pointer.new_at(val[0].pos) } - | MUL type_qualifier_list pointer {p = add_type_quals(Pointer.new_at(val[0].pos), val[1][1]); val[2].direct_type = p; result = val[2]} - | MUL pointer {p = Pointer.new_at(val[0].pos) ; val[1].direct_type = p; result = val[1]} - -# Returns {Pos, [Symbol]} -type_qualifier_list - : type_qualifier {result = [val[0][0], [val[0][1]]]} - | type_qualifier_list type_qualifier {val[0][1] << val[1][1]; result = val[0]} - -# Returns [NodeArray[Parameter], var_args?] -parameter_type_list - : parameter_list {result = [val[0], false]} - | parameter_list COMMA ELLIPSIS {result = [val[0], true ]} - -# Returns NodeArray[Parameter] -parameter_list - : parameter_declaration {result = NodeArray[val[0]]} - | parameter_list COMMA parameter_declaration {result = val[0] << val[2]} - -# Returns Parameter -parameter_declaration - : declaration_specifiers declarator {ind_type = val[1].indirect_type and ind_type.detach - result = make_parameter(val[0][0], val[0][1], ind_type, val[1].name)} - | declaration_specifiers abstract_declarator {result = make_parameter(val[0][0], val[0][1], val[1] , nil )} - | declaration_specifiers {result = make_parameter(val[0][0], val[0][1], nil , nil )} - -# Returns NodeArray[Parameter] -identifier_list - : identifier {result = NodeArray[Parameter.new_at(val[0].pos, nil, val[0].val)]} - | identifier_list COMMA identifier {result = val[0] << Parameter.new_at(val[2].pos, nil, val[2].val)} - -# Returns Type -type_name - : specifier_qualifier_list abstract_declarator {val[1].direct_type = make_direct_type(val[0][0], val[0][1]); result = val[1]} - | specifier_qualifier_list {result = make_direct_type(val[0][0], val[0][1]) } - -# Returns Type -abstract_declarator - : pointer {result = val[0]} - | pointer direct_abstract_declarator {val[1].direct_type = val[0]; result = val[1]} - | direct_abstract_declarator {result = val[0]} - -# Returns Type -direct_abstract_declarator - : LPAREN abstract_declarator RPAREN {result = val[1]} - | direct_abstract_declarator LBRACKET assignment_expression RBRACKET {val[0].direct_type = Array.new_at(val[0].pos, nil, val[2]); result = val[0]} - | direct_abstract_declarator LBRACKET RBRACKET {val[0].direct_type = Array.new_at(val[0].pos, nil, nil ); result = val[0]} - | LBRACKET assignment_expression RBRACKET {result = Array.new_at(val[0].pos, nil, val[1])} - | LBRACKET RBRACKET {result = Array.new_at(val[0].pos )} - | direct_abstract_declarator LBRACKET MUL RBRACKET {val[0].direct_type = Array.new_at(val[0].pos); result = val[0]} # TODO - | LBRACKET MUL RBRACKET {result = Array.new_at(val[0].pos)} # TODO - | direct_abstract_declarator LPAREN parameter_type_list RPAREN {val[0].direct_type = Function.new_at(val[0].pos, nil, param_list(*val[2]), val[2][1]); result = val[0]} - | direct_abstract_declarator LPAREN RPAREN {val[0].direct_type = Function.new_at(val[0].pos ); result = val[0]} - | LPAREN parameter_type_list RPAREN {result = Function.new_at(val[0].pos, nil, param_list(*val[1]), val[1][1])} - | LPAREN RPAREN {result = Function.new_at(val[0].pos )} - -# Returns CustomType -typedef_name - #: identifier -- insufficient since we must distinguish between type - # names and var names (otherwise we have a conflict) - : TYPENAME {result = CustomType.new_at(val[0].pos, val[0].val)} - -# Returns Expression -initializer - : assignment_expression {result = val[0]} - | LBRACE initializer_list RBRACE {result = CompoundLiteral.new_at(val[0].pos, nil, val[1])} - | LBRACE initializer_list COMMA RBRACE {result = CompoundLiteral.new_at(val[0].pos, nil, val[1])} - -# Returns NodeArray[MemberInit] -initializer_list - : designation initializer {result = NodeArray[MemberInit.new_at(val[0][0] , val[0][1], val[1])]} - | initializer {result = NodeArray[MemberInit.new_at(val[0].pos, nil , val[0])]} - | initializer_list COMMA designation initializer {result = val[0] << MemberInit.new_at(val[2][0] , val[2][1], val[3])} - | initializer_list COMMA initializer {result = val[0] << MemberInit.new_at(val[2].pos, nil , val[2])} - -# Returns {Pos, NodeArray[Expression|Token]} -designation - : designator_list EQ {result = val[0]} - -# Returns {Pos, NodeArray[Expression|Token]} -designator_list - : designator {result = val[0]; val[0][1] = NodeArray[val[0][1]]} - | designator_list designator {result = val[0]; val[0][1] << val[1][1]} - -# Returns {Pos, Expression|Member} -designator - : LBRACKET constant_expression RBRACKET {result = [val[1].pos, val[1] ]} - | DOT identifier {result = [val[1].pos, Member.new_at(val[1].pos, val[1].val)]} - -# A.2.1 Expressions - -# Returns Expression -primary_expression - : identifier {result = Variable.new_at(val[0].pos, val[0].val)} - | constant {result = val[0]} - | string_literal {result = val[0]} - # GCC EXTENSION: allow a compound statement in parentheses as an expression - | LPAREN expression RPAREN {result = val[1]} - | LPAREN compound_statement RPAREN {block_expressions_enabled? or parse_error val[0].pos, "compound statement found where expression expected" - result = BlockExpression.new(val[1]); result.pos = val[0].pos} - -# Returns Expression -postfix_expression - : primary_expression {result = val[0]} - | postfix_expression LBRACKET expression RBRACKET {result = Index .new_at(val[0].pos, val[0], val[2])} - | postfix_expression LPAREN argument_expression_list RPAREN {result = Call .new_at(val[0].pos, val[0], val[2] )} - | postfix_expression LPAREN RPAREN {result = Call .new_at(val[0].pos, val[0], NodeArray[])} - | postfix_expression DOT identifier {result = Dot .new_at(val[0].pos, val[0], Member.new(val[2].val))} - | postfix_expression ARROW identifier {result = Arrow .new_at(val[0].pos, val[0], Member.new(val[2].val))} - | postfix_expression INC {result = PostInc .new_at(val[0].pos, val[0] )} - | postfix_expression DEC {result = PostDec .new_at(val[0].pos, val[0] )} - | LPAREN type_name RPAREN LBRACE initializer_list RBRACE {result = CompoundLiteral.new_at(val[0].pos, val[1], val[4])} - | LPAREN type_name RPAREN LBRACE initializer_list COMMA RBRACE {result = CompoundLiteral.new_at(val[0].pos, val[1], val[4])} - -# Returns [Expression|Type] -argument_expression_list - : argument_expression {result = NodeArray[val[0]]} - | argument_expression_list COMMA argument_expression {result = val[0] << val[2]} - -# Returns Expression|Type -- EXTENSION: allow type names here too, to support some standard library macros (e.g., va_arg [7.15.1.1]) -argument_expression - : assignment_expression {result = val[0]} - | type_name {result = val[0]} - -# Returns Expression -unary_expression - : postfix_expression {result = val[0]} - | INC unary_expression {result = PreInc.new_at(val[0].pos, val[1])} - | DEC unary_expression {result = PreDec.new_at(val[0].pos, val[1])} - | unary_operator cast_expression {result = val[0][0].new_at(val[0][1], val[1])} - | SIZEOF unary_expression {result = Sizeof.new_at(val[0].pos, val[1])} - | SIZEOF LPAREN type_name RPAREN {result = Sizeof.new_at(val[0].pos, val[2])} - -# Returns [Class, Pos] -unary_operator - : AND {result = [Address , val[0].pos]} - | MUL {result = [Dereference, val[0].pos]} - | ADD {result = [Positive , val[0].pos]} - | SUB {result = [Negative , val[0].pos]} - | NOT {result = [BitNot , val[0].pos]} - | BANG {result = [Not , val[0].pos]} - -# Returns Expression -cast_expression - : unary_expression {result = val[0]} - | LPAREN type_name RPAREN cast_expression {result = Cast.new_at(val[0].pos, val[1], val[3])} - -# Returns Expression -multiplicative_expression - : cast_expression {result = val[0]} - | multiplicative_expression MUL cast_expression {result = Multiply.new_at(val[0].pos, val[0], val[2])} - | multiplicative_expression DIV cast_expression {result = Divide .new_at(val[0].pos, val[0], val[2])} - | multiplicative_expression MOD cast_expression {result = Mod .new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -additive_expression - : multiplicative_expression {result = val[0]} - | additive_expression ADD multiplicative_expression {result = Add .new_at(val[0].pos, val[0], val[2])} - | additive_expression SUB multiplicative_expression {result = Subtract.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -shift_expression - : additive_expression {result = val[0]} - | shift_expression LSHIFT additive_expression {result = ShiftLeft .new_at(val[0].pos, val[0], val[2])} - | shift_expression RSHIFT additive_expression {result = ShiftRight.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -relational_expression - : shift_expression {result = val[0]} - | relational_expression LT shift_expression {result = Less.new_at(val[0].pos, val[0], val[2])} - | relational_expression GT shift_expression {result = More.new_at(val[0].pos, val[0], val[2])} - | relational_expression LEQ shift_expression {result = LessOrEqual.new_at(val[0].pos, val[0], val[2])} - | relational_expression GEQ shift_expression {result = MoreOrEqual.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -equality_expression - : relational_expression {result = val[0]} - | equality_expression EQEQ relational_expression {result = Equal .new_at(val[0].pos, val[0], val[2])} - | equality_expression NEQ relational_expression {result = NotEqual.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -and_expression - : equality_expression {result = val[0]} - | and_expression AND equality_expression {result = BitAnd.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -exclusive_or_expression - : and_expression {result = val[0]} - | exclusive_or_expression XOR and_expression {result = BitXor.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -inclusive_or_expression - : exclusive_or_expression {result = val[0]} - | inclusive_or_expression OR exclusive_or_expression {result = BitOr.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -logical_and_expression - : inclusive_or_expression {result = val[0]} - | logical_and_expression ANDAND inclusive_or_expression {result = And.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -logical_or_expression - : logical_and_expression {result = val[0]} - | logical_or_expression OROR logical_and_expression {result = Or.new_at(val[0].pos, val[0], val[2])} - -# Returns Expression -conditional_expression - : logical_or_expression {result = val[0]} - | logical_or_expression QUESTION expression COLON conditional_expression {result = Conditional.new_at(val[0].pos, val[0], val[2], val[4])} - -# Returns Expression -assignment_expression - : conditional_expression {result = val[0]} - | unary_expression assignment_operator assignment_expression {result = val[1].new_at(val[0].pos, val[0], val[2])} - -# Returns Class -assignment_operator - : EQ {result = Assign} - | MULEQ {result = MultiplyAssign} - | DIVEQ {result = DivideAssign} - | MODEQ {result = ModAssign} - | ADDEQ {result = AddAssign} - | SUBEQ {result = SubtractAssign} - | LSHIFTEQ {result = ShiftLeftAssign} - | RSHIFTEQ {result = ShiftRightAssign} - | ANDEQ {result = BitAndAssign} - | XOREQ {result = BitXorAssign} - | OREQ {result = BitOrAssign} - -# Returns Expression -expression - : assignment_expression {result = val[0]} - | expression COMMA assignment_expression { - if val[0].is_a? Comma - if val[2].is_a? Comma - val[0].exprs.push(*val[2].exprs) - else - val[0].exprs << val[2] - end - result = val[0] - else - if val[2].is_a? Comma - val[2].exprs.unshift(val[0]) - val[2].pos = val[0].pos - result = val[2] - else - result = Comma.new_at(val[0].pos, NodeArray[val[0], val[2]]) - end - end - } - -# Returns Expression -constant_expression - : conditional_expression {result = val[0]} - -# A.1.1 -- Lexical elements -# -# token -# : keyword (raw string) -# | identifier expanded below -# | constant expanded below -# | string_literal expanded below -# | punctuator (raw string) -# -# preprocessing-token (skip) - -# Returns Token -identifier - : ID {result = val[0]} - -# Returns Literal -constant - : ICON {result = val[0].val; result.pos = val[0].pos} - | FCON {result = val[0].val; result.pos = val[0].pos} - #| enumeration_constant -- these are parsed as identifiers at all - # places the `constant' nonterminal appears - | CCON {result = val[0].val; result.pos = val[0].pos} - -# Returns Token -enumeration_constant - : ID {result = val[0]} - -# Returns StringLiteral -# Also handles string literal concatenation (6.4.5.4) -string_literal - : string_literal SCON {val[0].val << val[1].val.val; result = val[0]} - | SCON { result = val[0].val; result.pos = val[0].pos } - ----- inner - # A.1.9 -- Preprocessing numbers -- skip - # A.1.8 -- Header names -- skip - - # A.1.7 -- Puncuators -- we don't bother with {##,#,%:,%:%:} since - # we don't do preprocessing - @@punctuators = %r'\+\+|-[->]|&&|\|\||\.\.\.|(?:<<|>>|[<>=!*/%+\-&^|])=?|[\[\](){}.~?:;,]' - @@digraphs = %r'<[:%]|[:%]>' - - # A.1.6 -- String Literals -- simple for us because we don't decode - # the string (and indeed accept some illegal strings) - @@string_literal = %r'L?"(?:[^\\]|\\.)*?"'m - - # A.1.5 -- Constants - @@decimal_floating_constant = %r'(?:(?:\d*\.\d+|\d+\.)(?:e[-+]?\d+)?|\d+e[-+]?\d+)[fl]?'i - @@hexadecimal_floating_constant = %r'0x(?:(?:[0-9a-f]*\.[0-9a-f]+|[0-9a-f]+\.)|[0-9a-f]+)p[-+]?\d+[fl]?'i - - @@integer_constant = %r'(?:[1-9][0-9]*|0x[0-9a-f]+|0[0-7]*)(?:ul?l?|ll?u?)?'i - @@floating_constant = %r'#{@@decimal_floating_constant}|#{@@hexadecimal_floating_constant}' - @@enumeration_constant = %r'[a-zA-Z_\\][a-zA-Z_\\0-9]*' - @@character_constant = %r"L?'(?:[^\\]|\\.)+?'" - # (note that as with string-literals, we accept some illegal - # character-constants) - - # A.1.4 -- Universal character names -- skip - - # A.1.3 -- Identifiers -- skip, since an identifier is lexically - # identical to an enumeration constant - - # A.1.2 Keywords - keywords = %w'auto break case char const continue default do -double else enum extern float for goto if inline int long register -restrict return short signed sizeof static struct switch typedef union - unsigned void volatile while _Bool _Complex _Imaginary' - @@keywords = %r"#{keywords.join('|')}" - - def initialize - @type_names = ::Set.new - - @warning_proc = lambda{} - @pos = C::Node::Pos.new(nil, 1, 0) - end - def initialize_copy(x) - @pos = x.pos.dup - @type_names = x.type_names.dup - end - attr_accessor :pos, :type_names - - def parse(str) - if str.respond_to? :read - str = str.read - end - @str = str - begin - prepare_lexer(str) - return do_parse - rescue ParseError => e - e.set_backtrace(caller) - raise - end - end - - # - # Error handler, as used by racc. - # - def on_error(error_token_id, error_value, value_stack) - if error_value == '$' - parse_error @pos, "unexpected EOF" - else - parse_error(error_value.pos, - "parse error on #{token_to_str(error_token_id)} (#{error_value.val})") - end - end - - def self.feature(name) - attr_writer "#{name}_enabled" - class_eval <<-EOS - def enable_#{name} - @#{name}_enabled = true - end - def #{name}_enabled? - @#{name}_enabled - end - EOS - end - private_class_method :feature - - # - # Allow blocks in parentheses as expressions, as per the gcc - # extension. [http://rubyurl.com/iB7] - # - feature :block_expressions - - private # --------------------------------------------------------- - - class Token - attr_accessor :pos, :val - def initialize(pos, val) - @pos = pos - @val = val - end - end - def eat(str) - lines = str.split(/\r\n|[\r\n]/, -1) - if lines.length == 1 - @pos.col_num += lines[0].length - else - @pos.line_num += lines.length - 1 - @pos.col_num = lines[-1].length - end - end - - # - # Make a Declaration from the given specs and declarators. - # - def make_declaration(pos, specs, declarators) - specs.all?{|x| x.is_a?(Symbol) || x.is_a?(Type)} or raise specs.map{|x| x.class}.inspect - decl = Declaration.new_at(pos, nil, declarators) - - # set storage class - storage_classes = specs.find_all do |x| - [:typedef, :extern, :static, :auto, :register].include? x - end - # 6.7.1p2: at most, one storage-class specifier may be given in - # the declaration specifiers in a declaration - storage_classes.length <= 1 or - begin - if declarators.length == 0 - for_name = '' - else - for_name = "for `#{declarators[0].name}'" - end - parse_error pos, "multiple or duplicate storage classes given #{for_name}'" - end - decl.storage = storage_classes[0] - - # set type (specifiers, qualifiers) - decl.type = make_direct_type(pos, specs) - - # set function specifiers - decl.inline = specs.include?(:inline) - - # look for new type names - if decl.typedef? - decl.declarators.each do |d| - if d.name - @type_names << d.name - end - end - end - - return decl - end - - def make_function_def(pos, specs, func_declarator, decl_list, defn) - add_decl_type(func_declarator, make_direct_type(pos, specs)) - - # get types from decl_list if necessary - function = func_declarator.indirect_type - function.is_a? Function or - parse_error pos, "non function type for function `#{func_declarator.name}'" - params = function.params - if decl_list - params.all?{|p| p.type.nil?} or - parse_error pos, "both prototype and declaration list given for `#{func_declarator.name}'" - decl_list.each do |declaration| - declaration.declarators.each do |declarator| - param = params.find{|p| p.name == declarator.name} or - parse_error pos, "no parameter named #{declarator.name}" - if declarator.indirect_type - param.type = declarator.indirect_type - param.type.direct_type = declaration.type.dup - else - param.type = declaration.type.dup - end - end - end - params.all?{|p| p.type} or - begin - s = params.find_all{|p| p.type.nil?}.map{|p| "`#{p.name}'"}.join(' and ') - parse_error pos, "types missing for parameters #{s}" - end - end - - fd = FunctionDef.new_at(pos, - function.detach, - func_declarator.name, - defn, - :no_prototype => !decl_list.nil?) - - # set storage class - # 6.9.1p4: only extern or static allowed - specs.each do |s| - [:typedef, :auto, :register].include?(s) and - "`#{s}' illegal for function" - end - storage_classes = specs.find_all do |s| - s == :extern || s == :static - end - # 6.7.1p2: at most, one storage-class specifier may be given in - # the declaration specifiers in a declaration - storage_classes.length <= 1 or - "multiple or duplicate storage classes given for `#{func_declarator.name}'" - fd.storage = storage_classes[0] if storage_classes[0] - - # set function specifiers - # 6.7.4p5 'inline' can be repeated - fd.inline = specs.include?(:inline) - - return fd - end - - # - # Make a direct type from the list of type specifiers and type - # qualifiers. - # - def make_direct_type(pos, specs) - specs_order = [:signed, :unsigned, :short, :long, :double, :void, - :char, :int, :float, :_Bool, :_Complex, :_Imaginary] - - type_specs = specs.find_all do |x| - specs_order.include?(x) || !x.is_a?(Symbol) - end - type_specs.sort! do |a, b| - (specs_order.index(a)||100) <=> (specs_order.index(b)||100) - end - - # set type specifiers - # 6.7.2p2: the specifier list should be one of these - type = - case type_specs - when [:void] - Void.new - when [:char] - Char.new - when [:signed, :char] - Char.new :signed => true - when [:unsigned, :char] - Char.new :signed => false - when [:short], [:signed, :short], [:short, :int], - [:signed, :short, :int] - Int.new :longness => -1 - when [:unsigned, :short], [:unsigned, :short, :int] - Int.new :unsigned => true, :longness => -1 - when [:int], [:signed], [:signed, :int] - Int.new - when [:unsigned], [:unsigned, :int] - Int.new :unsigned => true - when [:long], [:signed, :long], [:long, :int], - [:signed, :long, :int] - Int.new :longness => 1 - when [:unsigned, :long], [:unsigned, :long, :int] - Int.new :longness => 1, :unsigned => true - when [:long, :long], [:signed, :long, :long], - [:long, :long, :int], [:signed, :long, :long, :int] - Int.new :longness => 2 - when [:unsigned, :long, :long], [:unsigned, :long, :long, :int] - Int.new :longness => 2, :unsigned => true - when [:float] - Float.new - when [:double] - Float.new :longness => 1 - when [:long, :double] - Float.new :longness => 2 - when [:_Bool] - Bool.new - when [:float, :_Complex] - Complex.new - when [:double, :_Complex] - Complex.new :longness => 1 - when [:long, :double, :_Complex] - Complex.new :longness => 2 - when [:float, :_Imaginary] - Imaginary.new - when [:double, :_Imaginary] - Imaginary.new :longness => 1 - when [:long, :double, :_Imaginary] - Imaginary.new :longness => 2 - else - if type_specs.length == 1 && - [CustomType, Struct, Union, Enum].any?{|c| type_specs[0].is_a? c} - type_specs[0] - else - if type_specs == [] - parse_error pos, "no type specifiers given" - else - parse_error pos, "invalid type specifier combination: #{type_specs.join(' ')}" - end - end - end - type.pos ||= pos - - # set type qualifiers - # 6.7.3p4: type qualifiers can be repeated - type.const = specs.any?{|x| x.equal? :const } - type.restrict = specs.any?{|x| x.equal? :restrict} - type.volatile = specs.any?{|x| x.equal? :volatile} - - return type - end - - def make_parameter(pos, specs, indirect_type, name) - type = indirect_type - if type - type.direct_type = make_direct_type(pos, specs) - else - type = make_direct_type(pos, specs) - end - [:typedef, :extern, :static, :auto, :inline].each do |sym| - specs.include? sym and - parse_error pos, "parameter `#{declarator.name}' declared `#{sym}'" - end - return Parameter.new_at(pos, type, name, - :register => specs.include?(:register)) - end - - def add_type_quals(type, quals) - type.const = quals.include?(:const ) - type.restrict = quals.include?(:restrict) - type.volatile = quals.include?(:volatile) - return type - end - - # - # Add te given type as the "most direct" type to the given - # declarator. Return the declarator. - # - def add_decl_type(declarator, type) - if declarator.indirect_type - declarator.indirect_type.direct_type = type - else - declarator.indirect_type = type - end - return declarator - end - - def param_list(params, var_args) - if params.length == 1 && - params[0].type.is_a?(Void) && - params[0].name.nil? - return NodeArray[] - elsif params.empty? - return nil - else - return params - end - end - - def parse_error(pos, str) - raise ParseError, "#{pos}: #{str}" - end - ----- header - -require 'set' - -# Error classes -module C - class ParseError < StandardError; end -end - -# Local variables: -# mode: ruby -# end: diff --git a/test/mri/racc/assets/chk.y b/test/mri/racc/assets/chk.y deleted file mode 100644 index 7e0ee20f1e8..00000000000 --- a/test/mri/racc/assets/chk.y +++ /dev/null @@ -1,126 +0,0 @@ -# -# racc tester -# - -class Calcp - - prechigh - left '*' '/' - left '+' '-' - preclow - - convert - NUMBER 'Number' - end - -rule - - target : exp | /* none */ { result = 0 } ; - - exp : exp '+' exp { result += val[2]; @plus = 'plus' } - | exp '-' exp { result -= val[2]; @str = "string test" } - | exp '*' exp { result *= val[2] } - | exp '/' exp { result /= val[2] } - | '(' { $emb = true } exp ')' - { - raise 'must not happen' unless $emb - result = val[2] - } - | '-' NUMBER { result = -val[1] } - | NUMBER - ; - -end - -----header - -class Number; end - -----inner - - def parse( src ) - $emb = false - @plus = nil - @str = nil - @src = src - result = do_parse - if @plus - raise 'string parse failed' unless @plus == 'plus' - end - if @str - raise 'string parse failed' unless @str == 'string test' - end - result - end - - def next_token - @src.shift - end - - def initialize - @yydebug = true - end - -----footer - -$parser = Calcp.new -$test_number = 1 - -def chk( src, ans ) - result = $parser.parse(src) - raise "test #{$test_number} fail" unless result == ans - $test_number += 1 -end - -chk( - [ [Number, 9], - [false, false], - [false, false] ], 9 -) - -chk( - [ [Number, 5], - ['*', nil], - [Number, 1], - ['-', nil], - [Number, 1], - ['*', nil], - [Number, 8], - [false, false], - [false, false] ], -3 -) - -chk( - [ [Number, 5], - ['+', nil], - [Number, 2], - ['-', nil], - [Number, 5], - ['+', nil], - [Number, 2], - ['-', nil], - [Number, 5], - [false, false], - [false, false] ], -1 -) - -chk( - [ ['-', nil], - [Number, 4], - [false, false], - [false, false] ], -4 -) - -chk( - [ [Number, 7], - ['*', nil], - ['(', nil], - [Number, 4], - ['+', nil], - [Number, 3], - [')', nil], - ['-', nil], - [Number, 9], - [false, false], - [false, false] ], 40 -) diff --git a/test/mri/racc/assets/conf.y b/test/mri/racc/assets/conf.y deleted file mode 100644 index de9de71d280..00000000000 --- a/test/mri/racc/assets/conf.y +++ /dev/null @@ -1,16 +0,0 @@ - -class A -rule - -a: A c C expr; - -b: A B; # useless - -c: A; -c: A; - -expr: expr '+' expr -expr: expr '-' expr -expr: NUMBER - -end diff --git a/test/mri/racc/assets/csspool.y b/test/mri/racc/assets/csspool.y deleted file mode 100644 index 3d6af25d85f..00000000000 --- a/test/mri/racc/assets/csspool.y +++ /dev/null @@ -1,729 +0,0 @@ -class CSSPool::CSS::Parser - -token CHARSET_SYM IMPORT_SYM STRING SEMI IDENT S COMMA LBRACE RBRACE STAR HASH -token LSQUARE RSQUARE EQUAL INCLUDES DASHMATCH LPAREN RPAREN FUNCTION GREATER PLUS -token SLASH NUMBER MINUS LENGTH PERCENTAGE ANGLE TIME FREQ URI -token IMPORTANT_SYM MEDIA_SYM NOT ONLY AND NTH_PSEUDO_CLASS -token DOCUMENT_QUERY_SYM FUNCTION_NO_QUOTE -token TILDE -token PREFIXMATCH SUFFIXMATCH SUBSTRINGMATCH -token NOT_PSEUDO_CLASS -token KEYFRAMES_SYM -token MATCHES_PSEUDO_CLASS -token NAMESPACE_SYM -token MOZ_PSEUDO_ELEMENT -token RESOLUTION -token COLON -token SUPPORTS_SYM -token OR -token VARIABLE_NAME -token CALC_SYM -token FONTFACE_SYM -token UNICODE_RANGE -token RATIO - -rule - document - : { @handler.start_document } - stylesheet - { @handler.end_document } - ; - stylesheet - : charset stylesheet - | import stylesheet - | namespace stylesheet - | charset - | import - | namespace - | body - | - ; - charset - : CHARSET_SYM STRING SEMI { @handler.charset interpret_string(val[1]), {} } - ; - import - : IMPORT_SYM import_location medium SEMI { - @handler.import_style val[2], val[1] - } - | IMPORT_SYM import_location SEMI { - @handler.import_style [], val[1] - } - ; - import_location - : import_location S - | STRING { result = Terms::String.new interpret_string val.first } - | URI { result = Terms::URI.new interpret_uri val.first } - ; - namespace - : NAMESPACE_SYM ident import_location SEMI { - @handler.namespace val[1], val[2] - } - | NAMESPACE_SYM import_location SEMI { - @handler.namespace nil, val[1] - } - ; - medium - : medium COMMA IDENT { - result = val[0] << MediaType.new(val[2]) - } - | IDENT { - result = [MediaType.new(val[0])] - } - ; - media_query_list - : media_query { result = MediaQueryList.new([ val[0] ]) } - | media_query_list COMMA media_query { result = val[0] << val[2] } - | { result = MediaQueryList.new } - ; - media_query - : optional_only_or_not media_type optional_and_exprs { result = MediaQuery.new(val[0], val[1], val[2]) } - | media_expr optional_and_exprs { result = MediaQuery.new(nil, val[0], val[1]) } - ; - optional_only_or_not - : ONLY { result = :only } - | NOT { result = :not } - | { result = nil } - ; - media_type - : IDENT { result = MediaType.new(val[0]) } - ; - media_expr - : LPAREN optional_space IDENT optional_space RPAREN { result = MediaType.new(val[2]) } - | LPAREN optional_space IDENT optional_space COLON optional_space expr RPAREN { result = MediaFeature.new(val[2], val[6][0]) } - ; - optional_space - : S { result = val[0] } - | { result = nil } - ; - optional_and_exprs - : optional_and_exprs AND media_expr { result = val[0] << val[2] } - | { result = [] } - ; - resolution - : RESOLUTION { - unit = val.first.gsub(/[\s\d.]/, '') - number = numeric(val.first) - result = Terms::Resolution.new(number, unit) - } - ; - body - : ruleset body - | conditional_rule body - | keyframes_rule body - | fontface_rule body - | ruleset - | conditional_rule - | keyframes_rule - | fontface_rule - ; - conditional_rule - : media - | document_query - | supports - ; - body_in_media - : body - | empty_ruleset - ; - media - : start_media body_in_media RBRACE { @handler.end_media val.first } - ; - start_media - : MEDIA_SYM media_query_list LBRACE { - result = val[1] - @handler.start_media result - } - ; - document_query - : start_document_query body RBRACE { @handler.end_document_query(before_pos(val), after_pos(val)) } - | start_document_query RBRACE { @handler.end_document_query(before_pos(val), after_pos(val)) } - ; - start_document_query - : start_document_query_pos url_match_fns LBRACE { - @handler.start_document_query(val[1], after_pos(val)) - } - ; - start_document_query_pos - : DOCUMENT_QUERY_SYM { - @handler.node_start_pos = before_pos(val) - } - ; - url_match_fns - : url_match_fn COMMA url_match_fns { - result = [val[0], val[2]].flatten - } - | url_match_fn { - result = val - } - ; - url_match_fn - : function_no_quote - | function - | uri - ; - supports - : start_supports body RBRACE { @handler.end_supports } - | start_supports RBRACE { @handler.end_supports } - ; - start_supports - : SUPPORTS_SYM supports_condition_root LBRACE { - @handler.start_supports val[1] - } - ; - supports_condition_root - : supports_negation { result = val.join('') } - | supports_conjunction_or_disjunction { result = val.join('') } - | supports_condition_in_parens { result = val.join('') } - ; - supports_condition - : supports_negation { result = val.join('') } - | supports_conjunction_or_disjunction { result = val.join('') } - | supports_condition_in_parens { result = val.join('') } - ; - supports_condition_in_parens - : LPAREN supports_condition RPAREN { result = val.join('') } - | supports_declaration_condition { result = val.join('') } - ; - supports_negation - : NOT supports_condition_in_parens { result = val.join('') } - ; - supports_conjunction_or_disjunction - : supports_conjunction - | supports_disjunction - ; - supports_conjunction - : supports_condition_in_parens AND supports_condition_in_parens { result = val.join('') } - | supports_conjunction_or_disjunction AND supports_condition_in_parens { result = val.join('') } - ; - supports_disjunction - : supports_condition_in_parens OR supports_condition_in_parens { result = val.join('') } - | supports_conjunction_or_disjunction OR supports_condition_in_parens { result = val.join('') } - ; - supports_declaration_condition - : LPAREN declaration_internal RPAREN { result = val.join('') } - | LPAREN S declaration_internal RPAREN { result = val.join('') } - ; - keyframes_rule - : start_keyframes_rule keyframes_blocks RBRACE - | start_keyframes_rule RBRACE - ; - start_keyframes_rule - : KEYFRAMES_SYM IDENT LBRACE { - @handler.start_keyframes_rule val[1] - } - ; - keyframes_blocks - : keyframes_block keyframes_blocks - | keyframes_block - ; - keyframes_block - : start_keyframes_block declarations RBRACE { @handler.end_keyframes_block } - | start_keyframes_block RBRACE { @handler.end_keyframes_block } - ; - start_keyframes_block - : keyframes_selectors LBRACE { - @handler.start_keyframes_block val[0] - } - ; - keyframes_selectors - | keyframes_selector COMMA keyframes_selectors { - result = val[0] + ', ' + val[2] - } - | keyframes_selector - ; - keyframes_selector - : IDENT - | PERCENTAGE { result = val[0].strip } - ; - fontface_rule - : start_fontface_rule declarations RBRACE { @handler.end_fontface_rule } - | start_fontface_rule RBRACE { @handler.end_fontface_rule } - ; - start_fontface_rule - : FONTFACE_SYM LBRACE { - @handler.start_fontface_rule - } - ; - ruleset - : start_selector declarations RBRACE { - @handler.end_selector val.first - } - | start_selector RBRACE { - @handler.end_selector val.first - } - ; - empty_ruleset - : optional_space { - start = @handler.start_selector([]) - @handler.end_selector(start) - } - ; - start_selector - : S start_selector { result = val.last } - | selectors LBRACE { - @handler.start_selector val.first - } - ; - selectors - : selector COMMA selectors - { - sel = Selector.new(val.first, {}) - result = [sel].concat(val[2]) - } - | selector - { - result = [Selector.new(val.first, {})] - } - ; - selector - : simple_selector combinator selector - { - val.flatten! - val[2].combinator = val.delete_at 1 - result = val - } - | simple_selector - ; - combinator - : S { result = :s } - | GREATER { result = :> } - | PLUS { result = :+ } - | TILDE { result = :~ } - ; - simple_selector - : element_name hcap { - selector = val.first - selector.additional_selectors = val.last - result = [selector] - } - | element_name { result = val } - | hcap - { - ss = Selectors::Simple.new nil, nil - ss.additional_selectors = val.flatten - result = [ss] - } - ; - simple_selectors - : simple_selector COMMA simple_selectors { result = [val[0], val[2]].flatten } - | simple_selector - ; - ident_with_namespace - : IDENT { result = [interpret_identifier(val[0]), nil] } - | IDENT '|' IDENT { result = [interpret_identifier(val[2]), interpret_identifier(val[0])] } - | '|' IDENT { result = [interpret_identifier(val[1]), nil] } - | STAR '|' IDENT { result = [interpret_identifier(val[2]), '*'] } - ; - element_name - : ident_with_namespace { result = Selectors::Type.new val.first[0], nil, val.first[1] } - | STAR { result = Selectors::Universal.new val.first } - | '|' STAR { result = Selectors::Universal.new val[1] } - | STAR '|' STAR { result = Selectors::Universal.new val[2], nil, val[0] } - | IDENT '|' STAR { result = Selectors::Universal.new val[2], nil, interpret_identifier(val[0]) } - ; - hcap - : hash { result = val } - | class { result = val } - | attrib { result = val } - | pseudo { result = val } - | hash hcap { result = val.flatten } - | class hcap { result = val.flatten } - | attrib hcap { result = val.flatten } - | pseudo hcap { result = val.flatten } - ; - hash - : HASH { - result = Selectors::Id.new interpret_identifier val.first.sub(/^#/, '') - } - class - : '.' IDENT { - result = Selectors::Class.new interpret_identifier val.last - } - ; - attrib - : LSQUARE ident_with_namespace EQUAL IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::EQUALS, - val[1][1] - ) - } - | LSQUARE ident_with_namespace EQUAL STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::EQUALS, - val[1][1] - ) - } - | LSQUARE ident_with_namespace INCLUDES STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::INCLUDES, - val[1][1] - ) - } - | LSQUARE ident_with_namespace INCLUDES IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::INCLUDES, - val[1][1] - ) - } - | LSQUARE ident_with_namespace DASHMATCH IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::DASHMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace DASHMATCH STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::DASHMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace PREFIXMATCH IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::PREFIXMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace PREFIXMATCH STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::PREFIXMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace SUFFIXMATCH IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::SUFFIXMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace SUFFIXMATCH STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::SUFFIXMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace SUBSTRINGMATCH IDENT RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_identifier(val[3]), - Selectors::Attribute::SUBSTRINGMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace SUBSTRINGMATCH STRING RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - interpret_string(val[3]), - Selectors::Attribute::SUBSTRINGMATCH, - val[1][1] - ) - } - | LSQUARE ident_with_namespace RSQUARE { - result = Selectors::Attribute.new( - val[1][0], - nil, - Selectors::Attribute::SET, - val[1][1] - ) - } - ; - pseudo - : COLON IDENT { - result = Selectors::pseudo interpret_identifier(val[1]) - } - | COLON COLON IDENT { - result = Selectors::PseudoElement.new( - interpret_identifier(val[2]) - ) - } - | COLON FUNCTION RPAREN { - result = Selectors::PseudoClass.new( - interpret_identifier(val[1].sub(/\($/, '')), - '' - ) - } - | COLON FUNCTION IDENT RPAREN { - result = Selectors::PseudoClass.new( - interpret_identifier(val[1].sub(/\($/, '')), - interpret_identifier(val[2]) - ) - } - | COLON NOT_PSEUDO_CLASS simple_selector RPAREN { - result = Selectors::PseudoClass.new( - 'not', - val[2].first.to_s - ) - } - | COLON NTH_PSEUDO_CLASS { - result = Selectors::PseudoClass.new( - interpret_identifier(val[1].sub(/\(.*/, '')), - interpret_identifier(val[1].sub(/.*\(/, '').sub(/\).*/, '')) - ) - } - | COLON MATCHES_PSEUDO_CLASS simple_selectors RPAREN { - result = Selectors::PseudoClass.new( - val[1].split('(').first.strip, - val[2].join(', ') - ) - } - | COLON MOZ_PSEUDO_ELEMENT optional_space any_number_of_idents optional_space RPAREN { - result = Selectors::PseudoElement.new( - interpret_identifier(val[1].sub(/\($/, '')) - ) - } - | COLON COLON MOZ_PSEUDO_ELEMENT optional_space any_number_of_idents optional_space RPAREN { - result = Selectors::PseudoElement.new( - interpret_identifier(val[2].sub(/\($/, '')) - ) - } - ; - any_number_of_idents - : - | multiple_idents - ; - multiple_idents - : IDENT - | IDENT COMMA multiple_idents - ; - # declarations can be separated by one *or more* semicolons. semi-colons at the start or end of a ruleset are also allowed - one_or_more_semis - : SEMI - | SEMI one_or_more_semis - ; - declarations - : declaration one_or_more_semis declarations - | one_or_more_semis declarations - | declaration one_or_more_semis - | declaration - | one_or_more_semis - ; - declaration - : declaration_internal { @handler.property val.first } - ; - declaration_internal - : property COLON expr prio - { result = Declaration.new(val.first, val[2], val[3]) } - | property COLON S expr prio - { result = Declaration.new(val.first, val[3], val[4]) } - | property S COLON expr prio - { result = Declaration.new(val.first, val[3], val[4]) } - | property S COLON S expr prio - { result = Declaration.new(val.first, val[4], val[5]) } - ; - prio - : IMPORTANT_SYM { result = true } - | { result = false } - ; - property - : IDENT { result = interpret_identifier val[0] } - | STAR IDENT { result = interpret_identifier val.join } - | VARIABLE_NAME { result = interpret_identifier val[0] } - ; - operator - : COMMA - | SLASH - | EQUAL - ; - expr - : term operator expr { - result = [val.first, val.last].flatten - val.last.first.operator = val[1] - } - | term expr { result = val.flatten } - | term { result = val } - ; - term - : ident - | ratio - | numeric - | string - | uri - | hexcolor - | calc - | function - | resolution - | VARIABLE_NAME - | uranges - ; - function - : function S { result = val.first } - | FUNCTION expr RPAREN { - name = interpret_identifier val.first.sub(/\($/, '') - if name == 'rgb' - result = Terms::Rgb.new(*val[1]) - else - result = Terms::Function.new name, val[1] - end - } - | FUNCTION RPAREN { - name = interpret_identifier val.first.sub(/\($/, '') - result = Terms::Function.new name - } - ; - function_no_quote - : function_no_quote S { result = val.first } - | FUNCTION_NO_QUOTE { - parts = val.first.split('(') - name = interpret_identifier parts.first - result = Terms::Function.new(name, [Terms::String.new(interpret_string_no_quote(parts.last))]) - } - ; - uranges - : UNICODE_RANGE COMMA uranges - | UNICODE_RANGE - ; - calc - : CALC_SYM calc_sum RPAREN optional_space { - result = Terms::Math.new(val.first.split('(').first, val[1]) - } - ; - # plus and minus are supposed to have whitespace around them, per http://dev.w3.org/csswg/css-values/#calc-syntax, but the numbers are eating trailing whitespace, so we inject it back in - calc_sum - : calc_product - | calc_product PLUS calc_sum { val.insert(1, ' '); result = val.join('') } - | calc_product MINUS calc_sum { val.insert(1, ' '); result = val.join('') } - ; - calc_product - : calc_value - | calc_value optional_space STAR calc_value { result = val.join('') } - | calc_value optional_space SLASH calc_value { result = val.join('') } - ; - calc_value - : numeric { result = val.join('') } - | function { result = val.join('') } # for var() variable references - | LPAREN calc_sum RPAREN { result = val.join('') } - ; - hexcolor - : hexcolor S { result = val.first } - | HASH { result = Terms::Hash.new val.first.sub(/^#/, '') } - ; - uri - : uri S { result = val.first } - | URI { result = Terms::URI.new interpret_uri val.first } - ; - string - : string S { result = val.first } - | STRING { result = Terms::String.new interpret_string val.first } - ; - numeric - : unary_operator numeric { - result = val[1] - val[1].unary_operator = val.first - } - | NUMBER { - result = Terms::Number.new numeric val.first - } - | PERCENTAGE { - result = Terms::Number.new numeric(val.first), nil, '%' - } - | LENGTH { - unit = val.first.gsub(/[\s\d.]/, '') - result = Terms::Number.new numeric(val.first), nil, unit - } - | ANGLE { - unit = val.first.gsub(/[\s\d.]/, '') - result = Terms::Number.new numeric(val.first), nil, unit - } - | TIME { - unit = val.first.gsub(/[\s\d.]/, '') - result = Terms::Number.new numeric(val.first), nil, unit - } - | FREQ { - unit = val.first.gsub(/[\s\d.]/, '') - result = Terms::Number.new numeric(val.first), nil, unit - } - ; - ratio - : RATIO { - result = Terms::Ratio.new(val[0], val[1]) - } - ; - unary_operator - : MINUS { result = :minus } - | PLUS { result = :plus } - ; - ident - : ident S { result = val.first } - | IDENT { result = Terms::Ident.new interpret_identifier val.first } - ; - ----- inner - -def numeric thing - thing = thing.gsub(/[^\d.]/, '') - Integer(thing) rescue Float(thing) -end - -def interpret_identifier s - interpret_escapes s -end - -def interpret_uri s - interpret_escapes s.match(/^url\((.*)\)$/mui)[1].strip.match(/^(['"]?)((?:\\.|.)*)\1$/mu)[2] -end - -def interpret_string_no_quote s - interpret_escapes s.match(/^(.*)\)$/mu)[1].strip.match(/^(['"]?)((?:\\.|.)*)\1$/mu)[2] -end - -def interpret_string s - interpret_escapes s.match(/^(['"])((?:\\.|.)*)\1$/mu)[2] -end - -def interpret_escapes s - token_exp = /\\(?:([0-9a-fA-F]{1,6}(?:\r\n|\s)?)|(.))/mu - return s.gsub(token_exp) do |escape_sequence| - if !$1.nil? - code = $1.chomp.to_i 16 - code = 0xFFFD if code > 0x10FFFF - next [code].pack('U') - end - next '' if $2 == "\n" - next $2 - end -end - -# override racc's on_error so we can have context in our error messages -def on_error(t, val, vstack) - errcontext = (@ss.pre_match[-10..-1] || @ss.pre_match) + - @ss.matched + @ss.post_match[0..9] - line_number = @ss.pre_match.lines.count - raise ParseError, sprintf("parse error on value %s (%s) " + - "on line %s around \"%s\"", - val.inspect, token_to_str(t) || '?', - line_number, errcontext) -end - -def before_pos(val) - # don't include leading whitespace - return current_pos - val.last.length + val.last[/\A\s*/].size -end - -def after_pos(val) - # don't include trailing whitespace - return current_pos - val.last[/\s*\z/].size -end - -# charpos will work with multibyte strings but is not available until ruby 2 -def current_pos - @ss.respond_to?('charpos') ? @ss.charpos : @ss.pos -end diff --git a/test/mri/racc/assets/digraph.y b/test/mri/racc/assets/digraph.y deleted file mode 100644 index 17a034ee54d..00000000000 --- a/test/mri/racc/assets/digraph.y +++ /dev/null @@ -1,29 +0,0 @@ -# ? detect digraph bug - -class P - token A B C D -rule - target : a b c d - a : A - | - b : B - | - c : C - | - d : D - | -end - ----- inner - - def parse - do_parse - end - - def next_token - [false, '$'] - end - ----- footer - -P.new.parse diff --git a/test/mri/racc/assets/echk.y b/test/mri/racc/assets/echk.y deleted file mode 100644 index 0fda2685aa5..00000000000 --- a/test/mri/racc/assets/echk.y +++ /dev/null @@ -1,118 +0,0 @@ -# -# racc tester -# - -class Calcp - - prechigh - left '*' '/' - left '+' '-' - preclow - - convert - NUMBER 'Number' - end - -rule - - target : exp | /* none */ { result = 0 } ; - - exp : exp '+' exp { result += val[2]; a = 'plus' } - | exp '-' exp { result -= val[2]; "string test" } - | exp '*' exp { result *= val[2] } - | exp '/' exp { result /= val[2] } - | '(' { $emb = true } exp ')' - { - raise 'must not happen' unless $emb - result = val[2] - } - | '-' NUMBER { result = -val[1] } - | NUMBER - ; - -end - -----header - -class Number ; end - -----inner - - def parse( src ) - @src = src - do_parse - end - - def next_token - @src.shift - end - - def initialize - @yydebug = true - end - -----footer - -$parser = Calcp.new -$tidx = 1 - -def chk( src, ans ) - ret = $parser.parse( src ) - unless ret == ans then - bug! "test #{$tidx} fail" - end - $tidx += 1 -end - -chk( - [ [Number, 9], - [false, false], - [false, false] ], 9 -) - -chk( - [ [Number, 5], - ['*', nil], - [Number, 1], - ['-', nil], - [Number, 1], - ['*', nil], - [Number, 8], - [false, false], - [false, false] ], -3 -) - -chk( - [ [Number, 5], - ['+', nil], - [Number, 2], - ['-', nil], - [Number, 5], - ['+', nil], - [Number, 2], - ['-', nil], - [Number, 5], - [false, false], - [false, false] ], -1 -) - -chk( - [ ['-', nil], - [Number, 4], - [false, false], - [false, false] ], -4 -) - -chk( - [ [Number, 7], - ['*', nil], - ['(', nil], - [Number, 4], - ['+', nil], - [Number, 3], - [')', nil], - ['-', nil], - [Number, 9], - [false, false], - [false, false] ], 40 -) diff --git a/test/mri/racc/assets/edtf.y b/test/mri/racc/assets/edtf.y deleted file mode 100644 index 4f5f6bb4fdd..00000000000 --- a/test/mri/racc/assets/edtf.y +++ /dev/null @@ -1,583 +0,0 @@ -# -*- racc -*- - -# Copyright 2011 Sylvester Keil. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and documentation are -# those of the authors and should not be interpreted as representing official -# policies, either expressed or implied, of the copyright holder. - -class EDTF::Parser - -token T Z E X U UNKNOWN OPEN LONGYEAR UNMATCHED DOTS UA PUA - -expect 0 - -rule - - edtf : level_0_expression - | level_1_expression - | level_2_expression - ; - - # ---- Level 0 / ISO 8601 Rules ---- - - # NB: level 0 intervals are covered by the level 1 interval rules - level_0_expression : date - | date_time - ; - - date : positive_date - | negative_date - ; - - positive_date : - year { result = Date.new(val[0]).year_precision! } - | year_month { result = Date.new(*val.flatten).month_precision! } - | year_month_day { result = Date.new(*val.flatten).day_precision! } - ; - - negative_date : '-' positive_date { result = -val[1] } - - - date_time : date T time { - result = DateTime.new(val[0].year, val[0].month, val[0].day, *val[2]) - result.skip_timezone = (val[2].length == 3) - } - - time : base_time - | base_time zone_offset { result = val.flatten } - - base_time : hour ':' minute ':' second { result = val.values_at(0, 2, 4) } - | midnight - - midnight : '2' '4' ':' '0' '0' ':' '0' '0' { result = [24, 0, 0] } - - zone_offset : Z { result = 0 } - | '-' zone_offset_hour { result = -1 * val[1] } - | '+' positive_zone_offset { result = val[1] } - ; - - positive_zone_offset : zone_offset_hour - | '0' '0' ':' '0' '0' { result = 0 } - ; - - - zone_offset_hour : d01_13 ':' minute { result = Rational(val[0] * 60 + val[2], 1440) } - | '1' '4' ':' '0' '0' { result = Rational(840, 1440) } - | '0' '0' ':' d01_59 { result = Rational(val[3], 1440) } - ; - - year : digit digit digit digit { - result = val.zip([1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } - } - - month : d01_12 - day : d01_31 - - year_month : year '-' month { result = [val[0], val[2]] } - - # We raise an exception if there are two many days for the month, but - # do not consider leap years, as the EDTF BNF did not either. - # NB: an exception will be raised regardless, because the Ruby Date - # implementation calculates leap years. - year_month_day : year_month '-' day { - result = val[0] << val[2] - if result[2] > 31 || (result[2] > 30 && [2,4,6,9,11].include?(result[1])) || (result[2] > 29 && result[1] == 2) - raise ArgumentError, "invalid date (invalid days #{result[2]} for month #{result[1]})" - end - } - - hour : d00_23 - minute : d00_59 - second : d00_59 - - # Completely covered by level_1_interval - # level_0_interval : date '/' date { result = Interval.new(val[0], val[1]) } - - - # ---- Level 1 Extension Rules ---- - - # NB: Uncertain/approximate Dates are covered by the Level 2 rules - level_1_expression : unspecified | level_1_interval | long_year_simple | season - - # uncertain_or_approximate_date : date UA { result = uoa(val[0], val[1]) } - - unspecified : unspecified_year - { - result = Date.new(val[0][0]).year_precision! - result.unspecified.year[2,2] = val[0][1] - } - | unspecified_month - | unspecified_day - | unspecified_day_and_month - ; - - unspecified_year : - digit digit digit U - { - result = [val[0,3].zip([1000,100,10]).reduce(0) { |s,(a,b)| s += a * b }, [false,true]] - } - | digit digit U U - { - result = [val[0,2].zip([1000,100]).reduce(0) { |s,(a,b)| s += a * b }, [true, true]] - } - - unspecified_month : year '-' U U { - result = Date.new(val[0]).unspecified!(:month) - result.precision = :month - } - - unspecified_day : year_month '-' U U { - result = Date.new(*val[0]).unspecified!(:day) - } - - unspecified_day_and_month : year '-' U U '-' U U { - result = Date.new(val[0]).unspecified!([:day,:month]) - } - - - level_1_interval : level_1_start '/' level_1_end { - result = Interval.new(val[0], val[2]) - } - - level_1_start : date | partial_uncertain_or_approximate | unspecified | partial_unspecified | UNKNOWN - - level_1_end : level_1_start | OPEN - - - long_year_simple : - LONGYEAR long_year - { - result = Date.new(val[1]) - result.precision = :year - } - | LONGYEAR '-' long_year - { - result = Date.new(-1 * val[2]) - result.precision = :year - } - ; - - long_year : - positive_digit digit digit digit digit { - result = val.zip([10000,1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } - } - | long_year digit { result = 10 * val[0] + val[1] } - ; - - - season : year '-' season_number ua { - result = Season.new(val[0], val[2]) - val[3].each { |ua| result.send(ua) } - } - - season_number : '2' '1' { result = 21 } - | '2' '2' { result = 22 } - | '2' '3' { result = 23 } - | '2' '4' { result = 24 } - ; - - - # ---- Level 2 Extension Rules ---- - - # NB: Level 2 Intervals are covered by the Level 1 Interval rules. - level_2_expression : season_qualified - | partial_uncertain_or_approximate - | partial_unspecified - | choice_list - | inclusive_list - | masked_precision - | date_and_calendar - | long_year_scientific - ; - - - season_qualified : season '^' { result = val[0]; result.qualifier = val[1] } - - - long_year_scientific : - long_year_simple E integer - { - result = Date.new(val[0].year * 10 ** val[2]).year_precision! - } - | LONGYEAR int1_4 E integer - { - result = Date.new(val[1] * 10 ** val[3]).year_precision! - } - | LONGYEAR '-' int1_4 E integer - { - result = Date.new(-1 * val[2] * 10 ** val[4]).year_precision! - } - ; - - - date_and_calendar : date '^' { result = val[0]; result.calendar = val[1] } - - - masked_precision : - digit digit digit X - { - d = val[0,3].zip([1000,100,10]).reduce(0) { |s,(a,b)| s += a * b } - result = EDTF::Decade.new(d) - } - | digit digit X X - { - d = val[0,2].zip([1000,100]).reduce(0) { |s,(a,b)| s += a * b } - result = EDTF::Century.new(d) - } - ; - - - choice_list : '[' list ']' { result = val[1].choice! } - - inclusive_list : '{' list '}' { result = val[1] } - - list : earlier { result = EDTF::Set.new(val[0]).earlier! } - | earlier ',' list_elements ',' later { result = EDTF::Set.new([val[0]] + val[2] + [val[4]]).earlier!.later! } - | earlier ',' list_elements { result = EDTF::Set.new([val[0]] + val[2]).earlier! } - | earlier ',' later { result = EDTF::Set.new([val[0]] + [val[2]]).earlier!.later! } - | list_elements ',' later { result = EDTF::Set.new(val[0] + [val[2]]).later! } - | list_elements { result = EDTF::Set.new(*val[0]) } - | later { result = EDTF::Set.new(val[0]).later! } - ; - - list_elements : list_element { result = [val[0]].flatten } - | list_elements ',' list_element { result = val[0] + [val[2]].flatten } - ; - - list_element : atomic - | consecutives - ; - - atomic : date - | partial_uncertain_or_approximate - | unspecified - ; - - earlier : DOTS date { result = val[1] } - - later : year_month_day DOTS { result = Date.new(*val[0]).year_precision! } - | year_month DOTS { result = Date.new(*val[0]).month_precision! } - | year DOTS { result = Date.new(val[0]).year_precision! } - ; - - consecutives : year_month_day DOTS year_month_day { result = (Date.new(val[0]).day_precision! .. Date.new(val[2]).day_precision!) } - | year_month DOTS year_month { result = (Date.new(val[0]).month_precision! .. Date.new(val[2]).month_precision!) } - | year DOTS year { result = (Date.new(val[0]).year_precision! .. Date.new(val[2]).year_precision!) } - ; - - partial_unspecified : - unspecified_year '-' month '-' day - { - result = Date.new(val[0][0], val[2], val[4]) - result.unspecified.year[2,2] = val[0][1] - } - | unspecified_year '-' U U '-' day - { - result = Date.new(val[0][0], 1, val[5]) - result.unspecified.year[2,2] = val[0][1] - result.unspecified!(:month) - } - | unspecified_year '-' U U '-' U U - { - result = Date.new(val[0][0], 1, 1) - result.unspecified.year[2,2] = val[0][1] - result.unspecified!([:month, :day]) - } - | unspecified_year '-' month '-' U U - { - result = Date.new(val[0][0], val[2], 1) - result.unspecified.year[2,2] = val[0][1] - result.unspecified!(:day) - } - | year '-' U U '-' day - { - result = Date.new(val[0], 1, val[5]) - result.unspecified!(:month) - } - ; - - - partial_uncertain_or_approximate : pua_base - | '(' pua_base ')' UA { result = uoa(val[1], val[3]) } - - pua_base : - pua_year { result = val[0].year_precision! } - | pua_year_month { result = val[0][0].month_precision! } - | pua_year_month_day { result = val[0].day_precision! } - - pua_year : year UA { result = uoa(Date.new(val[0]), val[1], :year) } - - pua_year_month : - pua_year '-' month ua { - result = [uoa(val[0].change(:month => val[2]), val[3], [:month, :year])] - } - | year '-' month UA { - result = [uoa(Date.new(val[0], val[2]), val[3], [:year, :month])] - } - | year '-(' month ')' UA { - result = [uoa(Date.new(val[0], val[2]), val[4], [:month]), true] - } - | pua_year '-(' month ')' UA { - result = [uoa(val[0].change(:month => val[2]), val[4], [:month]), true] - } - ; - - pua_year_month_day : - pua_year_month '-' day ua { - result = uoa(val[0][0].change(:day => val[2]), val[3], val[0][1] ? [:day] : nil) - } - | pua_year_month '-(' day ')' UA { - result = uoa(val[0][0].change(:day => val[2]), val[4], [:day]) - } - | year '-(' month ')' UA day ua { - result = uoa(uoa(Date.new(val[0], val[2], val[5]), val[4], :month), val[6], :day) - } - | year_month '-' day UA { - result = uoa(Date.new(val[0][0], val[0][1], val[2]), val[3]) - } - | year_month '-(' day ')' UA { - result = uoa(Date.new(val[0][0], val[0][1], val[2]), val[4], [:day]) - } - | year '-(' month '-' day ')' UA { - result = uoa(Date.new(val[0], val[2], val[4]), val[6], [:month, :day]) - } - | year '-(' month '-(' day ')' UA ')' UA { - result = Date.new(val[0], val[2], val[4]) - result = uoa(result, val[6], [:day]) - result = uoa(result, val[8], [:month, :day]) - } - | pua_year '-(' month '-' day ')' UA { - result = val[0].change(:month => val[2], :day => val[4]) - result = uoa(result, val[6], [:month, :day]) - } - | pua_year '-(' month '-(' day ')' UA ')' UA { - result = val[0].change(:month => val[2], :day => val[4]) - result = uoa(result, val[6], [:day]) - result = uoa(result, val[8], [:month, :day]) - } - # | '(' pua_year '-(' month ')' UA ')' UA '-' day ua { - # result = val[1].change(:month => val[3], :day => val[9]) - # result = uoa(result, val[5], [:month]) - # result = [uoa(result, val[7], [:year]), true] - # } - ; - - ua : { result = [] } | UA - - # ---- Auxiliary Rules ---- - - digit : '0' { result = 0 } - | positive_digit - ; - - positive_digit : '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' - - d01_12 : '0' positive_digit { result = val[1] } - | '1' '0' { result = 10 } - | '1' '1' { result = 11 } - | '1' '2' { result = 12 } - ; - - d01_13 : d01_12 - | '1' '3' { result = 13 } - ; - - d01_23 : '0' positive_digit { result = val[1] } - | '1' digit { result = 10 + val[1] } - | '2' '0' { result = 20 } - | '2' '1' { result = 21 } - | '2' '2' { result = 22 } - | '2' '3' { result = 23 } - ; - - d00_23 : '0' '0' - | d01_23 - ; - - d01_29 : d01_23 - | '2' '4' { result = 24 } - | '2' '5' { result = 25 } - | '2' '6' { result = 26 } - | '2' '7' { result = 27 } - | '2' '8' { result = 28 } - | '2' '9' { result = 29 } - ; - - d01_30 : d01_29 - | '3' '0' { result = 30 } - ; - - d01_31 : d01_30 - | '3' '1' { result = 31 } - ; - - d01_59 : d01_29 - | '3' digit { result = 30 + val[1] } - | '4' digit { result = 40 + val[1] } - | '5' digit { result = 50 + val[1] } - ; - - d00_59 : '0' '0' - | d01_59 - ; - - int1_4 : positive_digit { result = val[0] } - | positive_digit digit { result = 10 * val[0] + val[1] } - | positive_digit digit digit - { - result = val.zip([100,10,1]).reduce(0) { |s,(a,b)| s += a * b } - } - | positive_digit digit digit digit - { - result = val.zip([1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } - } - ; - - integer : positive_digit { result = val[0] } - | integer digit { result = 10 * val[0] + val[1] } - ; - - - ----- header -require 'strscan' - ----- inner - - @defaults = { - :level => 2, - :debug => false - }.freeze - - class << self; attr_reader :defaults; end - - attr_reader :options - - def initialize(options = {}) - @options = Parser.defaults.merge(options) - end - - def debug? - !!(options[:debug] || ENV['DEBUG']) - end - - def parse(input) - parse!(input) - rescue => e - warn e.message if debug? - nil - end - - def parse!(input) - @yydebug = debug? - @src = StringScanner.new(input) - do_parse - end - - def on_error(tid, value, stack) - raise ArgumentError, - "failed to parse date: unexpected '#{value}' at #{stack.inspect}" - end - - def apply_uncertainty(date, uncertainty, scope = nil) - uncertainty.each do |u| - scope.nil? ? date.send(u) : date.send(u, scope) - end - date - end - - alias uoa apply_uncertainty - - def next_token - case - when @src.eos? - nil - # when @src.scan(/\s+/) - # ignore whitespace - when @src.scan(/\(/) - ['(', @src.matched] - # when @src.scan(/\)\?~-/) - # [:PUA, [:uncertain!, :approximate!]] - # when @src.scan(/\)\?-/) - # [:PUA, [:uncertain!]] - # when @src.scan(/\)~-/) - # [:PUA, [:approximate!]] - when @src.scan(/\)/) - [')', @src.matched] - when @src.scan(/\[/) - ['[', @src.matched] - when @src.scan(/\]/) - [']', @src.matched] - when @src.scan(/\{/) - ['{', @src.matched] - when @src.scan(/\}/) - ['}', @src.matched] - when @src.scan(/T/) - [:T, @src.matched] - when @src.scan(/Z/) - [:Z, @src.matched] - when @src.scan(/\?~/) - [:UA, [:uncertain!, :approximate!]] - when @src.scan(/\?/) - [:UA, [:uncertain!]] - when @src.scan(/~/) - [:UA, [:approximate!]] - when @src.scan(/open/i) - [:OPEN, :open] - when @src.scan(/unkn?own/i) # matches 'unkown' typo too - [:UNKNOWN, :unknown] - when @src.scan(/u/) - [:U, @src.matched] - when @src.scan(/x/i) - [:X, @src.matched] - when @src.scan(/y/) - [:LONGYEAR, @src.matched] - when @src.scan(/e/) - [:E, @src.matched] - when @src.scan(/\+/) - ['+', @src.matched] - when @src.scan(/-\(/) - ['-(', @src.matched] - when @src.scan(/-/) - ['-', @src.matched] - when @src.scan(/:/) - [':', @src.matched] - when @src.scan(/\//) - ['/', @src.matched] - when @src.scan(/\s*\.\.\s*/) - [:DOTS, '..'] - when @src.scan(/\s*,\s*/) - [',', ','] - when @src.scan(/\^\w+/) - ['^', @src.matched[1..-1]] - when @src.scan(/\d/) - [@src.matched, @src.matched.to_i] - else @src.scan(/./) - [:UNMATCHED, @src.rest] - end - end - - -# -*- racc -*- diff --git a/test/mri/racc/assets/err.y b/test/mri/racc/assets/err.y deleted file mode 100644 index ae280957ccd..00000000000 --- a/test/mri/racc/assets/err.y +++ /dev/null @@ -1,60 +0,0 @@ - -class ErrTestp - -rule - -target: lines - ; - -lines: line - | lines line - ; - -line: A B C D E - | error E - ; - -end - ----- inner - -def initialize - @yydebug = false - @q = [ - [:A, 'a'], - # [:B, 'b'], - [:C, 'c'], - [:D, 'd'], - [:E, 'e'], - - [:A, 'a'], - [:B, 'b'], - [:C, 'c'], - [:D, 'd'], - [:E, 'e'], - - [:A, 'a'], - [:B, 'b'], - # [:C, 'c'], - [:D, 'd'], - [:E, 'e'], - [false, nil] - ] -end - -def next_token - @q.shift -end - -def on_error( t, val, values ) - $stderr.puts "error on token '#{val}'(#{t})" -end - -def parse - do_parse -end - ----- footer - -p = ErrTestp.new -p.parse diff --git a/test/mri/racc/assets/error_recovery.y b/test/mri/racc/assets/error_recovery.y deleted file mode 100644 index 1fd21ac7d04..00000000000 --- a/test/mri/racc/assets/error_recovery.y +++ /dev/null @@ -1,35 +0,0 @@ -# Regression test case for the bug discussed here: -# https://github.com/whitequark/parser/issues/93 -# In short, a Racc-generated parser could go into an infinite loop when -# attempting error recovery at EOF - -class InfiniteLoop - -rule - - stmts: stmt - | error stmt - - stmt: '%' stmt - -end - ----- inner - - def parse - @errors = [] - do_parse - end - - def next_token - nil - end - - def on_error(error_token, error_value, value_stack) - # oh my, an error - @errors << [error_token, error_value] - end - ----- footer - -InfiniteLoop.new.parse \ No newline at end of file diff --git a/test/mri/racc/assets/expect.y b/test/mri/racc/assets/expect.y deleted file mode 100644 index 24c27443e20..00000000000 --- a/test/mri/racc/assets/expect.y +++ /dev/null @@ -1,7 +0,0 @@ -class E - expect 1 -rule - list: inlist inlist - inlist: - | A -end diff --git a/test/mri/racc/assets/firstline.y b/test/mri/racc/assets/firstline.y deleted file mode 100644 index ab0692e543f..00000000000 --- a/test/mri/racc/assets/firstline.y +++ /dev/null @@ -1,4 +0,0 @@ -class T -rule - a: A B C -end diff --git a/test/mri/racc/assets/huia.y b/test/mri/racc/assets/huia.y deleted file mode 100644 index de9d45150c9..00000000000 --- a/test/mri/racc/assets/huia.y +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright (c) 2014 James Harton -# -# MIT License -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -class Huia::Parser - - token - IDENTIFIER EQUAL PLUS MINUS ASTERISK FWD_SLASH COLON FLOAT INTEGER STRING - EXPO INDENT OUTDENT OPAREN CPAREN DOT SIGNATURE NL EOF PIPE COMMA NIL TRUE - FALSE EQUALITY CALL SELF CONSTANT CHAR DOUBLE_TICK_STRING - DOUBLE_TICK_STRING_END INTERPOLATE_START INTERPOLATE_END BOX LSQUARE - RSQUARE FACES LFACE RFACE BANG TILDE RETURN NOT_EQUALITY OR AND GT LT - GTE LTE AT - - prechigh - left EXPO - left BANG TILDE - left ASTERISK FWD_SLASH PERCENT - left PLUS MINUS - - right EQUAL - preclow - - rule - statements: statement - | statements statement { return scope } - - statement: expr eol { return scope.append val[0] } - | expr { return scope.append val[0] } - | eol { return scope } - - eol: NL | EOF - nlq: NL | - - expr: literal - | grouped_expr - | binary_op - | unary_op - | method_call - | constant - | variable - | array - | hash - | return - - return: return_expr - | return_nil - return_expr: RETURN expr { return n(:Return, val[1]) } - return_nil: RETURN { return n(:Return, n(:Nil)) } - - array: empty_array - | array_list - - empty_array: BOX { return n :Array } - - array_list: LSQUARE array_items RSQUARE { return val[1] } - array_items: expr { return n :Array, [val[0]] } - | array_items COMMA expr { val[0].append(val[2]); return val[0] } - - hash: empty_hash - | hash_list - empty_hash: FACES { return n :Hash } - hash_list: LFACE hash_items RFACE { return val[1] } - hash_items: hash_item { return n :Hash, val[0] } - | hash_items COMMA hash_item { val[0].append(val[2]); return val[0] } - hash_item: expr COLON expr { return n :HashItem, val[0], val[2] } - - constant: CONSTANT { return constant val[0] } - - indented: indented_w_stmts - | indented_w_expr - | indented_wo_stmts - indented_w_stmts: indent statements outdent { return val[0] } - indented_w_expr: indent expr outdent { return val[0].append(val[1]) } - indented_wo_stmts: indent outdent { return val[0] } - outdent: OUTDENT { return pop_scope } - - - indent_w_args: indent_pipe indent_args PIPE nlq INDENT { return val[0] } - indent_pipe: PIPE { return push_scope } - indent_wo_args: INDENT { return push_scope } - indent: indent_w_args - | indent_wo_args - - indent_args: indent_arg - | indent_args COMMA indent_arg - indent_arg: arg_var { return scope.add_argument val[0] } - | arg_var EQUAL expr { return n :Assignment, val[0], val[2] } - arg_var: IDENTIFIER { return n :Variable, val[0] } - - method_call: method_call_on_object - | method_call_on_self - | method_call_on_closure - method_call_on_object: expr DOT call_signature { return n :MethodCall, val[0], val[2] } - | expr DOT IDENTIFIER { return n :MethodCall, val[0], n(:CallSignature, val[2]) } - method_call_on_self: call_signature { return n :MethodCall, scope_instance, val[0] } - - method_call_on_closure: AT call_signature { return n :MethodCall, this_closure, val[1] } - | AT IDENTIFIER { return n :MethodCall, this_closure, n(:CallSignature, val[1]) } - - call_signature: call_arguments - | call_simple_name - call_simple_name: CALL { return n :CallSignature, val[0] } - call_argument: SIGNATURE call_passed_arg { return n :CallSignature, val[0], [val[1]] } - call_passed_arg: call_passed_simple - | call_passed_indented - call_passed_simple: expr - | expr NL - call_passed_indented: indented - | indented NL - call_arguments: call_argument { return val[0] } - | call_arguments call_argument { return val[0].concat_signature val[1] } - - grouped_expr: OPAREN expr CPAREN { return n :Expression, val[1] } - - variable: IDENTIFIER { return allocate_local val[0] } - - binary_op: assignment - | addition - | subtraction - | multiplication - | division - | exponentiation - | modulo - | equality - | not_equality - | logical_or - | logical_and - | greater_than - | less_than - | greater_or_eq - | less_or_eq - - assignment: IDENTIFIER EQUAL expr { return allocate_local_assignment val[0], val[2] } - addition: expr PLUS expr { return binary val[0], val[2], 'plus:' } - subtraction: expr MINUS expr { return binary val[0], val[2], 'minus:' } - multiplication: expr ASTERISK expr { return binary val[0], val[2], 'multiplyBy:' } - division: expr FWD_SLASH expr { return binary val[0], val[2], 'divideBy:' } - exponentiation: expr EXPO expr { return binary val[0], val[2], 'toThePowerOf:' } - modulo: expr PERCENT expr { return binary val[0], val[2], 'moduloOf:' } - equality: expr EQUALITY expr { return binary val[0], val[2], 'isEqualTo:' } - not_equality: expr NOT_EQUALITY expr { return binary val[0], val[2], 'isNotEqualTo:' } - logical_or: expr OR expr { return binary val[0], val[2], 'logicalOr:' } - logical_and: expr AND expr { return binary val[0], val[2], 'logicalAnd:' } - greater_than: expr GT expr { return binary val[0], val[2], 'isGreaterThan:' } - less_than: expr LT expr { return binary val[0], val[2], 'isLessThan:' } - greater_or_eq: expr GTE expr { return binary val[0], val[2], 'isGreaterOrEqualTo:' } - less_or_eq: expr LTE expr { return binary val[0], val[2], 'isLessOrEqualTo:' } - - unary_op: unary_not - | unary_plus - | unary_minus - | unary_complement - - unary_not: BANG expr { return unary val[1], 'unaryNot' } - unary_plus: PLUS expr { return unary val[1], 'unaryPlus' } - unary_minus: MINUS expr { return unary val[1], 'unaryMinus' } - unary_complement: TILDE expr { return unary val[1], 'unaryComplement' } - - literal: integer - | float - | string - | nil - | true - | false - | self - - float: FLOAT { return n :Float, val[0] } - integer: INTEGER { return n :Integer, val[0] } - nil: NIL { return n :Nil } - true: TRUE { return n :True } - false: FALSE { return n :False } - self: SELF { return n :Self } - - string: STRING { return n :String, val[0] } - | interpolated_string - | empty_string - - interpolated_string: DOUBLE_TICK_STRING interpolated_string_contents DOUBLE_TICK_STRING_END { return val[1] } - interpolation: INTERPOLATE_START expr INTERPOLATE_END { return val[1] } - interpolated_string_contents: interpolated_string_chunk { return n :InterpolatedString, val[0] } - | interpolated_string_contents interpolated_string_chunk { val[0].append(val[1]); return val[0] } - interpolated_string_chunk: chars { return val[0] } - | interpolation { return to_string(val[0]) } - empty_string: DOUBLE_TICK_STRING DOUBLE_TICK_STRING_END { return n :String, '' } - - chars: CHAR { return n :String, val[0] } - | chars CHAR { val[0].append(val[1]); return val[0] } -end - ----- inner - -attr_accessor :lexer, :scopes, :state - -def initialize lexer - @lexer = lexer - @state = [] - @scopes = [] - push_scope -end - -def ast - @ast ||= do_parse - @scopes.first -end - -def on_error t, val, vstack - line = lexer.line - col = lexer.column - message = "Unexpected #{token_to_str t} at #{lexer.filename} line #{line}:#{col}:\n\n" - - start = line - 5 > 0 ? line - 5 : 0 - i_size = line.to_s.size - (start..(start + 5)).each do |i| - message << sprintf("\t%#{i_size}d: %s\n", i, lexer.get_line(i)) - message << "\t#{' ' * i_size} #{'-' * (col - 1)}^\n" if i == line - end - - raise SyntaxError, message -end - -def next_token - nt = lexer.next_computed_token - # just use a state stack for now, we'll have to do something - # more sophisticated soon. - if nt && nt.first == :state - if nt.last - state.push << nt.last - else - state.pop - end - next_token - else - nt - end -end - -def push_scope - new_scope = Huia::AST::Scope.new scope - new_scope.file = lexer.filename - new_scope.line = lexer.line - new_scope.column = lexer.column - scopes.push new_scope - new_scope -end - -def pop_scope - scopes.pop -end - -def scope - scopes.last -end - -def binary left, right, method - node(:MethodCall, left, node(:CallSignature, method, [right])) -end - -def unary left, method - node(:MethodCall, left, node(:CallSignature, method)) -end - -def node type, *args - Huia::AST.const_get(type).new(*args).tap do |n| - n.file = lexer.filename - n.line = lexer.line - n.column = lexer.column - end -end -alias n node - -def allocate_local name - node(:Variable, name).tap do |n| - scope.allocate_local n - end -end - -def allocate_local_assignment name, value - node(:Assignment, name, value).tap do |n| - scope.allocate_local n - end -end - -def this_closure - allocate_local('@') -end - -def scope_instance - node(:ScopeInstance, scope) -end - -def constant name - return scope_instance if name == 'self' - node(:Constant, name) -end - -def to_string expr - node(:MethodCall, expr, node(:CallSignature, 'toString')) -end diff --git a/test/mri/racc/assets/ichk.y b/test/mri/racc/assets/ichk.y deleted file mode 100644 index 1d359df83e2..00000000000 --- a/test/mri/racc/assets/ichk.y +++ /dev/null @@ -1,102 +0,0 @@ -class Calculator - - prechigh - left '*' '/' - left '+' '-' - preclow - - convert - NUMBER 'Number' - end - -rule - - target : exp - | /* none */ { result = 0 } - - exp : exp '+' exp { result += val[2]; a = 'plus' } - | exp '-' exp { result -= val[2]; a = "string test" } - | exp '*' exp { result *= val[2] } - | exp '/' exp { result /= val[2] } - | '(' { $emb = true } exp ')' - { - raise 'must not happen' unless $emb - result = val[2] - } - | '-' NUMBER { result = -val[1] } - | NUMBER - -----header - -class Number -end - -----inner - - def initialize - @racc_debug_out = $stdout - @yydebug = false - end - - def validate(expected, src) - result = parse(src) - unless result == expected - raise "test #{@test_number} fail" - end - @test_number += 1 - end - - def parse(src) - @src = src - @test_number = 1 - yyparse self, :scan - end - - def scan(&block) - @src.each(&block) - end - -----footer - -calc = Calculator.new - -calc.validate(9, [[Number, 9], nil]) - -calc.validate(-3, - [[Number, 5], - ['*', '*'], - [Number, 1], - ['-', '*'], - [Number, 1], - ['*', '*'], - [Number, 8], - nil]) - -calc.validate(-1, - [[Number, 5], - ['+', '+'], - [Number, 2], - ['-', '-'], - [Number, 5], - ['+', '+'], - [Number, 2], - ['-', '-'], - [Number, 5], - nil]) - -calc.validate(-4, - [['-', 'UMINUS'], - [Number, 4], - nil]) - -calc.validate(40, - [[Number, 7], - ['*', '*'], - ['(', '('], - [Number, 4], - ['+', '+'], - [Number, 3], - [')', ')'], - ['-', '-'], - [Number, 9], - nil]) diff --git a/test/mri/racc/assets/ifelse.y b/test/mri/racc/assets/ifelse.y deleted file mode 100644 index 18dbe4b1a78..00000000000 --- a/test/mri/racc/assets/ifelse.y +++ /dev/null @@ -1,14 +0,0 @@ -class C::Parser -token tSOMETHING -rule - statement - : tSOMETHING - | 'if' statement 'then' statement - | 'if' statement 'then' statement 'else' statement - ; - - dummy - : tSOMETHING '+' tSOMETHING - | tSOMETHING '-' tSOMETHING - ; - diff --git a/test/mri/racc/assets/intp.y b/test/mri/racc/assets/intp.y deleted file mode 100644 index 39e42afd74b..00000000000 --- a/test/mri/racc/assets/intp.y +++ /dev/null @@ -1,546 +0,0 @@ -# -# intp -# - -class Intp::Parser - -prechigh - nonassoc UMINUS - left '*' '/' - left '+' '-' - nonassoc EQ -preclow - -rule - - program : stmt_list - { - result = RootNode.new( val[0] ) - } - - stmt_list : - { - result = [] - } - | stmt_list stmt EOL - { - result.push val[1] - } - | stmt_list EOL - - stmt : expr - | assign - | IDENT realprim - { - result = FuncallNode.new( @fname, val[0][0], - val[0][1], [val[1]] ) - } - | if_stmt - | while_stmt - | defun - - if_stmt : IF stmt THEN EOL stmt_list else_stmt END - { - result = IfNode.new( @fname, val[0][0], - val[1], val[4], val[5] ) - } - - else_stmt : ELSE EOL stmt_list - { - result = val[2] - } - | - { - result = nil - } - - while_stmt: WHILE stmt DO EOL stmt_list END - { - result = WhileNode.new(@fname, val[0][0], - val[1], val[4]) - } - - defun : DEF IDENT param EOL stmt_list END - { - result = DefNode.new(@fname, val[0][0], val[1][1], - Function.new(@fname, val[0][0], val[2], val[4])) - } - - param : '(' name_list ')' - { - result = val[1] - } - | '(' ')' - { - result = [] - } - | - { - result = [] - } - - name_list : IDENT - { - result = [ val[0][1] ] - } - | name_list ',' IDENT - { - result.push val[2][1] - } - - assign : IDENT '=' expr - { - result = AssignNode.new(@fname, val[0][0], val[0][1], val[2]) - } - - expr : expr '+' expr - { - result = FuncallNode.new(@fname, val[0].lineno, '+', [val[0], val[2]]) - } - | expr '-' expr - { - result = FuncallNode.new(@fname, val[0].lineno, '-', [val[0], val[2]]) - } - | expr '*' expr - { - result = FuncallNode.new(@fname, val[0].lineno, '*', [val[0], val[2]]) - } - | expr '/' expr - { - result = FuncallNode.new(@fname, val[0].lineno, - '/', [val[0], val[2]]) - } - | expr EQ expr - { - result = FuncallNode.new(@fname, val[0].lineno, '==', [val[0], val[2]]) - } - | primary - - primary : realprim - | '(' expr ')' - { - result = val[1] - } - | '-' expr =UMINUS - { - result = FuncallNode.new(@fname, val[0][0], '-@', [val[1]]) - } - - realprim : IDENT - { - result = VarRefNode.new(@fname, val[0][0], - val[0][1]) - } - | NUMBER - { - result = LiteralNode.new(@fname, *val[0]) - } - | STRING - { - result = StringNode.new(@fname, *val[0]) - } - | TRUE - { - result = LiteralNode.new(@fname, *val[0]) - } - | FALSE - { - result = LiteralNode.new(@fname, *val[0]) - } - | NIL - { - result = LiteralNode.new(@fname, *val[0]) - } - | funcall - - funcall : IDENT '(' args ')' - { - result = FuncallNode.new(@fname, val[0][0], val[0][1], val[2]) - } - | IDENT '(' ')' - { - result = FuncallNode.new(@fname, val[0][0], val[0][1], []) - } - - args : expr - { - result = val - } - | args ',' expr - { - result.push val[2] - } - -end - ----- header -# -# intp/parser.rb -# - ----- inner - - def initialize - @scope = {} - end - - RESERVED = { - 'if' => :IF, - 'else' => :ELSE, - 'while' => :WHILE, - 'then' => :THEN, - 'do' => :DO, - 'def' => :DEF, - 'true' => :TRUE, - 'false' => :FALSE, - 'nil' => :NIL, - 'end' => :END - } - - RESERVED_V = { - 'true' => true, - 'false' => false, - 'nil' => nil - } - - def parse(f, fname) - @q = [] - @fname = fname - lineno = 1 - f.each do |line| - line.strip! - until line.empty? - case line - when /\A\s+/, /\A\#.*/ - ; - when /\A[a-zA-Z_]\w*/ - word = $& - @q.push [(RESERVED[word] || :IDENT), - [lineno, RESERVED_V.key?(word) ? RESERVED_V[word] : word.intern]] - when /\A\d+/ - @q.push [:NUMBER, [lineno, $&.to_i]] - when /\A"(?:[^"\\]+|\\.)*"/, /\A'(?:[^'\\]+|\\.)*'/ - @q.push [:STRING, [lineno, eval($&)]] - when /\A==/ - @q.push [:EQ, [lineno, '==']] - when /\A./ - @q.push [$&, [lineno, $&]] - else - raise RuntimeError, 'must not happen' - end - line = $' - end - @q.push [:EOL, [lineno, nil]] - lineno += 1 - end - @q.push [false, '$'] - do_parse - end - - def next_token - @q.shift - end - - def on_error(t, v, values) - if v - line = v[0] - v = v[1] - else - line = 'last' - end - raise Racc::ParseError, "#{@fname}:#{line}: syntax error on #{v.inspect}" - end - ----- footer -# intp/node.rb - -module Intp - - class IntpError < StandardError; end - class IntpArgumentError < IntpError; end - - class Core - - def initialize - @ftab = {} - @obj = Object.new - @stack = [] - @stack.push Frame.new '(toplevel)' - end - - def frame - @stack[-1] - end - - def define_function(fname, node) - raise IntpError, "function #{fname} defined twice" if @ftab.key?(fname) - @ftab[fname] = node - end - - def call_function_or(fname, args) - call_intp_function_or(fname, args) { - call_ruby_toplevel_or(fname, args) { - yield - } - } - end - - def call_intp_function_or(fname, args) - if func = @ftab[fname] - frame = Frame.new(fname) - @stack.push frame - func.call self, frame, args - @stack.pop - else - yield - end - end - - def call_ruby_toplevel_or(fname, args) - if @obj.respond_to? fname, true - @obj.send fname, *args - else - yield - end - end - - end - - class Frame - - def initialize(fname) - @fname = fname - @lvars = {} - end - - attr :fname - - def lvar?(name) - @lvars.key? name - end - - def [](key) - @lvars[key] - end - - def []=(key, val) - @lvars[key] = val - end - - end - - - class Node - - def initialize(fname, lineno) - @filename = fname - @lineno = lineno - end - - attr_reader :filename - attr_reader :lineno - - def exec_list(intp, nodes) - v = nil - nodes.each {|i| v = i.evaluate(intp) } - v - end - - def intp_error!(msg) - raise IntpError, "in #{filename}:#{lineno}: #{msg}" - end - - def inspect - "#{self.class.name}/#{lineno}" - end - - end - - - class RootNode < Node - - def initialize(tree) - super nil, nil - @tree = tree - end - - def evaluate - exec_list Core.new, @tree - end - - end - - - class DefNode < Node - - def initialize(file, lineno, fname, func) - super file, lineno - @funcname = fname - @funcobj = func - end - - def evaluate(intp) - intp.define_function @funcname, @funcobj - end - - end - - class FuncallNode < Node - - def initialize(file, lineno, func, args) - super file, lineno - @funcname = func - @args = args - end - - def evaluate(intp) - args = @args.map {|i| i.evaluate intp } - begin - intp.call_intp_function_or(@funcname, args) { - if args.empty? or not args[0].respond_to?(@funcname) - intp.call_ruby_toplevel_or(@funcname, args) { - intp_error! "undefined function #{@funcname.id2name}" - } - else - recv = args.shift - recv.send @funcname, *args - end - } - rescue IntpArgumentError, ArgumentError - intp_error! $!.message - end - end - - end - - class Function < Node - - def initialize(file, lineno, params, body) - super file, lineno - @params = params - @body = body - end - - def call(intp, frame, args) - unless args.size == @params.size - raise IntpArgumentError, - "wrong # of arg for #{frame.fname}() (#{args.size} for #{@params.size})" - end - args.each_with_index do |v,i| - frame[@params[i]] = v - end - exec_list intp, @body - end - - end - - - class IfNode < Node - - def initialize(fname, lineno, cond, tstmt, fstmt) - super fname, lineno - @condition = cond - @tstmt = tstmt - @fstmt = fstmt - end - - def evaluate(intp) - if @condition.evaluate(intp) - exec_list intp, @tstmt - else - exec_list intp, @fstmt if @fstmt - end - end - - end - - class WhileNode < Node - - def initialize(fname, lineno, cond, body) - super fname, lineno - @condition = cond - @body = body - end - - def evaluate(intp) - while @condition.evaluate(intp) - exec_list intp, @body - end - end - - end - - - class AssignNode < Node - - def initialize(fname, lineno, vname, val) - super fname, lineno - @vname = vname - @val = val - end - - def evaluate(intp) - intp.frame[@vname] = @val.evaluate(intp) - end - - end - - class VarRefNode < Node - - def initialize(fname, lineno, vname) - super fname, lineno - @vname = vname - end - - def evaluate(intp) - if intp.frame.lvar?(@vname) - intp.frame[@vname] - else - intp.call_function_or(@vname, []) { - intp_error! "unknown method or local variable #{@vname.id2name}" - } - end - end - - end - - class StringNode < Node - - def initialize(fname, lineno, str) - super fname, lineno - @val = str - end - - def evaluate(intp) - @val.dup - end - - end - - class LiteralNode < Node - - def initialize(fname, lineno, val) - super fname, lineno - @val = val - end - - def evaluate(intp) - @val - end - - end - -end # module Intp - -begin - tree = nil - fname = 'src.intp' - File.open(fname) {|f| - tree = Intp::Parser.new.parse(f, fname) - } - tree.evaluate -rescue Racc::ParseError, Intp::IntpError, Errno::ENOENT - raise #### - $stderr.puts "#{File.basename $0}: #{$!}" - exit 1 -end diff --git a/test/mri/racc/assets/journey.y b/test/mri/racc/assets/journey.y deleted file mode 100644 index c2640f33394..00000000000 --- a/test/mri/racc/assets/journey.y +++ /dev/null @@ -1,47 +0,0 @@ -class Journey::Parser - -token SLASH LITERAL SYMBOL LPAREN RPAREN DOT STAR OR - -rule - expressions - : expressions expression { result = Cat.new(val.first, val.last) } - | expression { result = val.first } - | or - ; - expression - : terminal - | group - | star - ; - group - : LPAREN expressions RPAREN { result = Group.new(val[1]) } - ; - or - : expressions OR expression { result = Or.new([val.first, val.last]) } - ; - star - : STAR { result = Star.new(Symbol.new(val.last)) } - ; - terminal - : symbol - | literal - | slash - | dot - ; - slash - : SLASH { result = Slash.new('/') } - ; - symbol - : SYMBOL { result = Symbol.new(val.first) } - ; - literal - : LITERAL { result = Literal.new(val.first) } - dot - : DOT { result = Dot.new(val.first) } - ; - -end - ----- header - -require 'journey/parser_extras' diff --git a/test/mri/racc/assets/liquor.y b/test/mri/racc/assets/liquor.y deleted file mode 100644 index 8045a072a42..00000000000 --- a/test/mri/racc/assets/liquor.y +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright (c) 2012-2013 Peter Zotov -# 2012 Yaroslav Markin -# 2012 Nate Gadgibalaev -# -# MIT License -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -class Liquor::Parser - token comma dot endtag ident integer keyword lblock lblock2 lbracket - linterp lparen op_div op_eq op_gt op_geq op_lt op_leq op_minus - op_mod op_mul op_neq op_not op_plus pipe plaintext rblock - rbracket rinterp rparen string tag_ident - - prechigh - left dot - nonassoc op_uminus op_not - left op_mul op_div op_mod - left op_plus op_minus - left op_eq op_neq op_lt op_leq op_gt op_geq - left op_and - left op_or - preclow - - expect 15 - - start block - -rule - block: /* empty */ - { result = [] } - | plaintext block - { result = [ val[0], *val[1] ] } - | interp block - { result = [ val[0], *val[1] ] } - | tag block - { result = [ val[0], *val[1] ] } - - interp: - linterp expr rinterp - { result = [ :interp, retag(val), val[1] ] } - | linterp filter_chain rinterp - { result = [ :interp, retag(val), val[1] ] } - - primary_expr: - ident - | lparen expr rparen - { result = [ val[1][0], retag(val), *val[1][2..-1] ] } - - expr: - integer - | string - | tuple - | ident function_args - { result = [ :call, retag(val), val[0], val[1] ] } - | expr lbracket expr rbracket - { result = [ :index, retag(val), val[0], val[2] ] } - | expr dot ident function_args - { result = [ :external, retag(val), val[0], val[2], val[3] ] } - | expr dot ident - { result = [ :external, retag(val), val[0], val[2], nil ] } - | op_minus expr =op_uminus - { result = [ :uminus, retag(val), val[1] ] } - | op_not expr - { result = [ :not, retag(val), val[1] ] } - | expr op_mul expr - { result = [ :mul, retag(val), val[0], val[2] ] } - | expr op_div expr - { result = [ :div, retag(val), val[0], val[2] ] } - | expr op_mod expr - { result = [ :mod, retag(val), val[0], val[2] ] } - | expr op_plus expr - { result = [ :plus, retag(val), val[0], val[2] ] } - | expr op_minus expr - { result = [ :minus, retag(val), val[0], val[2] ] } - | expr op_eq expr - { result = [ :eq, retag(val), val[0], val[2] ] } - | expr op_neq expr - { result = [ :neq, retag(val), val[0], val[2] ] } - | expr op_lt expr - { result = [ :lt, retag(val), val[0], val[2] ] } - | expr op_leq expr - { result = [ :leq, retag(val), val[0], val[2] ] } - | expr op_gt expr - { result = [ :gt, retag(val), val[0], val[2] ] } - | expr op_geq expr - { result = [ :geq, retag(val), val[0], val[2] ] } - | expr op_and expr - { result = [ :and, retag(val), val[0], val[2] ] } - | expr op_or expr - { result = [ :or, retag(val), val[0], val[2] ] } - | primary_expr - - tuple: - lbracket tuple_content rbracket - { result = [ :tuple, retag(val), val[1].compact ] } - - tuple_content: - expr comma tuple_content - { result = [ val[0], *val[2] ] } - | expr - { result = [ val[0] ] } - | /* empty */ - { result = [ ] } - - function_args: - lparen function_args_inside rparen - { result = [ :args, retag(val), *val[1] ] } - - function_args_inside: - expr function_keywords - { result = [ val[0], val[1][2] ] } - | function_keywords - { result = [ nil, val[0][2] ] } - - function_keywords: - keyword expr function_keywords - { name = val[0][2].to_sym - tail = val[2][2] - loc = retag([ val[0], val[1] ]) - - if tail.include? name - @errors << SyntaxError.new("duplicate keyword argument `#{val[0][2]}'", - tail[name][1]) - end - - hash = { - name => [ val[1][0], loc, *val[1][2..-1] ] - }.merge(tail) - - result = [ :keywords, retag([ loc, val[2] ]), hash ] - } - | /* empty */ - { result = [ :keywords, nil, {} ] } - - filter_chain: - expr pipe filter_chain_cont - { result = [ val[0], *val[2] ]. - reduce { |tree, node| node[3][2] = tree; node } - } - - filter_chain_cont: - filter_call pipe filter_chain_cont - { result = [ val[0], *val[2] ] } - | filter_call - { result = [ val[0] ] } - - filter_call: - ident function_keywords - { ident_loc = val[0][1] - empty_args_loc = { line: ident_loc[:line], - start: ident_loc[:end] + 1, - end: ident_loc[:end] + 1, } - result = [ :call, val[0][1], val[0], - [ :args, val[1][1] || empty_args_loc, nil, val[1][2] ] ] - } - - tag: - lblock ident expr tag_first_cont - { result = [ :tag, retag(val), val[1], val[2], *reduce_tag_args(val[3][2]) ] } - | lblock ident tag_first_cont - { result = [ :tag, retag(val), val[1], nil, *reduce_tag_args(val[2][2]) ] } - - # Racc cannot do lookahead across rules. I had to add states - # explicitly to avoid S/R conflicts. You are not expected to - # understand this. - - tag_first_cont: - rblock - { result = [ :cont, retag(val), [] ] } - | keyword tag_first_cont2 - { result = [ :cont, retag(val), [ val[0], *val[1][2] ] ] } - - tag_first_cont2: - rblock block lblock2 tag_next_cont - { result = [ :cont2, val[0][1], [ [:block, val[0][1], val[1] ], *val[3] ] ] } - | expr tag_first_cont - { result = [ :cont2, retag(val), [ val[0], *val[1][2] ] ] } - - tag_next_cont: - endtag rblock - { result = [] } - | keyword tag_next_cont2 - { result = [ val[0], *val[1] ] } - - tag_next_cont2: - rblock block lblock2 tag_next_cont - { result = [ [:block, val[0][1], val[1] ], *val[3] ] } - | expr keyword tag_next_cont3 - { result = [ val[0], val[1], *val[2] ] } - - tag_next_cont3: - rblock block lblock2 tag_next_cont - { result = [ [:block, val[0][1], val[1] ], *val[3] ] } - | expr tag_next_cont - { result = [ val[0], *val[1] ] } - ----- inner - attr_reader :errors, :ast - - def initialize(tags={}) - super() - - @errors = [] - @ast = nil - @tags = tags - end - - def success? - @errors.empty? - end - - def parse(string, name='(code)') - @errors.clear - @name = name - @ast = nil - - begin - @stream = Lexer.lex(string, @name, @tags) - @ast = do_parse - rescue Liquor::SyntaxError => e - @errors << e - end - - success? - end - - def next_token - tok = @stream.shift - [ tok[0], tok ] if tok - end - - TOKEN_NAME_MAP = { - :comma => ',', - :dot => '.', - :lblock => '{%', - :rblock => '%}', - :linterp => '{{', - :rinterp => '}}', - :lbracket => '[', - :rbracket => ']', - :lparen => '(', - :rparen => ')', - :pipe => '|', - :op_not => '!', - :op_mul => '*', - :op_div => '/', - :op_mod => '%', - :op_plus => '+', - :op_minus => '-', - :op_eq => '==', - :op_neq => '!=', - :op_lt => '<', - :op_leq => '<=', - :op_gt => '>', - :op_geq => '>=', - :keyword => 'keyword argument name', - :kwarg => 'keyword argument', - :ident => 'identifier', - } - - def on_error(error_token_id, error_token, value_stack) - if token_to_str(error_token_id) == "$end" - raise Liquor::SyntaxError.new("unexpected end of program", { - file: @name - }) - else - type, (loc, value) = error_token - type = TOKEN_NAME_MAP[type] || type - - raise Liquor::SyntaxError.new("unexpected token `#{type}'", loc) - end - end - - def retag(nodes) - loc = nodes.map { |node| node[1] }.compact - first, *, last = loc - return first if last.nil? - - { - file: first[:file], - line: first[:line], - start: first[:start], - end: last[:end], - } - end - - def reduce_tag_args(list) - list.each_slice(2).reduce([]) { |args, (k, v)| - if v[0] == :block - args << [ :blockarg, retag([ k, v ]), k, v[2] || [] ] - else - args << [ :kwarg, retag([ k, v ]), k, v ] - end - } - end \ No newline at end of file diff --git a/test/mri/racc/assets/machete.y b/test/mri/racc/assets/machete.y deleted file mode 100644 index ea92d47a69c..00000000000 --- a/test/mri/racc/assets/machete.y +++ /dev/null @@ -1,423 +0,0 @@ -# Copyright (c) 2011 SUSE -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation -# files (the "Software"), to deal in the Software without -# restriction, including without limitation the rights to use, -# copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following -# conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. - -class Machete::Parser - -token NIL -token TRUE -token FALSE -token INTEGER -token SYMBOL -token STRING -token REGEXP -token ANY -token EVEN -token ODD -token METHOD_NAME -token CLASS_NAME - -start expression - -rule - -expression : primary - | expression "|" primary { - result = if val[0].is_a?(ChoiceMatcher) - ChoiceMatcher.new(val[0].alternatives << val[2]) - else - ChoiceMatcher.new([val[0], val[2]]) - end - } - -primary : node - | array - | literal - | any - -node : CLASS_NAME { - result = NodeMatcher.new(val[0].to_sym) - } - | CLASS_NAME "<" attrs ">" { - result = NodeMatcher.new(val[0].to_sym, val[2]) - } - -attrs : attr - | attrs "," attr { result = val[0].merge(val[2]) } - -attr : method_name "=" expression { result = { val[0].to_sym => val[2] } } - | method_name "^=" SYMBOL { - result = { - val[0].to_sym => SymbolRegexpMatcher.new( - Regexp.new("^" + Regexp.escape(symbol_value(val[2]).to_s)) - ) - } - } - | method_name "$=" SYMBOL { - result = { - val[0].to_sym => SymbolRegexpMatcher.new( - Regexp.new(Regexp.escape(symbol_value(val[2]).to_s) + "$") - ) - } - } - | method_name "*=" SYMBOL { - result = { - val[0].to_sym => SymbolRegexpMatcher.new( - Regexp.new(Regexp.escape(symbol_value(val[2]).to_s)) - ) - } - } - | method_name "^=" STRING { - result = { - val[0].to_sym => StringRegexpMatcher.new( - Regexp.new("^" + Regexp.escape(string_value(val[2]))) - ) - } - } - | method_name "$=" STRING { - result = { - val[0].to_sym => StringRegexpMatcher.new( - Regexp.new(Regexp.escape(string_value(val[2])) + "$") - ) - } - } - | method_name "*=" STRING { - result = { - val[0].to_sym => StringRegexpMatcher.new( - Regexp.new(Regexp.escape(string_value(val[2]))) - ) - } - } - | method_name "*=" REGEXP { - result = { - val[0].to_sym => IndifferentRegexpMatcher.new( - Regexp.new(regexp_value(val[2])) - ) - } - } - -# Hack to overcome the fact that some tokens will lex as simple tokens, not -# METHOD_NAME tokens, and that "reserved words" will lex as separate kinds of -# tokens. -method_name : METHOD_NAME - | NIL - | TRUE - | FALSE - | ANY - | EVEN - | ODD - | "*" - | "+" - | "<" - | ">" - | "^" - | "|" - -array : "[" items_opt "]" { result = ArrayMatcher.new(val[1]) } - -items_opt : /* empty */ { result = [] } - | items - -items : item { result = [val[0]] } - | items "," item { result = val[0] << val[2] } - -item : expression - | expression quantifier { result = Quantifier.new(val[0], *val[1]) } - -quantifier : "*" { result = [0, nil, 1] } - | "+" { result = [1, nil, 1] } - | "?" { result = [0, 1, 1] } - | "{" INTEGER "}" { - result = [integer_value(val[1]), integer_value(val[1]), 1] - } - | "{" INTEGER "," "}" { - result = [integer_value(val[1]), nil, 1] - } - | "{" "," INTEGER "}" { - result = [0, integer_value(val[2]), 1] - } - | "{" INTEGER "," INTEGER "}" { - result = [integer_value(val[1]), integer_value(val[3]), 1] - } - | "{" EVEN "}" { result = [0, nil, 2] } - | "{" ODD "}" { result = [1, nil, 2] } - -literal : NIL { result = LiteralMatcher.new(nil) } - | TRUE { result = LiteralMatcher.new(true) } - | FALSE { result = LiteralMatcher.new(false) } - | INTEGER { result = LiteralMatcher.new(integer_value(val[0])) } - | SYMBOL { result = LiteralMatcher.new(symbol_value(val[0])) } - | STRING { result = LiteralMatcher.new(string_value(val[0])) } - | REGEXP { result = LiteralMatcher.new(regexp_value(val[0])) } - -any : ANY { result = AnyMatcher.new } - ----- inner - -include Matchers - -class SyntaxError < StandardError; end - -def parse(input) - @input = input - @pos = 0 - - do_parse -end - -private - -def integer_value(value) - if value =~ /^0[bB]/ - value[2..-1].to_i(2) - elsif value =~ /^0[oO]/ - value[2..-1].to_i(8) - elsif value =~ /^0[dD]/ - value[2..-1].to_i(10) - elsif value =~ /^0[xX]/ - value[2..-1].to_i(16) - elsif value =~ /^0/ - value.to_i(8) - else - value.to_i - end -end - -def symbol_value(value) - value[1..-1].to_sym -end - -def string_value(value) - quote = value[0..0] - if quote == "'" - value[1..-2].gsub("\\\\", "\\").gsub("\\'", "'") - elsif quote == '"' - value[1..-2]. - gsub("\\\\", "\\"). - gsub('\\"', '"'). - gsub("\\n", "\n"). - gsub("\\t", "\t"). - gsub("\\r", "\r"). - gsub("\\f", "\f"). - gsub("\\v", "\v"). - gsub("\\a", "\a"). - gsub("\\e", "\e"). - gsub("\\b", "\b"). - gsub("\\s", "\s"). - gsub(/\\([0-7]{1,3})/) { $1.to_i(8).chr }. - gsub(/\\x([0-9a-fA-F]{1,2})/) { $1.to_i(16).chr } - else - raise "Unknown quote: #{quote.inspect}." - end -end - -REGEXP_OPTIONS = { - 'i' => Regexp::IGNORECASE, - 'm' => Regexp::MULTILINE, - 'x' => Regexp::EXTENDED -} - -def regexp_value(value) - /\A\/(.*)\/([imx]*)\z/ =~ value - pattern, options = $1, $2 - - Regexp.new(pattern, options.chars.map { |ch| REGEXP_OPTIONS[ch] }.inject(:|)) -end - -# "^" needs to be here because if it were among operators recognized by -# METHOD_NAME, "^=" would be recognized as two tokens. -SIMPLE_TOKENS = [ - "|", - "<", - ">", - ",", - "=", - "^=", - "^", - "$=", - "[", - "]", - "*=", - "*", - "+", - "?", - "{", - "}" -] - -COMPLEX_TOKENS = [ - [:NIL, /^nil/], - [:TRUE, /^true/], - [:FALSE, /^false/], - # INTEGER needs to be before METHOD_NAME, otherwise e.g. "+1" would be - # recognized as two tokens. - [ - :INTEGER, - /^ - [+-]? # sign - ( - 0[bB][01]+(_[01]+)* # binary (prefixed) - | - 0[oO][0-7]+(_[0-7]+)* # octal (prefixed) - | - 0[dD]\d+(_\d+)* # decimal (prefixed) - | - 0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)* # hexadecimal (prefixed) - | - 0[0-7]*(_[0-7]+)* # octal (unprefixed) - | - [1-9]\d*(_\d+)* # decimal (unprefixed) - ) - /x - ], - [ - :SYMBOL, - /^ - : - ( - # class name - [A-Z][a-zA-Z0-9_]* - | - # regular method name - [a-z_][a-zA-Z0-9_]*[?!=]? - | - # instance variable name - @[a-zA-Z_][a-zA-Z0-9_]* - | - # class variable name - @@[a-zA-Z_][a-zA-Z0-9_]* - | - # operator (sorted by length, then alphabetically) - (<=>|===|\[\]=|\*\*|\+@|-@|<<|<=|==|=~|>=|>>|\[\]|[%&*+\-\/<>^`|~]) - ) - /x - ], - [ - :STRING, - /^ - ( - ' # sinqle-quoted string - ( - \\[\\'] # escape - | - [^'] # regular character - )* - ' - | - " # double-quoted string - ( - \\ # escape - ( - [\\"ntrfvaebs] # one-character escape - | - [0-7]{1,3} # octal number escape - | - x[0-9a-fA-F]{1,2} # hexadecimal number escape - ) - | - [^"] # regular character - )* - " - ) - /x - ], - [ - :REGEXP, - /^ - \/ - ( - \\ # escape - ( - [\\\/ntrfvaebs\(\)\[\]\{\}\-\.\?\*\+\|\^\$] # one-character escape - | - [0-7]{2,3} # octal number escape - | - x[0-9a-fA-F]{1,2} # hexadecimal number escape - ) - | - [^\/] # regular character - )* - \/ - [imx]* - /x - ], - # ANY, EVEN and ODD need to be before METHOD_NAME, otherwise they would be - # recognized as method names. - [:ANY, /^any/], - [:EVEN, /^even/], - [:ODD, /^odd/], - # We exclude "*", "+", "<", ">", "^" and "|" from method names since they are - # lexed as simple tokens. This is because they have also other meanings in - # Machette patterns beside Ruby method names. - [ - :METHOD_NAME, - /^ - ( - # regular name - [a-z_][a-zA-Z0-9_]*[?!=]? - | - # operator (sorted by length, then alphabetically) - (<=>|===|\[\]=|\*\*|\+@|-@|<<|<=|==|=~|>=|>>|\[\]|[%&\-\/`~]) - ) - /x - ], - [:CLASS_NAME, /^[A-Z][a-zA-Z0-9_]*/] -] - -def next_token - skip_whitespace - - return false if remaining_input.empty? - - # Complex tokens need to be before simple tokens, otherwise e.g. "<<" would be - # recognized as two tokens. - - COMPLEX_TOKENS.each do |type, regexp| - if remaining_input =~ regexp - @pos += $&.length - return [type, $&] - end - end - - SIMPLE_TOKENS.each do |token| - if remaining_input[0...token.length] == token - @pos += token.length - return [token, token] - end - end - - raise SyntaxError, "Unexpected character: #{remaining_input[0..0].inspect}." -end - -def skip_whitespace - if remaining_input =~ /\A^[ \t\r\n]+/ - @pos += $&.length - end -end - -def remaining_input - @input[@pos..-1] -end - -def on_error(error_token_id, error_value, value_stack) - raise SyntaxError, "Unexpected token: #{error_value.inspect}." -end diff --git a/test/mri/racc/assets/macruby.y b/test/mri/racc/assets/macruby.y deleted file mode 100644 index 5ede0083083..00000000000 --- a/test/mri/racc/assets/macruby.y +++ /dev/null @@ -1,2197 +0,0 @@ -# Copyright (c) 2013 Peter Zotov -# -# Parts of the source are derived from ruby_parser: -# Copyright (c) Ryan Davis, seattle.rb -# -# MIT License -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -class Parser::MacRuby - -token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS - kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT - kREDO kRETRY kIN kDO kDO_COND kDO_BLOCK kDO_LAMBDA kRETURN kYIELD kSUPER - kSELF kNIL kTRUE kFALSE kAND kOR kNOT kIF_MOD kUNLESS_MOD kWHILE_MOD - kUNTIL_MOD kRESCUE_MOD kALIAS kDEFINED klBEGIN klEND k__LINE__ - k__FILE__ k__ENCODING__ tIDENTIFIER tFID tGVAR tIVAR tCONSTANT - tLABEL tCVAR tNTH_REF tBACK_REF tSTRING_CONTENT tINTEGER tFLOAT - tREGEXP_END tUPLUS tUMINUS tUMINUS_NUM tPOW tCMP tEQ tEQQ tNEQ - tGEQ tLEQ tANDOP tOROP tMATCH tNMATCH tDOT tDOT2 tDOT3 tAREF - tASET tLSHFT tRSHFT tCOLON2 tCOLON3 tOP_ASGN tASSOC tLPAREN - tLPAREN2 tRPAREN tLPAREN_ARG tLBRACK tLBRACK2 tRBRACK tLBRACE - tLBRACE_ARG tSTAR tSTAR2 tAMPER tAMPER2 tTILDE tPERCENT tDIVIDE - tPLUS tMINUS tLT tGT tPIPE tBANG tCARET tLCURLY tRCURLY - tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG tREGEXP_OPT - tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END - tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA tLAMBEG - tCHARACTER - -prechigh - right tBANG tTILDE tUPLUS - right tPOW - right tUMINUS_NUM tUMINUS - left tSTAR2 tDIVIDE tPERCENT - left tPLUS tMINUS - left tLSHFT tRSHFT - left tAMPER2 - left tPIPE tCARET - left tGT tGEQ tLT tLEQ - nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH - left tANDOP - left tOROP - nonassoc tDOT2 tDOT3 - right tEH tCOLON - left kRESCUE_MOD - right tEQL tOP_ASGN - nonassoc kDEFINED - right kNOT - left kOR kAND - nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD - nonassoc tLBRACE_ARG - nonassoc tLOWEST -preclow - -rule - - program: top_compstmt - - top_compstmt: top_stmts opt_terms - { - result = @builder.compstmt(val[0]) - } - - top_stmts: # nothing - { - result = [] - } - | top_stmt - { - result = [ val[0] ] - } - | top_stmts terms top_stmt - { - result = val[0] << val[2] - } - | error top_stmt - { - result = [ val[1] ] - } - - top_stmt: stmt - | klBEGIN tLCURLY top_compstmt tRCURLY - { - result = @builder.preexe(val[0], val[1], val[2], val[3]) - } - - bodystmt: compstmt opt_rescue opt_else opt_ensure - { - rescue_bodies = val[1] - else_t, else_ = val[2] - ensure_t, ensure_ = val[3] - - if rescue_bodies.empty? && !else_.nil? - diagnostic :warning, :useless_else, nil, else_t - end - - result = @builder.begin_body(val[0], - rescue_bodies, - else_t, else_, - ensure_t, ensure_) - } - - compstmt: stmts opt_terms - { - result = @builder.compstmt(val[0]) - } - - stmts: # nothing - { - result = [] - } - | stmt - { - result = [ val[0] ] - } - | stmts terms stmt - { - result = val[0] << val[2] - } - | error stmt - { - result = [ val[1] ] - } - - stmt: kALIAS fitem - { - @lexer.state = :expr_fname - } - fitem - { - result = @builder.alias(val[0], val[1], val[3]) - } - | kALIAS tGVAR tGVAR - { - result = @builder.alias(val[0], - @builder.gvar(val[1]), - @builder.gvar(val[2])) - } - | kALIAS tGVAR tBACK_REF - { - result = @builder.alias(val[0], - @builder.gvar(val[1]), - @builder.back_ref(val[2])) - } - | kALIAS tGVAR tNTH_REF - { - diagnostic :error, :nth_ref_alias, nil, val[2] - } - | kUNDEF undef_list - { - result = @builder.undef_method(val[0], val[1]) - } - | stmt kIF_MOD expr_value - { - result = @builder.condition_mod(val[0], nil, - val[1], val[2]) - } - | stmt kUNLESS_MOD expr_value - { - result = @builder.condition_mod(nil, val[0], - val[1], val[2]) - } - | stmt kWHILE_MOD expr_value - { - result = @builder.loop_mod(:while, val[0], val[1], val[2]) - } - | stmt kUNTIL_MOD expr_value - { - result = @builder.loop_mod(:until, val[0], val[1], val[2]) - } - | stmt kRESCUE_MOD stmt - { - rescue_body = @builder.rescue_body(val[1], - nil, nil, nil, - nil, val[2]) - - result = @builder.begin_body(val[0], [ rescue_body ]) - } - | klEND tLCURLY compstmt tRCURLY - { - result = @builder.postexe(val[0], val[1], val[2], val[3]) - } - | lhs tEQL command_call - { - result = @builder.assign(val[0], val[1], val[2]) - } - | mlhs tEQL command_call - { - result = @builder.multi_assign(val[0], val[1], val[2]) - } - | var_lhs tOP_ASGN command_call - { - result = @builder.op_assign(val[0], val[1], val[2]) - } - | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_call - { - result = @builder.op_assign( - @builder.index( - val[0], val[1], val[2], val[3]), - val[4], val[5]) - } - | primary_value tDOT tIDENTIFIER tOP_ASGN command_call - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tDOT tCONSTANT tOP_ASGN command_call - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | backref tOP_ASGN command_call - { - @builder.op_assign(val[0], val[1], val[2]) - } - | lhs tEQL mrhs - { - result = @builder.assign(val[0], val[1], - @builder.array(nil, val[2], nil)) - } - | mlhs tEQL arg_value - { - result = @builder.multi_assign(val[0], val[1], val[2]) - } - | mlhs tEQL mrhs - { - result = @builder.multi_assign(val[0], val[1], - @builder.array(nil, val[2], nil)) - } - | expr - - expr: command_call - | expr kAND expr - { - result = @builder.logical_op(:and, val[0], val[1], val[2]) - } - | expr kOR expr - { - result = @builder.logical_op(:or, val[0], val[1], val[2]) - } - | kNOT opt_nl expr - { - result = @builder.not_op(val[0], nil, val[2], nil) - } - | tBANG command_call - { - result = @builder.not_op(val[0], nil, val[1], nil) - } - | arg - - expr_value: expr - - command_call: command - | block_command - - block_command: block_call - | block_call tDOT operation2 command_args - { - result = @builder.call_method(val[0], val[1], val[2], - *val[3]) - } - | block_call tCOLON2 operation2 command_args - { - result = @builder.call_method(val[0], val[1], val[2], - *val[3]) - } - - cmd_brace_block: tLBRACE_ARG - { - @static_env.extend_dynamic - } - opt_block_param compstmt tRCURLY - { - result = [ val[0], val[2], val[3], val[4] ] - - @static_env.unextend - } - - command: operation command_args =tLOWEST - { - result = @builder.call_method(nil, nil, val[0], - *val[1]) - } - | operation command_args cmd_brace_block - { - method_call = @builder.call_method(nil, nil, val[0], - *val[1]) - - begin_t, args, body, end_t = val[2] - result = @builder.block(method_call, - begin_t, args, body, end_t) - } - | primary_value tDOT operation2 command_args =tLOWEST - { - result = @builder.call_method(val[0], val[1], val[2], - *val[3]) - } - | primary_value tDOT operation2 command_args cmd_brace_block - { - method_call = @builder.call_method(val[0], val[1], val[2], - *val[3]) - - begin_t, args, body, end_t = val[4] - result = @builder.block(method_call, - begin_t, args, body, end_t) - } - | primary_value tCOLON2 operation2 command_args =tLOWEST - { - result = @builder.call_method(val[0], val[1], val[2], - *val[3]) - } - | primary_value tCOLON2 operation2 command_args cmd_brace_block - { - method_call = @builder.call_method(val[0], val[1], val[2], - *val[3]) - - begin_t, args, body, end_t = val[4] - result = @builder.block(method_call, - begin_t, args, body, end_t) - } - | kSUPER command_args - { - result = @builder.keyword_cmd(:super, val[0], - *val[1]) - } - | kYIELD command_args - { - result = @builder.keyword_cmd(:yield, val[0], - *val[1]) - } - | kRETURN call_args - { - result = @builder.keyword_cmd(:return, val[0], - nil, val[1], nil) - } - | kBREAK call_args - { - result = @builder.keyword_cmd(:break, val[0], - nil, val[1], nil) - } - | kNEXT call_args - { - result = @builder.keyword_cmd(:next, val[0], - nil, val[1], nil) - } - - mlhs: mlhs_basic - { - result = @builder.multi_lhs(nil, val[0], nil) - } - | tLPAREN mlhs_inner rparen - { - result = @builder.begin(val[0], val[1], val[2]) - } - - mlhs_inner: mlhs_basic - { - result = @builder.multi_lhs(nil, val[0], nil) - } - | tLPAREN mlhs_inner rparen - { - result = @builder.multi_lhs(val[0], val[1], val[2]) - } - - mlhs_basic: mlhs_head - | mlhs_head mlhs_item - { - result = val[0]. - push(val[1]) - } - | mlhs_head tSTAR mlhs_node - { - result = val[0]. - push(@builder.splat(val[1], val[2])) - } - | mlhs_head tSTAR mlhs_node tCOMMA mlhs_post - { - result = val[0]. - push(@builder.splat(val[1], val[2])). - concat(val[4]) - } - | mlhs_head tSTAR - { - result = val[0]. - push(@builder.splat(val[1])) - } - | mlhs_head tSTAR tCOMMA mlhs_post - { - result = val[0]. - push(@builder.splat(val[1])). - concat(val[3]) - } - | tSTAR mlhs_node - { - result = [ @builder.splat(val[0], val[1]) ] - } - | tSTAR mlhs_node tCOMMA mlhs_post - { - result = [ @builder.splat(val[0], val[1]), - *val[3] ] - } - | tSTAR - { - result = [ @builder.splat(val[0]) ] - } - | tSTAR tCOMMA mlhs_post - { - result = [ @builder.splat(val[0]), - *val[2] ] - } - - mlhs_item: mlhs_node - | tLPAREN mlhs_inner rparen - { - result = @builder.begin(val[0], val[1], val[2]) - } - - mlhs_head: mlhs_item tCOMMA - { - result = [ val[0] ] - } - | mlhs_head mlhs_item tCOMMA - { - result = val[0] << val[1] - } - - mlhs_post: mlhs_item - { - result = [ val[0] ] - } - | mlhs_post tCOMMA mlhs_item - { - result = val[0] << val[2] - } - - mlhs_node: variable - { - result = @builder.assignable(val[0]) - } - | primary_value tLBRACK2 opt_call_args rbracket - { - result = @builder.index_asgn(val[0], val[1], val[2], val[3]) - } - | primary_value tDOT tIDENTIFIER - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tCOLON2 tIDENTIFIER - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tDOT tCONSTANT - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tCOLON2 tCONSTANT - { - result = @builder.assignable( - @builder.const_fetch(val[0], val[1], val[2])) - } - | tCOLON3 tCONSTANT - { - result = @builder.assignable( - @builder.const_global(val[0], val[1])) - } - | backref - { - result = @builder.assignable(val[0]) - } - - lhs: variable - { - result = @builder.assignable(val[0]) - } - | primary_value tLBRACK2 opt_call_args rbracket - { - result = @builder.index_asgn(val[0], val[1], val[2], val[3]) - } - | primary_value tDOT tIDENTIFIER - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tCOLON2 tIDENTIFIER - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tDOT tCONSTANT - { - result = @builder.attr_asgn(val[0], val[1], val[2]) - } - | primary_value tCOLON2 tCONSTANT - { - result = @builder.assignable( - @builder.const_fetch(val[0], val[1], val[2])) - } - | tCOLON3 tCONSTANT - { - result = @builder.assignable( - @builder.const_global(val[0], val[1])) - } - | backref - { - result = @builder.assignable(val[0]) - } - - cname: tIDENTIFIER - { - diagnostic :error, :module_name_const, nil, val[0] - } - | tCONSTANT - - cpath: tCOLON3 cname - { - result = @builder.const_global(val[0], val[1]) - } - | cname - { - result = @builder.const(val[0]) - } - | primary_value tCOLON2 cname - { - result = @builder.const_fetch(val[0], val[1], val[2]) - } - - fname: tIDENTIFIER | tCONSTANT | tFID - | op - | reswords - - fsym: fname - { - result = @builder.symbol(val[0]) - } - | symbol - - fitem: fsym - | dsym - - undef_list: fitem - { - result = [ val[0] ] - } - | undef_list tCOMMA - { - @lexer.state = :expr_fname - } - fitem - { - result = val[0] << val[3] - } - - op: tPIPE | tCARET | tAMPER2 | tCMP | tEQ | tEQQ - | tMATCH | tNMATCH | tGT | tGEQ | tLT | tLEQ - | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2 - | tSTAR | tDIVIDE | tPERCENT | tPOW | tBANG | tTILDE - | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2 - - reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND - | kALIAS | kAND | kBEGIN | kBREAK | kCASE - | kCLASS | kDEF | kDEFINED | kDO | kELSE - | kELSIF | kEND | kENSURE | kFALSE | kFOR - | kIN | kMODULE | kNEXT | kNIL | kNOT - | kOR | kREDO | kRESCUE | kRETRY | kRETURN - | kSELF | kSUPER | kTHEN | kTRUE | kUNDEF - | kWHEN | kYIELD | kIF | kUNLESS | kWHILE - | kUNTIL - - arg: lhs tEQL arg - { - result = @builder.assign(val[0], val[1], val[2]) - } - | lhs tEQL arg kRESCUE_MOD arg - { - rescue_body = @builder.rescue_body(val[3], - nil, nil, nil, - nil, val[4]) - - rescue_ = @builder.begin_body(val[2], [ rescue_body ]) - - result = @builder.assign(val[0], val[1], rescue_) - } - | var_lhs tOP_ASGN arg - { - result = @builder.op_assign(val[0], val[1], val[2]) - } - | var_lhs tOP_ASGN arg kRESCUE_MOD arg - { - rescue_body = @builder.rescue_body(val[3], - nil, nil, nil, - nil, val[4]) - - rescue_ = @builder.begin_body(val[2], [ rescue_body ]) - - result = @builder.op_assign(val[0], val[1], rescue_) - } - | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg - { - result = @builder.op_assign( - @builder.index( - val[0], val[1], val[2], val[3]), - val[4], val[5]) - } - | primary_value tDOT tIDENTIFIER tOP_ASGN arg - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tDOT tCONSTANT tOP_ASGN arg - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg - { - result = @builder.op_assign( - @builder.call_method( - val[0], val[1], val[2]), - val[3], val[4]) - } - | primary_value tCOLON2 tCONSTANT tOP_ASGN arg - { - diagnostic :error, :dynamic_const, nil, val[2], [ val[3] ] - } - | tCOLON3 tCONSTANT tOP_ASGN arg - { - diagnostic :error, :dynamic_const, nil, val[1], [ val[2] ] - } - | backref tOP_ASGN arg - { - result = @builder.op_assign(val[0], val[1], val[2]) - } - | arg tDOT2 arg - { - result = @builder.range_inclusive(val[0], val[1], val[2]) - } - | arg tDOT3 arg - { - result = @builder.range_exclusive(val[0], val[1], val[2]) - } - | arg tPLUS arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tMINUS arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tSTAR2 arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tDIVIDE arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tPERCENT arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tPOW arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | tUMINUS_NUM tINTEGER tPOW arg - { - result = @builder.unary_op(val[0], - @builder.binary_op( - @builder.integer(val[1]), - val[2], val[3])) - } - | tUMINUS_NUM tFLOAT tPOW arg - { - result = @builder.unary_op(val[0], - @builder.binary_op( - @builder.float(val[1]), - val[2], val[3])) - } - | tUPLUS arg - { - result = @builder.unary_op(val[0], val[1]) - } - | tUMINUS arg - { - result = @builder.unary_op(val[0], val[1]) - } - | arg tPIPE arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tCARET arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tAMPER2 arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tCMP arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tGT arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tGEQ arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tLT arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tLEQ arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tEQ arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tEQQ arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tNEQ arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tMATCH arg - { - result = @builder.match_op(val[0], val[1], val[2]) - } - | arg tNMATCH arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | tBANG arg - { - result = @builder.not_op(val[0], nil, val[1], nil) - } - | tTILDE arg - { - result = @builder.unary_op(val[0], val[1]) - } - | arg tLSHFT arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tRSHFT arg - { - result = @builder.binary_op(val[0], val[1], val[2]) - } - | arg tANDOP arg - { - result = @builder.logical_op(:and, val[0], val[1], val[2]) - } - | arg tOROP arg - { - result = @builder.logical_op(:or, val[0], val[1], val[2]) - } - | kDEFINED opt_nl arg - { - result = @builder.keyword_cmd(:defined?, val[0], nil, [ val[2] ], nil) - } - - | arg tEH arg opt_nl tCOLON arg - { - result = @builder.ternary(val[0], val[1], - val[2], val[4], val[5]) - } - | primary - - arg_value: arg - - aref_args: none - | args trailer - | args tCOMMA assocs trailer - { - result = val[0] << @builder.associate(nil, val[2], nil) - } - | assocs trailer - { - result = [ @builder.associate(nil, val[0], nil) ] - } - - paren_args: tLPAREN2 opt_call_args rparen - { - result = val - } - - opt_paren_args: # nothing - { - result = [ nil, [], nil ] - } - | paren_args - - opt_call_args: # nothing - { - result = [] - } - | call_args - - call_args: command - { - result = [ val[0] ] - } - | args opt_block_arg - { - result = val[0].concat(val[1]) - } - | assocs opt_block_arg - { - result = [ @builder.associate(nil, val[0], nil) ] - result.concat(val[1]) - } - | args tCOMMA assocs opt_block_arg - { - assocs = @builder.associate(nil, val[2], nil) - result = val[0] << assocs - result.concat(val[3]) - } - | args tCOMMA assocs tCOMMA args opt_block_arg - { - val[2][-1] = @builder.objc_varargs(val[2][-1], val[4]) - assocs = @builder.associate(nil, val[2], nil) - result = val[0] << assocs - result.concat(val[5]) - } - | block_arg - { - result = [ val[0] ] - } - - call_args2: arg_value tCOMMA args opt_block_arg - { - result = [ val[0], *val[2].concat(val[3]) ] - } - | arg_value tCOMMA block_arg - { - result = [ val[0], val[2] ] - } - | assocs opt_block_arg - { - result = [ @builder.associate(nil, val[0], nil), - *val[1] ] - } - | arg_value tCOMMA assocs opt_block_arg - { - result = [ val[0], - @builder.associate(nil, val[2], nil), - *val[3] ] - } - | arg_value tCOMMA args tCOMMA assocs opt_block_arg - { - result = [ val[0], - *val[2]. - push(@builder.associate(nil, val[4], nil)). - concat(val[5]) ] - } - | block_arg - { - result = [ val[0] ] - } - - command_args: { - result = @lexer.cmdarg.dup - @lexer.cmdarg.push(true) - } - open_args - { - @lexer.cmdarg = val[0] - - result = val[1] - } - - open_args: call_args - { - result = [ nil, val[0], nil ] - } - | tLPAREN_ARG - { - @lexer.state = :expr_endarg - } - rparen - { - result = [ val[0], [], val[2] ] - } - | tLPAREN_ARG call_args2 - { - @lexer.state = :expr_endarg - } - rparen - { - result = [ val[0], val[1], val[3] ] - } - - block_arg: tAMPER arg_value - { - result = @builder.block_pass(val[0], val[1]) - } - - opt_block_arg: tCOMMA block_arg - { - result = [ val[1] ] - } - | tCOMMA - { - result = [] - } - | # nothing - { - result = [] - } - - args: arg_value - { - result = [ val[0] ] - } - | tSTAR arg_value - { - result = [ @builder.splat(val[0], val[1]) ] - } - | args tCOMMA arg_value - { - result = val[0] << val[2] - } - | args tCOMMA tSTAR arg_value - { - result = val[0] << @builder.splat(val[2], val[3]) - } - - mrhs: args tCOMMA arg_value - { - result = val[0] << val[2] - } - | args tCOMMA tSTAR arg_value - { - result = val[0] << @builder.splat(val[2], val[3]) - } - | tSTAR arg_value - { - result = [ @builder.splat(val[0], val[1]) ] - } - - primary: literal - | strings - | xstring - | regexp - | words - | qwords - | var_ref - | backref - | tFID - { - result = @builder.call_method(nil, nil, val[0]) - } - | kBEGIN bodystmt kEND - { - result = @builder.begin_keyword(val[0], val[1], val[2]) - } - | tLPAREN_ARG expr - { - @lexer.state = :expr_endarg - } - rparen - { - result = @builder.begin(val[0], val[1], val[3]) - } - | tLPAREN compstmt tRPAREN - { - result = @builder.begin(val[0], val[1], val[2]) - } - | primary_value tCOLON2 tCONSTANT - { - result = @builder.const_fetch(val[0], val[1], val[2]) - } - | tCOLON3 tCONSTANT - { - result = @builder.const_global(val[0], val[1]) - } - | tLBRACK aref_args tRBRACK - { - result = @builder.array(val[0], val[1], val[2]) - } - | tLBRACE assoc_list tRCURLY - { - result = @builder.associate(val[0], val[1], val[2]) - } - | kRETURN - { - result = @builder.keyword_cmd(:return, val[0]) - } - | kYIELD tLPAREN2 call_args rparen - { - result = @builder.keyword_cmd(:yield, val[0], val[1], val[2], val[3]) - } - | kYIELD tLPAREN2 rparen - { - result = @builder.keyword_cmd(:yield, val[0], val[1], [], val[2]) - } - | kYIELD - { - result = @builder.keyword_cmd(:yield, val[0]) - } - | kDEFINED opt_nl tLPAREN2 expr rparen - { - result = @builder.keyword_cmd(:defined?, val[0], - val[2], [ val[3] ], val[4]) - } - | kNOT tLPAREN2 expr rparen - { - result = @builder.not_op(val[0], val[1], val[2], val[3]) - } - | kNOT tLPAREN2 rparen - { - result = @builder.not_op(val[0], val[1], nil, val[2]) - } - | operation brace_block - { - method_call = @builder.call_method(nil, nil, val[0]) - - begin_t, args, body, end_t = val[1] - result = @builder.block(method_call, - begin_t, args, body, end_t) - } - | method_call - | method_call brace_block - { - begin_t, args, body, end_t = val[1] - result = @builder.block(val[0], - begin_t, args, body, end_t) - } - | tLAMBDA lambda - { - lambda_call = @builder.call_lambda(val[0]) - - args, (begin_t, body, end_t) = val[1] - result = @builder.block(lambda_call, - begin_t, args, body, end_t) - } - | kIF expr_value then compstmt if_tail kEND - { - else_t, else_ = val[4] - result = @builder.condition(val[0], val[1], val[2], - val[3], else_t, - else_, val[5]) - } - | kUNLESS expr_value then compstmt opt_else kEND - { - else_t, else_ = val[4] - result = @builder.condition(val[0], val[1], val[2], - else_, else_t, - val[3], val[5]) - } - | kWHILE - { - @lexer.cond.push(true) - } - expr_value do - { - @lexer.cond.pop - } - compstmt kEND - { - result = @builder.loop(:while, val[0], val[2], val[3], - val[5], val[6]) - } - | kUNTIL - { - @lexer.cond.push(true) - } - expr_value do - { - @lexer.cond.pop - } - compstmt kEND - { - result = @builder.loop(:until, val[0], val[2], val[3], - val[5], val[6]) - } - | kCASE expr_value opt_terms case_body kEND - { - *when_bodies, (else_t, else_body) = *val[3] - - result = @builder.case(val[0], val[1], - when_bodies, else_t, else_body, - val[4]) - } - | kCASE opt_terms case_body kEND - { - *when_bodies, (else_t, else_body) = *val[2] - - result = @builder.case(val[0], nil, - when_bodies, else_t, else_body, - val[3]) - } - | kFOR for_var kIN - { - @lexer.cond.push(true) - } - expr_value do - { - @lexer.cond.pop - } - compstmt kEND - { - result = @builder.for(val[0], val[1], - val[2], val[4], - val[5], val[7], val[8]) - } - | kCLASS cpath superclass - { - @static_env.extend_static - @lexer.push_cmdarg - } - bodystmt kEND - { - if in_def? - diagnostic :error, :class_in_def, nil, val[0] - end - - lt_t, superclass = val[2] - result = @builder.def_class(val[0], val[1], - lt_t, superclass, - val[4], val[5]) - - @lexer.pop_cmdarg - @static_env.unextend - } - | kCLASS tLSHFT expr term - { - result = @def_level - @def_level = 0 - - @static_env.extend_static - @lexer.push_cmdarg - } - bodystmt kEND - { - result = @builder.def_sclass(val[0], val[1], val[2], - val[5], val[6]) - - @lexer.pop_cmdarg - @static_env.unextend - - @def_level = val[4] - } - | kMODULE cpath - { - @static_env.extend_static - @lexer.push_cmdarg - } - bodystmt kEND - { - if in_def? - diagnostic :error, :module_in_def, nil, val[0] - end - - result = @builder.def_module(val[0], val[1], - val[3], val[4]) - - @lexer.pop_cmdarg - @static_env.unextend - } - | kDEF fname - { - @def_level += 1 - @static_env.extend_static - @lexer.push_cmdarg - } - f_arglist bodystmt kEND - { - result = @builder.def_method(val[0], val[1], - val[3], val[4], val[5]) - - @lexer.pop_cmdarg - @static_env.unextend - @def_level -= 1 - } - | kDEF singleton dot_or_colon - { - @lexer.state = :expr_fname - } - fname - { - @def_level += 1 - @static_env.extend_static - @lexer.push_cmdarg - } - f_arglist bodystmt kEND - { - result = @builder.def_singleton(val[0], val[1], val[2], - val[4], val[6], val[7], val[8]) - - @lexer.pop_cmdarg - @static_env.unextend - @def_level -= 1 - } - | kBREAK - { - result = @builder.keyword_cmd(:break, val[0]) - } - | kNEXT - { - result = @builder.keyword_cmd(:next, val[0]) - } - | kREDO - { - result = @builder.keyword_cmd(:redo, val[0]) - } - | kRETRY - { - result = @builder.keyword_cmd(:retry, val[0]) - } - - primary_value: primary - - then: term - | kTHEN - | term kTHEN - { - result = val[1] - } - - do: term - | kDO_COND - - if_tail: opt_else - | kELSIF expr_value then compstmt if_tail - { - else_t, else_ = val[4] - result = [ val[0], - @builder.condition(val[0], val[1], val[2], - val[3], else_t, - else_, nil), - ] - } - - opt_else: none - | kELSE compstmt - { - result = val - } - - for_var: lhs - | mlhs - - f_marg: f_norm_arg - | tLPAREN f_margs rparen - { - result = @builder.multi_lhs(val[0], val[1], val[2]) - } - - f_marg_list: f_marg - { - result = [ val[0] ] - } - | f_marg_list tCOMMA f_marg - { - result = val[0] << val[2] - } - - f_margs: f_marg_list - | f_marg_list tCOMMA tSTAR f_norm_arg - { - result = val[0]. - push(@builder.objc_restarg(val[2], val[3])) - } - | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list - { - result = val[0]. - push(@builder.objc_restarg(val[2], val[3])). - concat(val[5]) - } - | f_marg_list tCOMMA tSTAR - { - result = val[0]. - push(@builder.objc_restarg(val[2])) - } - | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list - { - result = val[0]. - push(@builder.objc_restarg(val[2])). - concat(val[4]) - } - | tSTAR f_norm_arg - { - result = [ @builder.objc_restarg(val[0], val[1]) ] - } - | tSTAR f_norm_arg tCOMMA f_marg_list - { - result = [ @builder.objc_restarg(val[0], val[1]), - *val[3] ] - } - | tSTAR - { - result = [ @builder.objc_restarg(val[0]) ] - } - | tSTAR tCOMMA f_marg_list - { - result = [ @builder.objc_restarg(val[0]), - *val[2] ] - } - - block_param: f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[6]). - concat(val[7]) - } - | f_arg tCOMMA f_block_optarg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_arg tCOMMA f_block_optarg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_arg tCOMMA - | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg opt_f_block_arg - { - result = val[0].concat(val[1]) - } - | f_block_optarg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_block_optarg opt_f_block_arg - { - result = val[0]. - concat(val[1]) - } - | f_block_optarg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[1]) - } - | f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_block_arg - { - result = [ val[0] ] - } - - opt_block_param: # nothing - { - result = @builder.args(nil, [], nil) - } - | block_param_def - { - @lexer.state = :expr_value - } - - block_param_def: tPIPE opt_bv_decl tPIPE - { - result = @builder.args(val[0], val[1], val[2]) - } - | tOROP - { - result = @builder.args(val[0], [], val[0]) - } - | tPIPE block_param opt_bv_decl tPIPE - { - result = @builder.args(val[0], val[1].concat(val[2]), val[3]) - } - - opt_bv_decl: # nothing - { - result = [] - } - | tSEMI bv_decls - { - result = val[1] - } - - bv_decls: bvar - { - result = [ val[0] ] - } - | bv_decls tCOMMA bvar - { - result = val[0] << val[2] - } - - bvar: tIDENTIFIER - { - result = @builder.shadowarg(val[0]) - } - | f_bad_arg - - lambda: { - @static_env.extend_dynamic - } - f_larglist lambda_body - { - result = [ val[1], val[2] ] - - @static_env.unextend - } - - f_larglist: tLPAREN2 f_args opt_bv_decl rparen - { - result = @builder.args(val[0], val[1].concat(val[2]), val[3]) - } - | f_args - { - result = @builder.args(nil, val[0], nil) - } - - lambda_body: tLAMBEG compstmt tRCURLY - { - result = [ val[0], val[1], val[2] ] - } - | kDO_LAMBDA compstmt kEND - { - result = [ val[0], val[1], val[2] ] - } - - do_block: kDO_BLOCK - { - @static_env.extend_dynamic - } - opt_block_param compstmt kEND - { - result = [ val[0], val[2], val[3], val[4] ] - - @static_env.unextend - } - - block_call: command do_block - { - begin_t, block_args, body, end_t = val[1] - result = @builder.block(val[0], - begin_t, block_args, body, end_t) - } - | block_call tDOT operation2 opt_paren_args - { - lparen_t, args, rparen_t = val[3] - result = @builder.call_method(val[0], val[1], val[2], - lparen_t, args, rparen_t) - } - | block_call tCOLON2 operation2 opt_paren_args - { - lparen_t, args, rparen_t = val[3] - result = @builder.call_method(val[0], val[1], val[2], - lparen_t, args, rparen_t) - } - - method_call: operation paren_args - { - lparen_t, args, rparen_t = val[1] - result = @builder.call_method(nil, nil, val[0], - lparen_t, args, rparen_t) - } - | primary_value tDOT operation2 opt_paren_args - { - lparen_t, args, rparen_t = val[3] - result = @builder.call_method(val[0], val[1], val[2], - lparen_t, args, rparen_t) - } - | primary_value tCOLON2 operation2 paren_args - { - lparen_t, args, rparen_t = val[3] - result = @builder.call_method(val[0], val[1], val[2], - lparen_t, args, rparen_t) - } - | primary_value tCOLON2 operation3 - { - result = @builder.call_method(val[0], val[1], val[2]) - } - | primary_value tDOT paren_args - { - lparen_t, args, rparen_t = val[2] - result = @builder.call_method(val[0], val[1], nil, - lparen_t, args, rparen_t) - } - | primary_value tCOLON2 paren_args - { - lparen_t, args, rparen_t = val[2] - result = @builder.call_method(val[0], val[1], nil, - lparen_t, args, rparen_t) - } - | kSUPER paren_args - { - lparen_t, args, rparen_t = val[1] - result = @builder.keyword_cmd(:super, val[0], - lparen_t, args, rparen_t) - } - | kSUPER - { - result = @builder.keyword_cmd(:zsuper, val[0]) - } - | primary_value tLBRACK2 opt_call_args rbracket - { - result = @builder.index(val[0], val[1], val[2], val[3]) - } - - brace_block: tLCURLY - { - @static_env.extend_dynamic - } - opt_block_param compstmt tRCURLY - { - result = [ val[0], val[2], val[3], val[4] ] - - @static_env.unextend - } - | kDO - { - @static_env.extend_dynamic - } - opt_block_param compstmt kEND - { - result = [ val[0], val[2], val[3], val[4] ] - - @static_env.unextend - } - - case_body: kWHEN args then compstmt cases - { - result = [ @builder.when(val[0], val[1], val[2], val[3]), - *val[4] ] - } - - cases: opt_else - { - result = [ val[0] ] - } - | case_body - - opt_rescue: kRESCUE exc_list exc_var then compstmt opt_rescue - { - assoc_t, exc_var = val[2] - - if val[1] - exc_list = @builder.array(nil, val[1], nil) - end - - result = [ @builder.rescue_body(val[0], - exc_list, assoc_t, exc_var, - val[3], val[4]), - *val[5] ] - } - | - { - result = [] - } - - exc_list: arg_value - { - result = [ val[0] ] - } - | mrhs - | none - - exc_var: tASSOC lhs - { - result = [ val[0], val[1] ] - } - | none - - opt_ensure: kENSURE compstmt - { - result = [ val[0], val[1] ] - } - | none - - literal: numeric - | symbol - | dsym - - strings: string - { - result = @builder.string_compose(nil, val[0], nil) - } - - string: string1 - { - result = [ val[0] ] - } - | string string1 - { - result = val[0] << val[1] - } - - string1: tSTRING_BEG string_contents tSTRING_END - { - result = @builder.string_compose(val[0], val[1], val[2]) - } - | tSTRING - { - result = @builder.string(val[0]) - } - | tCHARACTER - { - result = @builder.character(val[0]) - } - - xstring: tXSTRING_BEG xstring_contents tSTRING_END - { - result = @builder.xstring_compose(val[0], val[1], val[2]) - } - - regexp: tREGEXP_BEG regexp_contents tSTRING_END tREGEXP_OPT - { - opts = @builder.regexp_options(val[3]) - result = @builder.regexp_compose(val[0], val[1], val[2], opts) - } - - words: tWORDS_BEG word_list tSTRING_END - { - result = @builder.words_compose(val[0], val[1], val[2]) - } - - word_list: # nothing - { - result = [] - } - | word_list word tSPACE - { - result = val[0] << @builder.word(val[1]) - } - - word: string_content - { - result = [ val[0] ] - } - | word string_content - { - result = val[0] << val[1] - } - - qwords: tQWORDS_BEG qword_list tSTRING_END - { - result = @builder.words_compose(val[0], val[1], val[2]) - } - - qword_list: # nothing - { - result = [] - } - | qword_list tSTRING_CONTENT tSPACE - { - result = val[0] << @builder.string_internal(val[1]) - } - - string_contents: # nothing - { - result = [] - } - | string_contents string_content - { - result = val[0] << val[1] - } - -xstring_contents: # nothing - { - result = [] - } - | xstring_contents string_content - { - result = val[0] << val[1] - } - -regexp_contents: # nothing - { - result = [] - } - | regexp_contents string_content - { - result = val[0] << val[1] - } - - string_content: tSTRING_CONTENT - { - result = @builder.string_internal(val[0]) - } - | tSTRING_DVAR string_dvar - { - result = val[1] - } - | tSTRING_DBEG - { - @lexer.cond.push(false) - @lexer.cmdarg.push(false) - } - compstmt tRCURLY - { - @lexer.cond.lexpop - @lexer.cmdarg.lexpop - - result = @builder.begin(val[0], val[2], val[3]) - } - - string_dvar: tGVAR - { - result = @builder.gvar(val[0]) - } - | tIVAR - { - result = @builder.ivar(val[0]) - } - | tCVAR - { - result = @builder.cvar(val[0]) - } - | backref - - - symbol: tSYMBOL - { - result = @builder.symbol(val[0]) - } - - dsym: tSYMBEG xstring_contents tSTRING_END - { - result = @builder.symbol_compose(val[0], val[1], val[2]) - } - - numeric: tINTEGER - { - result = @builder.integer(val[0]) - } - | tFLOAT - { - result = @builder.float(val[0]) - } - | tUMINUS_NUM tINTEGER =tLOWEST - { - result = @builder.negate(val[0], - @builder.integer(val[1])) - } - | tUMINUS_NUM tFLOAT =tLOWEST - { - result = @builder.negate(val[0], - @builder.float(val[1])) - } - - variable: tIDENTIFIER - { - result = @builder.ident(val[0]) - } - | tIVAR - { - result = @builder.ivar(val[0]) - } - | tGVAR - { - result = @builder.gvar(val[0]) - } - | tCONSTANT - { - result = @builder.const(val[0]) - } - | tCVAR - { - result = @builder.cvar(val[0]) - } - | kNIL - { - result = @builder.nil(val[0]) - } - | kSELF - { - result = @builder.self(val[0]) - } - | kTRUE - { - result = @builder.true(val[0]) - } - | kFALSE - { - result = @builder.false(val[0]) - } - | k__FILE__ - { - result = @builder.__FILE__(val[0]) - } - | k__LINE__ - { - result = @builder.__LINE__(val[0]) - } - | k__ENCODING__ - { - result = @builder.__ENCODING__(val[0]) - } - - var_ref: variable - { - result = @builder.accessible(val[0]) - } - - var_lhs: variable - { - result = @builder.assignable(val[0]) - } - - backref: tNTH_REF - { - result = @builder.nth_ref(val[0]) - } - | tBACK_REF - { - result = @builder.back_ref(val[0]) - } - - superclass: term - { - result = nil - } - | tLT expr_value term - { - result = [ val[0], val[1] ] - } - | error term - { - yyerrok - result = nil - } - - f_arglist: tLPAREN2 f_args rparen - { - result = @builder.args(val[0], val[1], val[2]) - - @lexer.state = :expr_value - } - | f_args term - { - result = @builder.args(nil, val[0], nil) - } - - f_args: f_arg tCOMMA f_optarg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg tCOMMA f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[6]). - concat(val[7]) - } - | f_arg tCOMMA f_optarg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_arg tCOMMA f_optarg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_arg opt_f_block_arg - { - result = val[0]. - concat(val[1]) - } - | f_optarg tCOMMA f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[4]). - concat(val[5]) - } - | f_optarg opt_f_block_arg - { - result = val[0]. - concat(val[1]) - } - | f_optarg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_rest_arg opt_f_block_arg - { - result = val[0]. - concat(val[1]) - } - | f_rest_arg tCOMMA f_arg opt_f_block_arg - { - result = val[0]. - concat(val[2]). - concat(val[3]) - } - | f_block_arg - { - result = [ val[0] ] - } - | # nothing - { - result = [] - } - - f_bad_arg: tCONSTANT - { - diagnostic :error, :argument_const, nil, val[0] - } - | tIVAR - { - diagnostic :error, :argument_ivar, nil, val[0] - } - | tGVAR - { - diagnostic :error, :argument_gvar, nil, val[0] - } - | tCVAR - { - diagnostic :error, :argument_cvar, nil, val[0] - } - - f_norm_arg: f_bad_arg - | tIDENTIFIER - { - @static_env.declare val[0][0] - - result = @builder.arg(val[0]) - } - | tIDENTIFIER tASSOC tIDENTIFIER - { - @static_env.declare val[2][0] - - result = @builder.objc_kwarg(val[0], val[1], val[2]) - } - | tLABEL tIDENTIFIER - { - @static_env.declare val[1][0] - - result = @builder.objc_kwarg(val[0], nil, val[1]) - } - - f_arg_item: f_norm_arg - | tLPAREN f_margs rparen - { - result = @builder.multi_lhs(val[0], val[1], val[2]) - } - - f_arg: f_arg_item - { - result = [ val[0] ] - } - | f_arg tCOMMA f_arg_item - { - result = val[0] << val[2] - } - - f_opt: tIDENTIFIER tEQL arg_value - { - @static_env.declare val[0][0] - - result = @builder.optarg(val[0], val[1], val[2]) - } - - f_block_opt: tIDENTIFIER tEQL primary_value - { - @static_env.declare val[0][0] - - result = @builder.optarg(val[0], val[1], val[2]) - } - - f_block_optarg: f_block_opt - { - result = [ val[0] ] - } - | f_block_optarg tCOMMA f_block_opt - { - result = val[0] << val[2] - } - - f_optarg: f_opt - { - result = [ val[0] ] - } - | f_optarg tCOMMA f_opt - { - result = val[0] << val[2] - } - - restarg_mark: tSTAR2 | tSTAR - - f_rest_arg: restarg_mark tIDENTIFIER - { - @static_env.declare val[1][0] - - result = [ @builder.restarg(val[0], val[1]) ] - } - | restarg_mark - { - result = [ @builder.restarg(val[0]) ] - } - - blkarg_mark: tAMPER2 | tAMPER - - f_block_arg: blkarg_mark tIDENTIFIER - { - @static_env.declare val[1][0] - - result = @builder.blockarg(val[0], val[1]) - } - - opt_f_block_arg: tCOMMA f_block_arg - { - result = [ val[1] ] - } - | # nothing - { - result = [] - } - - singleton: var_ref - | tLPAREN2 expr rparen - { - result = val[1] - } - - assoc_list: # nothing - { - result = [] - } - | assocs trailer - - assocs: assoc - { - result = [ val[0] ] - } - | assocs tCOMMA assoc - { - result = val[0] << val[2] - } - - assoc: arg_value tASSOC arg_value - { - result = @builder.pair(val[0], val[1], val[2]) - } - | tLABEL arg_value - { - result = @builder.pair_keyword(val[0], val[1]) - } - - operation: tIDENTIFIER | tCONSTANT | tFID - operation2: tIDENTIFIER | tCONSTANT | tFID | op - operation3: tIDENTIFIER | tFID | op - dot_or_colon: tDOT | tCOLON2 - opt_terms: | terms - opt_nl: | tNL - rparen: opt_nl tRPAREN - { - result = val[1] - } - rbracket: opt_nl tRBRACK - { - result = val[1] - } - trailer: | tNL | tCOMMA - - term: tSEMI - { - yyerrok - } - | tNL - - terms: term - | terms tSEMI - - none: # nothing - { - result = nil - } -end - ----- header - -require 'parser' - -Parser.check_for_encoding_support - ----- inner - - def version - 19 # closest released match: v1_9_0_2 - end - - def default_encoding - Encoding::BINARY - end diff --git a/test/mri/racc/assets/mailp.y b/test/mri/racc/assets/mailp.y deleted file mode 100644 index eb7d4d529d0..00000000000 --- a/test/mri/racc/assets/mailp.y +++ /dev/null @@ -1,437 +0,0 @@ -# -# mailp for test -# - -class Testp - -rule - - content : DateH datetime { @field.date = val[1] } - | RecvH received - | RetpathH returnpath - | MaddrH addrs { @field.addrs.replace val[1] } - | SaddrH addr { @field.addr = val[1] } - | MmboxH mboxes { @field.addrs.replace val[1] } - | SmboxH mbox { @field.addr = val[1] } - | MsgidH msgid { @field.msgid = val[1] } - | KeyH keys { @field.keys.replace val[1] } - | EncH enc - | VersionH version - | CTypeH ctype - | CEncodingH cencode - | CDispositionH cdisp - | Mbox mbox - { - mb = val[1] - @field.phrase = mb.phrase - @field.setroute mb.route - @field.local = mb.local - @field.domain = mb.domain - } - | Spec spec - { - mb = val[1] - @field.local = mb.local - @field.domain = mb.domain - } - ; - - datetime : day DIGIT ATOM DIGIT hour zone - # 0 1 2 3 4 5 - # day month year - { - t = Time.gm( val[3].to_i, val[2], val[1].to_i, 0, 0, 0 ) - result = (t + val[4] - val[5]).localtime - } - ; - - day : /* none */ - | ATOM ',' - ; - - hour : DIGIT ':' DIGIT - { - result = (result.to_i * 60 * 60) + (val[2].to_i * 60) - } - | DIGIT ':' DIGIT ':' DIGIT - { - result = (result.to_i * 60 * 60) + - (val[2].to_i * 60) - + val[4].to_i - } - ; - - zone : ATOM - { - result = ::TMail.zonestr2i( val[0] ) * 60 - } - ; - - received : from by via with id for recvdatetime - ; - - from : /* none */ - | FROM domain - { - @field.from = Address.join( val[1] ) - } - | FROM domain '@' domain - { - @field.from = Address.join( val[3] ) - } - | FROM domain DOMLIT - { - @field.from = Address.join( val[1] ) - } - ; - - by : /* none */ - | BY domain - { - @field.by = Address.join( val[1] ) - } - ; - - via : /* none */ - | VIA ATOM - { - @field.via = val[1] - } - ; - - with : /* none */ - | WITH ATOM - { - @field.with.push val[1] - } - ; - - id : /* none */ - | ID msgid - { - @field.msgid = val[1] - } - | ID ATOM - { - @field.msgid = val[1] - } - ; - - for : /* none */ - | FOR addr - { - @field.for_ = val[1].address - } - ; - - recvdatetime - : /* none */ - | ';' datetime - { - @field.date = val[1] - } - ; - - returnpath: '<' '>' - | routeaddr - { - @field.route.replace result.route - @field.addr = result.addr - } - ; - - addrs : addr { result = val } - | addrs ',' addr { result.push val[2] } - ; - - addr : mbox - | group - ; - - mboxes : mbox - { - result = val - } - | mboxes ',' mbox - { - result.push val[2] - } - ; - - mbox : spec - | routeaddr - | phrase routeaddr - { - val[1].phrase = HFdecoder.decode( result ) - result = val[1] - } - ; - - group : phrase ':' mboxes ';' - { - result = AddressGroup.new( result, val[2] ) - } - # | phrase ':' ';' { result = AddressGroup.new( result ) } - ; - - routeaddr : '<' route spec '>' - { - result = val[2] - result.route = val[1] - } - | '<' spec '>' - { - result = val[1] - } - ; - - route : at_domains ':' - ; - - at_domains: '@' domain { result = [ val[1] ] } - | at_domains ',' '@' domain { result.push val[3] } - ; - - spec : local '@' domain { result = Address.new( val[0], val[2] ) } - | local { result = Address.new( result, nil ) } - ; - - local : word { result = val } - | local '.' word { result.push val[2] } - ; - - domain : domword { result = val } - | domain '.' domword { result.push val[2] } - ; - - domword : atom - | DOMLIT - | DIGIT - ; - - msgid : '<' spec '>' - { - val[1] = val[1].addr - result = val.join('') - } - ; - - phrase : word - | phrase word { result << ' ' << val[1] } - ; - - word : atom - | QUOTED - | DIGIT - ; - - keys : phrase - | keys ',' phrase - ; - - enc : word - { - @field.encrypter = val[0] - } - | word word - { - @field.encrypter = val[0] - @field.keyword = val[1] - } - ; - - version : DIGIT '.' DIGIT - { - @field.major = val[0].to_i - @field.minor = val[2].to_i - } - ; - - ctype : TOKEN '/' TOKEN params - { - @field.main = val[0] - @field.sub = val[2] - } - | TOKEN params - { - @field.main = val[0] - @field.sub = '' - } - ; - - params : /* none */ - | params ';' TOKEN '=' value - { - @field.params[ val[2].downcase ] = val[4] - } - ; - - value : TOKEN - | QUOTED - ; - - cencode : TOKEN - { - @field.encoding = val[0] - } - ; - - cdisp : TOKEN disp_params - { - @field.disposition = val[0] - } - ; - - disp_params - : /* none */ - | disp_params ';' disp_param - ; - - disp_param: /* none */ - | TOKEN '=' value - { - @field.params[ val[0].downcase ] = val[2] - } - ; - - atom : ATOM - | FROM - | BY - | VIA - | WITH - | ID - | FOR - ; - -end - - ----- header -# -# mailp for test -# - -require 'tmail/mails' - - -module TMail - ----- inner - - MAILP_DEBUG = false - - def initialize - self.debug = MAILP_DEBUG - end - - def debug=( flag ) - @yydebug = flag && Racc_debug_parser - @scanner_debug = flag - end - - def debug - @yydebug - end - - - def Mailp.parse( str, obj, ident ) - new.parse( str, obj, ident ) - end - - - NATIVE_ROUTINE = { - 'TMail::MsgidH' => :msgid_parse, - 'TMail::RefH' => :refs_parse - } - - def parse( str, obj, ident ) - return if /\A\s*\z/ === str - - @field = obj - - if mid = NATIVE_ROUTINE[ obj.type.name ] then - send mid, str - else - unless ident then - ident = obj.type.name.split('::')[-1].to_s - cmt = [] - obj.comments.replace cmt - else - cmt = nil - end - - @scanner = MailScanner.new( str, ident, cmt ) - @scanner.debug = @scanner_debug - @first = [ ident.intern, ident ] - @pass_array = [nil, nil] - - do_parse - end - end - - - private - - - def next_token - if @first then - ret = @first - @first = nil - ret - else - @scanner.scan @pass_array - end - end - - def on_error( tok, val, vstack ) - raise ParseError, - "\nparse error in '#{@field.name}' header, on token #{val.inspect}" - end - - - - def refs_parse( str ) - arr = [] - - while mdata = ::TMail::MSGID.match( str ) do - str = mdata.post_match - - pre = mdata.pre_match - pre.strip! - proc_phrase pre, arr unless pre.empty? - arr.push mdata.to_s - end - str.strip! - proc_phrase str, arr if not pre or pre.empty? - - @field.refs.replace arr - end - - def proc_phrase( str, arr ) - while mdata = /"([^\\]*(?:\\.[^"\\]*)*)"/.match( str ) do - str = mdata.post_match - - pre = mdata.pre_match - pre.strip! - arr.push pre unless pre.empty? - arr.push mdata[1] - end - str.strip! - arr.push unless str.empty? - end - - - def msgid_parse( str ) - if mdata = ::TMail::MSGID.match( str ) then - @field.msgid = mdata.to_s - else - raise ParseError, "wrong Message-ID format: #{str}" - end - end - ----- footer - -end # module TMail - -mp = TMail::Testp.new -mp.parse diff --git a/test/mri/racc/assets/mediacloth.y b/test/mri/racc/assets/mediacloth.y deleted file mode 100644 index 94cc411ea75..00000000000 --- a/test/mri/racc/assets/mediacloth.y +++ /dev/null @@ -1,599 +0,0 @@ -# Copyright (c) 2006 Pluron Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# The parser for the MediaWiki language. -# -# Usage together with a lexer: -# inputFile = File.new("data/input1", "r") -# input = inputFile.read -# parser = MediaWikiParser.new -# parser.lexer = MediaWikiLexer.new -# parser.parse(input) - -class MediaWikiParser - -token TEXT BOLD_START BOLD_END ITALIC_START ITALIC_END LINK_START LINK_END LINKSEP - INTLINK_START INTLINK_END INTLINKSEP RESOURCESEP CHAR_ENT - PRE_START PRE_END PREINDENT_START PREINDENT_END - SECTION_START SECTION_END HLINE SIGNATURE_NAME SIGNATURE_DATE SIGNATURE_FULL - PARA_START PARA_END UL_START UL_END OL_START OL_END LI_START LI_END - DL_START DL_END DT_START DT_END DD_START DD_END TAG_START TAG_END ATTR_NAME ATTR_VALUE - TABLE_START TABLE_END ROW_START ROW_END HEAD_START HEAD_END CELL_START CELL_END - KEYWORD TEMPLATE_START TEMPLATE_END CATEGORY PASTE_START PASTE_END - - -rule - -wiki: - repeated_contents - { - @nodes.push WikiAST.new(0, @wiki_ast_length) - #@nodes.last.children.insert(0, val[0]) - #puts val[0] - @nodes.last.children += val[0] - } - ; - -contents: - text - { - result = val[0] - } - | bulleted_list - { - result = val[0] - } - | numbered_list - { - result = val[0] - } - | dictionary_list - { - list = ListAST.new(@ast_index, @ast_length) - list.list_type = :Dictionary - list.children = val[0] - result = list - } - | preformatted - { - result = val[0] - } - | section - { - result = val[0] - } - | tag - { - result = val[0] - } - | template - { - result = val[0] - } - | KEYWORD - { - k = KeywordAST.new(@ast_index, @ast_length) - k.text = val[0] - result = k - } - | PARA_START para_contents PARA_END - { - p = ParagraphAST.new(@ast_index, @ast_length) - p.children = val[1] - result = p - } - | LINK_START link_contents LINK_END - { - l = LinkAST.new(@ast_index, @ast_length) - l.link_type = val[0] - l.url = val[1][0] - l.children += val[1][1..-1] if val[1].length > 1 - result = l - } - | PASTE_START para_contents PASTE_END - { - p = PasteAST.new(@ast_index, @ast_length) - p.children = val[1] - result = p - } - | INTLINK_START TEXT RESOURCESEP TEXT reslink_repeated_contents INTLINK_END - { - l = ResourceLinkAST.new(@ast_index, @ast_length) - l.prefix = val[1] - l.locator = val[3] - l.children = val[4] unless val[4].nil? or val[4].empty? - result = l - } - | INTLINK_START TEXT intlink_repeated_contents INTLINK_END - { - l = InternalLinkAST.new(@ast_index, @ast_length) - l.locator = val[1] - l.children = val[2] unless val[2].nil? or val[2].empty? - result = l - } - | INTLINK_START CATEGORY TEXT cat_sort_contents INTLINK_END - { - l = CategoryAST.new(@ast_index, @ast_length) - l.locator = val[2] - l.sort_as = val[3] - result = l - } - | INTLINK_START RESOURCESEP CATEGORY TEXT intlink_repeated_contents INTLINK_END - { - l = CategoryLinkAST.new(@ast_index, @ast_length) - l.locator = val[3] - l.children = val[4] unless val[4].nil? or val[4].empty? - result = l - } - | table - ; - -para_contents: - { - result = nil - } - | repeated_contents - { - result = val[0] - } - ; - -tag: - TAG_START tag_attributes TAG_END - { - if val[0] != val[2] - raise Racc::ParseError.new("XHTML end tag #{val[2]} does not match start tag #{val[0]}") - end - elem = ElementAST.new(@ast_index, @ast_length) - elem.name = val[0] - elem.attributes = val[1] - result = elem - } - | TAG_START tag_attributes repeated_contents TAG_END - { - if val[0] != val[3] - raise Racc::ParseError.new("XHTML end tag #{val[3]} does not match start tag #{val[0]}") - end - elem = ElementAST.new(@ast_index, @ast_length) - elem.name = val[0] - elem.attributes = val[1] - elem.children += val[2] - result = elem - } - ; - -tag_attributes: - { - result = nil - } - | ATTR_NAME tag_attributes - { - attr_map = val[2] ? val[2] : {} - attr_map[val[0]] = true - result = attr_map - } - | ATTR_NAME ATTR_VALUE tag_attributes - { - attr_map = val[2] ? val[2] : {} - attr_map[val[0]] = val[1] - result = attr_map - } - ; - - -link_contents: - TEXT - { - result = val - } - | TEXT LINKSEP link_repeated_contents - { - result = [val[0]] - result += val[2] - } - ; - - -link_repeated_contents: - repeated_contents - { - result = val[0] - } - | repeated_contents LINKSEP link_repeated_contents - { - result = val[0] - result += val[2] if val[2] - } - ; - - -intlink_repeated_contents: - { - result = nil - } - | INTLINKSEP repeated_contents - { - result = val[1] - } - ; - -cat_sort_contents: - { - result = nil - } - | INTLINKSEP TEXT - { - result = val[1] - } - ; - -reslink_repeated_contents: - { - result = nil - } - | INTLINKSEP reslink_repeated_contents - { - result = val[1] - } - | INTLINKSEP repeated_contents reslink_repeated_contents - { - i = InternalLinkItemAST.new(@ast_index, @ast_length) - i.children = val[1] - result = [i] - result += val[2] if val[2] - } - ; - -repeated_contents: contents - { - result = [] - result << val[0] - } - | repeated_contents contents - { - result = [] - result += val[0] - result << val[1] - } - ; - -text: element - { - p = TextAST.new(@ast_index, @ast_length) - p.formatting = val[0][0] - p.contents = val[0][1] - result = p - } - | formatted_element - { - result = val[0] - } - ; - -table: - TABLE_START table_contents TABLE_END - { - table = TableAST.new(@ast_index, @ast_length) - table.children = val[1] unless val[1].nil? or val[1].empty? - result = table - } - | TABLE_START TEXT table_contents TABLE_END - { - table = TableAST.new(@ast_index, @ast_length) - table.options = val[1] - table.children = val[2] unless val[2].nil? or val[2].empty? - result = table - } - -table_contents: - { - result = nil - } - | ROW_START row_contents ROW_END table_contents - { - row = TableRowAST.new(@ast_index, @ast_length) - row.children = val[1] unless val[1].nil? or val[1].empty? - result = [row] - result += val[3] unless val[3].nil? or val[3].empty? - } - | ROW_START TEXT row_contents ROW_END table_contents - { - row = TableRowAST.new(@ast_index, @ast_length) - row.children = val[2] unless val[2].nil? or val[2].empty? - row.options = val[1] - result = [row] - result += val[4] unless val[4].nil? or val[4].empty? - } - -row_contents: - { - result = nil - } - | HEAD_START HEAD_END row_contents - { - cell = TableCellAST.new(@ast_index, @ast_length) - cell.type = :head - result = [cell] - result += val[2] unless val[2].nil? or val[2].empty? - } - | HEAD_START repeated_contents HEAD_END row_contents - { - cell = TableCellAST.new(@ast_index, @ast_length) - cell.children = val[1] unless val[1].nil? or val[1].empty? - cell.type = :head - result = [cell] - result += val[3] unless val[3].nil? or val[3].empty? - } - | CELL_START CELL_END row_contents - { - cell = TableCellAST.new(@ast_index, @ast_length) - cell.type = :body - result = [cell] - result += val[2] unless val[2].nil? or val[2].empty? - } - | CELL_START repeated_contents CELL_END row_contents - { - if val[2] == 'attributes' - result = [] - else - cell = TableCellAST.new(@ast_index, @ast_length) - cell.children = val[1] unless val[1].nil? or val[1].empty? - cell.type = :body - result = [cell] - end - result += val[3] unless val[3].nil? or val[3].empty? - if val[2] == 'attributes' and val[3] and val[3].first.class == TableCellAST - val[3].first.attributes = val[1] - end - result - } - - -element: - TEXT - { return [:None, val[0]] } - | HLINE - { return [:HLine, val[0]] } - | CHAR_ENT - { return [:CharacterEntity, val[0]] } - | SIGNATURE_DATE - { return [:SignatureDate, val[0]] } - | SIGNATURE_NAME - { return [:SignatureName, val[0]] } - | SIGNATURE_FULL - { return [:SignatureFull, val[0]] } - ; - -formatted_element: - BOLD_START BOLD_END - { - result = FormattedAST.new(@ast_index, @ast_length) - result.formatting = :Bold - result - } - | ITALIC_START ITALIC_END - { - result = FormattedAST.new(@ast_index, @ast_length) - result.formatting = :Italic - result - } - | BOLD_START repeated_contents BOLD_END - { - p = FormattedAST.new(@ast_index, @ast_length) - p.formatting = :Bold - p.children += val[1] - result = p - } - | ITALIC_START repeated_contents ITALIC_END - { - p = FormattedAST.new(@ast_index, @ast_length) - p.formatting = :Italic - p.children += val[1] - result = p - } - ; - -bulleted_list: UL_START list_item list_contents UL_END - { - list = ListAST.new(@ast_index, @ast_length) - list.list_type = :Bulleted - list.children << val[1] - list.children += val[2] - result = list - } - ; - -numbered_list: OL_START list_item list_contents OL_END - { - list = ListAST.new(@ast_index, @ast_length) - list.list_type = :Numbered - list.children << val[1] - list.children += val[2] - result = list - } - ; - -list_contents: - { result = [] } - list_item list_contents - { - result << val[1] - result += val[2] - } - | - { result = [] } - ; - -list_item: - LI_START LI_END - { - result = ListItemAST.new(@ast_index, @ast_length) - } - | LI_START repeated_contents LI_END - { - li = ListItemAST.new(@ast_index, @ast_length) - li.children += val[1] - result = li - } - ; - -dictionary_list: - DL_START dictionary_term dictionary_contents DL_END - { - result = [val[1]] - result += val[2] - } - | DL_START dictionary_contents DL_END - { - result = val[1] - } - ; - -dictionary_term: - DT_START DT_END - { - result = ListTermAST.new(@ast_index, @ast_length) - } - | DT_START repeated_contents DT_END - { - term = ListTermAST.new(@ast_index, @ast_length) - term.children += val[1] - result = term - } - -dictionary_contents: - dictionary_definition dictionary_contents - { - result = [val[0]] - result += val[1] if val[1] - } - | - { - result = [] - } - -dictionary_definition: - DD_START DD_END - { - result = ListDefinitionAST.new(@ast_index, @ast_length) - } - | DD_START repeated_contents DD_END - { - term = ListDefinitionAST.new(@ast_index, @ast_length) - term.children += val[1] - result = term - } - -preformatted: PRE_START repeated_contents PRE_END - { - p = PreformattedAST.new(@ast_index, @ast_length) - p.children += val[1] - result = p - } - | PREINDENT_START repeated_contents PREINDENT_END - { - p = PreformattedAST.new(@ast_index, @ast_length) - p.indented = true - p.children += val[1] - result = p - } - ; - -section: SECTION_START repeated_contents SECTION_END - { result = [val[1], val[0].length] - s = SectionAST.new(@ast_index, @ast_length) - s.children = val[1] - s.level = val[0].length - result = s - } - ; - -template: TEMPLATE_START TEXT template_parameters TEMPLATE_END - { - t = TemplateAST.new(@ast_index, @ast_length) - t.template_name = val[1] - t.children = val[2] unless val[2].nil? or val[2].empty? - result = t - } - ; - -template_parameters: - { - result = nil - } - | INTLINKSEP TEXT template_parameters - { - p = TemplateParameterAST.new(@ast_index, @ast_length) - p.parameter_value = val[1] - result = [p] - result += val[2] if val[2] - } - | INTLINKSEP template template_parameters - { - p = TemplateParameterAST.new(@ast_index, @ast_length) - p.children << val[1] - result = [p] - result += val[2] if val[2] - } - ; - -end - ----- header ---- -require 'mediacloth/mediawikiast' - ----- inner ---- - -attr_accessor :lexer - -def initialize - @nodes = [] - @context = [] - @wiki_ast_length = 0 - super -end - -#Tokenizes input string and parses it. -def parse(input) - @yydebug=true - lexer.tokenize(input) - do_parse - return @nodes.last -end - -#Asks the lexer to return the next token. -def next_token - token = @lexer.lex - if token[0].to_s.upcase.include? "_START" - @context << token[2..3] - elsif token[0].to_s.upcase.include? "_END" - @ast_index = @context.last[0] - @ast_length = token[2] + token[3] - @context.last[0] - @context.pop - else - @ast_index = token[2] - @ast_length = token[3] - end - - @wiki_ast_length += token[3] - - return token[0..1] -end diff --git a/test/mri/racc/assets/mof.y b/test/mri/racc/assets/mof.y deleted file mode 100644 index 2e83c79b6f2..00000000000 --- a/test/mri/racc/assets/mof.y +++ /dev/null @@ -1,649 +0,0 @@ -# Distributed under the Ruby license -# See http://www.ruby-lang.org/en/LICENSE.txt for the full license text -# Copyright (c) 2010 Klaus Kämpf - -/* - * According to appendix A of - * http://www.dmtf.org/standards/cim/cim_spec_v22 - */ - -class MOF::Parser - prechigh -/* nonassoc UMINUS */ - left '*' '/' - left '+' '-' - preclow - - token PRAGMA INCLUDE IDENTIFIER CLASS ASSOCIATION INDICATION - AMENDED ENABLEOVERRIDE DISABLEOVERRIDE RESTRICTED TOSUBCLASS TOINSTANCE - TRANSLATABLE QUALIFIER SCOPE SCHEMA PROPERTY REFERENCE - METHOD PARAMETER FLAVOR INSTANCE - AS REF ANY OF - DT_VOID - DT_UINT8 DT_SINT8 DT_UINT16 DT_SINT16 DT_UINT32 DT_SINT32 - DT_UINT64 DT_SINT64 DT_REAL32 DT_REAL64 DT_CHAR16 DT_STR - DT_BOOLEAN DT_DATETIME - positiveDecimalValue - stringValue - realValue - charValue - booleanValue - nullValue - binaryValue - octalValue - decimalValue - hexValue - -rule - - /* Returns a Hash of filename and MofResult */ - mofSpecification - : /* empty */ - { result = Hash.new } - | mofProduction - { result = { @name => @result } } - | mofSpecification mofProduction - { result = val[0] - result[@name] = @result - } - ; - - mofProduction - : compilerDirective - | classDeclaration - { #puts "Class '#{val[0].name}'" - @result.classes << val[0] - } - | qualifierDeclaration - { @result.qualifiers << val[0] - @qualifiers[val[0].name.downcase] = val[0] - } - | instanceDeclaration - { @result.instances << val[0] } - ; - -/*** - * compilerDirective - * - */ - - compilerDirective - : "#" PRAGMA INCLUDE pragmaParameters_opt - { raise MOF::Helper::Error.new(@name,@lineno,@line,"Missing filename after '#pragma include'") unless val[3] - open val[3], :pragma - } - | "#" PRAGMA pragmaName pragmaParameters_opt - | "#" INCLUDE pragmaParameters_opt - { raise StyleError.new(@name,@lineno,@line,"Use '#pragma include' instead of '#include'") unless @style == :wmi - raise MOF::Helper::Error.new(@name,@lineno,@line,"Missing filename after '#include'") unless val[2] - open val[2], :pragma - } - ; - - pragmaName - : IDENTIFIER - ; - - pragmaParameters_opt - : /* empty */ - { raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi } - | "(" pragmaParameterValues ")" - { result = val[1] } - ; - - pragmaParameterValues - : pragmaParameterValue - | pragmaParameterValues "," pragmaParameterValue - ; - - pragmaParameterValue - : string - | integerValue - { raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi } - | IDENTIFIER - ; - -/*** - * classDeclaration - * - */ - - classDeclaration - : qualifierList_opt CLASS className alias_opt superClass_opt "{" classFeatures "}" ";" - { qualifiers = val[0] - features = val[6] - # FIXME: features must not include references - result = CIM::Class.new(val[2],qualifiers,val[3],val[4],features) - } - ; - - classFeatures - : /* empty */ - { result = [] } - | classFeatures classFeature - { result = val[0] << val[1] } - ; - - classFeature - : propertyDeclaration - | methodDeclaration - | referenceDeclaration /* must have association qualifier */ - ; - - - qualifierList_opt - : /* empty */ - | qualifierList - { result = CIM::QualifierSet.new val[0] } - ; - - qualifierList - : "[" qualifier qualifiers "]" - { result = val[2] - result.unshift val[1] if val[1] } - ; - - qualifiers - : /* empty */ - { result = [] } - | qualifiers "," qualifier - { result = val[0] - result << val[2] if val[2] - } - ; - - qualifier - : qualifierName qualifierParameter_opt flavor_opt - { # Get qualifier decl - qualifier = case val[0] - when CIM::Qualifier then val[0].definition - when CIM::QualifierDeclaration then val[0] - when String then @qualifiers[val[0].downcase] - else - nil - end - raise MOF::Helper::Error.new(@name,@lineno,@line,"'#{val[0]}' is not a valid qualifier") unless qualifier - value = val[1] - raise MOF::Helper::Error.new(@name,@lineno,@line,"#{value.inspect} does not match qualifier type '#{qualifier.type}'") unless qualifier.type.matches?(value)||@style == :wmi - # Don't propagate a boolean 'false' - if qualifier.type == :boolean && value == false - result = nil - else - result = CIM::Qualifier.new(qualifier,value,val[2]) - end - } - ; - - flavor_opt - : /* empty */ - | ":" flavor - { result = CIM::QualifierFlavors.new val[1] } - ; - - qualifierParameter_opt - : /* empty */ - | qualifierParameter - ; - - qualifierParameter - : "(" constantValue ")" - { result = val[1] } - | arrayInitializer - ; - - /* CIM::Flavors */ - flavor - : AMENDED | ENABLEOVERRIDE | DISABLEOVERRIDE | RESTRICTED | TOSUBCLASS | TRANSLATABLE | TOINSTANCE - { case val[0].to_sym - when :amended, :toinstance - raise StyleError.new(@name,@lineno,@line,"'#{val[0]}' is not a valid flavor") unless @style == :wmi - end - } - ; - - alias_opt - : /* empty */ - | alias - ; - - superClass_opt - : /* empty */ - | superClass - ; - - className - : IDENTIFIER /* must be _ in CIM v2.x */ - { raise ParseError.new("Class name must be prefixed by '_'") unless val[0].include?("_") || @style == :wmi } - ; - - alias - : AS aliasIdentifier - { result = val[1] } - ; - - aliasIdentifier - : "$" IDENTIFIER /* NO whitespace ! */ - { result = val[1] } - ; - - superClass - : ":" className - { result = val[1] } - ; - - - propertyDeclaration - : qualifierList_opt dataType propertyName array_opt defaultValue_opt ";" - { if val[3] - type = CIM::Array.new val[3],val[1] - else - type = val[1] - end - result = CIM::Property.new(type,val[2],val[0],val[4]) - } - ; - - referenceDeclaration - : qualifierList_opt objectRef referenceName array_opt defaultValue_opt ";" - { if val[4] - raise StyleError.new(@name,@lineno,@line,"Array not allowed in reference declaration") unless @style == :wmi - end - result = CIM::Reference.new(val[1],val[2],val[0],val[4]) } - ; - - methodDeclaration - : qualifierList_opt dataType methodName "(" parameterList_opt ")" ";" - { result = CIM::Method.new(val[1],val[2],val[0],val[4]) } - ; - - propertyName - : IDENTIFIER - | PROPERTY - { # tmplprov.mof has 'string Property;' - raise StyleError.new(@name,@lineno,@line,"Invalid keyword '#{val[0]}' used for property name") unless @style == :wmi - } - ; - - referenceName - : IDENTIFIER - | INDICATION - { result = "Indication" } - ; - - methodName - : IDENTIFIER - ; - - dataType - : DT_UINT8 - | DT_SINT8 - | DT_UINT16 - | DT_SINT16 - | DT_UINT32 - | DT_SINT32 - | DT_UINT64 - | DT_SINT64 - | DT_REAL32 - | DT_REAL64 - | DT_CHAR16 - | DT_STR - | DT_BOOLEAN - | DT_DATETIME - | DT_VOID - { raise StyleError.new(@name,@lineno,@line,"'void' is not a valid datatype") unless @style == :wmi } - ; - - objectRef - : className - { # WMI uses class names as data types (without REF ?!) - raise StyleError.new(@name,@lineno,@line,"Expected 'ref' keyword after classname '#{val[0]}'") unless @style == :wmi - result = CIM::ReferenceType.new val[0] - } - - | className REF - { result = CIM::ReferenceType.new val[0] } - ; - - parameterList_opt - : /* empty */ - | parameterList - ; - - parameterList - : parameter parameters - { result = val[1].unshift val[0] } - ; - - parameters - : /* empty */ - { result = [] } - | parameters "," parameter - { result = val[0] << val[2] } - ; - - parameter - : qualifierList_opt typespec parameterName array_opt parameterValue_opt - { if val[3] - type = CIM::Array.new val[3], val[1] - else - type = val[1] - end - result = CIM::Property.new(type,val[2],val[0]) - } - ; - - typespec - : dataType - | objectRef - ; - - parameterName - : IDENTIFIER - ; - - array_opt - : /* empty */ - | array - ; - - parameterValue_opt - : /* empty */ - | defaultValue - { raise "Default parameter value not allowed in syntax style '{@style}'" unless @style == :wmi } - ; - - array - : "[" positiveDecimalValue_opt "]" - { result = val[1] } - ; - - positiveDecimalValue_opt - : /* empty */ - { result = -1 } - | positiveDecimalValue - ; - - defaultValue_opt - : /* empty */ - | defaultValue - ; - - defaultValue - : "=" initializer - { result = val[1] } - ; - - initializer - : constantValue - | arrayInitializer - | referenceInitializer - ; - - arrayInitializer - : "{" constantValues "}" - { result = val[1] } - ; - - constantValues - : /* empty */ - | constantValue - { result = [ val[0] ] } - | constantValues "," constantValue - { result = val[0] << val[2] } - ; - - constantValue - : integerValue - | realValue - | charValue - | string - | booleanValue - | nullValue - | instance - { raise "Instance as property value not allowed in syntax style '{@style}'" unless @style == :wmi } - ; - - integerValue - : binaryValue - | octalValue - | decimalValue - | positiveDecimalValue - | hexValue - ; - - string - : stringValue - | string stringValue - { result = val[0] + val[1] } - ; - - referenceInitializer - : objectHandle - | aliasIdentifier - ; - - objectHandle - : namespace_opt modelPath - ; - - namespace_opt - : /* empty */ - | namespaceHandle ":" - ; - - namespaceHandle - : IDENTIFIER - ; - - /* - * Note - : structure depends on type of namespace - */ - - modelPath - : className "." keyValuePairList - ; - - keyValuePairList - : keyValuePair keyValuePairs - ; - - keyValuePairs - : /* empty */ - | keyValuePairs "," keyValuePair - ; - - keyValuePair - : keyname "=" initializer - ; - - keyname - : propertyName | referenceName - ; - -/*** - * qualifierDeclaration - * - */ - - qualifierDeclaration - /* 0 1 2 3 4 */ - : QUALIFIER qualifierName qualifierType scope defaultFlavor_opt ";" - { result = CIM::QualifierDeclaration.new( val[1], val[2][0], val[2][1], val[3], val[4]) } - ; - - defaultFlavor_opt - : /* empty */ - | defaultFlavor - ; - - qualifierName - : IDENTIFIER - | ASSOCIATION /* meta qualifier */ - | INDICATION /* meta qualifier */ - | REFERENCE /* Added in DSP0004 2.7.0 */ - | SCHEMA - ; - - /* [type, value] */ - qualifierType - : ":" dataType array_opt defaultValue_opt - { type = val[2].nil? ? val[1] : CIM::Array.new(val[2],val[1]) - result = [ type, val[3] ] - } - ; - - scope - : "," SCOPE "(" metaElements ")" - { result = CIM::QualifierScopes.new(val[3]) } - ; - - metaElements - : metaElement - { result = [ val[0] ] } - | metaElements "," metaElement - { result = val[0] << val[2] } - ; - - metaElement - : SCHEMA - | CLASS - | ASSOCIATION - | INDICATION - | QUALIFIER - | PROPERTY - | REFERENCE - | METHOD - | PARAMETER - | ANY - ; - - defaultFlavor - : "," FLAVOR "(" flavors ")" - { result = CIM::QualifierFlavors.new val[3] } - ; - - flavors - : flavor - { result = [ val[0] ] } - | flavors "," flavor - { result = val[0] << val[2] } - ; - -/*** - * instanceDeclaration - * - */ - - instanceDeclaration - : instance ";" - ; - - instance - : qualifierList_opt INSTANCE OF className alias_opt "{" valueInitializers "}" - ; - - valueInitializers - : valueInitializer - | valueInitializers valueInitializer - ; - - valueInitializer - : qualifierList_opt keyname "=" initializer ";" - | qualifierList_opt keyname ";" - { raise "Instance property '#{val[1]} must have a value" unless @style == :wmi } - ; - -end # class Parser - ----- header ---- - -# parser.rb - generated by racc - -require 'strscan' -require 'rubygems' -require 'cim' -require File.join(__dir__, 'result') -require File.join(__dir__, 'scanner') -require File.join(__dir__, 'case') - ----- inner ---- - -# -# Initialize MOF::Parser -# MOF::Parser.new options = {} -# -# options -> Hash of options -# :debug -> boolean -# :includes -> array of include dirs -# :style -> :cim or :wmi -# -def initialize options = {} - @yydebug = options[:debug] - @includes = options[:includes] || [] - @quiet = options[:quiet] - @style = options[:style] || :cim # default to style CIM v2.2 syntax - - @lineno = 1 - @file = nil - @iconv = nil - @eol = "\n" - @fname = nil - @fstack = [] - @in_comment = false - @seen_files = [] - @qualifiers = {} -end - -# -# Make options hash from argv -# -# returns [ files, options ] -# - - def self.argv_handler name, argv - files = [] - options = { :namespace => "" } - while argv.size > 0 - case opt = argv.shift - when "-h" - $stderr.puts "Ruby MOF compiler" - $stderr.puts "#{name} [-h] [-d] [-I ] []" - $stderr.puts "Compiles " - $stderr.puts "\t-d debug" - $stderr.puts "\t-h this help" - $stderr.puts "\t-I include dir" - $stderr.puts "\t-f force" - $stderr.puts "\t-n " - $stderr.puts "\t-o " - $stderr.puts "\t-s