Skip to content

Commit

Permalink
Fixed small issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aermoss committed Dec 9, 2023
1 parent e8b1b27 commit 089dfe3
Show file tree
Hide file tree
Showing 16 changed files with 1,456 additions and 1,443 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ int main() {
- rsxrmath
- rsxrglfw
- rsxrgl
- rsxr-rvr
- rsxr-rvr
15 changes: 14 additions & 1 deletion rsxr/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def compiler(ast, context: Context, builder = None):
ast = core.parser(core.lexer(tools.read_file(file_path), file_path), file_path)

with open(os.path.splitext(file_path)[0] + ".rsxrc", "wb") as file:
file.write(tools.dump_bytecode(ast, [], file_content))
file.write(tools.dump_bytecode(ast, file_content, context.version))

context.prepare_to_include(file_path)
tmp_parent_scopes = context.parent_scopes
Expand Down Expand Up @@ -658,6 +658,19 @@ def compiler(ast, context: Context, builder = None):
if len(ast) == 1: return res
continue

if i["value"]["value"] == "addrof":
if len(i["args"]) != 1:
tools.error("invalid argument count", context.file)

if i["args"][0]["type"] != "IDENTIFIER":
tools.error("invalid argument type", context.file)

value = context.get(i["args"][0]["value"])["ptr"]

if not value.type.is_pointer: continue
if len(ast) == 1: return value
continue

func = context.get(compiler([i["value"]], context, builder))
args = []

Expand Down
Binary file added rsxr/include/rsxrgl/constants.rsxrc
Binary file not shown.
Loading

0 comments on commit 089dfe3

Please sign in to comment.