/*
 * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.lfkdsk.justel.parser;

import com.lfkdsk.justel.ast.base.AstNode;
import com.lfkdsk.justel.exception.ParseException;
import com.lfkdsk.justel.lexer.JustLexerImpl;
import com.lfkdsk.justel.lexer.Lexer;
import com.lfkdsk.justel.utils.logger.Logger;
import org.junit.jupiter.api.Test;

import java.io.StringReader;

import static com.lfkdsk.justel.token.Token.EOF;

/**
 * Created by liufengkai on 2017/7/26.
 */
class JustParserImplTest {
    @Test
    void parser() throws ParseException {
        String lfkdsk = "lfkdsk == 12345 + 124";
        Lexer lexer = new JustLexerImpl(new StringReader(lfkdsk));
        JustParser parser = new JustParserImpl();
        Logger.init("test parser");
        while (lexer.peek(0) != EOF) {
            AstNode node = parser.parser(lexer);
            Logger.v(" => " + node.toString() + "  ");
        }
    }
}
@@ -1092,16 +1092,66 @@
 arser%22);
+%0A%0A        long start = System.currentTimeMillis();
 %0A       
@@ -1296,15 +1296,79 @@
       %7D%0A
+        System.out.println(System.currentTimeMillis() - start);%0A
     %7D%0A%7D

update parser test