1#ifndef INTERNAL_PARSE_H
2#define INTERNAL_PARSE_H
12#include "rubyparser.h"
13#include "internal/static_assert.h"
15#ifdef UNIVERSAL_PARSER
16#define rb_encoding void
21#define STRTERM_HEREDOC IMEMO_FL_USER0
29} rb_strterm_literal_t;
38} rb_strterm_heredoc_t;
40#define HERETERM_LENGTH_MAX UINT_MAX
45 rb_strterm_literal_t literal;
46 rb_strterm_heredoc_t heredoc;
51void rb_ruby_parser_mark(
void *ptr);
52size_t rb_ruby_parser_memsize(
const void *ptr);
54void rb_ruby_parser_set_options(rb_parser_t *p,
int print,
int loop,
int chomp,
int split);
55rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p,
const struct rb_iseq_struct *base,
int main);
56void rb_ruby_parser_set_script_lines(rb_parser_t *p,
VALUE lines_array);
57void rb_ruby_parser_error_tolerant(rb_parser_t *p);
58rb_ast_t* rb_ruby_parser_compile_file_path(rb_parser_t *p,
VALUE fname,
VALUE file,
int start);
59void rb_ruby_parser_keep_tokens(rb_parser_t *p);
60rb_ast_t* rb_ruby_parser_compile_generic(rb_parser_t *p,
VALUE (*lex_gets)(
VALUE,
int),
VALUE fname,
VALUE input,
int start);
61rb_ast_t* rb_ruby_parser_compile_string_path(rb_parser_t *p,
VALUE f,
VALUE s,
int line);
63RUBY_SYMBOL_EXPORT_BEGIN
65VALUE rb_ruby_parser_encoding(rb_parser_t *p);
66int rb_ruby_parser_end_seen_p(rb_parser_t *p);
67int rb_ruby_parser_set_yydebug(rb_parser_t *p,
int flag);
71int rb_reg_named_capture_assign_iter_impl(
struct parser_params *p,
const char *s,
long len, rb_encoding *enc, NODE **succ_block,
const rb_code_location_t *loc);
74void ripper_parser_mark(
void *ptr);
75void ripper_parser_free(
void *ptr);
76size_t ripper_parser_memsize(
const void *ptr);
79int rb_ruby_parser_get_yydebug(rb_parser_t *p);
80void rb_ruby_parser_set_value(rb_parser_t *p,
VALUE value);
81int rb_ruby_parser_error_p(rb_parser_t *p);
82VALUE rb_ruby_parser_debug_output(rb_parser_t *p);
83void rb_ruby_parser_set_debug_output(rb_parser_t *p,
VALUE output);
84VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p);
85void rb_ruby_parser_set_parsing_thread(rb_parser_t *p,
VALUE parsing_thread);
86void rb_ruby_parser_ripper_initialize(rb_parser_t *p,
VALUE (*gets)(
struct parser_params*,
VALUE),
VALUE input,
VALUE sourcefile_string,
const char *sourcefile,
int sourceline);
87VALUE rb_ruby_parser_result(rb_parser_t *p);
88rb_encoding *rb_ruby_parser_enc(rb_parser_t *p);
89VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p);
90int rb_ruby_parser_ruby_sourceline(rb_parser_t *p);
91int rb_ruby_parser_lex_state(rb_parser_t *p);
92void rb_ruby_ripper_parse0(rb_parser_t *p);
93int rb_ruby_ripper_dedent_string(rb_parser_t *p,
VALUE string,
int width);
94VALUE rb_ruby_ripper_lex_get_str(rb_parser_t *p,
VALUE s);
95int rb_ruby_ripper_initialized_p(rb_parser_t *p);
96void rb_ruby_ripper_parser_initialize(rb_parser_t *p);
97long rb_ruby_ripper_column(rb_parser_t *p);
98long rb_ruby_ripper_token_len(rb_parser_t *p);
99VALUE rb_ruby_ripper_lex_lastline(rb_parser_t *p);
104#ifdef UNIVERSAL_PARSER
int len
Length of the buffer.
uintptr_t VALUE
Type that represents a Ruby object.