Skip to content

niyarin/gorgos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gorgos

[WIP] Parser combinator for Scheme.

This library is in the alpha version and will undergo breaking changes in the future.

examples

This is an example of an unsinged integer parser.

In Gorgos, you can use (scheme charset).

(define unsigned-integer-parser
   (gconv (gpair (gcharset char-set:digit)
                 (glist-of (gcharset char-set:digit)))
          (lambda (x) (string->number (list->string x)))))

This is an example of creating an integer-parser using the previous unsigned-integer.

(define integer-parser
   (gconv (gpair (goptional (gchar #\-))
                 unsigned-integer-parser)
          (lambda (x)
             (if (null? (car x)) (cdr x) (- (cdr x))))))

See the examples directory for details.

About

[WIP] Parser combinator for Scheme.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages