From abe5b3a45fc01ff3948fb96dac78e65a7c67d086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20B=C3=B6ving?= Date: Sun, 29 Nov 2020 21:07:10 +0100 Subject: [PATCH] only allow lower case hex character for jump locations so labels like FINISH WORK --- src/asm.pest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/asm.pest b/src/asm.pest index f53cee1..00d8d99 100644 --- a/src/asm.pest +++ b/src/asm.pest @@ -18,11 +18,11 @@ jump_instruction = {"JMP"} arg_instruction = {"LDA" | "ADD" | "SUB"} no_arg_instruction = { "NOP" } -jump_argument = { jump_location | label} +jump_argument = { jump_location | label } argument = { memory_location | digit_literal } memory_location = { "(" ~ ASCII_HEX_DIGIT ~")" } digit_literal = {"#" ~ ASCII_HEX_DIGIT} -jump_location = { ASCII_HEX_DIGIT } +jump_location = { '0'..'9' | 'a'..'f' } label = { ASCII_ALPHA_UPPER+ }