compiler: use uint16 for label numbers

As noted in #687 this will make compiler a bit more predictable.
This commit is contained in:
Evgenii Stratonikov 2020-02-21 11:50:03 +03:00
parent 56f87cd44e
commit 5e229d84d4
3 changed files with 33 additions and 27 deletions

View file

@ -18,7 +18,7 @@ type funcScope struct {
decl *ast.FuncDecl
// Program label of the scope
label int
label uint16
// Local variables
locals map[string]int
@ -35,7 +35,7 @@ type funcScope struct {
i int
}
func newFuncScope(decl *ast.FuncDecl, label int) *funcScope {
func newFuncScope(decl *ast.FuncDecl, label uint16) *funcScope {
return &funcScope{
name: decl.Name.Name,
decl: decl,