diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 1e0a6a37e1..3885093cba 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -56,6 +56,7 @@ in: bootstrap.syntax "CONSTANT:" "TUPLE:" "SLOT:" + "slot:" "T{" "UNION:" "INTERSECTION:" diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 85b6a86e42..cc7d2afd59 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -99,6 +99,7 @@ in: bootstrap.syntax ] define-core-syntax "NAN:" [ 16 scan-base suffix! ] define-core-syntax + "nan:" [ 16 scan-base suffix! ] define-core-syntax "f" [ f suffix! ] define-core-syntax @@ -110,6 +111,14 @@ in: bootstrap.syntax } cond suffix! ] define-core-syntax + "char:" [ + lexer get parse-raw [ "token" throw-unexpected-eof ] unless* { + { [ dup length 1 = ] [ first ] } + { [ "\\" ?head ] [ next-escape >string "" assert= ] } + [ name>char-hook get call( name -- char ) ] + } cond suffix! + ] define-core-syntax + "\"" [ parse-string suffix! ] define-core-syntax "SBUF\"" [ @@ -262,6 +271,9 @@ in: bootstrap.syntax "SLOT:" [ scan-token define-protocol-slot ] define-core-syntax + "slot:" [ + scan-token define-protocol-slot + ] define-core-syntax "C:" [ scan-new-word scan-word define-boa-word