Sublime Forum

Extend C Syntax

#1

I’m looking to create a sublime syntax highlighting file for a language called DML that extends from C.

So far I have the simple starting point below. What I see in Sublime 3 is the .dml file being recognized as DML but none of the C style comments or string definitions are highlighted correctly. What am I doing wrong to create a syntax definition that extends from the C definition that ships with Sublime?

%YAML 1.2

name: DML
file_extensions:

  • dml
    scope: source.dml-lang
    extends: Packages/C++/C.sublime-syntax

contexts:
main:
- include: keywords

keywords:
- match: ‘\b(simStatement|dml|device|import|interface|log|loggroup|bitorder|interface|is|try|except|after|error|assert)\b’
scope: keyword.control.dml-lang

0 Likes

#2

extends is a Sublime Text 4 syntax feature

and you will want to add - meta_prepend: true to the top of your main context most likely

0 Likes

#3

That was the issue! Thanks.

I upgraded to Sublime 4 and then included the missing meta_prepend.

0 Likes