Package wycc.lang

Examples of wycc.lang.Pipeline$Template


        return result;
    }
   
    @Test
    public void testSimple() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        Assert.assertEquals("This is a test FOO\nBAR", t.eval(env(
                "foo", "FOO",
                "bar", "BAR")));
    }
View Full Code Here


                "bar", "BAR")));
    }
   
    @Test
    public void testJustPlaceholder() {
        Template t = new Template("@[foo]");
        Assert.assertEquals("FOO", t.eval(env(
                "foo", "FOO")));
    }
View Full Code Here

                "foo", "FOO")));
    }
   
    @Test
    public void testSimpleMissing() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 2", e.getMessage());
        }
        t = new Template("This is a test @[foo]\n\r\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 3", e.getMessage());
        }
View Full Code Here

   * .
   *
   * @return
   */
  protected Pipeline initialisePipeline() {
    return new Pipeline(defaultPipeline);
  }
View Full Code Here

   */
  protected void addBuildRules(StdProject project) {
    if(whileyDir != null) {
      // whileydir can be null if a subclass of this task doesn't
      // necessarily require it.
      Pipeline wyilPipeline = initialisePipeline();

      if(pipelineModifiers != null) {
            wyilPipeline.apply(pipelineModifiers);
          }

      // ========================================================
      // Whiley => Wyil Compilation Rule
      // ========================================================

      WhileyBuilder wyilBuilder = new WhileyBuilder(project,wyilPipeline);

      if(verbose) {
        wyilBuilder.setLogger(new Logger.Default(System.err));
      }

      project.add(new StdBuildRule(wyilBuilder, whileyDir,
          whileyIncludes, whileyExcludes, wyilDir));

      // ========================================================
      // Wyil => Wycs Compilation Rule
      // ========================================================

      if(verification || smtVerification) {

        // First, handle the conversion of wyil to wyal

        Wyil2WyalBuilder wyalBuilder = new Wyil2WyalBuilder(project);

        if(verbose) {
          wyalBuilder.setLogger(new Logger.Default(System.err));
        }

        project.add(new StdBuildRule(wyalBuilder, wyilDir,
            wyilIncludes, wyilExcludes, wyalDir));

        // Second, handle the conversion of wyal to wycs

        Pipeline<WycsFile> wycsPipeline = new Pipeline(WycsBuildTask.defaultPipeline);

        wycsPipeline.setOption(VerificationCheck.class,"enable",verification);
        wycsPipeline.setOption(SmtVerificationCheck.class,"enable",smtVerification);
        Wyal2WycsBuilder wycsBuilder = new Wyal2WycsBuilder(project,wycsPipeline);

        if(verbose) {
          wycsBuilder.setLogger(new Logger.Default(System.err));
        }
View Full Code Here

   *
   * @param project
   */
  protected void addCompileBuildRules(StdProject project) {
    if (wyalDir != null) {
      Pipeline pipeline = initialisePipeline();

      if (pipelineModifiers != null) {
        pipeline.apply(pipelineModifiers);
      }

      // whileydir can be null if a subclass of this task doesn't
      // necessarily require it.
      Wyal2WycsBuilder builder = new Wyal2WycsBuilder(project, pipeline);
View Full Code Here

   * .
   *
   * @return
   */
  protected Pipeline initialisePipeline() {
    return new Pipeline(defaultPipeline);
  }
View Full Code Here

TOP

Related Classes of wycc.lang.Pipeline$Template

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.