Implemented type checks
This commit is contained in:
parent
baa2463b4b
commit
cacee7260a
19 changed files with 199 additions and 79 deletions
|
@ -229,7 +229,12 @@ func (s *Scanner) scanFile(path string, pkg string) error {
|
|||
function := core.NewFunction(pkg, name, file, body)
|
||||
|
||||
if typeStart != -1 {
|
||||
function.ReturnTypes = append(function.ReturnTypes, types.New(tokens[typeStart:typeEnd]))
|
||||
if tokens[typeStart].Kind == token.GroupStart && tokens[typeEnd-1].Kind == token.GroupEnd {
|
||||
typeStart++
|
||||
typeEnd--
|
||||
}
|
||||
|
||||
function.ReturnTypes = types.NewList(tokens[typeStart:typeEnd], contents)
|
||||
}
|
||||
|
||||
parameters := tokens[paramsStart:paramsEnd]
|
||||
|
@ -241,8 +246,8 @@ func (s *Scanner) scanFile(path string, pkg string) error {
|
|||
}
|
||||
|
||||
name := tokens[0].Text(contents)
|
||||
dataType := types.New(tokens[1:])
|
||||
register := x64.CallRegisters[count]
|
||||
dataType := types.New(tokens[1:].Text(contents))
|
||||
register := x64.InputRegisters[count]
|
||||
uses := token.Count(function.Body, contents, token.Identifier, name)
|
||||
|
||||
if uses == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue