|Cobra||Interactive Query Language||mark|
NAMEmark — mark tokens if they match one or two patterns
m[ark] [qualifier]* pattern [pattern2] pattern: string | @string | /re | (expr) qualifier: ir | no | &
DESCRIPTIONIf used without qualifiers, the mark command can only add additional marks, but not remove them. The qualifiers can be used to restrict an existing set of marks to a subset.
A pattern can be a string (without quotes), a token type (when prefixed with a @ symbol), a regular expression (when preceded with a / symbol), or a pattern expression (in round braces).
A qualifier is one of the three terms ir, no, or &. Qualifiers can be escaped as \no, \&, or \ir if a literal match is intended.
m[ark] no pattern [pattern2] m[ark] & pattern [pattern2] m[ark] & ir pattern [pattern2]The command unmark can be used as a shorthand for m no. To avoid confusion with the undo command, unmark cannot be abbreviated.
: m s ++ # mark statements s++ (note the operator is a separate token) : m @ident \( # identifiers that are followed by a ( : m else if # else keywords that are followed by if : m /^[fg]oo # names starting with either foo or goo : m \/foo # tokens that match the string '/foo' : m no goo # unmark tokens named goo : unmark goo # same : m ir default # default keywords inside ranges associated with marked tokens : m /. # mark all tokens : r : m @key : m & (.fnm == "cobra.h" ) # first form : w (.fnm == "cobra.h" ) # alternative, using 'with' : m no (.lnr > 100 ) : w (.lnr <= 100) : m [ : m ir ==
NOTESThe arguments to the mark command (and all others that take arguments) are separated by white space. This means that if you want a space to be part of the pattern to be matched you need an escape character, for example:
: m /other\ prefix
SEE ALSOback, contains, jump, list, next, display, pre, qualifiers, stretch, undo, unmark, with
Return to index
|(Last Updated: 7 May 2017)|