mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-10 15:02:07 +01:00
Fix bug
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user