Skip to content
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

Merged
merged 12 commits into from
Dec 20, 2015
Merged

[Truffle] Antlr printf #3551

merged 12 commits into from
Dec 20, 2015

Conversation

chrisseaton
Copy link
Contributor

No description provided.

@chrisseaton chrisseaton self-assigned this Dec 19, 2015
@chrisseaton chrisseaton added this to the truffe milestone Dec 19, 2015
# Conflicts:
#	truffle/src/main/java/org/jruby/truffle/format/parser/FormatParser.java
#	truffle/src/main/java/org/jruby/truffle/format/parser/FormatTokenizer.java
@chrisseaton chrisseaton modified the milestones: truffle-dev, truffe Dec 19, 2015
@@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the renaming?

Copy link
Member

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

Copy link
Contributor Author

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.

@eregon
Copy link
Member

eregon commented Dec 19, 2015

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;
Copy link
Contributor Author

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.

chrisseaton added a commit that referenced this pull request Dec 20, 2015
@chrisseaton chrisseaton merged commit 9016ea4 into master Dec 20, 2015
@chrisseaton chrisseaton deleted the truffle-antlr-printf branch December 22, 2015 12:11
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants