summaryrefslogtreecommitdiff
path: root/fluid/io/Code_Writer.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 23:48:25 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 23:48:25 +0500
commitc53067d2f6cfd6e3c6b476c51ab8c4b931e40a30 (patch)
tree95bfab59b2d9a38a57b6aa05244cab2d0435c7d2 /fluid/io/Code_Writer.cxx
parent57860e277f2298ad6c0830b1492087cfa124c862 (diff)
wip
Diffstat (limited to 'fluid/io/Code_Writer.cxx')
-rw-r--r--fluid/io/Code_Writer.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx
index 7f265bafa..916d024bd 100644
--- a/fluid/io/Code_Writer.cxx
+++ b/fluid/io/Code_Writer.cxx
@@ -457,12 +457,12 @@ void Code_Writer::write_c_indented(const char *textlines, int inIndent, char inT
members of the class itself.
*/
bool is_class_member(Node *t) {
- return t->is_a(Type::Function)
- || t->is_a(Type::Decl)
- || t->is_a(Type::Data);
-// || t->is_a(Type::Class) // FLUID can't handle a class inside a class
-// || t->is_a(Type::Widget_Class)
-// || t->is_a(Type::DeclBlock) // Declaration blocks are generally not handled well
+ return t->is_a(FLD_NODE_TYPE_Function)
+ || t->is_a(FLD_NODE_TYPE_Decl)
+ || t->is_a(FLD_NODE_TYPE_Data);
+// || t->is_a(FLD_NODE_TYPE_Class) // FLUID can't handle a class inside a class
+// || t->is_a(FLD_NODE_TYPE_Widget_Class)
+// || t->is_a(FLD_NODE_TYPE_DeclBlock) // Declaration blocks are generally not handled well
}
/**
@@ -476,8 +476,8 @@ bool is_class_member(Node *t) {
\see is_class_member(Node *t)
*/
bool is_comment_before_class_member(Node *q) {
- if (q->is_a(Type::Comment) && q->next && q->next->level==q->level) {
- if (q->next->is_a(Type::Comment))
+ if (q->is_a(FLD_NODE_TYPE_Comment) && q->next && q->next->level==q->level) {
+ if (q->next->is_a(FLD_NODE_TYPE_Comment))
return is_comment_before_class_member(q->next);
if (is_class_member(q->next))
return true;
@@ -515,7 +515,7 @@ Node* Code_Writer::write_static(Node* p) {
Node* Code_Writer::write_code(Node* p) {
// write all code that comes before the children code
// (but don't write the last comment until the very end)
- if (!(p==Fluid.proj.tree.last && p->is_a(Type::Comment))) {
+ if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comment))) {
if (write_codeview) p->code1_start = (int)ftell(code_file);
if (write_codeview) p->header1_start = (int)ftell(header_file);
p->write_code1(*this);
@@ -611,7 +611,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
// if the first entry in the Type tree is a comment, then it is probably
// a copyright notice. We print that before anything else in the file!
Node* first_node = Fluid.proj.tree.first;
- if (first_node && first_node->is_a(Type::Comment)) {
+ if (first_node && first_node->is_a(FLD_NODE_TYPE_Comment)) {
if (write_codeview) {
first_node->code1_start = first_node->code2_start = (int)ftell(code_file);
first_node->header1_start = first_node->header2_start = (int)ftell(header_file);
@@ -689,14 +689,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
}
}
std::string loc_include, loc_conditional;
- if (proj_.i18n.type==fld::I18n_Type::GNU) {
+ if (proj_.i18n.type==FLD_I18N_TYPE_GNU) {
loc_include = proj_.i18n.gnu_include;
loc_conditional = proj_.i18n.gnu_conditional;
} else {
loc_include = proj_.i18n.posix_include;
loc_conditional = proj_.i18n.posix_conditional;
}
- if ((proj_.i18n.type != fld::I18n_Type::NONE) && !loc_include.empty()) {
+ if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && !loc_include.empty()) {
int conditional = !loc_conditional.empty();
if (conditional) {
write_c("#ifdef %s\n", loc_conditional.c_str());
@@ -706,7 +706,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
write_c("#%sinclude \"%s\"\n", indent(), loc_include.c_str());
else
write_c("#%sinclude %s\n", indent(), loc_include.c_str());
- if (proj_.i18n.type == fld::I18n_Type::POSIX) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) {
if (!proj_.i18n.posix_file.empty()) {
write_c("extern nl_catd %s;\n", proj_.i18n.posix_file.c_str());
} else {
@@ -718,14 +718,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
}
if (conditional) {
write_c("#else\n");
- if (proj_.i18n.type == fld::I18n_Type::GNU) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_GNU) {
if (!proj_.i18n.gnu_function.empty()) {
write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function.c_str());
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function.c_str());
write_c("#%sendif\n", indent());
}
}
- if (proj_.i18n.type == fld::I18n_Type::POSIX) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) {
write_c("#%sifndef catgets\n", indent());
write_c("#%sdefine catgets(catalog, set, msgid, text) text\n", indent_plus(1));
write_c("#%sendif\n", indent());
@@ -733,7 +733,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
indentation--;
write_c("#endif\n");
}
- if (proj_.i18n.type == fld::I18n_Type::GNU && proj_.i18n.gnu_static_function[0]) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function[0]) {
write_c("#ifndef %s\n", proj_.i18n.gnu_static_function.c_str());
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function.c_str());
write_c("#endif\n");
@@ -751,7 +751,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
fprintf(header_file, "#endif\n");
Node* last_node = Fluid.proj.tree.last;
- if (last_node && (last_node != Fluid.proj.tree.first) && last_node->is_a(Type::Comment)) {
+ if (last_node && (last_node != Fluid.proj.tree.first) && last_node->is_a(FLD_NODE_TYPE_Comment)) {
if (write_codeview) {
last_node->code1_start = last_node->code2_start = (int)ftell(code_file);
last_node->header1_start = last_node->header2_start = (int)ftell(header_file);