.999 numbers.invalid scopes for octal and hex. -999 and +999 numbers

This commit is contained in:
Thomas Aylott
2008-07-07 13:07:57 -04:00
parent dad2829a89
commit 7d3632c085
2 changed files with 77 additions and 3 deletions
+25 -2
View File
@@ -512,7 +512,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(Infinity|NaN|undefined)\b</string>
<string>\b(NaN|undefined)\b</string>
<key>name</key>
<string>constant.language.js</string>
</dict>
@@ -524,10 +524,33 @@
<array>
<dict>
<key>match</key>
<string>\b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)?))\b</string>
<string>(?i)\B[-+]?0x[0-9a-f]*\.(\B|\b[0-9]+)</string>
<key>name</key>
<string>invalid.illegal.numeric.hex.js</string>
</dict>
<dict>
<key>match</key>
<string>\B[-+]?0[0-9]+\.(\B|\b[0-9]+)</string>
<key>name</key>
<string>invalid.illegal.numeric.octal.js</string>
</dict>
<dict>
<key>match</key>
<string>(?xi)(?:\B[-+])?(?:
0x[0-9a-f]* # HEX
|( \B\.[0-9]+ # EG: .999
| \b[0-9]+ (\.[0-9]*)? # EG: 999.999 or 999. or 999
)(e[-+]?[0-9]+)? # EG: e+123 or E-123
)</string>
<key>name</key>
<string>constant.numeric.js</string>
</dict>
<dict>
<key>match</key>
<string>(?:\B[-+]|\b)(Infinity)\b</string>
<key>name</key>
<string>constant.language.js</string>
</dict>
</array>
</dict>
<key>core-punctuation</key>
+52 -1
View File
@@ -151,6 +151,8 @@ function(){ return /regex/ }
999
.999
(.999)
999. == 999;
999.999
4
16
@@ -161,10 +163,27 @@ function(){ return /regex/ }
3.402823669209385e+38
1.157920892373162e+77
1.3407807929942597e+154
.3407807929942597e+154
.3407807929942597E-154
3407807929942597.E-154.5 // SYNTAX ERROR: missing ; before statement
//....................^
Infinity
Infinity.propertyName
Infinity.methodName()
0377 // octal
0377. // SYNTAX ERROR
0377.5 // SYNTAX ERROR
0377.propertyName // number property
0377.methodName() // number method
0x // HEX
0XFF // HEX
0xFF // hex
0xff // hex
0xff. // SYNTAX ERROR
0xff.5 // SYNTAX ERROR
0xff.propertyName // number property
0xff.methodName() // number method
-999
-.999
@@ -180,15 +199,47 @@ Infinity
-1.3407807929942597e+154
-Infinity
-0377 // octal
-0x // hex
-0xFF // hex
-0377 // octal
-0xFF // hex
-0xff // hex
+999
+.999
+999.999
+4
+16
+256
+65536
+4294967296
+18446744073709552000
+3.402823669209385e+38
+1.157920892373162e+77
+1.3407807929942597e+154
+Infinity
+0377 // octal
+0x // hex
+0xFF // hex
+0377 // octal
+0xFF // hex
+0xff // hex
1e5
2.5E5
5e-324
1.7976931348623157e+308
x == 5;
x > 5;
x >= 5;
x < 5;
x <= 5;
x <=> 5; // Syntax Error
x = x +5; // is the same as x += 5;
x = x -5; // is the same as x -= 5;
x = x+5; // is the same as x += 5;
x = x-5; // is the same as x -= 5;
x = x*5; // is the same as x *= 5;