Hi, does someone remember why we have two lists:
$PMA_SQPdata_reserved_word $PMA_SQPdata_forbidden_word
referring both to the MySQL reserved words list!
Now that I'm updating the first one, I am about to get rid of the second one, replacing its references to the second one.
On Thu, May 23, 2013 at 01:06:03PM -0400, Marc Delisle wrote:
Hi, does someone remember why we have two lists:
$PMA_SQPdata_reserved_word $PMA_SQPdata_forbidden_word
referring both to the MySQL reserved words list!
Popping my head in as the person that originally wrote much of the parser+highlighter code ;-).
Reserved words originally referred to keywords that got highlighted specially, while forbidden words were those that the MySQL parser would throw an error on.
All forbidden words are reserved, but not all reserved words are forbidden.
reserved & forbidden => always highlight as keyword reserved & !forbidden => highlight as intelligently !reserved & forbidden => invalid state
Robin H. Johnson a écrit :
On Thu, May 23, 2013 at 01:06:03PM -0400, Marc Delisle wrote:
Hi, does someone remember why we have two lists:
$PMA_SQPdata_reserved_word $PMA_SQPdata_forbidden_word
referring both to the MySQL reserved words list!
Popping my head in as the person that originally wrote much of the parser+highlighter code ;-).
Thanks Robin. I introduced these forbidden words in
https://github.com/phpmyadmin/phpmyadmin/commit/06dc6dd5
and I no longer see a reason for maintaining two lists, now that we are planning to highlight with CodeMirror.
Reserved words originally referred to keywords that got highlighted specially, while forbidden words were those that the MySQL parser would throw an error on.
All forbidden words are reserved, but not all reserved words are forbidden.
reserved & forbidden => always highlight as keyword reserved & !forbidden => highlight as intelligently !reserved & forbidden => invalid state