@@ -51,8 +51,8 @@ The `LexResult` class provides access to the lexed tokens:
5151
5252``` java
5353public class LexResult {
54- public List<Token > getTokens () ;
55- public String getSource () ;
54+ public List<Token > tokens ;
55+ public String source ;
5656 public int getTokenCount ();
5757 public boolean isEmpty ();
5858}
@@ -73,8 +73,8 @@ String source = "<p>Hello <%= user.name %></p>";
7373
7474ParseResult result = Herb . parse(source);
7575
76- if (result. getValue() != null ) {
77- System . out. println(result. getValue() . treeInspect() );
76+ if (result. value != null ) {
77+ System . out. println(result. value . inspect( );
7878}
7979// Output:
8080// @ DocumentNode (location: (1:0)-(1:29))
@@ -133,12 +133,12 @@ The `ParseResult` class provides access to the parsed AST and any errors:
133133
134134```java
135135public class ParseResult {
136- public Node getValue () ;
137- public List<Node > getErrors () ;
138- public String getSource () ;
136+ public Node value ;
137+ public List<Node > errors ;
138+ public String source ;
139139 public boolean hasErrors ();
140140 public int getErrorCount ();
141- public boolean isSuccess ();
141+ public boolean isSuccessful ();
142142}
143143```
144144
@@ -278,7 +278,7 @@ public interface Node {
278278 String getNodeType ();
279279 Location getLocation ();
280280 List<Node > getErrors ();
281- String treeInspect ();
281+ String inspect ();
282282 <T > T accept (Visitor<T > visitor );
283283}
284284```
@@ -291,8 +291,8 @@ Parse errors are accessible through the `ParseResult`:
291291ParseResult result = Herb . parse(source);
292292
293293if (result. hasErrors()) {
294- for (Node error : result. getErrors ()) {
295- System . out. println(error. treeInspect ());
294+ for (Node error : result. recursiveErrors ()) {
295+ System . out. println(error. inspect ());
296296 }
297297}
298298```
0 commit comments