Help save net neutrality! Learn more.
Close

#38 multi-line regular expressions

open
nobody
None
5
2016-12-05
2007-05-28
No

Hi,

I recently tried extending ctags to support MATLAB via a simple regular expression, but unfortunately the regular expression code in ctags seems to be inherently single-line oriented, so definitions with linebreaks will go unnoticed.

(I reported this problem earlier on the user mailing list, and one developer hinted that the key might be in functions findRegexTags and iFileGetLine.)

As a programmer (not specialized in ctags) I understand there may be additional complications that hamper the implementation of multi-line regular expressions, but it's just an idea.

Thanks,
- Mikko

Discussion

  • Elliott Hughes

    Elliott Hughes - 2007-05-28

    Logged In: YES
    user_id=1127237
    Originator: NO

    experience writing something similar for VHDL suggests that it's actually quite hard to live in this middle ground between line-oriented regular expressions and a "proper" parser.

    if you know a scripting language, you could try to write your own matlab-only tags generator. that would (a) be useful to you directly and (b) useful in providing a concrete suggestion of how to add support for non-line-based regular expression parser in ctags.

    adding a way to read the whole file in at once and let the regular expressions loose on the full text is easy, but i think you'd find it very difficult to actually do anything useful with that.

     

Log in to post a comment.