aboutsummaryrefslogtreecommitdiff
path: root/asm.peg
diff options
context:
space:
mode:
Diffstat (limited to 'asm.peg')
-rw-r--r--asm.peg7
1 files changed, 7 insertions, 0 deletions
diff --git a/asm.peg b/asm.peg
index bbc00f1..7d644b6 100644
--- a/asm.peg
+++ b/asm.peg
@@ -41,6 +41,10 @@ directive =
{ $$ = fd; }
| sd:section-directive
{ $$ = sd; }
+ | type-directive
+ { $$.kind = ASM_DIR_TYPE; }
+ | size-directive
+ { $$.kind = ASM_DIR_SIZE; }
fill-directive =
"fill" ws r:number ws? "," ws? s:number ws? "," ws? v:number
@@ -62,6 +66,9 @@ section-type =
"@nobits" { $$.i64 = SHT_NOBITS; }
| "@progbits" { $$.i64 = SHT_PROGBITS; }
+type-directive = "type" ws ident "," ws "@function"
+size-directive = "size" ws ident "," ws ".-" ident
+
label =
i:ident ':'
{ $$.label = (Label){.kind = ASM_LABEL, .name = i.charptr}; }