Permalink
Browse files

enable SP as an alias for R7

  • Loading branch information...
1 parent dc96b26 commit b9d96a8e8418989e2e344b3605d92b3529ae2263 @izuzak committed Apr 20, 2012
Showing with 55 additions and 12 deletions.
  1. +4 −1 ace-mode-frisc.js
  2. +45 −9 friscasm.js
  3. +6 −2 friscasm.pegjs
View
@@ -55,7 +55,10 @@ define('ace/mode/frisc', function(require, exports, module) {
regex : "^[a-zA-Z][0-9a-zA-Z_]*"
}, {
token : "frisc_register",
- regex : "\\b[Rr][0-7]\\b"
+ regex : "\\s?\\b[Rr][0-7]\\b"
+ }, {
+ token : "frisc_register",
+ regex : "\\s?\\b[sS][pP]\\b"
}, {
token : "frisc_register",
regex : "\\s?\\b[Ss][Rr]\\b"
View
Oops, something went wrong.
View
@@ -601,8 +601,12 @@ whitespace
= " " / "\t"
register
- = [rR]regnum:[0-7] {
- return parseInt(regnum, 10);
+ = [rR]regnum:[0-7] / [sS][pP] {
+ if (typeof regnum === 'undefined') {
+ return 7; // SP == R7
+ } else {
+ return parseInt(regnum, 10);
+ }
}
number

0 comments on commit b9d96a8

Please sign in to comment.