Bill Allombert on Wed, 29 Oct 2025 14:57:10 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [EXTERN] Re: Re: Re: Re: Definition of tokens in GP language


On Wed, Oct 29, 2025 at 02:27:16PM +0100, Hong-Phuc Bui wrote:
> Hi,
> 
> I took a look into the file lang.l. I think here is discrepancy of the lexical rules and what the gp prompt does:
> The rule
> 
> HEXINTEGER 0x[0-9A-Za-z]([0-9A-Za-z ]*[0-9A-Za-z])?
> 
> does accpets 0x1 2 3 zzz. But gp prompt does not:
> 
> ? 0x1 2 3 zzz
>   ***   syntax error, unexpected variable name, expecting end of file: 0x123zzz
>   ***

Indeed, this is parsed as 
0x123 zzz
which is a syntax error.

> I would change the rule to be
> 
> HEXINTEGER 0x[0-9A-Fa-f]([0-9A-Fa-f ]*[0-9A-Fa-f])?

Thanks, I have update lang.l, same URL.

Cheers,
Bill.