# HG changeset patch # User Francesco Potort # Date 1023970239 0 # Node ID d4c9f3bd6dfa5496834c560503ad354492ebc4b2 # Parent 0cbd872ef18bc54ca40c32e5a3b1da7db7bea196 New {language} and @regexp features. diff -r 0cbd872ef18b -r d4c9f3bd6dfa etc/NEWS --- a/etc/NEWS Thu Jun 13 12:10:00 2002 +0000 +++ b/etc/NEWS Thu Jun 13 12:10:39 2002 +0000 @@ -570,11 +570,11 @@ ** Etags changes. *** New syntax for regular expressions, multi-line regular expressions. -The syntax --ignore-case-regexp=/REGEX/NAME/ is now undocumented and -retained only for backward compatibility. The new equivalent syntax is ---regex=/REGEX/NAME/i. More generally, it is --regex=/REGEX/NAME/MODS, -where `/NAME' is optional, as usual, and MODS is a string of 0 or more -characters among `i' (ignore case), `m' (multi-line) and `s' +The syntax --ignore-case-regexp=/regex/ is now undocumented and retained +only for backward compatibility. The new equivalent syntax is +--regex=/regex/i. More generally, it is --regex=/TAGREGEX/TAGNAME/MODS, +where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or +more characters among `i' (ignore case), `m' (multi-line) and `s' (single-line). The `m' and `s' modifiers behave as in Perl regular expressions: `m' allows regexps to match more than one line, while `s' (which implies `m') means that `.' matches newlines. The ability to @@ -586,6 +586,15 @@ respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL, CR, TAB, VT, +*** Regular expressions can be bound to a given language +The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags +only for files of language LANGUAGE, and ignored otherwise. This is +particularly useful when storing regexps in a file. + +*** Regular expressions can be read from a file +The --regex=@regexfile option means read the regexps from a file, one +per line. Lines beginning with space or tab are ignored. + *** In Prolog, etags creates tags for rules in addition to predicates. *** In Perl, packages are tags. diff -r 0cbd872ef18b -r d4c9f3bd6dfa etc/etags.1 --- a/etc/etags.1 Thu Jun 13 12:10:00 2002 +0000 +++ b/etc/etags.1 Thu Jun 13 12:10:39 2002 +0000 @@ -152,9 +152,11 @@ in addition to the tags made with the standard parsing based on language. May be freely intermixed with filenames and the \fB\-R\fP option. The regexps are cumulative, i.e. each such option will add to -the previous ones. The regexps are of the form: +the previous ones. The regexps are of one of the forms: .br - \fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP + [\fB{\fP\fIlanguage\fP\fB}\fP]\fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP +.br + \fB@\fP\fIregexfile\fP .br where \fItagregexp\fP is used to match the tag. It should not match @@ -173,6 +175,15 @@ at once, rather than line by line, and the matching sequence can match multiple lines; and \fIs\fP, which implies \fIm\fP and means that the dot character in \fItagregexp\fP matches the newline char as well. +.br +cthe optional \fB{\fP\fIlanguage\fP\fB}\fP means that the tag should be +created only for files of language \fIlanguage\fP, and ignored +otherwise. This is particularly useful when storing many predefined +regexps in a file. +.br +In its second form, \fIregexfile\fP is the name of a file containing +regexps, one per line. Lines beginning with a space or tab are assumed +to be comments, and ignored. .br Here are some examples. All the regexps are quoted to protect them