Skip to content

Commit b876f54

Browse files
committed
fix
1 parent 225aab8 commit b876f54

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/cm/modes/luau/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,6 @@ function readNumber(stream: StringStream, firstChar: string) {
384384
return;
385385
}
386386

387-
if (firstChar === "0" && next && /[bB]/.test(next)) {
388-
stream.next();
389-
stream.eatWhile(/[01_]/);
390-
return;
391-
}
392-
393387
stream.eatWhile(/[\d_]/);
394388

395389
if (stream.peek() === "." && stream.string.charAt(stream.pos + 1) !== ".") {
@@ -554,11 +548,13 @@ const normal: Tokenizer = (stream, state) => {
554548
return "comment";
555549
}
556550
if (stream.eat("[")) {
551+
const longBracketStart = stream.pos;
557552
const level = readLongBracket(stream);
558553
if (level >= 0) {
559554
pushTokenizer(state, bracketed(level, "comment"));
560555
return state.cur(stream, state);
561556
}
557+
stream.backUp(stream.pos - longBracketStart);
562558
}
563559
stream.skipToEnd();
564560
return "comment";
@@ -575,11 +571,13 @@ const normal: Tokenizer = (stream, state) => {
575571
}
576572

577573
if (char === "[") {
574+
const longBracketStart = stream.pos;
578575
const level = readLongBracket(stream);
579576
if (level >= 0) {
580577
pushTokenizer(state, bracketed(level, "string"));
581578
return state.cur(stream, state);
582579
}
580+
stream.backUp(stream.pos - longBracketStart);
583581
}
584582

585583
if (char === "@" && isWordStart(stream.peek() || "")) {

0 commit comments

Comments
 (0)