Skip to content

Commit 08284f1

Browse files
committed
fix token
1 parent 901c95b commit 08284f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

RexBench/OfflineAssembler/parser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function isInteger(token)
309309

310310
function isString(token)
311311
{
312-
return /^".*"/.test(token);
312+
return /^".*"/.test(token.string);
313313
}
314314

315315

@@ -426,7 +426,7 @@ class Parser
426426
{
427427
let result;
428428
if (isRegister(this.tokens[this.idx])) {
429-
if (fprPattern.test(this.tokens[this.idx]))
429+
if (fprPattern.test(this.tokens[this.idx].string))
430430
result = FPRegisterID.forName(this.tokens[this.idx].codeOrigin, this.tokens[this.idx].string);
431431
else
432432
result = RegisterID.forName(this.tokens[this.idx].codeOrigin, this.tokens[this.idx].string);
@@ -813,7 +813,7 @@ class Parser
813813
let codeOrigin = this.tokens[this.idx].codeOrigin;
814814
let name = this.tokens[this.idx].string;
815815
this.idx++;
816-
if ((!final && this.idx == this.tokens.size) || (final && final.test(this.tokens[this.idx]))) {
816+
if ((!final && this.idx == this.tokens.size) || (final && final.test(this.tokens[this.idx].string))) {
817817
// Zero operand instruction, and it's the last one.
818818
list.push(new Instruction(codeOrigin, name, [], this.annotation));
819819
this.annotation = null;
@@ -935,7 +935,7 @@ class Parser
935935
let fileList = [];
936936
fileList.push(this.tokens[this.idx].codeOrigin.fileName);
937937
while (true) {
938-
if ((this.idx == this.tokens.length && !final) || (final && final.test(this.tokens[this.idx])))
938+
if ((this.idx == this.tokens.length && !final) || (final && final.test(this.tokens[this.idx].string)))
939939
break;
940940
else if (this.tokens[this.idx].isEqualTo("include")) {
941941
this.idx++;

0 commit comments

Comments
 (0)