From 083d08878ad87b8df4a6a64da27ef3690987da50 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 12 Oct 2017 19:10:44 -0500 Subject: [PATCH] modern: Support one: 1 two:: 1 2 three::: 1 2 3 syntax Also M\ 1 M\\ 1 2 M\\\ { { { etc --- extra/modern/modern.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index 1091ac5c2e..4518bbfcf7 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -141,8 +141,9 @@ MACRO:: read-matched ( ch -- quot: ( n string tag -- n' string slice' ) ) ERROR: token-expected n string obj ; ERROR: unexpected-terminator n string slice ; : read-lowercase-colon ( n string slice -- n' string lowercase-colon ) - [ - lex-factor dup [ token-expected ] unless + dup [ char: \: = ] count-tail + '[ + _ [ lex-factor ] replicate dup [ token-expected ] unless dup terminator? [ unexpected-terminator ] when ] dip swap 2array ; @@ -210,8 +211,9 @@ ERROR: no-backslash-payload n string slice ; : read-backslash ( n string slice -- n' string obj ) merge-slice-til-whitespace dup "\\" tail? [ ! \ foo, M\ foo - [ - skip-blank-from slice-til-whitespace drop + dup [ char: \\ = ] count-tail + '[ + _ [ skip-blank-from slice-til-whitespace drop ] replicate dup [ no-backslash-payload ] unless ] dip swap 2array ] when ;