From 2cf9dc9d40794912ce8af7d776326b271f52d942 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Fri, 5 Jan 2018 17:26:07 +0000 Subject: 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. --- editors/sail2-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editors') 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) -- cgit v1.2.3