Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.ArrayLiteralNode


  }

  public String[] primitiveIn_(final String _className) {
    final PragmaNode _pragma;
    final Expression _argument;
    final ArrayLiteralNode _arrayNode;
    _pragma = this.primitivePragma();
    if (_pragma == null) {
      return null;
    }
    _argument = _pragma.expression().argument();
    if (_argument.isStringLiteralNode()) {
      return MethodNode.this.localPrimitiveIn_nameNode_(_className, ((StringLiteralNode) _argument));
    }
    if (!_argument.isArrayLiteralNode()) {
      return null;
    }
    _arrayNode = ((ArrayLiteralNode) _argument);
    return st.gravel.support.jvm.ArrayExtensions.collect_(_arrayNode.value(), ((st.gravel.support.jvm.Block1<String, Object>) (new st.gravel.support.jvm.Block1<String, Object>() {

      @Override
      public String value_(final Object _e) {
        final String _str;
        _str = ((String) _e);
View Full Code Here


    assertEquals((String) "foo: arg1 bar: arg2\n\t^bar", (String) _node.prettySourceString());
  }

  @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));
  }
View Full Code Here

    assertEquals((String) "\n[\n| a b |\na foo.\nb bar]", (String) _node.prettySourceString());
  }

  @Test
  public void testParseNilInArray1() {
    final ArrayLiteralNode _node;
    _node = ((ArrayLiteralNode) Parser.factory.source_("#(nil)").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) ArrayLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals((Object) null, (Object) _node.value()[0]);
  }
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.ast.ArrayLiteralNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.