ctags icon indicating copy to clipboard operation
ctags copied to clipboard

RFC: line oriented statefull regex parser

Open masatake opened this issue 2 years ago • 1 comments

After studying ctags for a long time, I have recognized what users, including myself, want is the way to define a "line-oriented stateful regex parser."

Currently, we have three:

  • --regex-<LANG>: an option for defining a line-oriented stateless regex parser,
  • --mline-regex-<LANG>: an option for defining a multiline-oriented stateless regex parser, and
  • --_mtable-regex-<LANG>: an option for defining byte-oriented stateful regex parser.

We can write a line-oriented stateful regex parser with --_mtable-regex. However, the parser definition with the option becomes a bit complicated. --_mtable-regex is too powerful for the purpose.

I'm looking for a good option name for defining a line-oriented stateful regex parser.

  • --lregex-<LANG>=TABLE/PATTERN/...
  • --regex2-<LANG>=TABLE/PATTERN/...
  • --ltable-<LANG>=TABLE/PATTERM/...
  • --pcre2-<LANG>=TABLE/PATTERN/...
  • --stable-<LANG>=TABLE/PATTERN/...
  • ...

Which one do you like?

masatake avatar Dec 20 '23 22:12 masatake

--stateful-regex

jafl avatar Dec 21 '23 01:12 jafl