mirror of
https://github.com/Relintai/sfw.git
synced 2025-02-06 15:05:54 +01:00
Handle ()-s in enums.
This commit is contained in:
parent
baa47dd6df
commit
ee7dc76dec
@ -95,10 +95,17 @@ List<String> process_classes_and_structs(const List<String> &list) {
|
||||
int current_parenthesis_scope_count = 0;
|
||||
bool in_method = false;
|
||||
bool method_signature_found = false;
|
||||
bool in_enum = false;
|
||||
int enum_scope_start = 0;
|
||||
String processed_line;
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
String l = lines[i];
|
||||
|
||||
if (l.contains("enum ")) {
|
||||
in_enum = true;
|
||||
enum_scope_start = current_scope_count;
|
||||
}
|
||||
|
||||
for (int j = 0; j < l.length(); ++j) {
|
||||
CharType current_char = l[j];
|
||||
|
||||
@ -107,6 +114,14 @@ List<String> process_classes_and_structs(const List<String> &list) {
|
||||
} else if (current_char == '}') {
|
||||
--current_scope_count;
|
||||
|
||||
if (in_enum) {
|
||||
if (enum_scope_start == current_scope_count) {
|
||||
in_enum = false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_method) {
|
||||
if (current_target_scope_count == current_scope_count) {
|
||||
//found method end
|
||||
@ -118,6 +133,10 @@ List<String> process_classes_and_structs(const List<String> &list) {
|
||||
}
|
||||
}
|
||||
|
||||
if (in_enum) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (method_signature_found) {
|
||||
if (current_char == '(') {
|
||||
++current_parenthesis_scope_count;
|
||||
|
Loading…
Reference in New Issue
Block a user