Fix parsing of cc
This commit is contained in:
parent
15ec7bd1f1
commit
f2606cd72f
|
@ -217,8 +217,19 @@ CallingConvention getCallingConvention(TSNode node, const char *source_code) {
|
|||
TSNode child = ts_node_child(node, i);
|
||||
const char *type = ts_node_type(child);
|
||||
|
||||
// Look for identifiers that might be calling conventions
|
||||
if (strcmp(type, "identifier") == 0) {
|
||||
// Handle Microsoft calling convention modifiers (tree-sitter specific)
|
||||
if (strcmp(type, "ms_call_modifier") == 0) {
|
||||
std::string text = extractNodeText(child, source_code);
|
||||
if (text == "__fastcall" || text == "__FASTCALL") {
|
||||
return CallingConvention::Fastcall;
|
||||
} else if (text == "__stdcall" || text == "__STDCALL") {
|
||||
return CallingConvention::Stdcall;
|
||||
} else if (text == "__cdecl" || text == "__CDECL") {
|
||||
return CallingConvention::Cdecl;
|
||||
}
|
||||
}
|
||||
// Look for identifiers that might be calling conventions (fallback)
|
||||
else if (strcmp(type, "identifier") == 0) {
|
||||
std::string text = extractNodeText(child, source_code);
|
||||
if (text == "__fastcall" || text == "__FASTCALL") {
|
||||
return CallingConvention::Fastcall;
|
||||
|
|
Loading…
Reference in New Issue