summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-01-05 17:26:07 +0000
committerAlasdair Armstrong2018-01-05 17:26:07 +0000
commit2cf9dc9d40794912ce8af7d776326b271f52d942 (patch)
treefc7472ff4292de363dcbc313b53d760c323e28c9 /editors
parent8147deaf0bccdbb19d4c020583fc8a5c7b6197e8 (diff)
Added bitfield syntax to replicate register bits type
For example: bitfield cr : vector(8, dec, bit) = { CR0 : 7 .. 4, LT : 7, CR1 : 3 .. 2, CR2 : 1, CR3 : 0, } The difference this creates a newtype wrapper around the vector type, then generates getters and setters for all the fields once, rather than having to handle this construct separately in every backend.
Diffstat (limited to 'editors')
-rw-r--r--editors/sail2-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/sail2-mode.el b/editors/sail2-mode.el
index e7c3614b..e17b1a4f 100644
--- a/editors/sail2-mode.el
+++ b/editors/sail2-mode.el
@@ -8,7 +8,7 @@
"else" "match" "in" "return" "register" "ref" "forall" "operator" "effect"
"overload" "cast" "sizeof" "constraint" "default" "assert" "newtype"
"pure" "infixl" "infixr" "infix" "scattered" "end" "try" "catch" "and"
- "throw" "clause" "as" "repeat" "until" "while" "do" "foreach"))
+ "throw" "clause" "as" "repeat" "until" "while" "do" "foreach" "bitfield"))
(defconst sail2-kinds
'("Int" "Type" "Order" "inc" "dec"
@@ -31,9 +31,10 @@
(defconst sail2-mode-syntax-table
(let ((st (make-syntax-table)))
+ (modify-syntax-entry ?> "." st)
(modify-syntax-entry ?_ "w" st)
(modify-syntax-entry ?' "w" st)
- (modify-syntax-entry ?* ". 23" st)
+ (modify-syntax-entry ?* ". 23" st)
(modify-syntax-entry ?/ ". 124b" st)
(modify-syntax-entry ?\n "> b" st)
st)