vickenty / lang-c

Lightweight C parser for Rust
Apache License 2.0
202 stars 30 forks source link

Typedef of function pointer with qualified return type #23

Closed robbym closed 4 years ago

robbym commented 4 years ago

test.c:

typedef const char* (*fnPtr) ();

Output:

# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
typedef const char* (*fnPtr) ();

SyntaxError {
    source: "# 1 \"test.c\"\r\n# 1 \"<built-in>\"\r\n# 1 \"<command-line>\"\r\n# 1 \"test.c\"\r\ntypedef const char* (*fnPtr) ();\r\n",
    line: 5,
    column: 9,
    offset: 76,
    expected: {
        "<typedef_name>",
    },
}