BetweenFlags API Documentation
BetweenFlags.Flag
— TypeFlag(flag::String,
flag_boundaries_left::Vector{String},
flag_boundaries_right::Vector{String})
A flag that BetweenFlags looks for to denote the start/stop position of a given scope. The flag boundaries need only be unique since every permutation of left and right flag boundaries are taken to determine scopes.
julia>
using BetweenFlags
# find: ["\nfunction", " function", ";function"]
start_flag = Flag("function",
["\n", "\s", ";"],
["\n", "\s"],
StartType())
# find: ["\nend", " end", ";end"]
stop_flag = Flag("end",
["\n", "\s", ";"],
["\n", "\s", ";"],
StopType())
BetweenFlags.FlagPair
— TypeFlagPair(start::Flag, stop::Flag)
A flag pair that defines the start and stop of the substring of interest.
julia>
using BetweenFlags
# find: ["\nfunction", " function", ";function"]
start_flag = Flag("function",
["\n", "\s", ";"],
["\n", "\s"],
StartType())
# find: ["\nend", " end", ";end"]
stop_flag = Flag("end",
["\n", "\s", ";"],
["\n", "\s", ";"],
StopType())
flag_pair = FlagPair(start_flag, stop_flag)
BetweenFlags.TokenStream
— TypeTokenStream
A token stream, containing
flag_set
aFlagSet
code
a string of code to be tokenizedtoken_stream
a token stream (dict) whose keys are the flag IDs, and whose values are vectors ofInt
s indicating the nestedness of the flag.