Introduced core.

This commit is contained in:
Borys Levytskyi
2015-04-04 16:33:33 +03:00
parent dd2175f04a
commit d96bcb0517
17 changed files with 48 additions and 42 deletions

View File

@@ -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);
});