[plt-scheme] parser tools

From: Ivanyi Peter (pivanyi at freemail.hu)
Date: Mon Nov 9 17:31:09 EST 2009

> But I recently made a simple quick-and-dirty text parser tool:
> http://planet.plt-scheme.org/package-source/orseau/lazy-doc.plt
> /1/6/planet-docs/manual/simple-parser.html
 
Thanks, this seems to work.
Now I do not understand one thing. Maybe this is not Scheme
related, but from the following code I would expect:
"\nsomething\n{#[#aa,#bb#]\n}\n"
but I get:
"\nsomething\n{\n#[\n#aa,#bb\n#]\n}\n"

I thought the start-keyword would match zero or many new-line
AND one or many spaces. What do I do wrong?

Thanks,

Peter Ivanyi

----------------------------------------------------------
#lang scheme

(require (planet orseau/lazy-doc:1:6/simple-parser))

(define start-keyword "\n* +")

(let ([block-parser (new-parser #:phase 'block-keywords)])
      (add-items
       block-parser
       ('block-keywords (start-keyword "#"))
      )
  (parse-text block-parser "
something
{
  [
        aa, bb
  ]
}
")
)



Posted on the users mailing list.