MCPcopy Create free account

hub / github.com/a-h/lexical / functions

Functions139 in github.com/a-h/lexical

↓ 45 callersFunctionNewFromString
NewFromString creates a new parser input from an input string.
input/stream.go:124
↓ 19 callersFunctionRune
Rune captures a single, specified rune.
parse/rune.go:4
↓ 17 callersMethodAdvance
Advance advances the input by a single rune and consumes it.
parse/function.go:12
↓ 14 callersMethodIndex
Index returns the current index of the parser input.
parse/function.go:20
↓ 13 callersFunctionFailure
Failure creates an unsuccessful result of a parse operation.
parse/function.go:46
↓ 11 callersFunctionSuccess
Success creates a successful result of a parse operation.
parse/function.go:36
↓ 10 callersFunctionNewPosition
NewPosition creates a Position to represent the character position within a text file.
input/position.go:17
↓ 8 callersMethodPeek
Peek returns the next rune from the input without consuming it.
parse/function.go:16
↓ 7 callersMethodAdvance
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 callersFunctionMany
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 callersFunctionString
String captures a specific string.
parse/string.go:6
↓ 6 callersFunctionAll
All ensures that all of the parsers are captured, or winds the whole set of captures back.
parse/all.go:8
↓ 6 callersFunctionStringUntil
TODO: Create a generic Until function. StringUntil captures runes until the delimiter is encountered and returns a string.
parse/until.go:6
↓ 6 callersFunctionrewind
(pi Input, times int)
parse/string.go:51
↓ 5 callersFunctionAny
Any returns the first match out of the parse functions passed in, or a failure if no parsers match.
parse/any.go:7
↓ 5 callersFunctionAnyRune
AnyRune returns a parser which will parse any rune at all.
parse/anyrune.go:4
↓ 5 callersMethodEq
Eq compares two positions and returns true if they are equal.
input/position.go:34
↓ 5 callersMethodRetreat
Retreat retreats the input position by a single rune and unconsumes it.
parse/function.go:14
↓ 5 callersMethodRetreat
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 callersFunctionRuneIn
RuneIn captures a rune if it's within the input set.
parse/runewhere.go:16
↓ 5 callersFunctionmany
(pi Input, combiner MultipleResultCombiner, atLeast, atMost int, f Function)
parse/many.go:44
↓ 4 callersMethodString
()
input/stream.go:92
↓ 4 callersFunctionThen
Then executes one function, then another, comining the results using the provided function.
parse/then.go:8
↓ 4 callersFunctionWithStringConcatCombiner
WithStringConcatCombiner is a MultipleResultCombiner which concatenates the results together as a string.
parse/multipleresultcombiner.go:12
↓ 4 callersFunctionexpectRune
(s *Stream, test func() (rune, error), expected rune, t *testing.T, name string)
input/stream_test.go:88
↓ 4 callersFunctionruneWhere
(pi Input, name string, predicate func(r rune) bool)
parse/runewhere.go:31
↓ 3 callersMethodCollect
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 callersFunctionNew
New creates a new Scanner.
scanner/scanner.go:30
↓ 3 callersMethodNext
Next should be called repeatedly to request the next token from the stream. If
scanner/scanner.go:18
↓ 3 callersFunctionOr
Or returns the first or a or b. It's equivalent to the Any function with two parameters.
parse/any.go:14
↓ 3 callersMethodPosition
Position returns the line and column number of the current position within the stream.
parse/function.go:18
↓ 3 callersMethodReadRune
ReadRune reads a rune from the underlying string.
input/stream.go:114
↓ 3 callersFunctionRuneInRanges
RuneInRanges returns a parser which accepts a rune within the specified Unicode range.
parse/runewhere.go:41
↓ 3 callersMethodString
String creates a string representation of the position.
input/position.go:29
↓ 3 callersFunctionfromBuffer
(startOfBufferIndex int64, currentIndex int64, buffer *Buffer)
input/stream.go:141
↓ 2 callersMethodAdvance
Advance reads a rune from the Input and sets the current position.
input/stream.go:154
↓ 2 callersMethodAppend
(runes ...rune)
input/stream.go:27
↓ 2 callersFunctionAtLeast
AtLeast captures the passed function at least the number of times provided.
parse/many.go:24
↓ 2 callersFunctionAtMost
AtMost captures the passed function between one and the number of times provided.
parse/many.go:31
↓ 2 callersMethodLen
()
input/stream.go:68
↓ 2 callersFunctionNew
New creates a new parser input from a buffered reader.
input/stream.go:98
↓ 2 callersFunctionNewBuffer
(size int)
input/stream.go:15
↓ 2 callersMethodRetreat
Retreat steps back a rune.
input/stream.go:210
↓ 2 callersFunctionRuneWhere
RuneWhere captures a rune which matches a predicate.
parse/runewhere.go:9
↓ 2 callersMethodString
String returns the string representation of a result, truncated to 10 characters.
parse/function.go:68
↓ 2 callersFunctionWithIntegerCombiner
WithIntegerCombiner is a MultipleResultCombiner which concatenates the results together as a string then parses the result as an integer.
parse/multipleresultcombiner.go:29
↓ 2 callersFunctioncomparePosition
(expected, actual Position, t *testing.T)
input/position_test.go:70
↓ 2 callersFunctionexpect
(actual, expected rune, t *testing.T)
input/stream_test.go:32
↓ 1 callersMethodAt
(i int)
input/stream.go:64
↓ 1 callersMethodCollect
()
input/stream.go:43
↓ 1 callersMethodCollectSlice
(max int)
input/stream.go:49
↓ 1 callersMethodEq
Eq compares two results for equality.
parse/function.go:55
↓ 1 callersFunctionNewBufferFromString
(s string, size int)
input/stream.go:21
↓ 1 callersFunctionOptional
Optional provides an optional parser.
parse/many.go:38
↓ 1 callersMethodPeekN
PeekN reads a number of runes from the Input, then sets the current position back.
input/stream.go:185
↓ 1 callersFunctionStringInsensitive
StringInsensitive tests whether the string is present, but ignoring string casing.
parse/string.go:29
↓ 1 callersFunctionTimes
Times captures the parser function a set number of times.
parse/many.go:17
↓ 1 callersFunctionall
(pi Input, combiner MultipleResultCombiner, functions ...Function)
parse/all.go:14
↓ 1 callersFunctionany
(pi Input, functions ...Function)
parse/any.go:18
↓ 1 callersFunctioncountHouses
(filename string)
examples/xml/main.go:58
↓ 1 callersFunctionhandle
(err error)
examples/xml/main.go:52
↓ 1 callersFunctionparseRune
(pi Input, r rune)
parse/rune.go:10
↓ 1 callersFunctionparseString
(pi Input, s string)
parse/string.go:12
↓ 1 callersFunctionparseStringInsensitive
(pi Input, s string)
parse/string.go:35
↓ 1 callersFunctionstringUntil
(pi Input, delimiter Function)
parse/until.go:12
↓ 1 callersFunctiontestPosition
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 callersFunctionthen
(pi Input, combiner MultipleResultCombiner, a, b Function)
parse/then.go:14
FunctionBenchmarkAll
(b *testing.B)
parse/all_test.go:76
FunctionBenchmarkAny
(b *testing.B)
parse/any_test.go:71
FunctionBenchmarkAnyRune
(b *testing.B)
parse/anyrune_test.go:47
FunctionBenchmarkMany
(b *testing.B)
parse/many_test.go:125
FunctionBenchmarkPosition
(b *testing.B)
input/position_test.go:164
FunctionBenchmarkResultString
(b *testing.B)
parse/function_test.go:77
FunctionBenchmarkRune
(b *testing.B)
parse/rune_test.go:68
FunctionBenchmarkRuneIn
(b *testing.B)
parse/runewhere_test.go:69
FunctionBenchmarkRuneWhere
(b *testing.B)
parse/runewhere_test.go:60
FunctionBenchmarkStreamAdvance
(b *testing.B)
input/stream_test.go:263
FunctionBenchmarkStreamPeek
(b *testing.B)
input/stream_test.go:280
FunctionBenchmarkStreamPosition
(b *testing.B)
input/stream_test.go:288
FunctionBenchmarkStreamRetreat
(b *testing.B)
input/stream_test.go:271
FunctionBenchmarkString
(b *testing.B)
parse/string_test.go:133
FunctionBenchmarkThen
(b *testing.B)
parse/then_test.go:45
FunctionBenchmarkUntil
(b *testing.B)
parse/until_test.go:69
FunctionBenchmarkWithIntegerCombiner
(b *testing.B)
parse/multipleresultcombiner_test.go:43
FunctionBenchmarkWithStringConcatCombiner
(b *testing.B)
parse/multipleresultcombiner_test.go:23
MethodCollect
Collect returns the value of the consumed buffer and updates the position of the stream to the current position.
input/stream.go:133
MethodIndex
Index returns the current index position within the stream.
input/stream.go:231
MethodPeek
()
input/stream.go:39
MethodPeek
Peek reads a rune from the Input, then sets the current position back.
input/stream.go:172
MethodPosition
Position returns the current position within the stream.
input/stream.go:226
FunctionRuneNotIn
RuneNotIn captures a rune if it's not within the input set.
parse/runewhere.go:24
FunctionTestAll
(t *testing.T)
parse/all_test.go:9
FunctionTestAnyErrorHandling
(t *testing.T)
parse/any_test.go:59
FunctionTestAnyRune
(t *testing.T)
parse/anyrune_test.go:10
FunctionTestCompose
(t *testing.T)
examples/compose_test.go:10
FunctionTestDateParsing
(t *testing.T)
examples/date_test.go:11
FunctionTestFromBufferFunction
(t *testing.T)
input/forward_test.go:5
FunctionTestMany
(t *testing.T)
parse/many_test.go:9
FunctionTestMany
(t *testing.T)
examples/compose_test.go:28
FunctionTestOr
(t *testing.T)
parse/any_test.go:10
next →1–100 of 139, ranked by callers