Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/maciejhirsz/logos
/ functions
Functions
367 in github.com/maciejhirsz/logos
⨍
Functions
367
◇
Types & classes
171
↓ 79 callers
Function
assert_lex
( source: &'a Token::Source, tokens: &[( Result<Token, Token::Error>, <Token::Source a
tests/src/lib.rs:8
↓ 71 callers
Method
err
(&mut self, message: M, span: Span)
logos-codegen/src/parser/mod.rs:421
↓ 47 callers
Method
span
(&self)
logos-codegen/src/parser/error_type.rs:67
↓ 23 callers
Method
len
(&self)
src/source.rs:101
↓ 21 callers
Method
next
(&mut self)
src/lexer.rs:223
↓ 21 callers
Method
span
(&self)
src/lexer.rs:134
↓ 19 callers
Method
clone
(&self)
src/lexer.rs:208
↓ 15 callers
Method
next
(&mut self)
tests/tests/lexer_modes.rs:79
↓ 15 callers
Method
span
(&self)
logos-codegen/src/leaf.rs:34
↓ 14 callers
Method
err
(&mut self, message: M, span: Span)
logos-codegen/src/error.rs:12
↓ 13 callers
Method
end
(&mut self, offset: usize)
src/lexer.rs:316
↓ 13 callers
Method
iter_states
Iterate over all of the states of the graph
logos-codegen/src/graph/mod.rs:362
↓ 12 callers
Method
span
(&self)
logos-codegen/src/parser/definition.rs:155
↓ 10 callers
Method
replace
(&mut self, stream: TokenStream)
logos-codegen/src/util.rs:15
↓ 9 callers
Method
get_state
Get a reference to the [StateData] corresponding to a state
logos-codegen/src/graph/mod.rs:367
↓ 9 callers
Method
next
(&mut self)
logos-codegen/src/parser/nested.rs:125
↓ 8 callers
Method
len
(&self)
tests/tests/source.rs:17
↓ 8 callers
Method
morph
Turn this lexer into a lexer for a new token type. The new lexer continues to point at the same span as the current lexer, and the current token beco
src/lexer.rs:174
↓ 7 callers
Method
clone
(&self)
tests/tests/clone.rs:15
↓ 7 callers
Method
collect_tail
(&mut self, first: T)
logos-codegen/src/parser/nested.rs:66
↓ 7 callers
Method
parse
(input: syn::parse::ParseStream)
logos-codegen/src/parser/definition.rs:164
↓ 7 callers
Method
slice
(&self, range: Range<usize>)
tests/tests/source.rs:38
↓ 6 callers
Method
deref
(&self)
src/lexer.rs:267
↓ 6 callers
Method
find
(&self, path: &Path)
logos-codegen/src/parser/type_params.rs:61
↓ 6 callers
Method
leaves
Get a reference to the leaves used to generate this graph
logos-codegen/src/graph/mod.rs:372
↓ 6 callers
Function
traverse_type
(ty: &mut Type, f: &mut impl FnMut(&mut Type))
logos-codegen/src/parser/type_params.rs:141
↓ 5 callers
Method
priority
(self, priority: usize)
logos-codegen/src/leaf.rs:83
↓ 5 callers
Method
remainder
(&self)
src/lexer.rs:158
↓ 5 callers
Method
slice
(&self)
src/lexer.rs:140
↓ 5 callers
Method
take
(&mut self)
logos-codegen/src/util.rs:19
↓ 5 callers
Function
test_variable_definition
ANCHOR: main */
examples/string-interpolation.rs:109
↓ 5 callers
Method
to_ident
(&self)
logos-codegen/src/util.rs:61
↓ 5 callers
Method
token
(&self)
logos-codegen/src/parser/definition.rs:53
↓ 5 callers
Method
unicode
(&self)
logos-codegen/src/parser/definition.rs:60
↓ 4 callers
Method
bump
Bumps the end of currently lexed token by `n` bytes. # Panics Panics if adding `n` to current offset would place the `Lexer` beyond the last byte, o
src/lexer.rs:193
↓ 4 callers
Method
escape
Escape this literal into a regex_syntax compatible pattern string. - `literal`: if true, escape any metacharacters the pattern so that it matches lite
logos-codegen/src/parser/definition.rs:27
↓ 4 callers
Function
expect_punct
If supplied `tt` is a punct matching a char, returns `None`, else returns `tt`
logos-codegen/src/util.rs:52
↓ 4 callers
Function
export_graphs
(patterns: Vec<&str>)
logos-codegen/src/graph/export.rs:289
↓ 4 callers
Function
gen_to_file
(format: bool)
logos-cli/tests/tests.rs:9
↓ 4 callers
Method
get_ident
(&self, state: State)
logos-codegen/src/generator/mod.rs:150
↓ 4 callers
Method
hir
Get a reference to a pattern's Hir
logos-codegen/src/pattern.rs:127
↓ 4 callers
Method
parse_callback
(&mut self, tokens: TokenStream)
logos-codegen/src/parser/mod.rs:352
↓ 4 callers
Method
set
(&mut self, param: Ident, ty: TokenStream, errors: &mut Errors)
logos-codegen/src/parser/type_params.rs:29
↓ 3 callers
Method
add
(&mut self, param: Ident)
logos-codegen/src/parser/type_params.rs:25
↓ 3 callers
Method
callback
(self, callback: Option<Callback>)
logos-codegen/src/leaf.rs:79
↓ 3 callers
Function
generate
Generate a `Logos` implementation for the given struct, provided as a stream of rust tokens.
logos-codegen/src/lib.rs:52
↓ 3 callers
Function
is_punct
(tt: &TokenTree, expect: char)
logos-codegen/src/util.rs:47
↓ 3 callers
Method
next_tt
(&mut self)
logos-codegen/src/parser/nested.rs:62
↓ 3 callers
Method
root
Get the root (initial) state of the graph
logos-codegen/src/graph/mod.rs:357
↓ 3 callers
Method
slice
(&self, range: Range<usize>)
src/source.rs:123
↓ 3 callers
Method
state_transition
Generates the code to transition to a state.
logos-codegen/src/generator/mod.rs:231
↓ 3 callers
Method
state_value
Generates the code to quote a state's representation
logos-codegen/src/generator/mod.rs:244
↓ 3 callers
Function
strip_attrs_from_vec
(attrs: &mut Vec<syn::Attribute>)
logos-codegen/src/lib.rs:475
↓ 3 callers
Method
subst_subpatterns
Given a new regex string, substitute existing subpatterns into the string. i.e. turn (?&my_subpattern) into the actual regex for "my_subpattern" Retur
logos-codegen/src/parser/subpattern.rs:112
↓ 3 callers
Method
to_table
(&self)
logos-codegen/src/graph/mod.rs:218
↓ 2 callers
Method
add_byte
Add the `byte` to the set of bytes that are included in this class
logos-codegen/src/graph/mod.rs:208
↓ 2 callers
Method
add_test_to_lut
Return the identifier and bit mask used to reference a LUT containing a bit mask. The bit mask is generated to match the given edge.
logos-codegen/src/generator/mod.rs:322
↓ 2 callers
Function
byte_to_tokens
Converts a byte to a byte literal that can be used to match it
logos-codegen/src/generator/mod.rs:371
↓ 2 callers
Method
early_or_accept
Collapse the `early` and `accept` fields into a single field, if either is set. (Priority is given to `early`.)
logos-codegen/src/graph/mod.rs:57
↓ 2 callers
Method
fork_eoi
Generate code for encountering the end of input. If we are not in the middle of a token, return None (the iterator is ended) If the state has an EOI n
logos-codegen/src/generator/fork.rs:31
↓ 2 callers
Function
get_string_content
ANCHOR: variable_definition */
examples/string-interpolation.rs:48
↓ 2 callers
Function
greedy_dotall_check
(definition: &Definition, pattern: &Pattern, parser: &mut Parser)
logos-codegen/src/lib.rs:421
↓ 2 callers
Method
iter_children
An iterator over all [State] objects directly reachable from this state
logos-codegen/src/graph/mod.rs:110
↓ 2 callers
Method
named_attr
(&mut self, name: Ident, value: NestedValue, parser: &mut Parser)
logos-codegen/src/parser/error_type.rs:28
↓ 2 callers
Method
parse_attr
(&mut self, attr: &mut Attribute)
logos-codegen/src/parser/mod.rs:58
↓ 2 callers
Method
parse_definition
(&mut self, mut nested: AttributeParser)
logos-codegen/src/parser/mod.rs:313
↓ 2 callers
Method
parse_definition_attr
Parse attribute definition of a token: + `#[token(literal[, callback])]` + `#[regex(literal[, callback])]`
logos-codegen/src/parser/mod.rs:307
↓ 2 callers
Method
parse_literal
(&mut self, lit: Lit)
logos-codegen/src/parser/mod.rs:291
↓ 2 callers
Function
parse_object
ANCHOR: object */ Parse a token stream into an object and return when a valid terminator is found. > NOTE: we assume '{' was consumed.
examples/json_borrowed.rs:164
↓ 2 callers
Function
parse_object
ANCHOR: object */ Parse a token stream into an object and return when a valid terminator is found. > NOTE: we assume '{' was consumed.
examples/json.rs:168
↓ 2 callers
Function
parse_value
ANCHOR: value */ Parse a token stream into a JSON value.
examples/json_borrowed.rs:85
↓ 2 callers
Function
parse_value
ANCHOR: value */ Parse a token stream into a JSON value.
examples/json.rs:89
↓ 2 callers
Method
render
(self)
logos-codegen/src/error.rs:24
↓ 2 callers
Method
retain_states
Retains only the states in `states` if `keep` is true, otherwise removes them.
logos-codegen/src/graph/mod.rs:651
↓ 2 callers
Method
rewrite_states
Rewrites all edges in the graph. Any edge that went to a key state in `rewrites` is changed to point to the corresponding value state in `rewrites`.
logos-codegen/src/graph/mod.rs:671
↓ 2 callers
Method
set_normal_edges
Using this function to initialize the edges from a hashmap will sort the resulting vec by state number for generated code stability
logos-codegen/src/graph/mod.rs:127
↓ 2 callers
Method
slice_unchecked
(&self, range: Range<usize>)
src/source.rs:129
↓ 2 callers
Method
spanned
(self)
src/lexer.rs:121
↓ 2 callers
Method
state_action
Generates the code to transition to a state stored in an identifier
logos-codegen/src/generator/mod.rs:236
↓ 2 callers
Method
to_token_stream
(&self)
logos-codegen/src/util.rs:32
↓ 2 callers
Function
traverse_path
(path: &mut Path, f: &mut impl FnMut(&mut Type))
logos-codegen/src/parser/type_params.rs:172
↓ 2 callers
Method
variant_kind
(self, kind: VariantKind)
logos-codegen/src/leaf.rs:75
↓ 1 callers
Method
add_back_edge
Add a backreference to the given state, which specifies that `self` is reachable from `state`.
logos-codegen/src/graph/mod.rs:119
↓ 1 callers
Method
can_error
Determine if there is a byte that doesn't have a next state (is an error) for this state.
logos-codegen/src/graph/mod.rs:133
↓ 1 callers
Method
check_for_greedy_all
Return true if this pattern contains a non-greedy `.+` or `.*`
logos-codegen/src/pattern.rs:103
↓ 1 callers
Function
codegen
(input: String)
logos-cli/src/main.rs:65
↓ 1 callers
Function
count_ok
(s: &str)
tests/benches/bench.rs:131
↓ 1 callers
Method
count_ops
(&self)
logos-codegen/src/graph/mod.rs:314
↓ 1 callers
Function
eq_ignore_newlines
(lhs: &str, rhs: &str)
logos-cli/src/main.rs:96
↓ 1 callers
Method
errors
Iterate over all the disambiguation errors encountered while generating this graph
logos-codegen/src/graph/mod.rs:382
↓ 1 callers
Function
execute
Execute Brainfuck code from a string slice.
examples/brainfuck.rs:90
↓ 1 callers
Method
explicit_lifetime
(&mut self, lt: LifetimeParam, errors: &mut Errors)
logos-codegen/src/parser/type_params.rs:15
↓ 1 callers
Function
fast_loop_macro
This macro is included with the generated code. It is used to manually unroll the fast_loop loop.
logos-codegen/src/generator/fast_loop.rs:53
↓ 1 callers
Method
find_boundary
(&self, mut index: usize)
src/source.rs:141
↓ 1 callers
Function
find_close_bracket
Find the next occurence of ]=] in the string, where level specifies the number of `=` in the needle
tests/tests/old_logos_bugs.rs:245
↓ 1 callers
Method
generate
Generates the implementation (body) of the [Logos::lex] function
logos-codegen/src/generator/mod.rs:84
↓ 1 callers
Method
generate_callback
This function generates the code responsible for calling user callbacks and returning an enum variant to the caller of [Logos::lex]. Its return value
logos-codegen/src/generator/leaf.rs:12
↓ 1 callers
Function
generate_graphs
(path_str: &str, name: &str, graph: &Graph)
logos-codegen/src/lib.rs:485
↓ 1 callers
Method
generate_state
Generates the body of a state. This is a match statement over the next byte, which determines the next state. It also instantiates the relevant leaf,
logos-codegen/src/generator/mod.rs:260
↓ 1 callers
Method
generics
(&mut self)
logos-codegen/src/parser/mod.rs:54
next →
1–100 of 367, ranked by callers