SYNTAX: :>
scan locals get [ :>-outside-lambda-error ] unless*
- parse-def parsed ;
- [ make-local ] bind <def> suffix! ;
++ parse-def suffix! ;
- SYNTAX: [| parse-lambda over push-all ;
+ SYNTAX: [| parse-lambda append! ;
- SYNTAX: [let parse-let over push-all ;
+ SYNTAX: [let parse-let append! ;
-SYNTAX: [let* parse-let* append! ;
-
-SYNTAX: [wlet parse-wlet append! ;
-
SYNTAX: :: (::) define-declared ;
SYNTAX: M:: (M::) define ;
ERROR: parse-failed input word ;
SYNTAX: PEG:
- (:)
- [let | effect [ ] def [ ] word [ ] |
- [
- [
- [let | compiled-def [ def call compile ] |
+ [let
+ (:) :> ( word def effect )
+ [
[
- dup compiled-def compiled-parse
- [ ast>> ] [ word parse-failed ] ?if
- ]
- word swap effect define-declared
- ]
- ] with-compilation-unit
- ] append!
- ] ;
+ def call compile :> compiled-def
+ [
+ dup compiled-def compiled-parse
+ [ ast>> ] [ word parse-failed ] ?if
+ ]
+ word swap effect define-declared
+ ] with-compilation-unit
- ] over push-all
++ ] append!
+ ] ;
USING: vocabs vocabs.loader ;
PRIVATE>
SYNTAX: [infix
- "infix]" [infix-parse parsed \ call parsed ;
+ "infix]" [infix-parse suffix! \ call suffix! ;
-
-<PRIVATE
-
-: parse-infix-locals ( assoc end -- quot )
- '[ _ [infix-parse prepare-operand ] ((parse-lambda)) ;
-
-PRIVATE>
-
-SYNTAX: [infix|
- "|" parse-bindings "infix]" parse-infix-locals <let>
- ?rewrite-closures append! ;