Skip to content

Instantly share code, notes, and snippets.

@nathanboktae
Created April 27, 2015 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanboktae/6c8adb4c2aa537a0bd3e to your computer and use it in GitHub Desktop.
Save nathanboktae/6c8adb4c2aa537a0bd3e to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>pgsql</string>
<string>psql</string>
</array>
<key>foldingStartMarker</key>
<string>\s*\(\s*$</string>
<key>foldingStopMarker</key>
<string>^\s*\)</string>
<key>name</key>
<string>SQL+Handlebars</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#block_helper</string>
</dict>
<dict>
<key>begin</key>
<string>(?i)^\s*(create)\s+(or\s+replace\s+)?(function|view)\s+(?:([\w]+|".+")\.)?([\w]+|".+")(?:[\(|\s)])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.pgsql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.pgsql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.other.pgsql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.other.inherited-class.pgsql</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.pgsql</string>
</dict>
</dict>
<key>end</key>
<string>;\s*</string>
<key>name</key>
<string>meta.statement.create.pgsql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#dollar_quotes</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#keywords</string>
</dict>
<dict>
<key>include</key>
<string>#misc</string>
</dict>
<dict>
<key>include</key>
<string>#vars</string>
</dict>
<dict>
<key>include</key>
<string>#proc</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?i:^\s*(create)\s+(aggregate|collation|(?:default\s+)?conversion|database|domain|extension(?:\s+if\s+not\s+exists)?|foreign\s+data\s+wrapper|foreign\s+table(?:\s+if\s+not\s+exists)?|group|(?:unique\s+)?index(?:\s+concurrently)?|(?:or\s+replace\s+)?(?:trusted\s+)?(?:procedural\s+)?language|operator\s+class|operator\s+family|role|(?:or\s+replace\s+)?rule|schema(?:\s+if\s+not\s+exists)?(?:\s+authorization)?|(?:(?:temporary|temp)\s+)?sequence|server|(?:(?:global|local)\s+)?(?:(?:temporary|temp)\s+)?(?:unlogged\s+)?table(?:\s+if\s+not\s+exists)?|tablespace|text\s+search\s+configuration|text\s+search\s+dictionary|text\s+search\s+parser|text\s+search\s+template|(?:(?:constraint|event)\s+)?trigger|type|user|materialized\s+view|(?:or\s+replace\s+)?(?:(?:temporary|temp)\s+)?(?:recursive\s+)?view)\s+)(?:([\w]+|".+")\.)?([\w]+|".+")(?=[\(|\s|\;)])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.pgsql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.pgsql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.other.inherited-class.pgsql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.function.pgsql</string>
</dict>
</dict>
<key>comment</key>
<string>Needs work: other key words possible, e.g create temp table</string>
<key>end</key>
<string>;\s*</string>
<key>name</key>
<string>meta.statement.pgsql.create</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#dollar_quotes</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#keywords</string>
</dict>
<dict>
<key>include</key>
<string>#misc</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(^\s*[a-zA-Z]+)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.other.pgsql</string>
</dict>
</dict>
<key>comment</key>
<string>(?i)^\s*(abort|alter|analyze|begin|checkpoint|close|cluster|comment|commit|copy|create|deallocate|declare|delete|discard|do|drop|end|execute|explain|fetch|grant|insert|listen|load|lock|move|notify|prepare|reassign|refresh|reindex|release|reset|revoke|rollback|savepoint|security|select|set|show|start|table|truncate|unlisten|update|vacuum|values|with)</string>
<key>end</key>
<string>;\s*</string>
<key>name</key>
<string>meta.statement.pgsql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#dollar_quotes</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#keywords</string>
</dict>
<dict>
<key>include</key>
<string>#misc</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^(\\[\S]+)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.preprocessor.pgsql</string>
</dict>
</dict>
<key>comment</key>
<string>psql directives</string>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>meta.statement.pgsql.psql</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>block_helper</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(\{\{~?\#)([-a-zA-Z0-9_\./]+)\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.parameter.handlebars</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>variable.parameter.handlebars</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>end</key>
<string>(~?\}\})</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>name</key>
<string>meta.function.block.start.handlebars</string>
</dict>
</array>
</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.pgsql</string>
</dict>
</dict>
<key>match</key>
<string>(--).*$\n?</string>
<key>name</key>
<string>comment.line.double-dash.pgsql</string>
</dict>
<dict>
<key>begin</key>
<string>(\{\{~?\#)([-a-zA-Z0-9_\./]+)\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.parameter.handlebars</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>variable.parameter.handlebars</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>end</key>
<string>(~?\}\})</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>name</key>
<string>meta.function.block.start.handlebars</string>
</dict>
<dict>
<key>begin</key>
<string>(\{\{~?/)([a-zA-Z0-9_\.-]+)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>end</key>
<string>(~?\}\})</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>name</key>
<string>meta.function.block.end.handlebars</string>
</dict>
<dict>
<key>begin</key>
<string>(\{\{~?\{*(&gt;|!&lt;)*)\s*(@?[-a-zA-Z0-9_\./]+)*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.parameter.handlebars</string>
</dict>
</dict>
<key>end</key>
<string>(~?\}\}\}*)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.handlebars</string>
</dict>
</dict>
<key>name</key>
<string>meta.function.inline.other.handlebars</string>
</dict>
</array>
</dict>
<key>dollar_quotes</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(\$[\w_0-9]*\$)$</string>
<key>comment</key>
<string>Assume multiline dollar quote is SQL; start if quote is at the end of the line.
This could easily support other PL languages like PHP and Ruby -- see PHP heredoc as an example.</string>
<key>end</key>
<string>\1</string>
<key>name</key>
<string>meta.dollar-quote.pgsql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#dollar_quotes</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#keywords</string>
</dict>
<dict>
<key>include</key>
<string>#misc</string>
</dict>
<dict>
<key>include</key>
<string>#vars</string>
</dict>
<dict>
<key>include</key>
<string>#proc</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>embeddedhbs</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\{\{</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>text.html.handlebars</string>
</dict>
</dict>
<key>end</key>
<string>\}\}</string>
<key>name</key>
<string>text.html.handlebars</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.hbs</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>keywords</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.pgsql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)\b(coalesce|nullif|greatest|least|abs|cbrt|ceil|ceiling|degrees|div|exp|floor|ln|log|mod|pi|power|radians|random|round|setseed|sign|sqrt|trunc|width_bucket|acos|asin|atan|atan2|cos|cot|sin|tan|bit_length|char_length|lower|octet_length|overlay|position|substring|trim|upper|ascii|btrim|chr|concat|concat_ws|convert|convert_from|convert_to|decode|encode|format|initcap|length|lpad|ltrim|md5|pg_client_encoding|quote_ident|quote_literal|quote_nullable|regexp_matches|regexp_replace|regexp_split_to_array|regexp_split_to_table|repeat|replace|reverse|rpad|rtrim|split_part|strpos|substr|to_ascii|to_hex|translate|get_bit|get_byte|set_bit|set_byte|to_char|to_date|to_number|to_timestamp|age|clock_timestamp|date_part|date_trunc|extract|isfinite|justify_days|justify_hours|justify_interval|make_date|make_interval|make_time|make_timestamp|make_timestamptz|now|statement_timestamp|timeofday|transaction_timestamp|enum_first|enum_last|enum_range|area|box|center|circle|diameter|height|isclosed|isopen|lseg|npoints|path|pclose|point|polygon|popen|radius|width|abbrev|abbrev|broadcast|family|host|hostmask|masklen|netmask|network|set_masklen|set_masklen|text|trunc|get_current_ts_config|numnode|plainto_tsquery|querytree|setweight|strip|to_tsquery|to_tsvector|ts_headline|ts_rank|ts_rank_cd|ts_rewrite|ts_rewrite|tsvector_update_trigger|tsvector_update_trigger_column|xmlattributes|xmlparse|xmlroot|xmlserialize|xmlcomment|xmlconcat|xmlelement|xmlforest|xmlpi|xmlexists|xml_is_well_formed|xml_is_well_formed_document|xml_is_well_formed_content|xpath|xpath_exists|table_to_xml|query_to_xml|cursor_to_xml|array_to_json|row_to_json|to_json|json_array_length|json_build_array|json_build_object|json_each|json_each_text|json_extract_path|json_extract_path_text|json_object|json_object_keys|json_populate_record|json_populate_recordset|json_array_elements|json_array_elements_text|json_typeof|json_to_record|json_to_recordset|jsonb_array_length|jsonb_each|jsonb_each_text|jsonb_extract_path|jsonb_extract_path_text|jsonb_object_keys|jsonb_populate_record|jsonb_populate_recordset|jsonb_array_elements|jsonb_array_elements_text|jsonb_typeof|jsonb_to_record|jsonb_to_recordset|currval|lastval|nextval|setval|array_append|array_cat|array_ndims|array_dims|array_fill|array_length|array_lower|array_prepend|array_remove|array_replace|array_to_string|array_upper|string_to_array|cardinality|unnest|isempty|lower_inc|upper_inc|lower_inf|upper_inf|generate_series|generate_subscripts|current_database|current_query|current_schema|current_schemas)\b\s*\(</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.pgsql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)\b(pg_sleep|pg_sleep_for|pg_sleep_until|inet_client_addr|inet_client_port|inet_server_addr|inet_server_port|pg_backend_pid|pg_conf_load_time|pg_is_other_temp_schema|pg_listening_channels|pg_my_temp_schema|pg_postmaster_start_time|pg_trigger_depth|version|txid_current|txid_current_snapshot|txid_snapshot_xip|txid_snapshot_xmax|txid_snapshot_xmin|txid_visible_in_snapshot|current_setting|set_config|pg_cancel_backend|pg_reload_conf|pg_rotate_logfile|pg_terminate_backend|pg_create_restore_point|pg_current_xlog_insert_location|pg_current_xlog_location|pg_start_backup|pg_stop_backup|pg_is_in_backup|pg_backup_start_time|pg_switch_xlog|pg_xlogfile_name|pg_xlogfile_name_offset|pg_xlog_location_diff|has_any_column_privilege|has_column_privilege|has_database_privilege|has_foreign_data_wrapper_privilege|has_function_privilege|has_language_privilege|has_schema_privilege|has_sequence_privilege|has_server_privilege|has_table_privilege|has_tablespace_privilege|pg_has_role|pg_collation_is_visible|pg_conversion_is_visible|pg_function_is_visible|pg_opclass_is_visible|pg_operator_is_visible|pg_opfamily_is_visible|pg_table_is_visible|pg_ts_config_is_visible|pg_ts_dict_is_visible|pg_ts_parser_is_visible|pg_ts_template_is_visible|pg_type_is_visible|format_type|pg_describe_object|pg_identify_object|pg_get_constraintdef|pg_get_expr|pg_get_functiondef|pg_get_function_arguments|pg_get_function_identity_arguments|pg_get_function_result|pg_get_indexdef|pg_get_keywords|pg_get_ruledef|pg_get_serial_sequence|pg_get_triggerdef|pg_get_userbyid|pg_get_viewdef|pg_options_to_table|pg_tablespace_databases|pg_tablespace_location|pg_typeof|to_regclass|to_regproc|to_regprocedure|to_regoper|to_regoperator|to_regtype|col_description|obj_description|shobj_description|pg_is_in_recovery|pg_last_xlog_receive_location|pg_last_xlog_replay_location|pg_last_xact_replay_timestamp|pg_is_xlog_replay_paused|pg_xlog_replay_pause|pg_xlog_replay_resume|pg_export_snapshot|pg_column_size|pg_database_size|pg_indexes_size|pg_relation_size|pg_size_pretty|pg_table_size|pg_tablespace_size|pg_total_relation_size|pg_relation_filenode|pg_relation_filepath|pg_filenode_relation|pg_ls_dir|pg_read_file|pg_read_binary_file|pg_stat_file|pg_advisory_lock|pg_advisory_lock_shared|pg_advisory_unlock|pg_advisory_unlock_all|pg_advisory_unlock_shared|pg_advisory_xact_lock|pg_advisory_xact_lock_shared|pg_try_advisory_lock|pg_try_advisory_lock_shared|pg_try_advisory_xact_lock|pg_try_advisory_xact_lock_shared|suppress_redundant_updates_trigger|pg_event_trigger_dropped_objects)\b\s*\(</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.pgsql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)\b(array_agg|avg|bit_and|bit_or|bool_and|bool_or|count|every|json_agg|json_object_agg|max|min|string_agg|sum|xmlagg|corr|covar_pop|covar_samp|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|regr_slope|regr_sxx|regr_sxy|regr_syy|stddev|stddev_pop|stddev_samp|variance|var_pop|var_samp|mode|percentile_cont|percentile_disc|row_number|rank|dense_rank|percent_rank|cume_dist|ntile|lag|lead|first_value|last_value|nth_value)\b\s*\(</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(current_catalog|current_date|current_role|current_schema|current_time|current_timestamp|current_user|session_user|localtime|localtimestamp)\b</string>
<key>name</key>
<string>support.function.pgsql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.pgsql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)\b(abort|absolute|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|analyse|analyze|and|any|array|as|asc|assertion|assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|both|by|cache|called|cascade|cascaded|case|cast|catalog|chain|characteristics|check|checkpoint|cid|class|close|cluster|collate|collation|column|comment|comments|commit|committed|concurrently|configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|create|createdb|createrole|createuser|cross|csv|current|cursor|cycle|data|database|day|ddl_command_start|ddl_command_end|deallocate|dec|declare|default|defaults|deferrable|deferred|definer|delete|delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|domain|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|family|fetch|fillfactor|first|following|for|force|foreign|forward|freeze|from|full|function|functions|global|grant|granted|greatest|group|handler|having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|in|including|increment|index|indexes|inherit|inherits|initially|inline|inner|inout|input|insensitive|insert|instead|intersect|into|invoker|is|isnull|isolation|join|key|label|language|last|lateral|lc_collate|lc_ctype|leading|least|left|level|like|limit|listen|load|local|locale|location|lock|login|mapping|match|materialized|maxvalue|minute|minvalue|mode|month|move|names|national|natural|next|no|none|nocreatedb|nocreaterole|nocreateuser|noinherit|nologin|noreplication|nosuperuser|not|nothing|notify|notnull|nowait|null|nullif|nulls|of|off|offset|oids|on|only|operator|option|options|or|order|ordinality|out|outer|over|overlaps|overlay|owned|owner|parser|partial|partition|passing|password|placing|plans|plpgsql|position|preceding|prepare|prepared|preserve|primary|prior|privileges|procedural|procedure|program|quote|range|read|reassign|recheck|record|recursive|ref|refcursor|references|refresh|regclass|regconfig|regdictionary|regoper|regoperator|regproc|regprocedure|regtype|reindex|relative|release|reltime|rename|repeatable|replace|replica|replication|reset|restart|restrict|returning|returns|revoke|right|role|rollback|row|rows|rule|savepoint|schema|scroll|search|second|security|select|sequence|sequences|serializable|server|session|set|setof|share|show|similar|simple|smgr|some|stable|standalone|start|statement|statistics|stdin|stdout|storage|strict|strip|substring|symmetric|sysid|system|sql|sql_drop|superuser|table|tables|tablespace|tag|temp|template|temporary|then|tid|tinterval|to|trailing|transaction|treat|trigger|trim|true|truncate|trusted|type|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|unlogged|until|update|user|using|vacuum|valid|validate|validator|value|values|variadic|verbose|version|view|volatile|when|where|whitespace|window|with|within|without|work|wrapper|write|xid|year|yes)\b</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(anyelement|anyarray|anynonarray|anyenum|anyrange|cstring|internal|language_handler|fdw_handler|void|opaque|smallint|integer|int|bigint|int2|int4|int8|numeric|decimal|double(?:\s+precision)?|real|float|float4|float8|smallserial|serial|bigserial|text|varchar|character\s+varying|char|character|bpchar|name|bytea|bool|boolean|date|time(?:\s+with(?:out)?\s+time\s+zone)?|timetz|timestamp(?:\s+with(?:out)?\s+time\s+zone)?|timestamptz|interval|point|lseg|box|line|path|polygon|circle|cidr|inet|macaddr|bit|varbit|bit\s+varying|tsvector|tsquery|uuid|xml|json|jsonb|txid_snapshot|money|oid|oidvector|int2range|int4range|int8range|numrange|event_trigger)\b</string>
<key>name</key>
<string>storage.type.pgsql</string>
</dict>
</array>
</dict>
<key>misc</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\b\d+\b</string>
<key>name</key>
<string>constant.numeric.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>-&gt;&gt;|-&gt;|#&gt;&gt;|#&gt;</string>
<key>name</key>
<string>keyword.operator.json.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>\?&amp;|\?\||\?</string>
<key>name</key>
<string>keyword.operator.jsonb.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>~|~\*!~|!~\*</string>
<key>name</key>
<string>keyword.operator.regex.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>@@|&amp;&amp;|!!|@&gt;|&lt;@</string>
<key>name</key>
<string>keyword.operator.tsearch.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>\*</string>
<key>name</key>
<string>keyword.operator.star.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>[!&lt;&gt;]?=|&lt;&gt;|&lt;|&gt;</string>
<key>name</key>
<string>keyword.operator.comparison.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>-|\+|/|\^</string>
<key>name</key>
<string>keyword.operator.math.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>\|\|</string>
<key>name</key>
<string>keyword.operator.concatenator.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>::</string>
<key>name</key>
<string>keyword.operator.cast.pgsql</string>
</dict>
</array>
</dict>
<key>proc</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?xi)\b(case|continue|else|elseif|elsif|exit|for|foreach|if|loop|return(?:(?:\s+next)|(?:\s+query))?|slice|then|when|while)\b</string>
<key>name</key>
<string>keyword.control.proc.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>(?xi)\b(alias|begin|constant|declare|end|exception|execute|get\s+(?:stacked\s+)?diagnostics|perform|raise|using|message|detail|hint|errcode|debug|log|info|notice|warning)\b</string>
<key>name</key>
<string>keyword.other.proc.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>(?xi)\b(found|sqlerrm|sqlstate|new|old|tg_name|tg_when|tg_level|tg_op|tg_relid|tg_relname|tg_table_name|tg_table_schema|tg_nargs|tg_argv|tg_event|tg_tag)\b</string>
<key>name</key>
<string>support.function.proc.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b([-a-z0-9_.]+%(row)?type)\b</string>
<key>name</key>
<string>storage.type.proc.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>\$\d+</string>
<key>name</key>
<string>variable.parameter.pgsql</string>
</dict>
</array>
</dict>
<key>string_escape</key>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.pgsql</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.pgsql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.pgsql</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.single.pgsql</string>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.pgsql</string>
</dict>
</dict>
<key>comment</key>
<string>Need to implement escape rule with two single quotes in a row. Lots of other escaping issues with single quotes.</string>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.pgsql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.pgsql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_escape</string>
</dict>
</array>
</dict>
<dict>
<key>comment</key>
<string>Double quoting treated like strings, but they are really identifiers.</string>
<key>match</key>
<string>(")[^"#]*(")</string>
<key>name</key>
<string>variable.other.pgsql</string>
</dict>
<dict>
<key>begin</key>
<string>(\$[\w_0-9]*\$)</string>
<key>comment</key>
<string>Color as a string if dollar quote did not start at the end of a line.</string>
<key>end</key>
<string>\1</string>
<key>name</key>
<string>string.unquoted.dollar.pgsql</string>
</dict>
</array>
</dict>
<key>vars</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?i)\b(p(i|t|b|n|c|d|r|ia|iv(?:al)?)_[-a-z0-9_]+)\b</string>
<key>name</key>
<string>variable.parameter.pgsql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(v(i|t|b|n|c|d|r|ia|iv(?:al)?)_[-a-z0-9_]+)\b</string>
<key>name</key>
<string>variable.parameter.pgsql</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.pgsql</string>
<key>uuid</key>
<string>4D6B679D-111C-4529-B558-3F25487D9E27</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment