Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

concatenation of string literals not supported #57

Open
noresistence opened this issue Mar 20, 2019 · 1 comment
Open

concatenation of string literals not supported #57

noresistence opened this issue Mar 20, 2019 · 1 comment

Comments

@noresistence
Copy link

Concatenation of adjacent string literals apparently is not supported, but legal c and quite helpful in some circumstances.

example.c

struct In {int in;};
struct Out {int out;};

void compute(struct In *input, struct Out *output) {
    printf("VAR: " "4");
}

compiler output

Compiling example.c
Exception in thread "main" java.lang.RuntimeException: Unexpected ""4""
        at ccomp.parser.CParser$208.syntaxError(CParser.java:1757)
        at beaver.Parser.parse(Parser.java:394)
        at beaver.Parser.parse(Parser.java:352)
        at ccomp.parser_hw.CCompiler.compileProgram(CCompiler.java:169)
        at zcc.ZCC.compile(ZCC.java:230)
        at zcc.ZCC.main(ZCC.java:127)
Makefile:113: recipe for target 'bin/example.params' failed
make: *** [bin/example.params] Error 1
@maxhowald
Copy link
Contributor

Thanks for reporting this. Unfortunately, strings and string literals are another thing that the Pepper compiler simply doesn't have much support for. Adding this isn't a priority for us right now, but we're always happy to accept pull requests! If you (or anyone else reading this) is interested, I'm happy to provide some code pointers on how to get started.

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

No branches or pull requests

2 participants