Small changes
This commit is contained in:
parent
d9b891216d
commit
b950ff80a2
|
@ -107,6 +107,10 @@ loop:
|
|||
## High Level Language: *DuoDeca-Script*
|
||||
|
||||

|
||||
<br/><small>
|
||||
Yes, you may cringe that I used Comic Sans in my logo.
|
||||
I do when others do so. <3 Kyler
|
||||
</small>
|
||||
|
||||
### About
|
||||
- Name: DuoDeca-Script
|
||||
|
|
|
@ -9,7 +9,6 @@ from .lexer import lexer
|
|||
from .syntactical_analyzer import syntactical_analyzer
|
||||
from .semantical_analyzer import semantical_analyzer
|
||||
|
||||
|
||||
def _compile(args: argparse.Namespace):
|
||||
tokens = lexer(args.input_file.read(), args.input_file.name)
|
||||
|
||||
|
@ -40,13 +39,15 @@ def compile(args: argparse.Namespace):
|
|||
def parser(parser: argparse.ArgumentParser):
|
||||
parser.add_argument(
|
||||
'input_file', type=argparse.FileType('r', encoding='utf-8'))
|
||||
# parser.add_argument('-o', '--output_file', type=argparse.FileType('wb'))
|
||||
parser.add_argument('-o', '--output_file', type=argparse.FileType('wb'))
|
||||
parser.add_argument(
|
||||
'-t', '--token_file', type=argparse.FileType('w', encoding='utf-8'))
|
||||
parser.add_argument(
|
||||
'-x', '--syntax_file', type=argparse.FileType('w', encoding='utf-8'))
|
||||
parser.add_argument(
|
||||
'-n', '--annotated_file', type=argparse.FileType('w', encoding='utf-8'))
|
||||
parser.add_argument(
|
||||
'-a', '--assembly_file', type=argparse.FileType('w', encoding='utf-8'))
|
||||
parser.set_defaults(func=compile)
|
||||
|
||||
def main(argv: Sequence[str] | None = None):
|
||||
|
|
|
@ -1207,7 +1207,6 @@ class File:
|
|||
symbol_table.add(symbol)
|
||||
for child in syntax_tree.children:
|
||||
new_child: (
|
||||
syntactical_analyzer.Directive |
|
||||
syntactical_analyzer.StructBlock |
|
||||
FunctionBlock |
|
||||
syntactical_analyzer.EnumBlock
|
||||
|
@ -1217,11 +1216,13 @@ class File:
|
|||
symbol_table.get(
|
||||
child.identifier.content
|
||||
)._definition = new_child # type: ignore
|
||||
# TODO: analyze structs
|
||||
elif isinstance(child, syntactical_analyzer.StructBlock):
|
||||
new_child = child
|
||||
elif isinstance(child, syntactical_analyzer.EnumBlock):
|
||||
new_child = _sa_enum(child)
|
||||
# TODO: analyze structs
|
||||
else:
|
||||
new_child = child
|
||||
elif isinstance(child, syntactical_analyzer.Directive):
|
||||
continue
|
||||
children.append(new_child)
|
||||
file = File(children, syntax_tree._file_info, symbol_table)
|
||||
return file
|
||||
|
|
Loading…
Reference in New Issue