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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of algorithms

algorithms

Related news:

News photo

Lockheed Martin launches ‘AI Fight Club’ to test algorithms for warfare

News photo

'For Algorithms, a Little Memory Outweighs a Lot of Time'

News photo

For algorithms, a little memory outweighs a lot of time