@Test public void testParseSymbol2() { final SymbolLiteralNode _node; _node = ((SymbolLiteralNode) Parser.factory.source_("#foo").parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), SymbolLiteralNode.factory)); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_( _node.value(), st.gravel.core.Symbol.value("foo"))); }
@Override public JVMInstruction effectStack_(final JVMStack _aJVMStack) { for (int _temp1 = 0; _temp1 < _signature.arguments().length; _temp1++) { final JVMType _each = _signature.arguments()[(_signature.arguments().length - _temp1) - 1]; st.gravel.support.jvm.ObjectExtensions.assert_( InvokeStatic.this, st.gravel.support.jvm.ObjectExtensions.equals_(_aJVMStack.pop(), _each)); } if (!_signature.returnType().isVoidType()) { _aJVMStack.push_(_signature.returnType()); } return this; }
@Override public DynamicSuperSend withReturnType_(final JVMType _aType) { if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) { return DynamicSuperSend.this; } throw new RuntimeException("niy"); }
@Test public void testParse2ArgBlockEmpty2() { final Statement _node; _node = Parser.factory.source_("[:a :b ]").parseExpression(); assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory)); assertEquals((String) "[:a :b | ]", (String) _node.prettySourceString()); }
@Test public void testAssignmentExpressionInBlock() { final Statement _node; _node = Parser.factory.source_("[ foo := 7 ]").parseStatement(); assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory)); assertEquals((String) "[foo := 7]", (String) _node.prettySourceString()); }
@Test public void testParseVariableDot() { final BlockNode _node; _node = ((BlockNode) Parser.factory.source_(" [foo. bar] ").parseExpression()); assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory)); assertEquals((String) "\n[\nfoo.\nbar]", (String) _node.prettySourceString()); }
@Test public void testParse2ArgBlockNoTempsDotEnd() { final Statement _node; _node = Parser.factory.source_("[:a :b | a foo. b bar.]").parseExpression(); assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory)); assertEquals((String) "\n[:a :b | \na foo.\nb bar]", (String) _node.prettySourceString()); }
@Override public PutStatic withReturnType_(final JVMType _aType) { if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) { return PutStatic.this; } throw new RuntimeException("niy"); }
@Override public WhileGreaterThanLoop withReturnType_(final JVMType _aType) { if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) { return WhileGreaterThanLoop.this; } throw new RuntimeException("niy"); }
@Test public void testParseNilaryBlockNoTemps() { final Statement _node; _node = Parser.factory.source_("[1 foo. 2 bar]").parseExpression(); assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory)); assertEquals((String) "\n[\n1 foo.\n2 bar]", (String) _node.prettySourceString()); }
@Test public void testParseKeywordMethod2() { final KeywordMethodNode _node; _node = ((KeywordMethodNode) Parser.factory.parseMethod_("foo: arg1 bar: arg2 ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), KeywordMethodNode.factory)); assertEquals((String) "foo: arg1 bar: arg2\n\t^bar", (String) _node.prettySourceString()); }
@Test public void testParseOrType() { final BinaryMethodNode _node; _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String | Nil} ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory)); assertEquals((String) "+ arg {String | Nil}\n\t^bar", (String) _node.prettySourceString()); }
@Test public void testParseVariable() { final VariableNode _node; _node = ((VariableNode) Parser.factory.source_(" foo ").parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), VariableNode.factory)); assertEquals((String) "foo", (String) _node.prettySourceString()); }
@Test public void testParseBinaryExpression() { final Statement _node; _node = Parser.factory.source_(" 3 + 7 ").parseExpression(); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMessageNode.factory)); assertEquals((String) "3 + 7", (String) _node.prettySourceString()); }
@Test public void testParseUnaryMethod() { final UnaryMethodNode _node; _node = ((UnaryMethodNode) Parser.factory.parseMethod_("foo self baz. ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), UnaryMethodNode.factory)); assertEquals((String) "foo\n\tself baz.\n\t^bar", (String) _node.prettySourceString()); }
@Test public void testParseString2() { final StringLiteralNode _node; _node = ((StringLiteralNode) Parser.factory.source_("\'from\'\'age\'").parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), StringLiteralNode.factory)); assertTrue(st.gravel.support.jvm.StringExtensions.equals_(_node.value(), "from\'age")); }
public UpdateClassDiff diffTo_(final ClassNode _aClassNode) { if (!st.gravel.support.jvm.ObjectExtensions.equals_(_aClassNode.name(), _name)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } if (!st.gravel.support.jvm.ArrayExtensions.equals_(_aClassNode.namespace(), _namespace)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } if (!st.gravel.support.jvm.StringExtensions.equals_( _aClassNode.superclassPath(), _superclassPath)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } if (!st.gravel.support.jvm.DictionaryExtensions.equals_( _aClassNode.properties(), _properties)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isExtension(), _isExtension)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isTrait(), _isTrait)) { st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode); } return UpdateClassDiff.factory.reference_superclassReference_thisDiff_metaDiff_( _aClassNode.reference(), ((AbsoluteReference) _aClassNode.superclassReference()), this.diffToClassDescriptionNode_(_aClassNode), _metaclassNode.diffToClassDescriptionNode_(_aClassNode.metaclassNode())); }
@Test public void testParseChar() { final CharacterLiteralNode _node; _node = ((CharacterLiteralNode) Parser.factory.source_("$a").parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_( _node.factory(), CharacterLiteralNode.factory)); assertEquals((String) "$a", (String) _node.prettySourceString()); assertTrue(st.gravel.support.jvm.CharacterExtensions.equals_(_node.value(), 'a')); }
@Test public void testParseMethodWithArgType() { final BinaryMethodNode _node; _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String} ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory)); assertEquals((String) "+ arg {String}\n\t^bar", (String) _node.prettySourceString()); assertTrue(_node.argument().type() != null); assertTrue(_node.returnType() == null); }
@Test public void testParseByteArray() { final ByteArrayLiteralNode _node; _node = ((ByteArrayLiteralNode) Parser.factory.source_("#[1 2 3]").parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_( _node.factory(), ByteArrayLiteralNode.factory)); assertEquals((String) "#[1 2 3]", (String) _node.prettySourceString()); assertTrue( st.gravel.support.jvm.ByteArrayExtensions.equals_(_node.value(), new byte[] {1, 2, 3})); }
@Test public void testParseLiteralArray() { final ArrayLiteralNode _node; _node = ((ArrayLiteralNode) Parser.factory .source_("#(#foo foo \'foo\' 1 (a b c) #( a b c) ((x)) () #[1 2 3])") .parseExpression()); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ArrayLiteralNode.factory)); assertEquals( (String) "#(#foo #foo \'foo\' 1 #(#a #b #c) #(#a #b #c) #(#(#x)) #() #[1 2 3])", (String) _node.prettySourceString()); assertTrue(st.gravel.support.jvm.IntegerExtensions.equals_(_node.value().length, 9)); }
@Test public void testParseKeywordBinaryUnaryExpression4() { final Statement _node; _node = Parser.factory .source_( "2 + 7 bar foo: 7 bar: 4 baz foo: 2 + 1 boo: 3 foo + 2 roo: 3 + 2 foo noo: 3 hoo + 2 joo") .parseExpression(); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_( _node.factory(), KeywordMessageNode.factory)); assertEquals( (String) "2 + 7 bar\n\tfoo: 7\n\tbar: 4 baz\n\tfoo: 2 + 1\n\tboo: 3 foo + 2\n\troo: 3 + 2 foo\n\tnoo: 3 hoo + 2 joo", (String) _node.prettySourceString()); }
@Override public boolean equals(final Object _anObject) { if (!super.equals(_anObject)) { return false; } if (this._expression == null) { if (!(((PragmaNode) _anObject)._expression == null)) { return false; } } else { if (!st.gravel.support.jvm.ObjectExtensions.equals_( this._expression, ((PragmaNode) _anObject)._expression)) { return false; } } return true; }
public boolean isPropertyPragmaAt_(final st.gravel.core.Symbol _aKey) { return st.gravel.support.jvm.StringExtensions.equals_(_expression.selector(), "propertyAt:put:") && (_expression.arguments()[0].isSymbolLiteralNode() && st.gravel.support.jvm.ObjectExtensions.equals_( ((SymbolLiteralNode) _expression.arguments()[0]).value(), _aKey)); }
@Override public boolean equals(final Object _anObject) { if (!super.equals(_anObject)) { return false; } if (this._name == null) { if (!(((ClassNode) _anObject)._name == null)) { return false; } } else { if (!st.gravel.support.jvm.ObjectExtensions.equals_( this._name, ((ClassNode) _anObject)._name)) { return false; } } if (this._namespace == null) { if (!(((ClassNode) _anObject)._namespace == null)) { return false; } } else { if (!st.gravel.support.jvm.ArrayExtensions.equals_( this._namespace, ((ClassNode) _anObject)._namespace)) { return false; } } if (this._superclassPath == null) { if (!(((ClassNode) _anObject)._superclassPath == null)) { return false; } } else { if (!st.gravel.support.jvm.StringExtensions.equals_( this._superclassPath, ((ClassNode) _anObject)._superclassPath)) { return false; } } if (this._properties == null) { if (!(((ClassNode) _anObject)._properties == null)) { return false; } } else { if (!st.gravel.support.jvm.DictionaryExtensions.equals_( this._properties, ((ClassNode) _anObject)._properties)) { return false; } } if (!st.gravel.support.jvm.BooleanExtensions.equals_( this._isExtension, ((ClassNode) _anObject)._isExtension)) { return false; } if (this._metaclassNode == null) { if (!(((ClassNode) _anObject)._metaclassNode == null)) { return false; } } else { if (!st.gravel.support.jvm.ObjectExtensions.equals_( this._metaclassNode, ((ClassNode) _anObject)._metaclassNode)) { return false; } } if (!st.gravel.support.jvm.BooleanExtensions.equals_( this._isTrait, ((ClassNode) _anObject)._isTrait)) { return false; } return true; }