core: working on fry/locals
parent
f5c75922ec
commit
9c7c8cd9dd
|
@ -169,7 +169,13 @@ IN: bootstrap.syntax
|
||||||
"}}"
|
"}}"
|
||||||
":::"
|
":::"
|
||||||
"q[["
|
"q[["
|
||||||
"{{"
|
"'{{"
|
||||||
|
"q[["
|
||||||
"q{{"
|
"q{{"
|
||||||
|
"{{"
|
||||||
|
"'{{"
|
||||||
|
"H{{"
|
||||||
|
"'H{{"
|
||||||
|
"'[["
|
||||||
} [ "syntax" create-word drop ] each
|
} [ "syntax" create-word drop ] each
|
||||||
] with-compilation-unit
|
] with-compilation-unit
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov, Eduardo Cavazos, Joe Groff.
|
! Copyright (C) 2009 Slava Pestov, Eduardo Cavazos, Joe Groff.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs combinators kernel locals.backend
|
USING: accessors combinators kernel locals.backend math
|
||||||
locals.parser locals.types math math.parser quotations sequences
|
math.parser quotations sequences sets splitting words ;
|
||||||
sequences.extras sequences.private sets splitting words ;
|
|
||||||
IN: fry
|
IN: fry
|
||||||
|
|
||||||
TUPLE: fryable quot ;
|
TUPLE: fryable quot ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007, 2009 Slava Pestov, Eduardo Cavazos.
|
! Copyright (C) 2007, 2009 Slava Pestov, Eduardo Cavazos.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: fry kernel lexer locals.errors locals.parser locals.types
|
! USING: fry kernel lexer locals.errors locals.parser locals.types
|
||||||
macros memoize namespaces sequences vocabs vocabs.loader words ;
|
! macros memoize namespaces sequences vocabs vocabs.loader words ;
|
||||||
IN: locals
|
IN: locals
|
||||||
|
|
||||||
! SYNTAX: :>
|
! SYNTAX: :>
|
||||||
|
|
|
@ -56,8 +56,14 @@ M: callable rewrite-closures*
|
||||||
[ length \ curry <repetition> % ]
|
[ length \ curry <repetition> % ]
|
||||||
tri ;
|
tri ;
|
||||||
|
|
||||||
|
! almost good
|
||||||
|
M: fryable rewrite-closures* quot>> fry rewrite-closures* \ call , ;
|
||||||
|
|
||||||
|
! M: fryable rewrite-closures* B quot>> fry (rewrite-closures) % ;
|
||||||
|
|
||||||
|
! M: fryable rewrite-closures* B quot>> fry rewrite-closures* ;
|
||||||
|
|
||||||
![[
|
![[
|
||||||
! M: fryable rewrite-closures* quot>> fry rewrite-closures* \ call , ;
|
|
||||||
M: fryable rewrite-closures*
|
M: fryable rewrite-closures*
|
||||||
B
|
B
|
||||||
quot>> [
|
quot>> [
|
||||||
|
|
|
@ -144,7 +144,7 @@ ERROR: no-paren-container-word payload word ;
|
||||||
|
|
||||||
: strict-single-quote? ( string -- ? )
|
: strict-single-quote? ( string -- ? )
|
||||||
dup (strict-single-quote?)
|
dup (strict-single-quote?)
|
||||||
[ "'[" sequence= not ] [ drop f ] if ;
|
[ { "'[" "'[[" "'{{" "'H{{" } member? not ] [ drop f ] if ;
|
||||||
|
|
||||||
: strict-double-quote? ( string -- ? ) ?last char: \" = ;
|
: strict-double-quote? ( string -- ? ) ?last char: \" = ;
|
||||||
|
|
||||||
|
@ -181,4 +181,3 @@ ERROR: no-paren-container-word payload word ;
|
||||||
\ no-op "data-stack" set-lower-colon-word
|
\ no-op "data-stack" set-lower-colon-word
|
||||||
! USE: urls \ >url "url" set-container-word
|
! USE: urls \ >url "url" set-container-word
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -472,9 +472,10 @@ IN: bootstrap.syntax
|
||||||
|
|
||||||
|
|
||||||
"q{{" [
|
"q{{" [
|
||||||
! \ }} parse-until >quotation [ output>array ] curry
|
\ }} parse-until
|
||||||
! <fryable> suffix!
|
>quotation [ output>array ] curry
|
||||||
\ }} parse-until >array <fryable> suffix!
|
<fryable> suffix!
|
||||||
|
\ call suffix!
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"{{" [
|
"{{" [
|
||||||
|
@ -482,4 +483,27 @@ IN: bootstrap.syntax
|
||||||
>quotation [ output>array ] curry append!
|
>quotation [ output>array ] curry append!
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
|
"H{{" [
|
||||||
|
\ }} parse-until
|
||||||
|
>quotation [ H{ } output>assoc ] curry append!
|
||||||
|
] define-core-syntax
|
||||||
|
|
||||||
|
"'[[" [
|
||||||
|
\ ]] parse-until
|
||||||
|
>quotation [ [ ] output>sequence ] curry
|
||||||
|
<fryable> suffix!
|
||||||
|
] define-core-syntax
|
||||||
|
|
||||||
|
"'{{" [
|
||||||
|
\ }} parse-until
|
||||||
|
>quotation [ { } output>sequence ] curry
|
||||||
|
<fryable> suffix!
|
||||||
|
] define-core-syntax
|
||||||
|
|
||||||
|
"'H{{" [
|
||||||
|
\ }} parse-until
|
||||||
|
>quotation [ H{ } output>assoc ] curry
|
||||||
|
<fryable> suffix!
|
||||||
|
] define-core-syntax
|
||||||
|
|
||||||
] with-compilation-unit
|
] with-compilation-unit
|
||||||
|
|
Loading…
Reference in New Issue