From e7a51013660afe33441816f55747597423747861 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 21 Aug 2017 23:16:51 -0500 Subject: [PATCH] modern: Allow +: section? ( string -- ? ) + { [ "<" head? ] [ ">" tail? not ] } 1&& ; + ERROR: colon-word-must-be-all-uppercase-or-lowercase n string word ; : read-colon ( n string slice -- n' string colon ) dup length 1 = [ @@ -150,7 +170,7 @@ ERROR: colon-word-must-be-all-uppercase-or-lowercase n string word ; ] if ; : read-acute ( n string slice -- n' string acute ) - ; + [ matching-section-delimiter 1array lex-until ] keep swap unclip-last 3array ; ! Words like append! and suffix! are allowed for now. : read-exclamation ( n string slice -- n' string obj ) @@ -178,7 +198,7 @@ ERROR: mismatched-terminator n string slice ; : lex-factor ( n/f string -- n'/f string literal ) over [ - skip-whitespace "\"\\!:[{(\s\r\n" slice-til-either { + skip-whitespace "\"\\!:[{(<\s\r\n" slice-til-either { ! { CHAR: ` [ read-backtick ] } { CHAR: " [ read-string ] } { CHAR: \ [ read-backslash ] } @@ -191,10 +211,24 @@ ERROR: mismatched-terminator n string slice ; read-colon ] if ] } + { CHAR: < [ + ! FOO: a b + ! FOO: a b + ! FOO: a b + ! FOO: a b + [ slice-til-whitespace drop ] dip span-slices + ! if we are in a FOO: and we hit a " surround + ] [ + rest ">" append + ] if ; + ERROR: unexpected-end n string ; : nth-check-eof ( n string -- nth ) 2dup ?nth [ 2nip ] [ unexpected-end ] if* ;