asm: remove unused parameter for function Lex (#18058)
This commit is contained in:
parent
1a29bf0ee2
commit
768b4c2e6b
@ -25,7 +25,7 @@ import (
|
|||||||
|
|
||||||
func Compile(fn string, src []byte, debug bool) (string, error) {
|
func Compile(fn string, src []byte, debug bool) (string, error) {
|
||||||
compiler := asm.NewCompiler(debug)
|
compiler := asm.NewCompiler(debug)
|
||||||
compiler.Feed(asm.Lex(fn, src, debug))
|
compiler.Feed(asm.Lex(src, debug))
|
||||||
|
|
||||||
bin, compileErrors := compiler.Compile()
|
bin, compileErrors := compiler.Compile()
|
||||||
if len(compileErrors) > 0 {
|
if len(compileErrors) > 0 {
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func lexAll(src string) []token {
|
func lexAll(src string) []token {
|
||||||
ch := Lex("test.asm", []byte(src), false)
|
ch := Lex([]byte(src), false)
|
||||||
|
|
||||||
var tokens []token
|
var tokens []token
|
||||||
for i := range ch {
|
for i := range ch {
|
||||||
|
@ -95,7 +95,7 @@ type lexer struct {
|
|||||||
|
|
||||||
// lex lexes the program by name with the given source. It returns a
|
// lex lexes the program by name with the given source. It returns a
|
||||||
// channel on which the tokens are delivered.
|
// channel on which the tokens are delivered.
|
||||||
func Lex(name string, source []byte, debug bool) <-chan token {
|
func Lex(source []byte, debug bool) <-chan token {
|
||||||
ch := make(chan token)
|
ch := make(chan token)
|
||||||
l := &lexer{
|
l := &lexer{
|
||||||
input: string(source),
|
input: string(source),
|
||||||
|
Loading…
Reference in New Issue
Block a user