Package cn.bran.japid.compiler

Examples of cn.bran.japid.compiler.JapidParser.allTokens()


   */
  @Test
  public void testTemplateArgsWithDefaults() {
    String src = "`(A a, @Default(1)int b \n) \t \n end";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
    dumpTokens(tokens);
  }

  /**
   * test the parsing of `()
View Full Code Here


    String src = "`( String name, String url, String type, String data, String reRender,\r\n" +
        "       @default(\"html\") String dataType,\r\n" +
        "       String beforeSend, String success, String jsData, Boolean cache, String event\r\n" +
        "   )\n well...";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
    dumpTokens(tokens);
  }
    @Test
  public void testContinue() {
    String src = "hello \\\n `t Tag2 \\\n \"123\"`!";
View Full Code Here

  }
    @Test
  public void testContinue() {
    String src = "hello \\\n `t Tag2 \\\n \"123\"`!";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
//    dumpTokens(tokens);
    assertEquals(3, tokens.size());
    assertEquals(Token.PLAIN, tokens.get(0).token);
    assertEquals("hello  ", tokens.get(0).source);
    assertEquals(Token.SCRIPT_LINE, tokens.get(1).token);
View Full Code Here

  @Test
  public void testBackquoteAlone() {
    String src = "hello \n  `\n ss\n`  ";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
//    dumpTokens(tokens);
    assertEquals(4, tokens.size());
    assertEquals(Token.PLAIN, tokens.get(0).token);
    assertEquals(Token.SCRIPT_LINE, tokens.get(1).token);
    assertEquals(Token.PLAIN, tokens.get(2).token);
View Full Code Here

 
  @Test
  public void testScriptline() {
    String src = "hello `t Tag2 \"123\"`!";
    JapidParser p = new JapidParser(src);
    List<TokenPair> tokens = p.allTokens();
//    dumpTokens(tokens);
    assertEquals(3, tokens.size());
    assertEquals(Token.PLAIN, tokens.get(0).token);
    assertEquals(Token.SCRIPT_LINE, tokens.get(1).token);
    assertEquals(Token.PLAIN, tokens.get(2).token);
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.