mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-23 13:12:42 +01:00
implemented dispatcher commands
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
(function() {
|
||||
var twoOperandsRegex = /^(\d+)(<<|>>|\||\&|\^)(\d+)$/;
|
||||
var twoOperandsRegex = /^(\d+)\s*(<<|>>|\||\&|\^)\s*(\d+)$/;
|
||||
var numbersList = /^((\d*)+\s?)+$/;
|
||||
|
||||
app.service('expression', {
|
||||
canParse: function(string) {
|
||||
return twoOperandsRegex.test(string) || numbersList.test(string);
|
||||
},
|
||||
parse: function(string) {
|
||||
var trimmed = string.replace(/^\s+|\s+$/, '');
|
||||
var matches = twoOperandsRegex.exec(trimmed);
|
||||
|
||||
Reference in New Issue
Block a user