Skip to content

Commit

Permalink
Add "reserved" tokens from top level/new line
Browse files Browse the repository at this point in the history
Reserved keywords are special - they must be quoted.
  • Loading branch information
mvorisek committed May 21, 2024
1 parent 4ac7a28 commit 5473108
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final class Tokenizer
private array $reserved = [
'ACCESSIBLE',
'ACTION',
'ADD',
'AFTER',
'AGAINST',
'AGGREGATE',
Expand All @@ -37,6 +38,7 @@ final class Tokenizer
'ALTER',
'ANALYSE',
'ANALYZE',
'AND',
'AS',
'ASC',
'AUTO_INCREMENT',
Expand All @@ -46,6 +48,7 @@ final class Tokenizer
'BETWEEN',
'BINLOG',
'BOTH',
'BY',
'CASCADE',
'CASE',
'CHANGE',
Expand Down Expand Up @@ -86,6 +89,7 @@ final class Tokenizer
'DISTINCTROW',
'DIV',
'DO',
'DROP',
'DUMPFILE',
'DUPLICATE',
'DYNAMIC',
Expand All @@ -98,6 +102,8 @@ final class Tokenizer
'ESCAPE',
'ESCAPED',
'EVENTS',
'EXCEPT',
'EXCLUDE',
'EXEC',
'EXECUTE',
'EXISTS',
Expand All @@ -114,6 +120,7 @@ final class Tokenizer
'FOR',
'FORCE',
'FOREIGN',
'FROM',
'FULL',
'FULLTEXT',
'FUNCTION',
Expand All @@ -122,6 +129,7 @@ final class Tokenizer
'GRANTS',
'GROUP',
'GROUPS',
'HAVING',
'HEAP',
'HIGH_PRIORITY',
'HOSTS',
Expand All @@ -136,21 +144,26 @@ final class Tokenizer
'INDEX',
'INDEXES',
'INFILE',
'INNER',
'INSERT',
'INSERT_ID',
'INSERT_METHOD',
'INTERSECT',
'INTERVAL',
'INTO',
'INVOKER',
'IS',
'ISOLATION',
'JOIN',
'KEY',
'KEYS',
'KILL',
'LAST_INSERT_ID',
'LEADING',
'LEFT',
'LEVEL',
'LIKE',
'LIMIT',
'LINEAR',
'LINES',
'LOAD',
Expand All @@ -176,6 +189,7 @@ final class Tokenizer
'MINUTE',
'MINUTE_SECOND',
'MODE',
'MODIFY',
'MONTH',
'MRG_MYISAM',
'MYISAM',
Expand All @@ -189,6 +203,9 @@ final class Tokenizer
'OPTIMIZE',
'OPTION',
'OPTIONALLY',
'OR',
'ORDER',
'OUTER',
'OUTFILE',
'OVER',
'PACK_KEYS',
Expand Down Expand Up @@ -228,16 +245,19 @@ final class Tokenizer
'RETURN',
'RETURNS',
'REVOKE',
'RIGHT',
'RLIKE',
'ROLLBACK',
'ROW',
'ROW_FORMAT',
'ROWS',
'SECOND',
'SECURITY',
'SELECT',
'SEPARATOR',
'SERIALIZABLE',
'SESSION',
'SET',
'SHARE',
'SHOW',
'SHUTDOWN',
Expand Down Expand Up @@ -288,18 +308,24 @@ final class Tokenizer
'TYPES',
'UNBOUNDED',
'UNCOMMITTED',
'UNION',
'UNIQUE',
'UNLOCK',
'UNSIGNED',
'UPDATE',
'USAGE',
'USE',
'USING',
'VALUES',
'VARIABLES',
'VIEW',
'WHEN',
'WHERE',
'WINDOW',
'WITH',
'WORK',
'WRITE',
'XOR',
'YEAR_MONTH',
];

Expand Down

0 comments on commit 5473108

Please sign in to comment.