libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
Data Fields
ps_lexer_state Struct Reference

Represents lexer state for a single file. More...

#include <lexer.h>

Data Fields

STR code
 The source code of the file.
 
usize length
 The length of the file.
 
struct ps_loc loc
 The current location of the lexer.
 
struct ps_token_arrtokens
 The token array.
 
struct ps_string_arrdefines
 
bool in_comment
 Whether the lexer is currently in a comment.
 
usize par_nesting
 Nesting level of parentheses.
 
bool is_string_escaped
 Whether the next character in the string should be escaped.
 
bool interp_string
 Whether the lexer is currrently in an interpolated string.
 
usize interp_par_nesting
 The nesting of parentheses at the start of string interpolation.
 

Detailed Description

Represents lexer state for a single file.

Definition at line 26 of file lexer.h.

Field Documentation

◆ code

STR ps_lexer_state::code

The source code of the file.

Definition at line 27 of file lexer.h.

◆ defines

struct ps_string_arr* ps_lexer_state::defines

Definition at line 32 of file lexer.h.

◆ in_comment

bool ps_lexer_state::in_comment

Whether the lexer is currently in a comment.

Definition at line 34 of file lexer.h.

◆ interp_par_nesting

usize ps_lexer_state::interp_par_nesting

The nesting of parentheses at the start of string interpolation.

Definition at line 42 of file lexer.h.

◆ interp_string

bool ps_lexer_state::interp_string

Whether the lexer is currrently in an interpolated string.

Definition at line 40 of file lexer.h.

◆ is_string_escaped

bool ps_lexer_state::is_string_escaped

Whether the next character in the string should be escaped.

Definition at line 38 of file lexer.h.

◆ length

usize ps_lexer_state::length

The length of the file.

Definition at line 28 of file lexer.h.

◆ loc

struct ps_loc ps_lexer_state::loc

The current location of the lexer.

Definition at line 29 of file lexer.h.

◆ par_nesting

usize ps_lexer_state::par_nesting

Nesting level of parentheses.

Definition at line 35 of file lexer.h.

◆ tokens

struct ps_token_arr* ps_lexer_state::tokens

The token array.

Definition at line 30 of file lexer.h.


The documentation for this struct was generated from the following file: