UnionCompilerDesign / compiler_core

The core of the compiler, runtime, and builder setup.
MIT License
1 stars 1 forks source link

Syntax Element - C99 Update #115

Closed tbreimer14 closed 3 weeks ago

tbreimer14 commented 1 month ago

This closes issue #98

tbreimer14 commented 1 month ago

I think renaming Literal(String) -> Constant(String) would make sense, I added constant because I figured it would (optionally) be a child of an initialization, but renaming it seems more simple.

I think not having comments makes sense. I added comment variants just to align with the Token variants, but I can't see a real reason to use them.

Removing mutable makes sense, oversight by me.

Maybe LoopInitializer is redundant? I don't see the need for a generic loop initializer when we have SyntaxElements for While, For, and DoWhile loops.

CalebLItalien commented 4 weeks ago

Looking at this issue now, I think we should keep our verbosity and table removing excess variants for a later date. Doesn't look like you removed anything (if you did, just roll back the commit). Let me know when everything is still in, and I'll merge this in.

tbreimer14 commented 3 weeks ago

Think the only things I removed were elif (since there isn't an elif token), match/match arm, and mutable, should should I bring those back?

CalebLItalien commented 3 weeks ago

Nope! I'll approve the PR then.

CalebLItalien commented 3 weeks ago

Oh one comment Thomas, I think you need to update the utility tests. There are some tests failing.

tbreimer14 commented 3 weeks ago

I see what I was doing wrong, I was running cargo test at the root of the project, and subsequently not actually testing anything 😂. Though there's a sym table test failing too:

---- test_variable_initialization_sym_table stdout ---- thread 'test_variable_initialization_sym_table' panicked at frontend/tests/sym_table_stack_tests.rs:143:13: assertionleft == rightfailed left: SymbolTableStack { size: 1, tables: ["{\"test_var\": SymbolInfo { data_type: Boolean, value: Node(ASTNode { element: AssignedValue, children: [ASTNode { element: Literal(\"true\"), children: [] }] }) }}"] } right: SymbolTableStack { size: 1, tables: ["{\"test_var\": SymbolInfo { data_type: Boolean, value: StrValue(\"true\") }}"] } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Is this known or did I break something?

CalebLItalien commented 3 weeks ago

No, there should be no tests that fail in frontend. Can you try and uncover the source of the issue? Maybe reach out to general and see if anyone knows anything about this as well.