-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[Truffle] Antlr printf #3551
[Truffle] Antlr printf #3551
Conversation
# Conflicts: # truffle/src/main/java/org/jruby/truffle/format/parser/FormatParser.java # truffle/src/main/java/org/jruby/truffle/format/parser/FormatTokenizer.java
@@ -1947,11 +1947,11 @@ public Long block() throws InterruptedException { | |||
|
|||
@CoreMethod(names = { "format", "sprintf" }, isModuleFunction = true, rest = true, required = 1, taintFromParameter = 0) | |||
@ImportStatic(StringCachingGuards.class) | |||
public abstract static class FormatNode extends CoreMethodArrayArgumentsNode { | |||
public abstract static class XFormatNode extends CoreMethodArrayArgumentsNode { |
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.
Why the renaming?
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 would call it SprintfNode
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 renaming was a debugging thing. I'll use sprintf.
Looks good, there is still quite a bit of logic with switches in the TreeBuilder but it seems hard to avoid. |
public class PrintfTreeBuilder extends org.jruby.truffle.format.parser.PrintfParserBaseListener { | ||
|
||
// TODO CS 19-Dec-15 this is never used, but the functionality seems useful | ||
public static final int PADDING_FROM_ARGUMENT = -2; |
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.
Accidentally deleted a comment from Benoit here saying it's using in Time.httpdate
and that there should be a spec for it.
No description provided.