Hi all,

looking at some packages, the optional arguments for some commands are
getting more and more complex, e.g.

--8<---------------cut here---------------start------------->8---
\declaresomething[%
  key          = value               ,
  name         = {[Optional]Value}   ,
  anothername  = {valu-es[]}]{}      ,
  colframe     = red!75!black        ,
  fonttitle    = \bfseries           ,
  enhanced                           ,
  attach boxed = {yshift=-2mm}       ,
  title        = #2
  ]
  {
    some1thing
  }
--8<---------------cut here---------------end--------------->8---

I was thinking about a general regex-solution how to add these kind of
beasts to AUCTeX parser.  My solution is currently:

--8<---------------cut here---------------start------------->8---
\\\\declaresomething[ \t\n\r%]*\\(?:\\[\\(?:[\t\n\r[:print:]]*\\)\\]\\)?[ 
\t\n\r%]*{[ \t\n\r%]*\\([[:print:]]+\\)[ \t\n\r%]*}
--8<---------------cut here---------------end--------------->8---

Any comments?  Admittedly, the last two `[ \t\n\r%]' are excessive, but
you never know.

Best, Arash


_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to