/acetone A simple parser => https://git.foldling.org/rope.git rope ">
Proxy Information
Original URL
gemini://idiomdrottning.org/glex
Status Code
Success (20)
Meta
text/gemini; lang=en # glex Glex is a simple SRE-based lexer/tokenizer designed to be a good match for the acetone parser. Glex is a macro. As arguments, you give it any amount of pairs of SRE and tags. The macro returns a procedure that can take a single rope, any amount of strings (they’ll be concatenated), or nothing (in case it’ll read from the current input port.) ```Code ((glex ("ab" ab) ("abb" abb)) "klabb in the ab") ⇒ ((unknown "kl") (abb "abb") (unknown " in the ") (ab "ab")) ``` You can use two-element lists, or pairs, it doesn’t matter which: ```Code ((glex ("ab" . ab) ("abb" . abb)) "klabb in the ab") ⇒ ((unknown "kl") (abb "abb") (unknown " in the ") (ab "ab")) ``` You can use any SRE: ```Code ((glex (word word)) "klabb in the ab") ⇒ ((word "klabb") (unknown " ") (word "in") (unknown " ") (word "the") (unknown " ") (word "ab")) ``` You don’t need to worry about PCRE grawlix mucking things up: ```Code ((glex ("^hi" literal-caret-hi)) "oh ^hi") ⇒ ((unknown "oh ") (literal-caret-hi "^hi")) ``` You can not use variables and stuff, it doesn’t compose very well (your only recourse if you want some regexes containing other regexes is to construct the glex call itself from another macro). It’s not a parser, it’s just a tokenizer. For a repo, ```Code git clone https://idiomdrottning.org/glex ``` => /acetone A simple parser => https://git.foldling.org/rope.git rope
Capsule Response Time
483.279337 milliseconds
Gemini-to-HTML Time
0.013188 milliseconds

This content has been proxied by September (3851b).