-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add namespaces #734
Add namespaces #734
Conversation
804890a
to
81dd057
Compare
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.
Personally I don't like the ::, but it seems to be more rust compatible, so ...
Should we add also feature like "use A::B::c" of rust ? (not necessary for this PR).
compiler/src/ppasm.ml
Outdated
@@ -33,6 +33,7 @@ let pp_gens (fmt : Format.formatter) xs = | |||
|
|||
(* -------------------------------------------------------------------- *) | |||
let string_of_label name (p : label) = | |||
let name = String.map (fun c -> if c = '.' || c = ':' then '_' else c) name in |
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.
It seems that we have twice the same function, maybe we should share them.
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.
Yes. There is already a comment about this in the code. Your contribution (as a separate PR) is welcome.
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.
I moved my addition to the PrintCommon
module but left the duplication of string_of_label
. I believe that the two asm-printers could be refactored to share their common functionality and make it easier to add new targets.
5216d67
to
20a4985
Compare
No description provided.