From 9f40bd3bac06ca447682522377d7f97e6b89680e Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 3 Jun 2016 11:18:48 -0700 Subject: [PATCH] core: adding lowercase syntax to core. --- core/bootstrap/syntax.factor | 15 +++++++++++++++ core/modern/compiler/compiler.factor | 1 + core/syntax/syntax.factor | 13 +++++++++++++ 3 files changed, 29 insertions(+) diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 19d572e690..79ed8bc319 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -17,7 +17,9 @@ IN: bootstrap.syntax "BV{" "C:" "CHAR:" + "char:" "DEFER:" + "defer:" "ERROR:" "FORGET:" "GENERIC#" @@ -26,14 +28,18 @@ IN: bootstrap.syntax "H{" "HS{" "IN:" + "in:" "INSTANCE:" "M:" "MAIN:" + "main:" "MATH:" "MIXIN:" "NAN:" + "nan:" "P\"" "POSTPONE:" + "postpone:" "PREDICATE:" "PRIMITIVE:" "PRIVATE>" @@ -41,7 +47,9 @@ IN: bootstrap.syntax "SINGLETON:" "SINGLETONS:" "BUILTIN:" + "builtin:" "SYMBOL:" + "symbol:" "SYMBOLS:" "CONSTANT:" "TUPLE:" @@ -51,6 +59,7 @@ IN: bootstrap.syntax "UNION:" "INTERSECTION:" "USE:" + "use:" "UNUSE:" "USING:" "QUALIFIED:" @@ -73,6 +82,12 @@ IN: bootstrap.syntax "foldable" "inline" "recursive" + "@delimiter" + "@deprecated" + "@flushable" + "@foldable" + "@inline" + "@recursive" "t" "{" "}" diff --git a/core/modern/compiler/compiler.factor b/core/modern/compiler/compiler.factor index b1b963da5d..109ff5998d 100644 --- a/core/modern/compiler/compiler.factor +++ b/core/modern/compiler/compiler.factor @@ -98,6 +98,7 @@ GENERIC: literal>tag ( class -- string/f ) M: line-comment-literal literal>tag drop f ; M: uppercase-colon-literal literal>tag tag>> [ "word" ] [ >lower ] if-empty ; +! M: lowercase-colon-literal literal>tag tag>> ; M: compound-literal literal>tag base-literal literal>tag ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index b9d5ff538d..960b9da675 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -68,12 +68,14 @@ IN: bootstrap.syntax ] define-core-syntax "IN:" [ scan-token set-current-vocab ] define-core-syntax + "in:" [ scan-token set-current-vocab ] define-core-syntax "" [ end-private ] define-core-syntax "USE:" [ scan-token use-vocab ] define-core-syntax + "use:" [ scan-token use-vocab ] define-core-syntax "UNUSE:" [ scan-token unuse-vocab ] define-core-syntax @@ -128,6 +130,7 @@ IN: bootstrap.syntax "HS{" [ \ } [ >hash-set ] parse-literal ] define-core-syntax "POSTPONE:" [ scan-word suffix! ] define-core-syntax + "postpone:" [ scan-word suffix! ] define-core-syntax "\\" [ scan-word suffix! ] define-core-syntax "M\\" [ scan-word scan-word lookup-method suffix! ] define-core-syntax "inline" [ last-word make-inline ] define-core-syntax @@ -137,6 +140,13 @@ IN: bootstrap.syntax "delimiter" [ last-word t "delimiter" set-word-prop ] define-core-syntax "deprecated" [ last-word make-deprecated ] define-core-syntax + "@inline" [ last-word make-inline ] define-core-syntax + "@recursive" [ last-word make-recursive ] define-core-syntax + "@foldable" [ last-word make-foldable ] define-core-syntax + "@flushable" [ last-word make-flushable ] define-core-syntax + "@delimiter" [ last-word t "delimiter" set-word-prop ] define-core-syntax + "@deprecated" [ last-word make-deprecated ] define-core-syntax + "SYNTAX:" [ scan-new-word mark-top-level-syntax @@ -152,6 +162,9 @@ IN: bootstrap.syntax "SYMBOL:" [ scan-new-word define-symbol ] define-core-syntax + "symbol:" [ + scan-new-word define-symbol + ] define-core-syntax "SYMBOLS:" [ ";" [ create-word-in [ reset-generic ] [ define-symbol ] bi ] each-token