-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add syntax highlighting for meson build system #3236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8333f7d
Add syntax highlighting for meson build system
asakovets 714f5c3
Merge branch 'zyedidia:master' into meson-syntax
asakovets 1204fdf
meson.yaml: fix meson_options.txt detection
asakovets 17cca54
meson.yaml: remove empty rules
asakovets 8e32066
meson.yaml: add highlighting for operators and brackets
asakovets a83c182
meson.yaml: rearrange the keywords to be in alphabetical order
asakovets 87224cb
meson.yaml: add highlighting for numbers
asakovets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| filetype: meson | ||
|
|
||
| detect: | ||
| filename: "(meson\\.build|meson_options\\.txt|meson\\.options)" | ||
|
|
||
| rules: | ||
|
|
||
| # refer to https://mesonbuild.com/Syntax.html | ||
|
|
||
| - statement: "\\b(elif|else|if|endif)\\b" | ||
| - statement: "\\b(foreach|endforeach)\\b" | ||
| - statement: "\\b(continue|break)\\b" | ||
| - statement: "\\b(and|not|or|in)\\b" | ||
|
|
||
| - symbol.operator: "[<>?:+*/-]|[+!<>=]?=" | ||
| - symbol.brackets: "[(){}\\[\\]]" | ||
|
|
||
| - constant.number: "\\b(0|[1-9][0-9]*)\\b" # decimal | ||
| - constant.number: "\\b(0b[01]+)\\b" # bin | ||
| - constant.number: "\\b(0o[0-7]+)\\b" # oct | ||
| - constant.number: "\\b(0x[0-9a-fA-F]+)\\b" # hex | ||
|
|
||
| # meson builtins | ||
| - identifier: "\\b(add_global_arguments|add_global_link_arguments|add_languages|add_project_arguments|add_project_dependencies)\\b" | ||
| - identifier: "\\b(add_project_link_arguments|add_test_setup|alias_target|assert|benchmark|both_libraries|build_machine|build_target|configuration_data)\\b" | ||
| - identifier: "\\b(configure_file|custom_target|debug|declare_dependency|dependency|disabler|environment|error|executable|files)\\b" | ||
| - identifier: "\\b(find_program|generator|get_option|get_variable|host_machine|import|include_directories|install_data|install_emptydir)\\b" | ||
| - identifier: "\\b(install_headers|install_man|install_subdir|install_symlink|is_disabler|is_variable|jar|join_paths|library|meson)\\b" | ||
| - identifier: "\\b(message|option|project|range|run_command|run_target|set_variable|shared_library|shared_module|static_library)\\b" | ||
| - identifier: "\\b(structured_sources|subdir|subdir_done|subproject|summary|target_machine|test|unset_variable|vcs_tag|warning)\\b" | ||
|
|
||
| - constant.bool: "\\b(true|false)\\b" | ||
|
|
||
| - comment: | ||
| start: "#" | ||
| end: "$" | ||
|
|
||
| # multiline strings do not support escape sequences | ||
| - constant.string: | ||
| start: "'''" | ||
| end: "'''" | ||
|
|
||
| - constant.string: | ||
| start: "'" | ||
| end: "'" | ||
| skip: "\\\\." | ||
| rules: | ||
| - constant.specialChar: "\\\\[abfnrtv\\\\']" | ||
| - constant.specialChar: "\\\\([0-7]{1,3}|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|N\\{[^\\}]+\\})" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.