Get the latest tech news
Three Algorithms for YSH Syntax Highlighting
oils.vim - Vim syntax highlighting for Oils
Recognizing most languages (Python, JavaScript, C) with Tree-sitter requires writing C code in an external scanner, and the same is true for YSH. After writing this Vim plugin for YSH, I wrote docs describing the "coarse parsing" algorithm, linked below. In Tree-sitter, Stage 2 is hard because recursive lexer modes require an external scanner, written in C. The C API is unusual because of incremental lexing and parsing.
Or read this on Hacker News