Struct lib_ruby_parser_bindings::Options[][src]

pub struct Options {
Show 44 fields pub ifndef_name: &'static str, pub pre_code: &'static str, pub post_code: &'static str, pub fn_attributes: &'static str, pub ptr_blob_name: &'static str, pub maybe_ptr_blob_name: &'static str, pub string_ptr_blob_name: &'static str, pub maybe_string_ptr_blob_name: &'static str, pub shared_byte_list_blob_name: &'static str, pub byte_blob_name: &'static str, pub token_blob_name: &'static str, pub node_blob_name: &'static str, pub diagnostic_blob_name: &'static str, pub comment_type_blob_name: &'static str, pub comment_blob_name: &'static str, pub magic_comment_kind_blob_name: &'static str, pub magic_comment_blob_name: &'static str, pub bytes_blob_name: &'static str, pub loc_blob_name: &'static str, pub maybe_loc_blob_name: &'static str, pub error_level_blob_name: &'static str, pub diagnostic_message_blob_name: &'static str, pub source_line_blob_name: &'static str, pub byte_list_blob_name: &'static str, pub token_list_blob_name: &'static str, pub node_list_blob_name: &'static str, pub diagnostic_list_blob_name: &'static str, pub comment_list_blob_name: &'static str, pub magic_comment_list_blob_name: &'static str, pub source_line_list_blob_name: &'static str, pub message_variant_blob_name_fn: fn(_: &Message) -> String, pub node_variant_blob_name_fn: fn(_: &Node) -> String, pub input_error_blob_name: &'static str, pub decoder_result_blob_name: &'static str, pub decoder_blob_name: &'static str, pub rewrite_action_blob_name: &'static str, pub lex_state_action_blob_name: &'static str, pub token_rewriter_result_blob_name: &'static str, pub token_rewriter_blob_name: &'static str, pub maybe_decoder_blob_name: &'static str, pub maybe_token_rewriter_blob_name: &'static str, pub parser_options_blob_name: &'static str, pub decoded_input_blob_name: &'static str, pub parser_result_blob_name: &'static str,
}
Expand description

A struct with codegen options

Fields

ifndef_name: &'static str

Identifier that is passed to wrapping #ifndef

Default: LIB_RUBY_PARSER_BINDINGS_H

pre_code: &'static str

Pre-code

You can put here things like #include or #ifdef __cplusplus \n extern "C" ...

Default: "// pre-code"

post_code: &'static str

Post-code

Can be used to close #ifdef __cplusplus

Default: "// post-code"

fn_attributes: &'static str

Attributes that are attached to every generated function

can be __attribute__((always_inline)) if you want to perform inlining

ptr_blob_name: &'static str

Name of what you want to be used as a blob of the Ptr<T> struct in lib-ruby-parser

maybe_ptr_blob_name: &'static str

Name of what you want to be used as a blob of the MaybePtr<T> struct in lib-ruby-parser

string_ptr_blob_name: &'static str

Name of what you want to be used as a blob of the &'static strPtr struct in lib-ruby-parser

maybe_string_ptr_blob_name: &'static str

Name of what you want to be used as a blob of the Maybe&'static strPtr struct in lib-ruby-parser

shared_byte_list_blob_name: &'static str

Name of what you want to be used as a blob of the SharedByteList struct in lib-ruby-parser

byte_blob_name: &'static str

Name of what you want to be used as a blob of the u8 struct in lib-ruby-parser

In most cases if you build low-level bindings it will be u8 (without converting it to/from blob)

token_blob_name: &'static str

Name of what you want to be used as a blob of the Token struct in lib-ruby-parser

node_blob_name: &'static str

Name of what you want to be used as a blob of the Node struct in lib-ruby-parser

diagnostic_blob_name: &'static str

Name of what you want to be used as a blob of the Diagnostic struct in lib-ruby-parser

comment_type_blob_name: &'static str

Name of what you want to be used as a blob of the CommentType struct in lib-ruby-parser

comment_blob_name: &'static str

Name of what you want to be used as a blob of the Comment struct in lib-ruby-parser

magic_comment_kind_blob_name: &'static str

Name of what you want to be used as a blob of the MagicCommentKind struct in lib-ruby-parser

magic_comment_blob_name: &'static str

Name of what you want to be used as a blob of the MagicComment struct in lib-ruby-parser

bytes_blob_name: &'static str

Name of what you want to be used as a blob of the Bytes struct in lib-ruby-parser

loc_blob_name: &'static str

Name of what you want to be used as a blob of the Loc struct in lib-ruby-parser

maybe_loc_blob_name: &'static str

Name of what you want to be used as a blob of the MaybeLoc struct in lib-ruby-parser

error_level_blob_name: &'static str

Name of what you want to be used as a blob of the ErrorLevel struct in lib-ruby-parser

diagnostic_message_blob_name: &'static str

Name of what you want to be used as a blob of the Diagnostic struct in lib-ruby-parser

source_line_blob_name: &'static str

Name of what you want to be used as a blob of the SourceLine struct in lib-ruby-parser

byte_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<Byte> struct in lib-ruby-parser

token_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<Token> struct in lib-ruby-parser

node_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<Node> struct in lib-ruby-parser

diagnostic_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<Diagnostic> struct in lib-ruby-parser

comment_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<Comment> struct in lib-ruby-parser

magic_comment_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<MagicComment> struct in lib-ruby-parser

source_line_list_blob_name: &'static str

Name of what you want to be used as a blob of the List<SourceLine> struct in lib-ruby-parser

message_variant_blob_name_fn: fn(_: &Message) -> String

Function that takes a Message from lib-ruby-parser-nodes and returns a name of what you want to be used as a blob of its representation in in lib-ruby-parser

For example, for UnexpectedToken message you may want to call your blob class/struct in C++ as UnexpectedToken_BLOB

Default: fn that returns <message.camelcase_name>_BLOB

node_variant_blob_name_fn: fn(_: &Node) -> String

Function that takes a Node from lib-ruby-parser-nodes and returns a name of what you want to be used as a blob of its representation in in lib-ruby-parser

For example, for Arg message you may want to call your blob class/struct in C++ as Arg_BLOB

Default: fn that returns <node.camelcase_name>_BLOB

input_error_blob_name: &'static str

Name of what you want to be used as a blob of the InputError struct in lib-ruby-parser

decoder_result_blob_name: &'static str

Name of what you want to be used as a blob of the DecoderResult struct in lib-ruby-parser

decoder_blob_name: &'static str

Name of what you want to be used as a blob of the Decoder struct in lib-ruby-parser

rewrite_action_blob_name: &'static str

Name of what you want to be used as a blob of the RewriteAction struct in lib-ruby-parser

lex_state_action_blob_name: &'static str

Name of what you want to be used as a blob of the LexStateAction struct in lib-ruby-parser

token_rewriter_result_blob_name: &'static str

Name of what you want to be used as a blob of the TokenRewriterResult struct in lib-ruby-parser

token_rewriter_blob_name: &'static str

Name of what you want to be used as a blob of the TokenRewriter struct in lib-ruby-parser

maybe_decoder_blob_name: &'static str

Name of what you want to be used as a blob of the MaybeDecoder struct in lib-ruby-parser

maybe_token_rewriter_blob_name: &'static str

Name of what you want to be used as a blob of the MaybeTokenRewriter struct in lib-ruby-parser

parser_options_blob_name: &'static str

Name of what you want to be used as a blob of the ParserOptions struct in lib-ruby-parser

decoded_input_blob_name: &'static str

Name of what you want to be used as a blob of the DecodedInput struct in lib-ruby-parser

parser_result_blob_name: &'static str

Name of what you want to be used as a blob of the ParserResult struct in lib-ruby-parser

Implementations

Applies self.message_variant_blob_name_fn on a given message

Utility function

Applies self.node_variant_blob_name on a given node

Utility function

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.