
Hi.
I'm building a language that has 2 keywords that are fairly close to the same. What I've done is create a token for each keyword (instead of having one token with multiple patterns). I've done that since the tokens have to appear in a specific order.
However, when the lexer runs and produces the tokens it matches improperly.
Token 1: TokenKey -> AddressListKW, pattern -> address_list
Token 2: TokeyKey -> AddressKW, pattern -> address
Now, when the lexer is doing it's thing it matches the 'address_list pattern' when the 'address' text is actually present. It's an explicit pattern type.
I'm not sure what I'm doing wrong.
Cheers,
Dave
I'm building a language that has 2 keywords that are fairly close to the same. What I've done is create a token for each keyword (instead of having one token with multiple patterns). I've done that since the tokens have to appear in a specific order.
However, when the lexer runs and produces the tokens it matches improperly.
Token 1: TokenKey -> AddressListKW, pattern -> address_list
Token 2: TokeyKey -> AddressKW, pattern -> address
Now, when the lexer is doing it's thing it matches the 'address_list pattern' when the 'address' text is actually present. It's an explicit pattern type.
I'm not sure what I'm doing wrong.
Cheers,
Dave