core/asm: fix typos

This commit is contained in:
bstnfr 2023-09-28 12:49:25 +02:00
parent 2b0a8ff838
commit caf65b500a
3 changed files with 4 additions and 4 deletions

View file

@ -34,7 +34,7 @@ type instructionIterator struct {
started bool started bool
} }
// NewInstructionIterator create a new instruction iterator. // NewInstructionIterator creates a new instruction iterator.
func NewInstructionIterator(code []byte) *instructionIterator { func NewInstructionIterator(code []byte) *instructionIterator {
it := new(instructionIterator) it := new(instructionIterator)
it.code = code it.code = code

View file

@ -49,7 +49,7 @@ func NewCompiler(debug bool) *Compiler {
} }
} }
// Feed feeds tokens in to ch and are interpreted by // Feed feeds tokens into ch and are interpreted by
// the compiler. // the compiler.
// //
// feed is the first pass in the compile stage as it collects the used labels in the // feed is the first pass in the compile stage as it collects the used labels in the

View file

@ -72,12 +72,12 @@ func TestLexer(t *testing.T) {
input: "@label123", input: "@label123",
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}}, tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
}, },
// comment after label // Comment after label
{ {
input: "@label123 ;; comment", input: "@label123 ;; comment",
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}}, tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
}, },
// comment after instruction // Comment after instruction
{ {
input: "push 3 ;; comment\nadd", input: "push 3 ;; comment\nadd",
tokens: []token{{typ: lineStart}, {typ: element, text: "push"}, {typ: number, text: "3"}, {typ: lineEnd, text: "\n"}, {typ: lineStart, lineno: 1}, {typ: element, lineno: 1, text: "add"}, {typ: eof, lineno: 1}}, tokens: []token{{typ: lineStart}, {typ: element, text: "push"}, {typ: number, text: "3"}, {typ: lineEnd, text: "\n"}, {typ: lineStart, lineno: 1}, {typ: element, lineno: 1, text: "add"}, {typ: eof, lineno: 1}},