Added more tests
This commit is contained in:
parent
a48f2868fb
commit
1b99722cd8
7 changed files with 32 additions and 6 deletions
|
@ -113,17 +113,17 @@ func (f *Function) CompileInstruction(line token.List) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
if line[0].Kind == token.Identifier {
|
||||
if len(line) < 2 {
|
||||
return fmt.Errorf("error to be implemented")
|
||||
}
|
||||
if len(line) < 2 {
|
||||
return errors.New(&errors.InvalidInstruction{Instruction: line[0].Text()}, f.File, line[0].Position)
|
||||
}
|
||||
|
||||
if line[0].Kind == token.Identifier {
|
||||
if line[1].Kind == token.Define {
|
||||
name := line[0].Text()
|
||||
value := line[2:]
|
||||
|
||||
if len(value) == 0 {
|
||||
return errors.New(errors.MissingAssignmentValue, f.File, line[1].After())
|
||||
return errors.New(errors.MissingAssignValue, f.File, line[1].After())
|
||||
}
|
||||
|
||||
if config.Verbose {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue