janet-lang / janet-lang.org

Website for janet
https://janet-lang.org
MIT License
90 stars 59 forks source link

Update look peg special docs #224

Open sogaiu opened 2 months ago

sogaiu commented 2 months ago

This PR contains changes to the docs for the look peg special.

The docs do not currently appear to cover the case of look being called with only a single argument:

(look offset patt)

Matches only if patt matches at a fixed offset. offset can be any integer. patt will not produce captures and the peg will not advance any characters.

This PR attempts to cover this additional case.

Please see here for some background.

sogaiu commented 2 months ago

Thanks to @pepe for discussion :+1: