Examples of ErrorBuffer


Examples of org.stringtemplate.v4.misc.ErrorBuffer

    String templates =
      "foo() ::= {";
    writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    STErrorListener errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "t.stg 1:11: missing final '}' in {...} anonymous template" +newline+
              "t.stg 1:10: no viable alternative at input '{'"+newline;
    String result = errors.toString();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "foo( ::= << >>\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    STErrorListener errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "t.stg 1:5: no viable alternative at input '::='"+newline;
    String result = errors.toString();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "foo() ::= \"\nfoo\"\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    STErrorListener errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "t.stg 1:11: \\n in string"+newline;
    String result = errors.toString();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

            "foo) ::= << >>\n" +
            "bar() ::= <<bar>>\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    STErrorListener errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "t.stg 1:0: garbled template definition starting at 'foo'"+newline;
    String result = errors.toString();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "foo(a,) ::= << >>\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    STErrorListener errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "t.stg 1:6: missing ID at ')'"+newline;
    String result = errors.toString();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "foo(a,,) ::= << >>\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    ErrorBuffer errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected =
      "[t.stg 1:6: missing ID at ',', " +
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    String templates =
      "foo(a b) ::= << >>\n";
    writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    ErrorBuffer errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected =
      "[t.stg 1:6: no viable alternative at input 'b']";
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    String templates =
      "foo(a={hi}, b) ::= << >>\n";
    writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    ErrorBuffer errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected =
      "[t.stg 1:12: required parameters (b) must appear before optional parameters]";
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "foo(a) ::= \"<a b>\"\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    ErrorBuffer errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "[t.stg 1:15: 'b' came as a complete surprise to me]";
    String result = errors.errors.toString();
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
            "d ::= []\n";
        writeFile(tmpdir, "t.stg", templates);

    STGroupFile group = null;
    ErrorBuffer errors = new ErrorBuffer();
    group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "[t.stg 1:7: missing dictionary entry at ']']";
    String result = errors.errors.toString();
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.