Default regular expression for etags

房东的猫 提交于 2020-01-02 13:32:54

问题


I'd like to create additional regular expressions for use with etags, but I'd like them to be based upon what's already there (in particular, I'd like to add [ \t]* to the current set of regular expressions that etags uses). What are the default set of regular expressions that etags uses for .lisp files?


回答1:


etags doesn't generally use regular expressions to implement the languages that are built-in. Instead, it has custom parser code for each built-in language.

That said, it seems for Lisp to look for just a few forms, that could be handled by regular expressions:

  • It looks for "(" in the first column
  • It skips defvar
  • It ignores a "cl-" or "CL-" appearing after the "("
  • Then, "def" and "DEF" match
  • It also checks for "(package::def" as a lead-in

I found this by reading lib-src/etags.c in the Emacs source tree. Search for "Lisp_functions".



来源:https://stackoverflow.com/questions/25290531/default-regular-expression-for-etags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!