mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-27 03:32:05 +00:00
clean up whitespace coalesce a bit
This commit is contained in:
parent
2485f08172
commit
4131616420
15
phase1.rl
15
phase1.rl
@ -72,6 +72,7 @@ const unsigned char escape = 0xb6;
|
||||
}
|
||||
;
|
||||
|
||||
# todo -- {{variables}}
|
||||
# same quoting logic as ' string
|
||||
vstring =
|
||||
'{' $push_back
|
||||
@ -99,17 +100,13 @@ const unsigned char escape = 0xb6;
|
||||
}
|
||||
;
|
||||
|
||||
# this is a mess ...
|
||||
# gobble up all the white space...
|
||||
coalesce_ws =
|
||||
ws
|
||||
(
|
||||
ws
|
||||
|
|
||||
escape nl ${ line++; }
|
||||
)*
|
||||
ws+
|
||||
<:
|
||||
any ${ scratch.push_back(' '); fhold; }
|
||||
;
|
||||
''
|
||||
%{ if (!scratch.empty() && scratch.back() != ' ') scratch.push_back(' '); }
|
||||
;
|
||||
|
||||
line :=
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user