Using sublime version 3.0 build 3143
Trying to create a sql Teradata.sublime-syntax variant and google seems to have failed me on how to “inherit” an existing syntax. I’ve looked at other sql like language packages (ie Hive) but they seem to have rolled their own syntax using .tmLanguage files. So here I am asking the hive mind.
Below is my attempt to inherit to get “CREATE SET TABLE foo.bar” to highlight as a keyword from my syntax as well as “SELECT ‘foo’;” . In reading the docs it appears I can push regex matches to other libraries for evaluation but I think I’m missing something…
So far my syntax highlights my “CREATE SET TABLE” but nothing from the Packages/SQL/SQL.sublime-syntax. So is there no other fix rather than copying the entire builtin SQL.sublime-syntax file and adding my own vendor specific keywords?
%YAML 1.2
---
name: TeradataSql
file_extensions:
- sql
- ddl
- dml
scope: source.sql
contexts:
main:
- match: '(?i:\s*\b(create|create set|create multiset(?:\s+or\s+replace)?)\s+(aggregate|conversion|database|domain|function|group|(?:unique\s+)?index|language|operator class|operator|procedure|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)(?:(\w+)|''(\w+)''|"(\w+)"|`(\w+)`)'
scope: meta.create.sql
captures:
1: keyword.other.create.sql
2: keyword.other.sql
3: entity.name.function.sql
4: entity.name.function.sql
5: entity.name.function.sql
6: entity.name.function.sql
ansii:
- match: ""
push: "Packages/SQL/SQL.sublime-syntax"
This text will be hidden