BetweenFlags API Documentation

BetweenFlags.StartFlagType
StartFlag(flag::String,
          flag_boundaries_left::Vector{String},
          flag_boundaries_right::Vector{String})

A "start" flag that BetweenFlags looks for to denote the start position of a given scope.

source
BetweenFlags.StopFlagType
StopFlag(flag::String,
          flag_boundaries_left::Vector{String},
          flag_boundaries_right::Vector{String})

A "stop" flag that BetweenFlags looks for to denote the stop position of a given scope.

source
BetweenFlags.FlagPairType
FlagPair(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 = StartFlag("function",
                  ["\n", "\s", ";"],
                  ["\n", "\s"])
# find: ["\nend", " end", ";end"]
stop_flag = StopFlag("end",
                 ["\n", "\s", ";"],
                 ["\n", "\s", ";"])
flag_pair = FlagPair{ScopeType}(start_flag, stop_flag)
source
BetweenFlags.TokenStreamType
TokenStream

A token stream, containing

  • flag_set a FlagSet
  • code a string of code to be tokenized
  • token_stream a token stream (dict) whose keys are the flag IDs, and whose values are vectors of Ints indicating the nestedness of the flag.
source