Examples of TSLBlock


Examples of wyvern.tools.typedAST.extensions.TSLBlock

        Util.invokeValue(((MetaType) dslType).getMetaObj(),
            "getParser", UnitVal.getInstance(FileLocation.UNKNOWN));
    ExtParser parser = (ExtParser) Util.toJavaObject(vparser, ExtParser.class);

    try {
      dslAST = new TSLBlock(parser.parse(new ParseBuffer(dslText.get())));
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return dslAST.typecheck(env,expected);
  }
View Full Code Here

Examples of wyvern.tools.typedAST.extensions.TSLBlock

  @Test
  public void testSplice1() throws IOException, CopperParserException {
    TypedAST testAST = new Sequence(
        new ValDeclaration("x", new IntegerConstant(4), null),
        new Application(new TSLBlock(new Fn(Arrays.asList(new NameBindingImpl("x", Int.getInstance())),
            new SpliceExn(new Variable(new NameBindingImpl("x", Int.getInstance()), null)))), new IntegerConstant(9), null) );
    Type result = testAST.typecheck(Globals.getStandardEnv(), Optional.<Type>empty());
    Value out = testAST.evaluate(Globals.getStandardEnv());
    int finalRes = ((IntegerConstant)out).getValue();
    Assert.assertEquals(4, finalRes);
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.