| Cobra | Interactive Query Language | mark | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NAMEmark — mark tokens if they match one or more sequental tokensSYNTAXm[ark] [qualifier]* pattern [pattern]* 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 mark command normally has one pattern argument, but starting with Cobra Version 5.3 it can also match a sequence of two or more patterns. Only the first token in the sequence will be marked, provided that all tokens in the sequence match from that point.A pattern can be one of the following:
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, as can the / that would otherwise identify a regular expression, or a round brace ( that would otherwise indicate a pattern expression.
m[ark] no pattern [pattern]* m[ark] & pattern [pattern]* m[ark] & ir pattern [pattern]*The command unmark is a shorthand for m no. To avoid confusion with the undo command, unmark cannot be abbreviated. Pattern expressions are general boolean clauses enclosed in round braces. For instance: m & (a <= b && (.lnr < 100 || .fnm == cobra_lib.c))The following operators are recognized in expressions:
EXAMPLES: 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") # restrict to the set of marks that match the expression : m no (.lnr > 100 ) # remove marks that match the expression : m & (.fnm == /\.h$) : m [ : m ir == : >2 : m while : n \( : >1 : w (size(1) > size(2)) 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, display, jump, list, next, patterns, pre, qualifiers, reset, stretch, undo, unmark, |
||||||||||||||||||||||||||||||||||||||||||||||
|
Return to index Manual Tutorial |
(Last Updated: 11 September 2025) | |||