-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewriting constants #73
Conversation
…ing path typo in rust-lite
rust-lite/src/rust_lite/__main__.py
Outdated
@@ -60,7 +60,7 @@ def exec_run(options: RunOptions) -> None: | |||
print('Performed all possible rewriting operations; Trying to fetch the content of the K cell.') | |||
|
|||
module_manager.print_k_top_element() | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty space change, it may be worth removing.
tests/execution/constant-lookup.rs
Outdated
fn lookup_constant(&self) -> u64 { YEARLY_INTEREST } | ||
|
||
fn lookup_constant_with_type(&self) -> u64 { | ||
let x = YEARLY_INTEREST::u64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work if you try to compile it with rustc? Shouldn't this be let x = YEARLY_INTEREST;
?
tests/execution/constant-lookup.rs
Outdated
|
||
fn lookup_constant_with_type(&self) -> u64 { | ||
let x = YEARLY_INTEREST::u64; | ||
x } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line after x?
@@ -24,5 +24,10 @@ module RUST-CONSTANTS | |||
</constant> | |||
... | |||
</constants> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule should actually be in a new file, called rust-semantics/expression/constants.mx
. This file (and its module) should be required/imported in the same places as rust-semantics/expression/literals.md
, so that it will be used both for preprocessing and for execution.
… it for both preprocessing and execution
Introducing constant lookup at preprocessing time.