Skip to content

Commit a77a094

Browse files
committed
the numeric lirals X && B are not case sensitive
1 parent f38bae6 commit a77a094

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

src/lexer/numbers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ module.exports = {
2222
if (ch === '0') {
2323
ch = this.input();
2424
// check if hexa
25-
if (ch === 'x') {
25+
if (ch === 'x' || ch === 'X') {
2626
this.input();
2727
if (this.is_HEX()) {
2828
return this.consume_HNUM();
2929
} else {
3030
this.unput(2);
3131
}
32-
} else if (ch === 'b') {
32+
} else if (ch === 'b' || ch === 'B') {
3333
ch = this.input();
3434
if (ch === '0' || ch === '1') {
3535
return this.consume_BNUM();

test/token/texts.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
<?php
2-
/*
3-
@todo - should pass
4-
*/
2+
3+
$colors = array("red", "white", "blue");
4+
echo "\colors contains >$colors<\n";
5+
echo "\colors[1] contains >$colors[1]<\n";
6+
echo "\colors[1] contains >$colors [1]<\n"; // whitespace permitted, but semantics change
7+
//echo "\colors[1] contains >$colors[ 1]<\n"; // whitespace not permitted
8+
//echo "\colors[1] contains >$colors[1 ]<\n"; // whitespace not permitted
9+
var_dump("$colors[1]");
10+
var_dump("$colors[01]"); // invalid index
11+
var_dump("$colors[0x1]"); // invalid index
12+
var_dump("$colors[0X1]"); // invalid index
13+
514
echo "~'.{{$expectedLength}}'\$~s";
615
$obj = new stdClass();
716
$obj->name = 'john';
@@ -19,12 +28,12 @@
1928
$v = strtolower("$i.$j.$k-$rel");
2029
$text = "$text at line $line";
2130
return "Class.create('$package$className',{";
22-
31+
2332
$this->lastTTYMode = trim(`stty -g`);
24-
33+
2534
/**, $methodName = null **/
2635
$source = preg_replace('/(^|\s)namespace(.*?)\s*;/', "$1namespace$2\n{", $source)."}\n";
2736
/*/
2837
$foo;
2938
/**/
30-
$foo;
39+
$foo;

0 commit comments

Comments
 (0)