Skip to content

Instantly share code, notes, and snippets.

@k-gun

k-gun/SQL.tmLanguage

Last active Nov 27, 2015
Embed
What would you like to do?
<!-- SQL.tmLanguage -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>sql</string>
<string>ddl</string>
<string>dml</string>
</array>
<key>foldingStartMarker</key>
<string>\s*\(\s*$</string>
<key>foldingStopMarker</key>
<string>^\s*\)</string>
<key>keyEquivalent</key>
<string>^~S</string>
<key>name</key>
<string>SQL</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.sql</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(create)\s+(aggregate|conversion|database|domain|function|group|(unique\s+)?index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)(['"`]?)(\w+)\4</string>
<key>name</key>
<string>meta.create.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(drop)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view))</string>
<key>name</key>
<string>meta.drop.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.table.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.sql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.other.cascade.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:\s*(drop)\s+(table)\s+(\w+)(\s+cascade)?\b)</string>
<key>name</key>
<string>meta.drop.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.table.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(alter)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)</string>
<key>name</key>
<string>meta.alter.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>10</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>11</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>12</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>13</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>14</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>15</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>9</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)
# normal stuff, capture 1
# \b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|datetime|double\sprecision|inet|int|integer|float|decimal|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text|enum)\b
### kerem
\b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|datetime|double\sprecision|inet|int|integer|float|decimal|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text|enum)\s*[^\,\(]\b
# numeric suffix, capture 2 + 3i
|\b(bit\svarying|character\s(?:varying)?|tinyint|var\schar|float|interval)\((\d+)\)
# optional numeric suffix, capture 4 + 5i
|\b(char|number|varchar\d?)\b(?:\((\d+)\))?
# special case, capture 6 + 7i + 8i
|\b(numeric)\b(?:\((\d+),(\d+)\))?
# special case, captures 9, 10i, 11
|\b(times)(?:\((\d+)\))(\swithoutstimeszone\b)?
# special case, captures 12, 13, 14i, 15
|\b(timestamp)(?:(s)\((\d+)\)(\swithoutstimeszone\b)?)?
</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b((?:primary|foreign)\s+key|references|on\sdelete(\s+cascade)?|check|constraint)\b)</string>
<key>name</key>
<string>storage.modifier.sql</string>
</dict>
<dict>
<key>match</key>
<string>\b\d+\b</string>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<dict>
<key>match</key>
<!-- <string>(?i:\b(select(\s+distinct)?|insert\s+(ignore\s+)?into|update|delete|from|set|where|group\sby|or|like|and|union(\s+all)?|having|order\sby|limit|(inner|cross)\s+join|straight_join|(left|right)(\s+outer)?\s+join|natural(\s+(left|right)(\s+outer)?)?\s+join)\b)</string> -->
<!-- kerem -->
<string>(?x)
# mysql lte >> 5.6
\b(ACCESSIBLE|ACTION|ADD|AFTER|AGAINST|AGGREGATE|ALGORITHM|ALL|ALTER|ANALYSE|ANALYE|AND|ANY|AS|ASC|ASCII|ASENSITIVE|AT|AUTHORS|AUTOEXTEND_SIE|AUTO_INCREMENT|AVG|AVG_ROW_LENGTH|BACKUP|BEFORE|BEGIN|BETWEEN|BIGINT|BINARY|BINLOG|BIT|BLOB|BLOCK|BOOL|BOOLEAN|BOTH|BTREE|BY|BYTE|CACHE|CALL|CASCADE|CASCADED|CASE|CATALOG_NAME|CHAIN|CHANGE|CHANGED|CHAR|CHARACTER|CHARSET|CHECK|CHECKSUM|CIPHER|CLASS_ORIGIN|CLIENT|CLOSE|COALESCE|CODE|COLLATE|COLLATION|COLUMN|COLUMNS|COLUMN_FORMAT|COLUMN_NAME|COMMENT|COMMIT|COMMITTED|COMPACT|COMPLETION|COMPRESSED|CONCURRENT|CONDITION|CONNECTION|CONSISTENT|CONSTRAINT|CONSTRAINT_CATALOG|CONSTRAINT_NAME|CONSTRAINT_SCHEMA|CONTAINS|CONTEXT|CONTINUE|CONTRIBUTORS|CONVERT|CPU|CREATE|CROSS|CUBE|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|CURSOR_NAME|DATA|DATABASE|DATABASES|DATAFILE|DATE|DATETIME|DAY|DAY_HOUR|DAY_MICROSECOND|DAY_MINUTE|DAY_SECOND|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFAULT_AUTH|DEFINER|DELAYED|DELAY_KEY_WRITE|DELETE|DESC|DESCRIBE|DES_KEY_FILE|DETERMINISTIC|DIAGNOSTICS|DIRECTORY|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DIV|DO|DOUBLE|DROP|DUAL|DUMPFILE|DUPLICATE|DYNAMIC|EACH|ELSE|ELSEIF|ENABLE|ENCLOSED|END|ENDS|ENGINE|ENGINES|ENUM|ERROR|ERRORS|ESCAPE|ESCAPED|EVENT|EVENTS|EVERY|EXCHANGE|EXECUTE|EXISTS|EXIT|EXPANSION|EXPIRE|EXPLAIN|EXPORT|EXTENDED|EXTENT_SIE|FALSE|FAST|FAULTS|FETCH|FIELDS|FILE|FIRST|FIXED|FLOAT|FLOAT4|FLOAT8|FLUSH|FOR|FORCE|FOREIGN|FORMAT|FOUND|FROM|FULL|FULLTEXT|FUNCTION|GENERAL|GEOMETRY|GEOMETRYCOLLECTION|GET|GET_FORMAT|GLOBAL|GRANT|GRANTS|GROUP|HANDLER|HASH|HAVING|HELP|HIGH_PRIORITY|HOST|HOSTS|HOUR|HOUR_MICROSECOND|HOUR_MINUTE|HOUR_SECOND|IDENTIFIED|IF|IGNORE|IGNORE_SERVER_IDS|IMPORT|IN|INDEX|INDEXES|INFILE|INITIAL_SIE|INNER|INOUT|INSENSITIVE|INSERT|INSERT_METHOD|INSTALL|INT|INT1|INT2|INT3|INT4|INT8|INTEGER|INTERVAL|INTO|INVOKER|IO|IO_AFTER_GTIDS|IO_BEFORE_GTIDS|IO_THREAD|IPC|IS|ISOLATION|ISSUER|ITERATE|JOIN|KEY|KEYS|KEY_BLOCK_SIE|KILL|LANGUAGE|LAST|LEADING|LEAVE|LEAVES|LEFT|LESS|LEVEL|LIKE|LIMIT|LINEAR|LINES|LINESTRING|LIST|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCK|LOCKS|LOGFILE|LOGS|LONG|LONGBLOB|LONGTEXT|LOOP|LOW_PRIORITY|MASTER|MASTER_AUTO_POSITION|MASTER_BIND|MASTER_CONNECT_RETRY|MASTER_DELAY|MASTER_HEARTBEAT_PERIOD|MASTER_HOST|MASTER_LOG_FILE|MASTER_LOG_POS|MASTER_PASSWORD|MASTER_PORT|MASTER_RETRY_COUNT|MASTER_SERVER_ID|MASTER_SSL|MASTER_SSL_CA|MASTER_SSL_CAPATH|MASTER_SSL_CERT|MASTER_SSL_CIPHER|MASTER_SSL_CRL|MASTER_SSL_CRLPATH|MASTER_SSL_KEY|MASTER_SSL_VERIFY_SERVER_CERT|MASTER_USER|MATCH|MAXVALUE|MAX_CONNECTIONS_PER_HOUR|MAX_QUERIES_PER_HOUR|MAX_ROWS|MAX_SIE|MAX_UPDATES_PER_HOUR|MAX_USER_CONNECTIONS|MEDIUM|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MEMORY|MERGE|MESSAGE_TEXT|MICROSECOND|MIDDLEINT|MIGRATE|MINUTE|MINUTE_MICROSECOND|MINUTE_SECOND|MIN_ROWS|MOD|MODE|MODIFIES|MODIFY|MONTH|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|MUTEX|MYSQL_ERRNO|NAME|NAMES|NATIONAL|NATURAL|NCHAR|NDB|NDBCLUSTER|NEW|NEXT|NO|NODEGROUP|NONE|NOT|NO_WAIT|NO_WRITE_TO_BINLOG|NULL|NUMBER|NUMERIC|NVARCHAR|OFFSET|OLD_PASSWORD|ON|ONE|ONE_SHOT|ONLY|OPEN|OPTIMIE|OPTION|OPTIONALLY|OPTIONS|OR|ORDER|OUT|OUTER|OUTFILE|OWNER|PACK_KEYS|PAGE|PARSER|PARTIAL|PARTITION|PARTITIONING|PARTITIONS|PASSWORD|PHASE|PLUGIN|PLUGINS|PLUGIN_DIR|POINT|POLYGON|PORT|PRECISION|PREPARE|PRESERVE|PREV|PRIMARY|PRIVILEGES|PROCEDURE|PROCESSLIST|PROFILE|PROFILES|PROXY|PURGE|QUARTER|QUERY|QUICK|RANGE|READ|READS|READ_ONLY|READ_WRITE|REAL|REBUILD|RECOVER|REDOFILE|REDO_BUFFER_SIE|REDUNDANT|REFERENCES|REGEXP|RELAY|RELAYLOG|RELAY_LOG_FILE|RELAY_LOG_POS|RELAY_THREAD|RELEASE|RELOAD|REMOVE|RENAME|REORGANIE|REPAIR|REPEAT|REPEATABLE|REPLACE|REPLICATION|REQUIRE|RESET|RESIGNAL|RESTORE|RESTRICT|RESUME|RETURN|RETURNED_SQLSTATE|RETURNS|REVERSE|REVOKE|RIGHT|RLIKE|ROLLBACK|ROLLUP|ROUTINE|ROW|ROWS|ROW_COUNT|ROW_FORMAT|RTREE|SAVEPOINT|SCHEDULE|SCHEMA|SCHEMAS|SCHEMA_NAME|SECOND|SECOND_MICROSECOND|SECURITY|SELECT|SENSITIVE|SEPARATOR|SERIAL|SERIALIABLE|SERVER|SESSION|SET|SHARE|SHOW|SHUTDOWN|SIGNAL|SIGNED|SIMPLE|SLAVE|SLOW|SMALLINT|SNAPSHOT|SOCKET|SOME|SONAME|SOUNDS|SOURCE|SPATIAL|SPECIFIC|SQL|SQLEXCEPTION|SQLSTATE|SQLWARNING|SQL_AFTER_GTIDS|SQL_AFTER_MTS_GAPS|SQL_BEFORE_GTIDS|SQL_BIG_RESULT|SQL_BUFFER_RESULT|SQL_CACHE|SQL_CALC_FOUND_ROWS|SQL_NO_CACHE|SQL_SMALL_RESULT|SQL_THREAD|SQL_TSI_DAY|SQL_TSI_HOUR|SQL_TSI_MINUTE|SQL_TSI_MONTH|SQL_TSI_QUARTER|SQL_TSI_SECOND|SQL_TSI_WEEK|SQL_TSI_YEAR|SSL|START|STARTING|STARTS|STATS_AUTO_RECALC|STATS_PERSISTENT|STATS_SAMPLE_PAGES|STATUS|STOP|STORAGE|STRAIGHT_JOIN|STRING|SUBCLASS_ORIGIN|SUBJECT|SUBPARTITION|SUBPARTITIONS|SUPER|SUSPEND|SWAPS|SWITCHES|TABLE|TABLES|TABLESPACE|TABLE_CHECKSUM|TABLE_NAME|TEMPORARY|TEMPTABLE|TERMINATED|TEXT|THAN|THEN|TIME|TIMESTAMP|TIMESTAMPADD|TIMESTAMPDIFF|TINYBLOB|TINYINT|TINYTEXT|TO|TRAILING|TRANSACTION|TRIGGER|TRIGGERS|TRUE|TRUNCATE|TYPE|TYPES|UNCOMMITTED|UNDEFINED|UNDO|UNDOFILE|UNDO_BUFFER_SIE|UNICODE|UNINSTALL|UNION|UNIQUE|UNKNOWN|UNLOCK|UNSIGNED|UNTIL|UPDATE|UPGRADE|USAGE|USE|USER|USER_RESOURCES|USE_FRM|USING|UTC_DATE|UTC_TIME|UTC_TIMESTAMP|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARIABLES|VARYING|VIEW|WAIT|WARNINGS|WEEK|WEIGHT_STRING|WHEN|WHERE|WHILE|WITH|WORK|WRAPPER|WRITE|X509|XA|XML|XOR|YEAR|YEAR_MONTH|EROFILL)\b
# mysql gte >> 5.7
|\b(ACCOUNT|ALWAYS|CHANNEL|COMPRESSION|FILE_BLOCK_SIZE|FILTER|FOLLOWS|GENERATED|GROUP_REPLICATION|JSON|MASTER_TLS_VERSION|NEVER|OPTIMIZER_COSTS|PARSE_GCOL_EXPR|PRECEDES|REPLICATE_DO_DB|REPLICATE_DO_TABLE|REPLICATE_IGNORE_DB|REPLICATE_IGNORE_TABLE|REPLICATE_REWRITE_DB|REPLICATE_WILD_DO_TABLE|REPLICATE_WILD_IGNORE_TABLE|STACKED|STORED|VALIDATION|VIRTUAL|WITHOUT|XID)\b
</string>
<key>name</key>
<string>keyword.other.DML.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(on|((is\s+)?not\s+)?null)\b)</string>
<key>name</key>
<string>keyword.other.DDL.create.II.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\bvalues\b)</string>
<key>name</key>
<string>keyword.other.DML.II.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(begin(\s+work)?|start\s+transaction|commit(\s+work)?|rollback(\s+work)?)\b)</string>
<key>name</key>
<string>keyword.other.LUW.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(grant(\swith\sgrant\soption)?|revoke)\b)</string>
<key>name</key>
<string>keyword.other.authorization.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\bin\b)</string>
<key>name</key>
<string>keyword.other.data-integrity.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:^\s*(comment\s+on\s+(table|column|aggregate|constraint|database|domain|function|index|operator|rule|schema|sequence|trigger|type|view))\s+.*?\s+(is)\s+)</string>
<key>name</key>
<string>keyword.other.object-comments.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\bAS\b</string>
<key>name</key>
<string>keyword.other.alias.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(DESC|ASC)\b</string>
<key>name</key>
<string>keyword.other.order.sql</string>
</dict>
<dict>
<key>match</key>
<string>\*</string>
<key>name</key>
<string>keyword.operator.star.sql</string>
</dict>
<dict>
<key>match</key>
<string>[!&lt;&gt;]?=|&lt;&gt;|&lt;|&gt;</string>
<key>name</key>
<string>keyword.operator.comparison.sql</string>
</dict>
<dict>
<key>match</key>
<string>-|\+|/</string>
<key>name</key>
<string>keyword.operator.math.sql</string>
</dict>
<dict>
<key>match</key>
<string>\|\|</string>
<key>name</key>
<string>keyword.operator.concatenator.sql</string>
</dict>
<dict>
<key>comment</key>
<string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string>
<key>match</key>
<string>(?i)\b(CURRENT_(DATE|TIME(STAMP)?|USER)|(SESSION|SYSTEM)_USER)\b</string>
<key>name</key>
<string>support.function.scalar.sql</string>
</dict>
<!-- kerem: all funcs -->
<dict>
<key>match</key>
<string>(?i)\b([\w]+)(?=\s*\()</string>
<key>name</key>
<string>all.func.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(CONCATENATE|CONVERT|LOWER|SUBSTRING|TRANSLATE|TRIM|UPPER)\b</string>
<key>name</key>
<string>support.function.string.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.database-name.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.other.table-name.sql</string>
</dict>
</dict>
<key>match</key>
<string>\b(\w+?)\.(\w+)\b</string>
<!-- <string>(\w+?)\.(\w+)</string> -->
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#regexps</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>match</key>
<string>(--).*$\n?</string>
<key>name</key>
<string>comment.line.double-dash.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>match</key>
<string>(#).*$\n?</string>
<key>name</key>
<string>comment.line.number-sign.sql</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.c</string>
</dict>
</array>
</dict>
<key>regexps</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>/(?=\S.*/)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>/</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.regexp.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
<dict>
<key>match</key>
<string>\\/</string>
<key>name</key>
<string>constant.character.escape.slash.sql</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>%r\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>comment</key>
<string>We should probably handle nested bracket pairs!?! -- Allan</string>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.regexp.modr.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>string_escape</key>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.sql</string>
</dict>
<key>string_interpolation</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>match</key>
<string>(#\{)([^\}]*)(\})</string>
<key>name</key>
<string>string.interpolated.sql</string>
</dict>
<key>strings</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>\s+(')[^'\\]*(')</string>
<key>name</key>
<!-- <string>string.quoted.single.sql</string> -->
<string>string.quoted.single.sql2</string>
</dict>
<!-- <dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_escape</string>
</dict>
</array>
</dict> -->
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>\s+(`)[^`\\]*(`)</string>
<key>name</key>
<!-- <string>string.quoted.other.backtick.sql</string> -->
<string>string.quoted.other.backtick.sql2</string>
</dict>
<!-- <dict>
<key>begin</key>
<string>`</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>`</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.other.backtick.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_escape</string>
</dict>
</array>
</dict> -->
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>(")[^"#]*(")</string>
<key>name</key>
<string>string.quoted.double.sql</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>%\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.other.quoted.brackets.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.sql</string>
<key>uuid</key>
<string>C49120AC-6ECC-11D9-ACC8-000D93589AF6</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.