core: SYNTAX: should allow \FOO words.

modern-harvey2
Doug Coleman 2017-08-26 13:26:51 -05:00
parent 15fe8c3844
commit a2eb7b854d
2 changed files with 11 additions and 2 deletions

View File

@ -4,7 +4,7 @@ USING: accessors arrays assocs classes combinators
compiler.units continuations definitions effects io compiler.units continuations definitions effects io
io.encodings.utf8 io.files kernel lexer math.parser namespaces io.encodings.utf8 io.files kernel lexer math.parser namespaces
parser.notes quotations sequences sets slots source-files parser.notes quotations sequences sets slots source-files
vectors vocabs vocabs.parser words words.symbol ; splitting vectors vocabs vocabs.parser words words.symbol ;
IN: parser IN: parser
: location ( -- loc ) : location ( -- loc )
@ -87,6 +87,15 @@ ERROR: invalid-word-name string ;
: scan-new-word ( -- word ) : scan-new-word ( -- word )
scan-new dup reset-generic ; scan-new dup reset-generic ;
: scan-syntax-word-name ( -- string )
scan-word-name "\\" ?head drop ;
: scan-new-syntax ( -- word )
scan-syntax-word-name create-word-in ;
: scan-new-syntax-word ( -- word )
scan-new-syntax dup reset-generic ;
ERROR: staging-violation word ; ERROR: staging-violation word ;
: (execute-parsing) ( accum word -- accum ) : (execute-parsing) ( accum word -- accum )

View File

@ -120,7 +120,7 @@ IN: bootstrap.syntax
"deprecated" [ last-word make-deprecated ] define-core-syntax "deprecated" [ last-word make-deprecated ] define-core-syntax
"SYNTAX:" [ "SYNTAX:" [
scan-new-word scan-new-syntax-word
mark-top-level-syntax mark-top-level-syntax
parse-definition define-syntax parse-definition define-syntax
] define-core-syntax ] define-core-syntax