Skip to content

Commit

Permalink
DELETE unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Dec 28, 2024
1 parent add88af commit c6b5b9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 63 deletions.
16 changes: 5 additions & 11 deletions src/generator_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,17 @@ string_t *generator_code_layout_block_item(generator_t *generator,
lexer_t *lexer = lexer_create(path, content);
lexer_lex(lexer);

// lexer_save(lexer, "include-tokens.txt");

ast_t *ast = parser_parse(lexer);

if (ast->layout == NULL) {
error_generator(1, "Include file '%s' does not have a layout block",
path);
}
// else if (ast->layout->block->children->length == 0)
// {
// error_generator(1, "Include file '%s' layout block does not have
// any children", path);
// }
else if (ast->layout->block->children->length == 0)
{
error_generator(1, "Include file '%s' layout block does not have
any children", path);
}
else {
for (size_t i = 1; i <= repeat_value_sizet; i++) {
if (ast->layout->block->text_content != NULL) {
Expand Down Expand Up @@ -535,8 +533,6 @@ void generator_code_head(generator_t *generator, ast_layout_block_t *block,
return;
}

// size_t html_tags_length = 0;

if (block->attributes != NULL) {
hashmap_t *attributes = cast(hashmap_t *, block->attributes);
size_t attribute_capacity = attributes->capacity;
Expand All @@ -552,8 +548,6 @@ void generator_code_head(generator_t *generator, ast_layout_block_t *block,
attribute->isContent == true) {
} else {
generator_code_head_item(attribute, head);

// html_tags_length++;
}

entry = cast(hashmap_entry_t *, entry->next);
Expand Down
52 changes: 0 additions & 52 deletions src/generator_layout_style.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,58 +168,6 @@ string_t *generator_code_layout_styles(hashmap_layout_attribute_t *styles,
return code;
}

/**
*
* @function generator_code_layout_style_name
* @brief Convert AST layout attribute type to CSS attribute name
* @params {ast_layout_attribute_type_t} type - Layout Attribute Type
* @returns {char*} name - Name
*
*/
char *generator_code_layout_style_name(ast_layout_attribute_type_t type) {
DEBUG_ME;
switch (type) {
#undef ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE
#undef ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE_HIDE
#undef ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE_REPEAT

#define ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE(TYPE, NAME, NAME_LOWER, ENDUSER_NAME, \
GENERATED_NAME, FILTER, \
ALLOWED_VALUES, SUBTAGS) \
case TYPE: \
return GENERATED_NAME;

#define ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE_REPEAT( \
TYPE, NAME, NAME_LOWER, ENDUSER_NAME, GENERATED_NAME, FILTER, \
ALLOWED_VALUES, SUBTAGS)

#define ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE_HIDE(TYPE, NAME, NAME_LOWER, \
ENDUSER_NAME, GENERATED_NAME, \
FILTER, ALLOWED_VALUES, SUBTAGS) \
case TYPE: \
return GENERATED_NAME;

#include "generated-config/ast_layout_attribute_style_type.h"

#undef ADD_LAYOUT_ATTRIBUTE_TYPE
#undef ADD_LAYOUT_ATTRIBUTE_TYPE_REPEAT

#define ADD_LAYOUT_ATTRIBUTE_TYPE(TYPE, NAME, NAME_LOWER, ENDUSER_NAME, \
GENERATED_NAME, FILTER, ALLOWED_VALUES, \
SUBTAGS) \
case TYPE: \
return "ERROR";

#define ADD_LAYOUT_ATTRIBUTE_TYPE_REPEAT(TYPE, NAME, NAME_LOWER, ENDUSER_NAME, \
GENERATED_NAME, FILTER, \
ALLOWED_VALUES, SUBTAGS)

#include "generated-config/ast_layout_attribute_type.h"
}

return "error????";
}

/**
*
* @function generator_code_layout_attribute_style_state_enduser_name_to_type
Expand Down

0 comments on commit c6b5b9c

Please sign in to comment.