yoshiki / yaml-mode

The emacs major mode for editing files in the YAML data serialization format.
GNU General Public License v3.0
487 stars 132 forks source link

Incorrect highlighting of inline lists #72

Open calebreister opened 5 years ago

calebreister commented 5 years ago

I've discovered an highlighting error when dealing with inline lists (see image). I've narrowed down the issue to the yaml-nested-sequence-re regex, but have not found a way to fix the problem.

Screenshot_20190711_174920

wasamasa commented 5 years ago

That's not terribly surprising because to solve this properly you need something more powerful than regular expressions, you need code that actually parses YAML and detects the beginning, items and end of a list, with the items possibly being nested further. I don't expect such a change to happen any time soon.

calebreister commented 5 years ago

@wasamasa I was kind of beginning to get that idea. After looking at YAML in more detail, I came to realize just how ridiculously complicated it can be. Perhaps it would be possible to port an existing parser to ELisp?

wasamasa commented 5 years ago

What everyone does in practice is using libyaml directly. You don't want to port that kind of thing, other than for educational purposes. An Emacs module binding to it might be interesting to build a better major mode upon, much like js2-mode or enh-ruby-mode.

sten0 commented 3 years ago

Maybe this project would be useful for this effort?: https://github.com/syohex/emacs-libyaml

@syohex, @yoshiki is looking to recruit maintainers and collaborators for yaml-mode. Out of curiosity, might you be interested in working on it, and possibly integrating support for your emacs-libyaml?

Regards, Nicholas