Closed tbreimer14 closed 3 weeks 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.
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.
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?
Nope! I'll approve the PR then.
Oh one comment Thomas, I think you need to update the utility tests. There are some tests failing.
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: assertion
left == 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?
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.
This closes issue #98