mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for Bug 163691 - Incorrect syntax highlight of numbers
This commit is contained in:
parent
e6a0b48500
commit
1aafcab10c
2 changed files with 10 additions and 4 deletions
|
@ -114,6 +114,13 @@ public class NumberRuleTest extends TestCase {
|
|||
// assertNoNumber("1e+");
|
||||
}
|
||||
|
||||
public void testBug163691() {
|
||||
assertNoNumber("+x1");
|
||||
assertNoNumber("-z0");
|
||||
assertNoNumber("- 0");
|
||||
assertNoNumber("+ 9");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that given string is recognized as a number.
|
||||
* @param string
|
||||
|
|
|
@ -55,7 +55,6 @@ public class NumberRule implements IRule
|
|||
}
|
||||
if (ch == '0') {
|
||||
int xCh = scanner.read();
|
||||
++unreadCount;
|
||||
if (xCh == 'x' || xCh == 'X') {
|
||||
// hexnumber starting with [+-]?0[xX]
|
||||
do {
|
||||
|
@ -66,7 +65,7 @@ public class NumberRule implements IRule
|
|||
}
|
||||
scanner.unread();
|
||||
// assert ch == '0';
|
||||
} else if (!Character.isDigit((char)ch)) {
|
||||
} else if (ch == '.') {
|
||||
ch = scanner.read();
|
||||
++unreadCount;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue