diff options
author | Himbeer <himbeer@disroot.org> | 2024-09-06 13:19:22 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-09-06 13:56:07 +0200 |
commit | 959599b7bf803a91595375f650245609bf7a338f (patch) | |
tree | 47aafa8d49e00e45c0cb25255c8486eeec763692 /decl.go | |
parent | 05c620c4d637b73f6b267ed57d5750587ccfd7a3 (diff) |
Add basic type system with only integers
This commit adds static typing with signed and unsigned integers of 8,
16, 32 and 64 bits.
Diffstat (limited to 'decl.go')
-rw-r--r-- | decl.go | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -4,9 +4,26 @@ package main -var funcs = map[string]struct{}{} -var localConsts = map[string]map[string]string{} -var localMuts = map[string]map[string]struct{}{} +var funcs = map[string]*funcInfo{} +var localConsts = map[string]map[string]*localConst{} +var localMuts = map[string]map[string]*localMut{} + +type funcInfo struct { + params []paramInfo + returnType cerType +} + +type paramInfo struct { + typ cerType +} + +type localConst struct { + typ cerType +} + +type localMut struct { + typ cerType +} func isDeclared(name string, toplevel bool) (ok bool, mutable bool) { if toplevel { |