This commit is contained in:
BorysLevytskyi
2023-05-25 13:44:10 +02:00
parent e861b9f0de
commit 34a0d776b9
2 changed files with 6 additions and 1 deletions

View File

@@ -54,6 +54,11 @@ describe("expression parser", () => {
var result = parser.parse("1|~2") as BitwiseOperation;
expect(result.children.length).toBe(2);
});
it("bug2", () => {
const result = parser.parse('0b0000000000000000001000010001011110000010100000001 & (0b0000000000000000001000010001011110000010100000001 >> 7)');
expect(result).toBeNull();
})
});
describe("comparison with nodejs engine", () => {

View File

@@ -84,7 +84,7 @@ class BitwiseOperationExpressionFactory implements IExpressionParserFactory {
regex: RegExp;
constructor() {
this.fullRegex = /^((<<|>>|>>>|\||\&|\^)?(~?-?([b,x,l,s,u,a-f,0-9]+)))+$/i;
this.fullRegex = /^[-,~,<,>,&,\^\|,b,x,l,s,u,a-f,0-9,\s]+$/i;
this.regex = /(<<|>>|>>>|\||\&|\^)?(~?-?(?:[b,x,l,s,u,,a-f,0-9]+))/gi;
}