added return type to function
This commit is contained in:
@@ -15,10 +15,6 @@ class Error:
|
||||
2.3: 'Unknown function',
|
||||
2.4: 'Unknown class',
|
||||
2.5: 'Unknown library',
|
||||
2.6: 'Access error: no export',
|
||||
2.7: 'Expression error',
|
||||
2.8: 'Unexpected end of line',
|
||||
2.9: 'Unexpected {}', # other types
|
||||
|
||||
# Parser:
|
||||
3.0: 'Lib in lib',
|
||||
@@ -28,6 +24,11 @@ class Error:
|
||||
3.4: 'Class in func',
|
||||
3.5: 'Func in lib',
|
||||
3.6: 'Func in func',
|
||||
3.7: 'Expected: type',
|
||||
3.8: 'Access error: no export',
|
||||
3.9: 'Expression error',
|
||||
3.10: 'Unexpected end of line',
|
||||
3.11: 'Unexpected {}', # other types
|
||||
}
|
||||
|
||||
self.msg = self.__msgs[code].format(msg)
|
||||
|
@@ -1,6 +0,0 @@
|
||||
class Func:
|
||||
|
||||
def __init__(self, name: str, access: str = '') -> None:
|
||||
self.name = name
|
||||
self.ast = []
|
||||
self.access = access
|
@@ -2,5 +2,5 @@ class Class:
|
||||
|
||||
def __init__(self, name: str, access: str = '') -> None:
|
||||
self.name = name
|
||||
self.ast = []
|
||||
self.ast = [] # filled by parser
|
||||
self.access = access
|
7
src/Models/Language/Func.py
Normal file
7
src/Models/Language/Func.py
Normal file
@@ -0,0 +1,7 @@
|
||||
class Func:
|
||||
|
||||
def __init__(self, name: str, return_type: str, access: str = '') -> None:
|
||||
self.name = name
|
||||
self.return_type = return_type
|
||||
self.ast = [] # filled by parser
|
||||
self.access = access
|
@@ -2,4 +2,4 @@ class Lib:
|
||||
|
||||
def __init__(self, name: str) -> None:
|
||||
self.name = name
|
||||
self.ast = []
|
||||
self.ast = [] # filled by parser
|
6
src/Models/Language/Var.py
Normal file
6
src/Models/Language/Var.py
Normal file
@@ -0,0 +1,6 @@
|
||||
class Var:
|
||||
|
||||
def __init__(self, name: str, type: str, access: str = ''):
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.access = access
|
Reference in New Issue
Block a user