mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-23 13:12:42 +01:00
Introduced core.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
(function() {
|
||||
app.compose(function(){
|
||||
var twoOperandsRegex = /^(\d+)\s*(<<|>>|\||\&|\^)\s*(\d+)$/;
|
||||
var numbersList = /^((\d*)+\s?)+$/;
|
||||
|
||||
app.set('expression', {
|
||||
canParse: function(string) {
|
||||
return twoOperandsRegex.test(string) || numbersList.test(string);
|
||||
return twoOperandsRegex.test(string) || numbersList.test(string);
|
||||
},
|
||||
parse: function(string) {
|
||||
var trimmed = string.replace(/^\s+|\s+$/, '');
|
||||
@@ -48,4 +48,4 @@
|
||||
|
||||
return new app.models.BitwiseNumbers(numbers);
|
||||
}
|
||||
})(window.app);
|
||||
});
|
||||
Reference in New Issue
Block a user