factor: add ![[ ]] and multiline to core.
parent
890434b6db
commit
721434cb44
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007, 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: words words.symbol sequences vocabs kernel
|
||||
compiler.units ;
|
||||
compiler.units multiline ;
|
||||
in: bootstrap.syntax
|
||||
|
||||
[
|
||||
|
@ -11,6 +11,7 @@ in: bootstrap.syntax
|
|||
"("
|
||||
":"
|
||||
";"
|
||||
"![[" "![=[" "![==["
|
||||
"PRIVATE<"
|
||||
"B{"
|
||||
"BV{"
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
USING: kernel modern.lexer sequences tools.test ;
|
||||
in: modern.lexer.tests
|
||||
|
||||
! { T{ slice f 0 8 "dinosaur" } f } [
|
||||
! "dinosaur" <modern-lexer> lex-til-whitespace
|
||||
! ] unit-test
|
||||
![[
|
||||
{ T{ slice f 0 8 "dinosaur" } f } [
|
||||
"dinosaur" <modern-lexer> lex-til-whitespace
|
||||
] unit-test
|
||||
|
||||
! { f f } [
|
||||
! "dinosaur" <modern-lexer>
|
||||
! [ lex-til-whitespace 2drop ] [ lex-til-whitespace ] bi
|
||||
! ] unit-test
|
||||
{ f f } [
|
||||
"dinosaur" <modern-lexer>
|
||||
[ lex-til-whitespace 2drop ] [ lex-til-whitespace ] bi
|
||||
] unit-test
|
||||
]]
|
|
@ -12,7 +12,7 @@ lexer locals.errors locals.parser macros math memoize namespaces
|
|||
parser quotations sbufs sequences slots source-files splitting
|
||||
stack-checker strings strings.parser strings.parser.private
|
||||
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
|
||||
|
||||
! These words are defined as a top-level form, instead of with
|
||||
|
@ -58,6 +58,18 @@ in: bootstrap.syntax
|
|||
{ "_" "@" } define-fry-specifiers
|
||||
! "@" [ "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:" [
|
||||
current-vocab name>>
|
||||
scan-word scan-effect ";" expect ensure-primitive
|
||||
|
|
|
@ -65,7 +65,7 @@ gc
|
|||
|
||||
{
|
||||
unify-variables
|
||||
(balance-actual-depth)
|
||||
balance-actual-depth
|
||||
} compile-unoptimized
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue