Examples of Unit


Examples of loop.ast.script.Unit

  }

  @Test
  public final void emitIndexIntoList3() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("fun(ls) ->\n  ls[1..]\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit


  @Test
  public final void emitIndexIntoList4() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("fun(ls) ->\n  ls[..2]\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit


  @Test
  public final void emitInlineMapDef() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("fun() ->\n  [1: 'a', 2: 'b', 3: 'c']\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit


  @Test
  public final void emitListAddition() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("add(x, y) ->\n  x + y\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit


  @Test
  public final void emitStringSlice() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("slice(str) ->\n  str[1..3]\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit

    Parser parser = new LexprParser(new Tokenizer(
        "pick(ls) =>\n" +
        "  1         : 'one'\n" +
        "  2         : 'two'\n"
    ).tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit

        "      two()\n" +
        "    where\n" +
        "      two ->\n" +
        "        'two'\n"
    ).tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit

        "  2         : @two()\n" +
        "\n" +
        "@two() ->\n" +
        "  'two'\n"
    ).tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit

        "  (a: '--' :b)         : a + b\n" +
        "  ''                   : ''\n" +
        "  *                    | str == 'yoyo'  : 'ma'\n" +
        "                       | else           : 'nothing'\n"
    ).tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of loop.ast.script.Unit

        "  5                    : 'five'\n" +
        "  *         | ls == 1  : 'one'\n" +
        "            | ls == 2  : 'two'\n" +
        "            | else     : 'other'\n"
    ).tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
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.