Skip to content

Inlist buffering

Kevin Hovsäter requested to merge hovsater/dte:feature/inlist-buffering into master

The rational for this pull request is described below. Feel free to close this pull request if you don't think it makes sense.

Rational

Sometimes you may need to "peek ahead" in order to determine if the inlist conditional is valid or not. A good example for this is highlighting types in Odin. Let's say I want to highlight f32 as a type. This can easily be achived using list type f32 and the inlist conditional. However, you may want to highlight type casts differently. In Odin, you can cast the integer 2 to an f32 using cast(f32)2 or the shorthand f32(2). In order to determine whether or not the currently matched f32 is a type or type cast, we need to check the next byte.

Implementation

inlist now accepts an optional flag, -b, similiar to noeat.

Edited by Kevin Hovsäter

Merge request reports