Skip to content

Instantly share code, notes, and snippets.

@TingPing
Created February 7, 2017 20:26
Show Gist options
  • Save TingPing/02aea7422dacaded3a35a6ba12fc3757 to your computer and use it in GitHub Desktop.
Save TingPing/02aea7422dacaded3a35a6ba12fc3757 to your computer and use it in GitHub Desktop.
Syntax Highlighting for Meson
<?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>author</key>
<string>Patrick Griffis</string>
<key>fileTypes</key>
<array>
<string>meson.build</string>
<string>meson_options.txt</string>
</array>
<key>name</key>
<string>Meson</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\#.*$</string>
<key>name</key>
<string>comment.line.meson</string>
</dict>
<dict>
<key>include</key>
<string>#string_quoted_single</string>
</dict>
<dict>
<key>match</key>
<string>\b(if|else|elif|endif|foreach|endforeach)\b</string>
<key>name</key>
<string>keyword.control.flow.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b(and|not|or)\b</string>
<key>name</key>
<string>keyword.operator.logical.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b(true|false)\b</string>
<key>name</key>
<string>constant.language.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b([1-9]+[0-9]*\.[0-9]*)</string>
<key>name</key>
<string>constant.numeric.float.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b([1-9]+[0-9]*|0)</string>
<key>name</key>
<string>constant.numeric.integer.decimal.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b(meson)\b</string>
<key>name</key>
<string>support.variable.meson</string>
</dict>
<dict>
<key>match</key>
<string>\b([\w_]+)\s*(?=:)</string>
<key>name</key>
<string>variable.parameter.function.keyword.meson</string>
</dict>
<dict>
<key>match</key>
<string>&lt;\=|&gt;\=|\=\=|&lt;|&gt;|\!\=</string>
<key>name</key>
<string>keyword.operator.comparison.meson</string>
</dict>
<dict>
<key>match</key>
<string>\+\=</string>
<key>name</key>
<string>keyword.operator.assignment.augmented.meson</string>
</dict>
<dict>
<key>match</key>
<string>\=</string>
<key>name</key>
<string>keyword.operator.assignment.meson</string>
</dict>
<dict>
<key>match</key>
<string>\+|\-|\*|%|\/</string>
<key>name</key>
<string>keyword.operator.arithmetic.meson</string>
</dict>
<dict>
<key>match</key>
<string>(?x)\b(add_global_arguments|add_global_link_arguments|add_languages|add_project_arguments|add_project_link_arguments|add_test_setup|benchmark|build_target|configuration_data|configure_file|custom_target|declare_dependency|dependency|error|environment|executable|find_program|find_library|files|generator|get_option|get_variable|import|include_directories|install_data|install_headers|install_man|install_subdir|is_subproject|is_variable|jar|join_paths|library|message|option|project|run_command|run_target|set_variable|shared_library|shared_module|static_library|subdir|subproject|test|vcs_tag
)\b\s*(?=\()</string>
<key>name</key>
<string>support.function.builtin.meson</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>constant_placeholder</key>
<dict>
<key>match</key>
<string>(?i:(%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?([hL][a-z]|[a-z%]))|(\{([!\[\].:\w ]+)?\}))</string>
<key>name</key>
<string>constant.other.placeholder.meson</string>
</dict>
<key>escaped_character</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.character.escape.newline.meson</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.character.escape.backlash.meson</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>constant.character.escape.single-quote.meson</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>constant.character.escape.linefeed.meson</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>constant.character.escape.return.meson</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>constant.character.escape.tab.meson</string>
</dict>
</dict>
<key>match</key>
<string>((\\\n)|(\\\\)|(\\')|(\\n)|(\\r)|(\\t))</string>
</dict>
<key>string_quoted_single</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>puncutation.definition.string.begin.meson</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>puncutation.definition.string.end.meson</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.empty-string.single.meson</string>
</dict>
</dict>
<key>match</key>
<string>(?&lt;!')(')(('))(?!')</string>
<key>name</key>
<string>string.quoted.single.single-line.meson</string>
</dict>
<dict>
<key>begin</key>
<string>(''')</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.meson</string>
</dict>
</dict>
<key>end</key>
<string>((?&lt;=''')(')''|''')</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.meson</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.empty-string.single.meson</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.block.meson</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#constant_placeholder</string>
</dict>
<dict>
<key>include</key>
<string>#escaped_character</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(')</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.meson</string>
</dict>
</dict>
<key>end</key>
<string>(')|(\n)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.meson</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>invalid.illegal.unclosed-string.meson</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.single-line.meson</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#constant_placeholder</string>
</dict>
<dict>
<key>include</key>
<string>#escaped_character</string>
</dict>
</array>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.meson</string>
<key>uuid</key>
<string>b3713e1e-4289-4e0c-88af-79e8876e5adb</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment