[m-dev.] for review: three small changes to the library

Fergus Henderson fjh at cs.mu.oz.au
Thu Jan 8 19:07:26 AEDT 1998


On 08-Jan-1998, Zoltan Somogyi <zs at cs.mu.oz.au> wrote:
> 
> Fergus, please look at these.
> 
> The changes to each file are independent and will be committed separately.
> 
> rbtree.m:
> 	Factor out some common code by hand, since we can't yet do it
> 	automatically on the HLDS.
> 
> varset.m:
> 	Remove an obsolete "sanity" check and its documentation.

They're fine, please commit away.

> lexer.m:
> 	Derive the context of a token from the front of the token,
> 	not its end. This is what you want for strings; for other kinds
> 	of tokens, it shouldn't make a difference.

>  lexer__get_token(Token, Context) -->
> -	lexer__get_token_1(Token),
> -	lexer__get_context(Context).
> +	lexer__get_context(Context),
> +	lexer__get_token_1(Token).

That will do the wrong thing in the case that the token
happens to be preceded by some whitespace.

e.g. for

1>	token1 /* whitespace */
2>
3>	/* more whitespace */ token2

the context for `token2' should be line 3, not line 1.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list