Skip to content

string literals lost during tokenization for C/C++ code. #4

Description

@5c4lar

For the following code

import code_tokenize as ctok
sample = """
#include <stdio.h>
int main() {
    printf("hello world");
}
"""
ctok.tokenize(sample, lang = "cpp")

Output:

[#include, <stdio.h>, , int, main, (, ), {, printf, (, ", ", ), ;, }]

But parsing string literals works fine for Java and Python code. How should I fix this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions