From 933cc6e63c5e19d12b1007037516500643ce6667 Mon Sep 17 00:00:00 2001 From: parrt Date: Thu, 24 Nov 2016 20:30:18 -0800 Subject: [PATCH] make the switch an ENV not property. --- .../src/org/antlr/v4/runtime/atn/ParserATNSimulator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java index 48fd5663e..576b5b60e 100755 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java @@ -293,7 +293,8 @@ public class ParserATNSimulator extends ATNSimulator { public static final boolean dfa_debug = false; public static final boolean retry_debug = false; - public static final boolean TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT = Boolean.parseBoolean(System.getProperty("TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT")); + /** Just in case this optimization is bad, add an ENV variable to turn it off */ + public static final boolean TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT = Boolean.parseBoolean(System.getenv("TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT")); protected final Parser parser; @@ -1694,6 +1695,8 @@ public class ParserATNSimulator extends ATNSimulator { * making a decision in stat seeing through expr. It is only when * parsing rule expr that we must use the precedence to get the * right interpretation and, hence, parse tree. + * + * @since 4.6 */ protected boolean canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig config) { if ( TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT ) return false;