Herb C Reference
Loading...
Searching...
No Matches
analyze_conditional_open_tags.c File Reference
#include "include/analyze_conditional_open_tags.h"
#include "include/ast_nodes.h"
#include "include/element_source.h"
#include "include/errors.h"
#include "include/token_struct.h"
#include "include/util.h"
#include "include/util/hb_array.h"
#include "include/util/hb_string.h"
#include "include/visitor.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

Data Structures

struct  single_open_tag_result_T
 

Functions

static bool transform_conditional_open_tags_visitor (const AST_NODE_T *node, void *data)
 
static void transform_conditional_open_tags_in_array (hb_array_T *array, hb_array_T *document_errors)
 
static bool is_non_void_open_tag (AST_NODE_T *node)
 
static const char * get_open_tag_name (AST_HTML_OPEN_TAG_NODE_T *open_tag)
 
static single_open_tag_result_T get_single_open_tag_from_statements (hb_array_T *statements)
 
static const char * check_erb_if_conditional_open_tag (AST_ERB_IF_NODE_T *if_node)
 
static const char * check_erb_unless_conditional_open_tag (AST_ERB_UNLESS_NODE_T *unless_node)
 
static size_t find_matching_close_tag (hb_array_T *siblings, size_t start_index, const char *tag_name, AST_HTML_CLOSE_TAG_NODE_T **out_close_tag)
 
static token_Tget_first_branch_tag_name_token (AST_ERB_IF_NODE_T *if_node)
 
static token_Tget_first_branch_tag_name_token_unless (AST_ERB_UNLESS_NODE_T *unless_node)
 
static void add_multiple_tags_error_to_erb_node (AST_NODE_T *erb_node, AST_HTML_OPEN_TAG_NODE_T *second_tag)
 
static void check_and_report_multiple_tags_in_if (AST_ERB_IF_NODE_T *if_node)
 
static void check_and_report_multiple_tags_in_unless (AST_ERB_UNLESS_NODE_T *unless_node)
 
static void rewrite_conditional_open_tags (hb_array_T *nodes, hb_array_T *document_errors)
 
void herb_transform_conditional_open_tags (AST_DOCUMENT_NODE_T *document)
 

Function Documentation

◆ transform_conditional_open_tags_visitor()

static bool transform_conditional_open_tags_visitor ( const AST_NODE_T node,
void *  data 
)
static

◆ transform_conditional_open_tags_in_array()

static void transform_conditional_open_tags_in_array ( hb_array_T *  array,
hb_array_T *  document_errors 
)
static

◆ is_non_void_open_tag()

static bool is_non_void_open_tag ( AST_NODE_T node)
static

◆ get_open_tag_name()

static const char * get_open_tag_name ( AST_HTML_OPEN_TAG_NODE_T open_tag)
static

◆ get_single_open_tag_from_statements()

static single_open_tag_result_T get_single_open_tag_from_statements ( hb_array_T *  statements)
static

◆ check_erb_if_conditional_open_tag()

static const char * check_erb_if_conditional_open_tag ( AST_ERB_IF_NODE_T if_node)
static

◆ check_erb_unless_conditional_open_tag()

static const char * check_erb_unless_conditional_open_tag ( AST_ERB_UNLESS_NODE_T unless_node)
static

◆ find_matching_close_tag()

static size_t find_matching_close_tag ( hb_array_T *  siblings,
size_t  start_index,
const char *  tag_name,
AST_HTML_CLOSE_TAG_NODE_T **  out_close_tag 
)
static

◆ get_first_branch_tag_name_token()

static token_T * get_first_branch_tag_name_token ( AST_ERB_IF_NODE_T if_node)
static

◆ get_first_branch_tag_name_token_unless()

static token_T * get_first_branch_tag_name_token_unless ( AST_ERB_UNLESS_NODE_T unless_node)
static

◆ add_multiple_tags_error_to_erb_node()

static void add_multiple_tags_error_to_erb_node ( AST_NODE_T erb_node,
AST_HTML_OPEN_TAG_NODE_T second_tag 
)
static

◆ check_and_report_multiple_tags_in_if()

static void check_and_report_multiple_tags_in_if ( AST_ERB_IF_NODE_T if_node)
static

◆ check_and_report_multiple_tags_in_unless()

static void check_and_report_multiple_tags_in_unless ( AST_ERB_UNLESS_NODE_T unless_node)
static

◆ rewrite_conditional_open_tags()

static void rewrite_conditional_open_tags ( hb_array_T *  nodes,
hb_array_T *  document_errors 
)
static

◆ herb_transform_conditional_open_tags()

void herb_transform_conditional_open_tags ( AST_DOCUMENT_NODE_T document)