Parser Option "ParseAsCpp" problem when parsing as C
danyhm opened this issue · 2 comments
danyhm commented
Hello,
if the parser option ParseAsCpp is set to false, the compilation is always returned empty regardless of the input files or texts.
Is Parsing as C not supported?
waldnercharles commented
Not sure if this is a bug. It looks like CppParser just excludes passing the -xc++
option to clang if ParseAsCpp is false. I think you can work around it for now by passing -xc
or --language=c
into AdditionalArguments
.
var options = new CSharpConverterOptions();
options.AdditionalArguments.Add("--language=c");
xoofx commented
Correct, ParseAsCpp is doing this:
CppAst.NET/src/CppAst/CppParser.cs
Lines 97 to 100 in f2d7445
But you can pass other arguments to clang directly.