Herb C Reference
Loading...
Searching...
No Matches
prism_helpers.c File Reference
#include "include/prism_helpers.h"
#include "include/ast_nodes.h"
#include "include/errors.h"
#include "include/location.h"
#include "include/position.h"
#include "include/util.h"
#include "include/util/hb_buffer.h"
#include <prism.h>
#include <stdlib.h>
#include <string.h>

Data Structures

struct  then_keyword_search_context_T
 

Functions

const char * pm_error_level_to_string (pm_error_level_t level)
 
RUBY_PARSE_ERROR_Truby_parse_error_from_prism_error (const pm_diagnostic_t *error, const AST_NODE_T *node, const char *source, pm_parser_t *parser)
 
RUBY_PARSE_ERROR_Truby_parse_error_from_prism_error_with_positions (const pm_diagnostic_t *error, position_T start, position_T end)
 
static bool has_pm_location (pm_location_t location)
 
static bool search_then_keyword_location (const pm_node_t *node, void *data)
 
location_Tget_then_keyword_location (analyzed_ruby_T *analyzed, const char *source)
 
static location_Tparse_wrapped_and_find_then_keyword (hb_buffer_T *buffer, const char *source, size_t source_length, size_t prefix_length, size_t adjustment_threshold, size_t adjustment_amount)
 
location_Tget_then_keyword_location_wrapped (const char *source, bool is_in_clause)
 
location_Tget_then_keyword_location_elsif_wrapped (const char *source)
 

Function Documentation

◆ pm_error_level_to_string()

const char * pm_error_level_to_string ( pm_error_level_t  level)

◆ ruby_parse_error_from_prism_error()

RUBY_PARSE_ERROR_T * ruby_parse_error_from_prism_error ( const pm_diagnostic_t *  error,
const AST_NODE_T node,
const char *  source,
pm_parser_t *  parser 
)

◆ ruby_parse_error_from_prism_error_with_positions()

RUBY_PARSE_ERROR_T * ruby_parse_error_from_prism_error_with_positions ( const pm_diagnostic_t *  error,
position_T  start,
position_T  end 
)

◆ has_pm_location()

static bool has_pm_location ( pm_location_t  location)
static

◆ search_then_keyword_location()

static bool search_then_keyword_location ( const pm_node_t *  node,
void *  data 
)
static

◆ get_then_keyword_location()

location_T * get_then_keyword_location ( analyzed_ruby_T analyzed,
const char *  source 
)

◆ parse_wrapped_and_find_then_keyword()

static location_T * parse_wrapped_and_find_then_keyword ( hb_buffer_T *  buffer,
const char *  source,
size_t  source_length,
size_t  prefix_length,
size_t  adjustment_threshold,
size_t  adjustment_amount 
)
static

◆ get_then_keyword_location_wrapped()

location_T * get_then_keyword_location_wrapped ( const char *  source,
bool  is_in_clause 
)

◆ get_then_keyword_location_elsif_wrapped()

location_T * get_then_keyword_location_elsif_wrapped ( const char *  source)