@@ -115,7 +115,7 @@ private void addAllDecimalNumbers() {
115115 // for every number found:
116116 // save its type (int/float), name, value and position in code.
117117
118- Pattern p = Pattern .compile ("[\\ [\\ {<>(),\\ t\\ s\\ +\\ -\\ /\\ *^%!|&=?:~]\\ d+\\ .? \\ d* " );
118+ Pattern p = Pattern .compile ("[\\ [\\ {<>(),\\ t\\ s\\ +\\ -\\ /\\ *^%!|&=?:~]\\ d+(_+ \\ d+)*( \\ . \\ d+(_+ \\ d+)*)? " ); // Matches any "delimiting" character, and then a decimal number.
119119 for (int i = 0 ; i < codeTabs .length ; i ++) {
120120 List <Handle > handles = new ArrayList <>();
121121 allHandles .add (handles );
@@ -185,7 +185,7 @@ private void addAllDecimalNumbers() {
185185 continue ;
186186
187187 int line = countLines (c .substring (0 , start )) - 1 ; // zero based
188- String value = c .substring (start , end );
188+ String value = c .substring (start , end ). replace ( "_" , "" ) ;
189189 if (value .contains ("." ) || forceFloat ) {
190190 // consider this as a float
191191 String name = varPrefix + "_float[" + floatVarCount +"]" ;
@@ -211,7 +211,7 @@ private void addAllDecimalNumbers() {
211211 private void addAllHexNumbers () {
212212 // for every number found:
213213 // save its type (int/float), name, value and position in code.
214- Pattern p = Pattern .compile ("[\\ [\\ {<>(),\\ t\\ s\\ +\\ -\\ /\\ *^%!|&=?:~]0x[A-Fa-f0-9]+" );
214+ Pattern p = Pattern .compile ("[\\ [\\ {<>(),\\ t\\ s\\ +\\ -\\ /\\ *^%!|&=?:~]0x[A-Fa-f0-9]+(_+[A-Fa-f0-9]+)* " );
215215 for (int i = 0 ; i < codeTabs .length ; i ++) {
216216 String c = codeTabs [i ];
217217 Matcher m = p .matcher (c );
@@ -248,7 +248,7 @@ private void addAllHexNumbers() {
248248 }
249249
250250 int line = countLines (c .substring (0 , start )) - 1 ; // zero based
251- String value = c .substring (start , end );
251+ String value = c .substring (start , end ). replace ( "_" , "" ) ;
252252 String name = varPrefix + "_int[" + intVarCount + "]" ;
253253 Handle handle ;
254254 try {
0 commit comments