forked from GitHub/lad
make opcodes case insensitive
This commit is contained in:
+3
-3
@@ -100,7 +100,7 @@ grammar = [[
|
|||||||
label <- <name> ":"
|
label <- <name> ":"
|
||||||
string <- '"' ('\\' / '\"' / !'"' .)* '"'
|
string <- '"' ('\\' / '\"' / !'"' .)* '"'
|
||||||
instruction <- ( <s> ( {<label>} / <number>)? <s> <ln>? <s> {<op>} ( <s> {<param>} )+ <s> ( %nl )+ ) -> {}
|
instruction <- ( <s> ( {<label>} / <number>)? <s> <ln>? <s> {<op>} ( <s> {<param>} )+ <s> ( %nl )+ ) -> {}
|
||||||
op <- [A-Z]+
|
op <- [A-Za-z]+
|
||||||
param <- <register> / <number> / <name> / <string>
|
param <- <register> / <number> / <name> / <string>
|
||||||
register <- ( "R[" <number> "]" )
|
register <- ( "R[" <number> "]" )
|
||||||
s <- ( !%nl %s )*
|
s <- ( !%nl %s )*
|
||||||
@@ -310,10 +310,10 @@ function parse_inst(table, parsed, n)
|
|||||||
local b = 3
|
local b = 3
|
||||||
local c = 4
|
local c = 4
|
||||||
if check_label(table[1]) == nil then
|
if check_label(table[1]) == nil then
|
||||||
op = table[1]
|
op = string.upper (table[1])
|
||||||
else
|
else
|
||||||
set_label(table[1], parsed, n)
|
set_label(table[1], parsed, n)
|
||||||
op = table[2]
|
op = string.upper (table[2])
|
||||||
a = 3
|
a = 3
|
||||||
b = 4
|
b = 4
|
||||||
c = 5
|
c = 5
|
||||||
|
|||||||
Reference in New Issue
Block a user