Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.Statement.prettySourceString()


  @Test
  public void testParseKeywordBinaryUnaryExpression1() {
    final Statement _node;
    _node = Parser.factory.source_("2 bar + 7 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 bar + 7\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());
  }

  @Test
  public void testParseKeywordBinaryUnaryExpression2() {
    final Statement _node;
View Full Code Here


  @Test
  public void testParseKeywordBinaryUnaryExpression2() {
    final Statement _node;
    _node = Parser.factory.source_("2 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 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());
  }

  @Test
  public void testParseKeywordBinaryUnaryExpression3() {
    final Statement _node;
View Full Code Here

  @Test
  public void testParseKeywordBinaryUnaryExpression3() {
    final Statement _node;
    _node = Parser.factory.source_("2 + 7 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\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());
  }

  @Test
  public void testParseKeywordBinaryUnaryExpression4() {
    final Statement _node;
View Full Code Here

  @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());
  }

  @Test
  public void testParseKeywordExpression() {
    final Statement _node;
View Full Code Here

  @Test
  public void testParseKeywordExpression() {
    final Statement _node;
    _node = Parser.factory.source_(" 3 foo: 7 bar: 4 ").parseExpression();
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) KeywordMessageNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals((String) "3 foo: 7 bar: 4", (String) _node.prettySourceString());
  }

  @Test
  public void testParseKeywordMethod1() {
    final KeywordMethodNode _node;
View Full Code Here

  @Test
  public void testParseNestedExpression() {
    final Statement _node;
    _node = Parser.factory.source_(" 3 + (4 + 5) ").parseExpression();
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMessageNode.factory));
    assertEquals((String) "3 + (4 + 5)", (String) _node.prettySourceString());
  }

  @Test
  public void testParseNilaryBlockNoTemps() {
    final Statement _node;
View Full Code Here

  @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 testParseNilaryBlockWithTemps() {
    final Statement _node;
View Full Code Here

  @Test
  public void testParseNilaryBlockWithTemps() {
    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[\n| a b |\na foo.\nb bar]", (String) _node.prettySourceString());
  }

  @Test
  public void testParseNilInArray1() {
    final ArrayLiteralNode _node;
View Full Code Here

  @Test
  public void testParseReturn() {
    final Statement _node;
    _node = Parser.factory.source_("[:a | ^a]").parseExpression();
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
    assertEquals((String) "[:a | ^a]", (String) _node.prettySourceString());
  }

  @Test
  public void testParseString1() {
    final StringLiteralNode _node;
View Full Code Here

  @Test
  public void testParseUnaryBlockNoTemps() {
    final Statement _node;
    _node = Parser.factory.source_("[:a | a foo. 2 bar]").parseExpression();
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
    assertEquals((String) "\n[:a | \na foo.\n2 bar]", (String) _node.prettySourceString());
  }

  @Test
  public void testParseUnaryBlockWithTemps() {
    final Statement _node;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.