Improved instruction parser
This commit is contained in:
parent
cf696a6f10
commit
57f1da10fe
7 changed files with 114 additions and 54 deletions
|
@ -86,6 +86,11 @@ func scanFile(path string, functions chan<- *Function) error {
|
|||
|
||||
tokens := token.Tokenize(contents)
|
||||
|
||||
file := &File{
|
||||
Tokens: tokens,
|
||||
Path: path,
|
||||
}
|
||||
|
||||
var (
|
||||
i = 0
|
||||
groupLevel = 0
|
||||
|
@ -216,6 +221,7 @@ func scanFile(path string, functions chan<- *Function) error {
|
|||
|
||||
functions <- &Function{
|
||||
Name: tokens[nameStart].Text(),
|
||||
File: file,
|
||||
Head: tokens[paramsStart:bodyStart],
|
||||
Body: tokens[bodyStart : i+1],
|
||||
Variables: map[string]*Variable{},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue