LLDB mainline
scanner.c File Reference
#include "tree_sitter/alloc.h"
#include "tree_sitter/parser.h"
#include <wctype.h>

Go to the source code of this file.

Classes

struct  Scanner
struct  BlockCommentProcessing

Enumerations

enum  TokenType {
  STRING_CONTENT , RAW_STRING_LITERAL_START , RAW_STRING_LITERAL_CONTENT , RAW_STRING_LITERAL_END ,
  FLOAT_LITERAL , BLOCK_OUTER_DOC_MARKER , BLOCK_INNER_DOC_MARKER , BLOCK_COMMENT_CONTENT ,
  LINE_DOC_CONTENT , ERROR_SENTINEL
}
enum  BlockCommentState { LeftForwardSlash , LeftAsterisk , Continuing }

Functions

void * tree_sitter_rust_external_scanner_create ()
void tree_sitter_rust_external_scanner_destroy (void *payload)
unsigned tree_sitter_rust_external_scanner_serialize (void *payload, char *buffer)
void tree_sitter_rust_external_scanner_deserialize (void *payload, const char *buffer, unsigned length)
static bool is_num_char (int32_t c)
static void advance (TSLexer *lexer)
static void skip (TSLexer *lexer)
static bool process_string (TSLexer *lexer)
static bool scan_raw_string_start (Scanner *scanner, TSLexer *lexer)
static bool scan_raw_string_content (Scanner *scanner, TSLexer *lexer)
static bool scan_raw_string_end (Scanner *scanner, TSLexer *lexer)
static bool process_float_literal (TSLexer *lexer)
static bool process_line_doc_content (TSLexer *lexer)
static void process_left_forward_slash (BlockCommentProcessing *processing, char current)
static void process_left_asterisk (BlockCommentProcessing *processing, char current, TSLexer *lexer)
static void process_continuing (BlockCommentProcessing *processing, char current)
static bool process_block_comment (TSLexer *lexer, const bool *valid_symbols)
bool tree_sitter_rust_external_scanner_scan (void *payload, TSLexer *lexer, const bool *valid_symbols)

Enumeration Type Documentation

◆ BlockCommentState

Enumerator
LeftForwardSlash 
LeftAsterisk 
Continuing 

Definition at line 203 of file Rust/tree-sitter-rust/scanner.c.

◆ TokenType

enum TokenType
Enumerator
STRING_CONTENT 
RAW_STRING_LITERAL_START 
RAW_STRING_LITERAL_CONTENT 
RAW_STRING_LITERAL_END 
FLOAT_LITERAL 
BLOCK_OUTER_DOC_MARKER 
BLOCK_INNER_DOC_MARKER 
BLOCK_COMMENT_CONTENT 
LINE_DOC_CONTENT 
ERROR_SENTINEL 

Definition at line 6 of file Rust/tree-sitter-rust/scanner.c.

Function Documentation

◆ advance()

◆ is_num_char()

bool is_num_char ( int32_t c)
inlinestatic

Definition at line 42 of file Rust/tree-sitter-rust/scanner.c.

Referenced by process_float_literal().

◆ process_block_comment()

◆ process_continuing()

void process_continuing ( BlockCommentProcessing * processing,
char current )
inlinestatic

◆ process_float_literal()

bool process_float_literal ( TSLexer * lexer)
inlinestatic

◆ process_left_asterisk()

void process_left_asterisk ( BlockCommentProcessing * processing,
char current,
TSLexer * lexer )
inlinestatic

◆ process_left_forward_slash()

void process_left_forward_slash ( BlockCommentProcessing * processing,
char current )
inlinestatic

◆ process_line_doc_content()

bool process_line_doc_content ( TSLexer * lexer)
inlinestatic

Definition at line 187 of file Rust/tree-sitter-rust/scanner.c.

References advance(), and LINE_DOC_CONTENT.

Referenced by tree_sitter_rust_external_scanner_scan().

◆ process_string()

bool process_string ( TSLexer * lexer)
inlinestatic

Definition at line 48 of file Rust/tree-sitter-rust/scanner.c.

References advance(), and STRING_CONTENT.

Referenced by tree_sitter_rust_external_scanner_scan().

◆ scan_raw_string_content()

bool scan_raw_string_content ( Scanner * scanner,
TSLexer * lexer )
inlinestatic

◆ scan_raw_string_end()

bool scan_raw_string_end ( Scanner * scanner,
TSLexer * lexer )
inlinestatic

◆ scan_raw_string_start()

bool scan_raw_string_start ( Scanner * scanner,
TSLexer * lexer )
inlinestatic

◆ skip()

◆ tree_sitter_rust_external_scanner_create()

void * tree_sitter_rust_external_scanner_create ( )

Definition at line 23 of file Rust/tree-sitter-rust/scanner.c.

◆ tree_sitter_rust_external_scanner_deserialize()

void tree_sitter_rust_external_scanner_deserialize ( void * payload,
const char * buffer,
unsigned length )

Definition at line 33 of file Rust/tree-sitter-rust/scanner.c.

References Scanner::opening_hash_count.

◆ tree_sitter_rust_external_scanner_destroy()

void tree_sitter_rust_external_scanner_destroy ( void * payload)

Definition at line 25 of file Rust/tree-sitter-rust/scanner.c.

◆ tree_sitter_rust_external_scanner_scan()

◆ tree_sitter_rust_external_scanner_serialize()

unsigned tree_sitter_rust_external_scanner_serialize ( void * payload,
char * buffer )

Definition at line 27 of file Rust/tree-sitter-rust/scanner.c.

References Scanner::opening_hash_count.