-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: Add TO_<CHAR,STRING>
functions
#1355
base: master
Are you sure you want to change the base?
Conversation
This commit introduces the `TO_CHAR`, `TO_WCHAR`, `TO_STRING` and `TO_WSTRING` functions, all making use of already existing `X_TO_Y` functions.
@@ -701,12 +702,10 @@ impl AnnotationMapImpl { | |||
|
|||
/// annotates the given statement (using it's `get_id()`) with the given type-name | |||
pub fn annotate(&mut self, s: &AstNode, annotation: StatementAnnotation) { | |||
log::trace!("Annotation: {annotation:?} @ {s:?}"); |
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.
fyi I've previously introduced these trace statements but in hindsight I have to admit they're not as useful as I imagined (i.e. they're waaaaay too bloaty). A better approach would be a more concise representation but that's something I'll address (or not, who knows) when I have the pleasure to debug resolver bugs again :^)
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.
soonTM
END_FUNCTION | ||
|
||
FUNCTION TO_CHAR__STRING : CHAR | ||
VAR_INPUT {ref} |
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.
The {ref}
here is no longer necessary, since aggregate-type arguments are now always passed as pointers. Not blocking, we should probably change these for all occurances in the `stdlib
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.
Lets address this in another PR since I also forgot to remove the code-gen python scripts.
|
||
// ----------------------------------------------------------------------------------------------------------- | ||
|
||
FUNCTION TO_WCHAR<T: ANY> : WCHAR |
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.
Would it make sense here to constrict the generic type nature to ANY_INT
?
This commit introduces the
TO_CHAR
,TO_WCHAR
,TO_STRING
andTO_WSTRING
functions, all making use of already existingX_TO_Y
functions.EDIT: There's some issue with printf() statements giving incorrect validation errors, which needs to be fixed before this can be merged.