Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OQ3 has no imaginary type, only complex type (I don't know of any general purpose language that differs in this respect). But it is convenient to implement and use imaginary literals in order to handle expressions like
10 im
,10im
,12.3 im
,12.3im
, etc.We already have implemented all the machinery for timing literals. Lexing and maniuplating imaginary literal is structurally identical, so we can use the machinery for timing literals at (almost) no extra cost in coding or complexity. A disadvantage is that imaginary and timing literals don't belong in the same category. IDK, we could rename everything to `timing_or_imaginary.
An imaginary float literal can be stored and manipulated in exactly the same way, with the same semantics as a real float literal. The exception is the last step of specifying the type. For this reason we break with the precedent of all other variants of enums in asg.rs by reusing a the struct field for real literals. That is, we have:
The type (float or complex float) is stored at a higher level as it is for all expressions.
Closes #190