Hello vim-dev,

I sent the email below to the yacc.vim maintainer, but it seems the listed address bounces. Does anyone on this list have the expertise/desire to step in to maintain this file? I'd be happy to do it myself, but the complexity of this file is a bit above my level of Vim expertise.


Thanks,
Matt


-------- Forwarded Message --------
Subject: Vim Yacc syntax inconsistencies
Date: Wed, 9 Aug 2017 07:31:33 -0700
From: Matthew Fernandez <matthew.fernan...@gmail.com>
To: Charles E. Campbell <ndroch...@pcampbellafamily.mbiz>

Hi Charles,

I've been working on a Bison-generated parser recently and have come across some unexpected behaviour in syntax highlighting within Vim. I've never used Yacc itself before, so my understanding of it is based off its docs [0].

The highlighting rule for "%prec" looks like the following [1]:

    syn match   yaccKey "\s%\(prec\|expect\)\>" contained

This doesn't seem to actually highlight "%prec" in the context in which it is 
used, trailing the body of an expression:

    expr    :       expr  '+'  expr
            |       expr  '-'  expr
            |       expr  '*'  expr
            |       expr  '/'  expr
            |       '-'  expr      %prec  '*'
            |       NAME
            ;

Is this intentional?

I've noticed that this rule also tries to match "%expect" which doesn't seem supported by Yacc. This is supported by Bison and it would actually be desirable for me if highlighting worked on other newer Bison features, like the prologue alternatives [2]. Are you happy to accept patches that add Bison support? The complexity of yacc.vim is above my level of Vimscript competence, but I'm sure I can learn what I need from the Vim docs.

If you're no longer the maintainer of this file, please let me know who I should contact about this issue. Thank you for your time.

Thanks,
Matt

  [0]: http://dinosaur.compilertools.net/yacc/index.html
  [1]: https://github.com/vim/vim/blob/master/runtime/syntax/yacc.vim#L64
  [2]: 
https://www.gnu.org/software/bison/manual/html_node/_0025code-Summary.html#g_t_0025code-Summary

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui