From 52d8eda04d1e2e33bf4c09713d83360453cec435 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 9 Apr 2024 20:41:43 +0300 Subject: add blit to instructions --- src/parser.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index c0653bd..24a2ebe 100644 --- a/src/parser.y +++ b/src/parser.y @@ -59,7 +59,9 @@ %token LEXTHINARROW "->" %token LEXTO ">>" %token LEXFROM "<<" +%token LEXBLIT "<<*" %token LEXSEMI ";" +%token LEXALLOC "^" %token LEXI9 "i9" %token LEXI27 "i27" @@ -370,9 +372,14 @@ mem /* really not a huge fan or 'reusing' the output slot... */ INSADD(STORE, $[type], noclass(), b, t, $[mem_off]); } + | id "<<*" int id { + struct val t = IDTOVAL($1); + struct val f = IDTOVAL($4); + INSADD(BLIT, NOTYPE, noclass(), t, f, $[int]); + } stack - : type id "=" "alloc" int { + : type id "=" "^" int { struct val t = IDALLOC($[id]); INSADD(ALLOC, $[type], t, noclass(), noclass(), $[int]); } -- cgit v1.3