summaryrefslogtreecommitdiff
path: root/parser.fun
diff options
context:
space:
mode:
Diffstat (limited to 'parser.fun')
-rw-r--r--parser.fun15
1 files changed, 13 insertions, 2 deletions
diff --git a/parser.fun b/parser.fun
index d49f895..ca4171a 100644
--- a/parser.fun
+++ b/parser.fun
@@ -1150,7 +1150,7 @@ functor Parser(structure Tree: TREE; structure P: PPC;
if Char.isDigit c then
SOME $ ord c - ord #"0"
else if Char.isHexDigit c then
- SOME $ ord c - ord #"a" + 10
+ SOME $ ord (Char.toLower c) - ord #"a" + 10
else
NONE
@@ -3253,8 +3253,19 @@ functor Parser(structure Tree: TREE; structure P: PPC;
)
end
+ fun makeDivBy8 v =
+ let
+ open Word
+ in
+ (v + 0w7) div 0w8 * 0w8
+ end
+
fun registerLayout layout t toplev =
- D.pushAndGetId iniLayouts (toplev, sizeOfType t, layout)
+ let
+ val size = makeDivBy8 $ sizeOfType t
+ in
+ D.pushAndGetId iniLayouts (toplev, size, layout)
+ end
fun getLayoutSize id = #2 $ D.get iniLayouts id