Set Handling in the Lexer/Parser

Is there any reason why set forms aren't differentiated in the lexer, in the same way that metadata is? Given the following rules:

mLC = "{"
mRC = "}"
…
mSHARP = "#"
mUP = "^"
mSHARPUP = {mSHARP} {mUP}

why not add

mSHARPLC = {mSHARP} {mLC}

instead of using lookahead in the parser?

0
2 comments

Hi Ian.

There is no any preference in this choice. The macro was just created for the one case, but someone forgot to do the same for another.

Ilya

0

OK, cool. I’ll have a look add updating the lexer with this rule then. It may take me a while as I’ll need to read up on JFlex a bit first, but I think that it's a cleaner solution and should make it easier to write code that manipulates braced forms.

0

Please sign in to leave a comment.