automatic whitespace for s-expression

This commit is contained in:
Arpad Ryszka 2017-10-28 23:21:52 +02:00
parent 6f5f4bf270
commit 68cf598920

View File

@ -1,9 +1,8 @@
ws:alias = [ \b\f\n\r\t\v];
comment:alias = ";" [^\n]*;
wsc:alias = ws | comment;
number = "-"? ("0" | [1-9][0-9]*) ("." [0-9]+)? ([eE] [+\-]? [0-9]+)?;
string = "\"" ([^\\"] | "\\" .)* "\"";
symbol = ([^\\ \n\t\b\f\r\v\"()] | "\\" .)+;
list = "(" wsc* (expression wsc*)* ")";
whitespace:ws = [ \b\f\n\r\t\v];
comment:alias:ws = ";" [^\n]*;
number:nows = "-"? ("0" | [1-9][0-9]*) ("." [0-9]+)? ([eE] [+\-]? [0-9]+)?;
string:nows = "\"" ([^\\"] | "\\" .)* "\"";
symbol:nows = ([^\\ \n\t\b\f\r\v\"()] | "\\" .)+;
list = "(" expression* ")";
expression:alias = number | string | symbol | list;
s-expression = expression;