From 0cdd57f2a90e4ebe0129a2350b80fe8f198a8584 Mon Sep 17 00:00:00 2001 From: "chris.double" Date: Sun, 8 Oct 2006 11:41:42 +0000 Subject: [PATCH] lambda: fix for parser combinator changes --- contrib/lambda/parser.factor | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/lambda/parser.factor b/contrib/lambda/parser.factor index f771f9792a..c69d515a45 100644 --- a/contrib/lambda/parser.factor +++ b/contrib/lambda/parser.factor @@ -6,41 +6,41 @@ #! ::= ( ) #! ::= #! ::= : -USING: parser-combinators strings sequences kernel ; +USING: lazy-lists parser-combinators strings sequences kernel ; IN: lambda -: +LAZY: #! parses an uppercase or lowercase letter [ letter? ] satisfy [ ch>string ] <@ ; -: +LAZY: #! parses an uppercase or lowercase letter [ LETTER? ] satisfy [ ch>string ] <@ ; -: +LAZY: #! parses a number [ digit? ] satisfy [ ch>string ] <@ ; -: +LAZY: #! parses an alphanumeral <|> ; -: +LAZY: #! parses an alphanumeral <|> ; -: +LAZY: #! parses an identifier (string for now) #! TODO: do we need to enter it into a symbol table? <*> <&:> [ concat ] <@ ; -: +LAZY: #! parses a name, which is used in replacement <+> [ concat ] <@ ; DEFER: -: +LAZY: ( -- parser ) #! parses (.), the "lambda" expression #! all occurences of are replaced with a pointer to this #! lambda expression. @@ -48,23 +48,23 @@ DEFER: sp <&> ")" token sp <& [ [ first var-node-name ] keep second ] <@ ; -: +LAZY: ( -- parser ) #! parses ( ), the function application "(" token sp &> sp <&> ")" token sp <& [ [ first ] keep second ] <@ ; -: +LAZY: ( -- parser ) #! parses [], the alien invocation #! an alien factor word must be all capital letters and numerals "[" token sp &> "]" token sp <& [ ] <@ ; -: - [ call ] [ call ] [ call ] <|> <|> +LAZY: + <|> <|> [ ] <@ <|> <|> ; -: +LAZY: ":" token &> sp <&> f succeed <&> <|> "." token &> f succeed <&> <|> ; : lambda-parse - some call ; \ No newline at end of file + some parse force ; \ No newline at end of file -- 2.34.1