[Phpmyadmin-devel] reserved words and forbidden words

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. -- Marc Delisle http://infomarc.info

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 Hugh Johnson Gentoo Linux: Developer, Trustee & Infrastructure Lead E-Mail : robbat2@gentoo.org GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85

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
-- Marc Delisle http://infomarc.info
participants (2)
-
Marc Delisle
-
Robin H. Johnson