Skip to content

concatenation of string literals not supported #57

@noresistence

Description

@noresistence

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions