Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/a-h/lexical
/ functions
Functions
139 in github.com/a-h/lexical
⨍
Functions
139
◇
Types & classes
15
↓ 45 callers
Function
NewFromString
NewFromString creates a new parser input from an input string.
input/stream.go:124
↓ 19 callers
Function
Rune
Rune captures a single, specified rune.
parse/rune.go:4
↓ 17 callers
Method
Advance
Advance advances the input by a single rune and consumes it.
parse/function.go:12
↓ 14 callers
Method
Index
Index returns the current index of the parser input.
parse/function.go:20
↓ 13 callers
Function
Failure
Failure creates an unsuccessful result of a parse operation.
parse/function.go:46
↓ 11 callers
Function
Success
Success creates a successful result of a parse operation.
parse/function.go:36
↓ 10 callers
Function
NewPosition
NewPosition creates a Position to represent the character position within a text file.
input/position.go:17
↓ 8 callers
Method
Peek
Peek returns the next rune from the input without consuming it.
parse/function.go:16
↓ 7 callers
Method
Advance
Advance advances the position by a line if the rune is'\n', does nothing if the rune is '\r' and advances by a col character if the rune is anything e
input/position.go:40
↓ 7 callers
Function
Many
Many captures the function at least x times and at most y times and sets the result item to an array of the function captures.
parse/many.go:10
↓ 7 callers
Function
String
String captures a specific string.
parse/string.go:6
↓ 6 callers
Function
All
All ensures that all of the parsers are captured, or winds the whole set of captures back.
parse/all.go:8
↓ 6 callers
Function
StringUntil
TODO: Create a generic Until function. StringUntil captures runes until the delimiter is encountered and returns a string.
parse/until.go:6
↓ 6 callers
Function
rewind
(pi Input, times int)
parse/string.go:51
↓ 5 callers
Function
Any
Any returns the first match out of the parse functions passed in, or a failure if no parsers match.
parse/any.go:7
↓ 5 callers
Function
AnyRune
AnyRune returns a parser which will parse any rune at all.
parse/anyrune.go:4
↓ 5 callers
Method
Eq
Eq compares two positions and returns true if they are equal.
input/position.go:34
↓ 5 callers
Method
Retreat
Retreat retreats the input position by a single rune and unconsumes it.
parse/function.go:14
↓ 5 callers
Method
Retreat
Retreat decreases the position by a line if the rune is'\n', does nothing if the rune is '\r' and decreases by a col character if the rune is anything
input/position.go:58
↓ 5 callers
Function
RuneIn
RuneIn captures a rune if it's within the input set.
parse/runewhere.go:16
↓ 5 callers
Function
many
(pi Input, combiner MultipleResultCombiner, atLeast, atMost int, f Function)
parse/many.go:44
↓ 4 callers
Method
String
()
input/stream.go:92
↓ 4 callers
Function
Then
Then executes one function, then another, comining the results using the provided function.
parse/then.go:8
↓ 4 callers
Function
WithStringConcatCombiner
WithStringConcatCombiner is a MultipleResultCombiner which concatenates the results together as a string.
parse/multipleresultcombiner.go:12
↓ 4 callers
Function
expectRune
(s *Stream, test func() (rune, error), expected rune, t *testing.T, name string)
input/stream_test.go:88
↓ 4 callers
Function
runeWhere
(pi Input, name string, predicate func(r rune) bool)
parse/runewhere.go:31
↓ 3 callers
Method
Collect
Collect collects all of the string data parsed so far and returns it, then starts a new collection from the current position in the input.
parse/function.go:10
↓ 3 callers
Function
New
New creates a new Scanner.
scanner/scanner.go:30
↓ 3 callers
Method
Next
Next should be called repeatedly to request the next token from the stream. If
scanner/scanner.go:18
↓ 3 callers
Function
Or
Or returns the first or a or b. It's equivalent to the Any function with two parameters.
parse/any.go:14
↓ 3 callers
Method
Position
Position returns the line and column number of the current position within the stream.
parse/function.go:18
↓ 3 callers
Method
ReadRune
ReadRune reads a rune from the underlying string.
input/stream.go:114
↓ 3 callers
Function
RuneInRanges
RuneInRanges returns a parser which accepts a rune within the specified Unicode range.
parse/runewhere.go:41
↓ 3 callers
Method
String
String creates a string representation of the position.
input/position.go:29
↓ 3 callers
Function
fromBuffer
(startOfBufferIndex int64, currentIndex int64, buffer *Buffer)
input/stream.go:141
↓ 2 callers
Method
Advance
Advance reads a rune from the Input and sets the current position.
input/stream.go:154
↓ 2 callers
Method
Append
(runes ...rune)
input/stream.go:27
↓ 2 callers
Function
AtLeast
AtLeast captures the passed function at least the number of times provided.
parse/many.go:24
↓ 2 callers
Function
AtMost
AtMost captures the passed function between one and the number of times provided.
parse/many.go:31
↓ 2 callers
Method
Len
()
input/stream.go:68
↓ 2 callers
Function
New
New creates a new parser input from a buffered reader.
input/stream.go:98
↓ 2 callers
Function
NewBuffer
(size int)
input/stream.go:15
↓ 2 callers
Method
Retreat
Retreat steps back a rune.
input/stream.go:210
↓ 2 callers
Function
RuneWhere
RuneWhere captures a rune which matches a predicate.
parse/runewhere.go:9
↓ 2 callers
Method
String
String returns the string representation of a result, truncated to 10 characters.
parse/function.go:68
↓ 2 callers
Function
WithIntegerCombiner
WithIntegerCombiner is a MultipleResultCombiner which concatenates the results together as a string then parses the result as an integer.
parse/multipleresultcombiner.go:29
↓ 2 callers
Function
comparePosition
(expected, actual Position, t *testing.T)
input/position_test.go:70
↓ 2 callers
Function
expect
(actual, expected rune, t *testing.T)
input/stream_test.go:32
↓ 1 callers
Method
At
(i int)
input/stream.go:64
↓ 1 callers
Method
Collect
()
input/stream.go:43
↓ 1 callers
Method
CollectSlice
(max int)
input/stream.go:49
↓ 1 callers
Method
Eq
Eq compares two results for equality.
parse/function.go:55
↓ 1 callers
Function
NewBufferFromString
(s string, size int)
input/stream.go:21
↓ 1 callers
Function
Optional
Optional provides an optional parser.
parse/many.go:38
↓ 1 callers
Method
PeekN
PeekN reads a number of runes from the Input, then sets the current position back.
input/stream.go:185
↓ 1 callers
Function
StringInsensitive
StringInsensitive tests whether the string is present, but ignoring string casing.
parse/string.go:29
↓ 1 callers
Function
Times
Times captures the parser function a set number of times.
parse/many.go:17
↓ 1 callers
Function
all
(pi Input, combiner MultipleResultCombiner, functions ...Function)
parse/all.go:14
↓ 1 callers
Function
any
(pi Input, functions ...Function)
parse/any.go:18
↓ 1 callers
Function
countHouses
(filename string)
examples/xml/main.go:58
↓ 1 callers
Function
handle
(err error)
examples/xml/main.go:52
↓ 1 callers
Function
parseRune
(pi Input, r rune)
parse/rune.go:10
↓ 1 callers
Function
parseString
(pi Input, s string)
parse/string.go:12
↓ 1 callers
Function
parseStringInsensitive
(pi Input, s string)
parse/string.go:35
↓ 1 callers
Function
stringUntil
(pi Input, delimiter Function)
parse/until.go:12
↓ 1 callers
Function
testPosition
testPosition tests applies the operation to the Stream and checks the results. The advanceCount does some inital setup on the Stream.
input/streamposition_test.go:91
↓ 1 callers
Function
then
(pi Input, combiner MultipleResultCombiner, a, b Function)
parse/then.go:14
Function
BenchmarkAll
(b *testing.B)
parse/all_test.go:76
Function
BenchmarkAny
(b *testing.B)
parse/any_test.go:71
Function
BenchmarkAnyRune
(b *testing.B)
parse/anyrune_test.go:47
Function
BenchmarkMany
(b *testing.B)
parse/many_test.go:125
Function
BenchmarkPosition
(b *testing.B)
input/position_test.go:164
Function
BenchmarkResultString
(b *testing.B)
parse/function_test.go:77
Function
BenchmarkRune
(b *testing.B)
parse/rune_test.go:68
Function
BenchmarkRuneIn
(b *testing.B)
parse/runewhere_test.go:69
Function
BenchmarkRuneWhere
(b *testing.B)
parse/runewhere_test.go:60
Function
BenchmarkStreamAdvance
(b *testing.B)
input/stream_test.go:263
Function
BenchmarkStreamPeek
(b *testing.B)
input/stream_test.go:280
Function
BenchmarkStreamPosition
(b *testing.B)
input/stream_test.go:288
Function
BenchmarkStreamRetreat
(b *testing.B)
input/stream_test.go:271
Function
BenchmarkString
(b *testing.B)
parse/string_test.go:133
Function
BenchmarkThen
(b *testing.B)
parse/then_test.go:45
Function
BenchmarkUntil
(b *testing.B)
parse/until_test.go:69
Function
BenchmarkWithIntegerCombiner
(b *testing.B)
parse/multipleresultcombiner_test.go:43
Function
BenchmarkWithStringConcatCombiner
(b *testing.B)
parse/multipleresultcombiner_test.go:23
Method
Collect
Collect returns the value of the consumed buffer and updates the position of the stream to the current position.
input/stream.go:133
Method
Index
Index returns the current index position within the stream.
input/stream.go:231
Method
Peek
()
input/stream.go:39
Method
Peek
Peek reads a rune from the Input, then sets the current position back.
input/stream.go:172
Method
Position
Position returns the current position within the stream.
input/stream.go:226
Function
RuneNotIn
RuneNotIn captures a rune if it's not within the input set.
parse/runewhere.go:24
Function
TestAll
(t *testing.T)
parse/all_test.go:9
Function
TestAnyErrorHandling
(t *testing.T)
parse/any_test.go:59
Function
TestAnyRune
(t *testing.T)
parse/anyrune_test.go:10
Function
TestCompose
(t *testing.T)
examples/compose_test.go:10
Function
TestDateParsing
(t *testing.T)
examples/date_test.go:11
Function
TestFromBufferFunction
(t *testing.T)
input/forward_test.go:5
Function
TestMany
(t *testing.T)
parse/many_test.go:9
Function
TestMany
(t *testing.T)
examples/compose_test.go:28
Function
TestOr
(t *testing.T)
parse/any_test.go:10
next →
1–100 of 139, ranked by callers