c3d / xl

A minimalist, general-purpose programming language based on meta-programming and parse tree rewrites
GNU General Public License v3.0
270 stars 15 forks source link

Add nodes with arbitrary syntax using a regexp #27

Open c3d opened 4 years ago

c3d commented 4 years ago

The language could be made more extensible if you could add arbitrary terminal node types defined for example by a regular expression. This could be used to address issue #20 or issue #26.

In the syntax, it could be something like:

TEXT
        "<<" ">>"
        "HTML" "END_HTML"

CUSTOM
        version_number "[0-9]+\(\.[0-9]+\)+"
        bits "bits 16#[0-9a-fA-F_]+"

Note that the renderer should be updated to correctly render this kind of node. Also think about colorization (issue #23 and issue #24).