From 051cf6520f342003582185fceb4c474e1e7d20dc Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 30 Dec 2024 22:29:17 -0800 Subject: Getting error code to report same w/out peeps Parse "arg--2" as "arg - -2" and not "arg-- 2". Use ParserException instead of RuntimeException. Add a Field w/out final test. Allow Float NaN to hash/compare Bug cast didn't check type when GVN Better handling of dead return/exit paths --- chapter17/src/main/java/com/seaofnodes/simple/Parser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter17/src') diff --git a/chapter17/src/main/java/com/seaofnodes/simple/Parser.java b/chapter17/src/main/java/com/seaofnodes/simple/Parser.java index 570ae67e..5a44b63e 100644 --- a/chapter17/src/main/java/com/seaofnodes/simple/Parser.java +++ b/chapter17/src/main/java/com/seaofnodes/simple/Parser.java @@ -1420,7 +1420,7 @@ public class Parser { if( "+-/*&|^".indexOf(ch0) == -1 ) return 0; char ch1 = (char)_input[_position+1]; if( ch1 == '=' ) { _position += 2; return ch0; } - if( Character.isDigit(_input[_position+2]) ) return 0; + if( isIdLetter((char)_input[_position+2]) ) return 0; if( ch0 == '+' && ch1 == '+' ) { _position += 2; return (char) 1; } if( ch0 == '-' && ch1 == '-' ) { _position += 2; return (char)-1; } return 0; -- cgit v1.2.3