Skip to content

Commit

Permalink
Added a meson syntax file
Browse files Browse the repository at this point in the history
  • Loading branch information
OnurKader committed Mar 5, 2021
1 parent a725b5d commit a2b2463
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions nvim/syntax/meson.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
" Vim syntax file
" Language: Meson build
" Maintainer: Ivan Gankevich <[email protected]>
" Based on conf.vim by Bram Moolenaar

if exists("b:current_syntax")
finish
endif

syn keyword mesonTodo contained TODO FIXME XXX
syn match mesonComment "^#.*" contains=mesonTodo
syn match mesonComment "\s#.*"ms=s+1 contains=mesonTodo
syn region mesonString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline
syn region mesonStringM start=+'''+ skip=+\\\\\|\\'+ end=+'''+

" global objects
syn keyword mesonGlobal meson host_machine target_machine build_machine

" control flow
syn keyword mesonBool true false
syn keyword mesonCond if else endif elif and or not
syn keyword mesonRepeat foreach endforeach

" global builtin functions
syn keyword mesonBuiltin
\ add_global_arguments
\ add_global_link_arguments
\ add_languages
\ add_project_arguments
\ add_project_link_arguments
\ add_test_setup
\ alias_target
\ assert
\ benchmark
\ both_libraries
\ build_target
\ configuration_data
\ configure_file
\ custom_target
\ declare_dependency
\ dependency
\ disabler
\ environment
\ error
\ executable
\ files
\ find_library
\ find_program
\ generator
\ get_option
\ gettext
\ get_variable
\ import
\ include_directories
\ install_data
\ install_headers
\ install_man
\ install_subdir
\ is_disabler
\ is_variable
\ jar
\ join_paths
\ library
\ message
\ option
\ project
\ run_command
\ run_target
\ set_variable
\ shared_library
\ shared_module
\ static_library
\ subdir
\ subdir_done
\ subproject
\ summary
\ test
\ vcs_tag
\ warning

hi link mesonComment Comment
hi link mesonTodo Todo
hi link mesonString String
hi link mesonStringM String
hi link mesonBuiltin Function
hi link mesonGlobal Keyword
hi link mesonCond Conditional
hi link mesonBool Boolean
hi link mesonRepeat Repeat

let b:current_syntax = "meson"

0 comments on commit a2b2463

Please sign in to comment.