diff --git a/compiler/semantic.py b/compiler/semantic.py index a15a1f9..b55e8b3 100644 --- a/compiler/semantic.py +++ b/compiler/semantic.py @@ -38,6 +38,10 @@ class Type(SymbolABC): super().__init__(context, name, value) +class Function(Type): + pass + + class Variable(SymbolABC): @typecheck def __init__(self, context: Context, name: str, value: nodes.Value | None = None, typedef: Type | None = None): @@ -160,5 +164,9 @@ class BuiltinContext(Context): super().__init__(name="builtins", parent=None) self.types = { "__unknown": Type(self, "__unknown", "builtin"), + "__function": Function(self, "__function", "builtin"), "uint32": Type(self, "uint32", "builtin") } + self.variables = { + "display": Variable(self, "display", None, self.types["__function"]) + }