forked from jasder/antlr
GrammarASTWithOptions.getOptions never returns null
This commit is contained in:
parent
f418ae6610
commit
70360a4ce8
|
@ -6,6 +6,7 @@ December 11, 2012
|
|||
* "warning treated as error" is a one-off error
|
||||
* Listen for issues reported by StringTemplate, report them as warnings
|
||||
* Fix template issues
|
||||
* GrammarASTWithOptions.getOptions never returns null
|
||||
|
||||
December 2, 2012
|
||||
|
||||
|
|
|
@ -32,7 +32,9 @@ package org.antlr.v4.tool.ast;
|
|||
|
||||
import org.antlr.runtime.Token;
|
||||
import org.antlr.v4.misc.CharSupport;
|
||||
import org.antlr.v4.runtime.misc.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -84,5 +86,12 @@ public abstract class GrammarASTWithOptions extends GrammarAST {
|
|||
@Override
|
||||
public abstract GrammarASTWithOptions dupNode();
|
||||
|
||||
public Map<String, GrammarAST> getOptions() { return options; }
|
||||
@NotNull
|
||||
public Map<String, GrammarAST> getOptions() {
|
||||
if (options == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue