Search in sources :

Example 21 with ParseResults

use of org.springframework.ide.vscode.java.properties.parser.ParseResults in project sts4 by spring-projects.

the class PropertiesAstTest method testLines1.

@Test
public void testLines1() throws Exception {
    ParseResults results = parser.parse("# Comment\n\n \t   \t \n\t\t\n");
    assertTrue(results.syntaxErrors.isEmpty());
    assertTrue(results.problems.isEmpty());
    assertEquals(4, results.ast.getAllNodes().size());
    assertEquals(1, results.ast.getNodes(Comment.class).size());
    assertEquals(3, results.ast.getNodes(EmptyLine.class).size());
}
Also used : ParseResults(org.springframework.ide.vscode.java.properties.parser.ParseResults) Test(org.junit.Test)

Aggregations

ParseResults (org.springframework.ide.vscode.java.properties.parser.ParseResults)21 Test (org.junit.Test)14 Node (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.Node)9 KeyValuePair (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.KeyValuePair)5 Value (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.Value)5 Problem (org.springframework.ide.vscode.java.properties.parser.Problem)3 Key (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.Key)3 ArrayList (java.util.ArrayList)2 BadLocationException (org.springframework.ide.vscode.commons.util.BadLocationException)2 Comment (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.Comment)2 EmptyLine (org.springframework.ide.vscode.java.properties.parser.PropertiesAst.EmptyLine)2 File (java.io.File)1 URI (java.net.URI)1 BitSet (java.util.BitSet)1 ANTLRErrorListener (org.antlr.v4.runtime.ANTLRErrorListener)1 ANTLRInputStream (org.antlr.v4.runtime.ANTLRInputStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 RecognitionException (org.antlr.v4.runtime.RecognitionException)1 ATNConfigSet (org.antlr.v4.runtime.atn.ATNConfigSet)1 DFA (org.antlr.v4.runtime.dfa.DFA)1