factor: add ![[ ]] and multiline to core.

locals-and-roots
Doug Coleman 2016-06-17 16:07:58 -07:00
parent 890434b6db
commit 721434cb44
10 changed files with 25 additions and 10 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007, 2008 Slava Pestov. ! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: words words.symbol sequences vocabs kernel USING: words words.symbol sequences vocabs kernel
compiler.units ; compiler.units multiline ;
in: bootstrap.syntax in: bootstrap.syntax
[ [
@ -11,6 +11,7 @@ in: bootstrap.syntax
"(" "("
":" ":"
";" ";"
"![[" "![=[" "![==["
"PRIVATE<" "PRIVATE<"
"B{" "B{"
"BV{" "BV{"

View File

@ -3,11 +3,13 @@
USING: kernel modern.lexer sequences tools.test ; USING: kernel modern.lexer sequences tools.test ;
in: modern.lexer.tests in: modern.lexer.tests
! { T{ slice f 0 8 "dinosaur" } f } [ ![[
! "dinosaur" <modern-lexer> lex-til-whitespace { T{ slice f 0 8 "dinosaur" } f } [
! ] unit-test "dinosaur" <modern-lexer> lex-til-whitespace
] unit-test
! { f f } [ { f f } [
! "dinosaur" <modern-lexer> "dinosaur" <modern-lexer>
! [ lex-til-whitespace 2drop ] [ lex-til-whitespace ] bi [ lex-til-whitespace 2drop ] [ lex-til-whitespace ] bi
! ] unit-test ] unit-test
]]

View File

@ -12,7 +12,7 @@ lexer locals.errors locals.parser macros math memoize namespaces
parser quotations sbufs sequences slots source-files splitting parser quotations sbufs sequences slots source-files splitting
stack-checker strings strings.parser strings.parser.private stack-checker strings strings.parser strings.parser.private
typed vectors vocabs vocabs.parser words words.alias typed vectors vocabs vocabs.parser words words.alias
words.constant words.symbol delegate.private hints ; words.constant words.symbol delegate.private hints multiline ;
in: bootstrap.syntax in: bootstrap.syntax
! These words are defined as a top-level form, instead of with ! These words are defined as a top-level form, instead of with
@ -58,6 +58,18 @@ in: bootstrap.syntax
{ "_" "@" } define-fry-specifiers { "_" "@" } define-fry-specifiers
! "@" [ "Only valid inside a fry" throw ] ( -- * ) define-fry-specifier ! "@" [ "Only valid inside a fry" throw ] ( -- * ) define-fry-specifier
"![[" [
"]]" parse-multiline-string drop
] define-core-syntax
"![=[" [
"]=]" parse-multiline-string drop
] define-core-syntax
"![==[" [
"]==]" parse-multiline-string drop
] define-core-syntax
"PRIMITIVE:" [ "PRIMITIVE:" [
current-vocab name>> current-vocab name>>
scan-word scan-effect ";" expect ensure-primitive scan-word scan-effect ";" expect ensure-primitive

View File

@ -65,7 +65,7 @@ gc
{ {
unify-variables unify-variables
(balance-actual-depth) balance-actual-depth
} compile-unoptimized } compile-unoptimized
{ {