[mercury-users] Proposed change in lex interface

Ondrej Bojar bojar at csse.unimelb.edu.au
Fri Mar 2 14:53:52 AEDT 2007


Hi, all.

I'd like to ask if there would be any severe objections against changing the 
interface to lex library as included in the mercury extras.

Some years ago I adapted a copy of lex so that the context returned would be 
not just byte offset but also the line number:

:- type context
     ==      {offset, lineno}.

and also changed the output type for the read predicate

:- pred read(io__read_result(Tok),
             lexer_state(Tok, Src), lexer_state(Tok, Src)).
:- mode read(out, di, uo) is det.

to

:- pred read(lexer_read_result(Tok), lexer_state(Tok, Src),
             lexer_state(Tok, Src)).
:- mode read(out, di, uo) is det.

where

:- type lexer_read_result(Token)
     --->    ok(Token, context)
     ;       error(string, context)
     ;       eof.

My version is now out of sync with the main one and I would like to use the 
same features for in the new version.

If you do not object, I'm going to change the interace in near future.

Thanks, Ondrej.

-- 
Ondrej Bojar (mailto:obo at cuni.cz / bojar at ufal.mff.cuni.cz)
http://www.cuni.cz/~obo
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list