good morning!!!!

Skip to content
Snippets Groups Projects
Commit 3a0480e0 authored by Michael Forney's avatar Michael Forney Committed by Felix Lange
Browse files

core/asm: allow numbers in labels (#20362)

Numbers were already allowed when creating labels, just not when
referencing them.
parent 5d216675
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,14 @@ func TestLexer(t *testing.T) {
input: "0123abc",
tokens: []token{{typ: lineStart}, {typ: number, text: "0123"}, {typ: element, text: "abc"}, {typ: eof}},
},
{
input: "@foo",
tokens: []token{{typ: lineStart}, {typ: label, text: "foo"}, {typ: eof}},
},
{
input: "@label123",
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
},
}
for _, test := range tests {
......
......@@ -234,7 +234,7 @@ func lexComment(l *lexer) stateFn {
// the lex text state function to advance the parsing
// process.
func lexLabel(l *lexer) stateFn {
l.acceptRun(Alpha + "_")
l.acceptRun(Alpha + "_" + Numbers)
l.emit(label)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment