[plt-scheme] Parser tools and source positions

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Tue May 19 06:29:46 EDT 2009

Hi,

PLT-Scheme version 4.2.0.2-svn17may2009 [3m] here.

I am using lexer-src-pos and parser with (src-pos) option. However, I
am having a very strange error and my error procedure set in the
parser is getting start-pos and end-pos with #f.
Example:
(error (lambda (tok-ok? tok-name tok-value start-pos end-pos)
             (error 'parser "Error : tok-ok? ~a, tok-name ~a,
tok-value ~a, start-pos (~a, ~a), end-pos (~a, ~a)." tok-ok? tok-name
tok-value (position-line start-pos) (position-col start-pos)
(position-line end-pos) (position-col end-pos))))

in the parser returns in an example:
parser: Error : tok-ok? #t, tok-name IDENTIFIER, tok-value e,,
start-pos (#f, #f), end-pos (#f, #f).

Why is it returning #f and #f? Shouldn't it be returning always valid
positions given that (src-pos) and lexer-src-pos are being used?

Cheers,
-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.