Skip to content

Commit

Permalink
syntax-highlighting: vim: update builtin function list
Browse files Browse the repository at this point in the history
Update builtin function list using the refman

	python docs/genrefman.py \
		-g vim \
		-o data/syntax-highlighting/vim/syntax/

This also drops gettext() and find_library() from the list of builtin
functions that have been deprecated since 2016.

Changes are squashed here because test_vim_syntax_highlighting() would
validate the file against the list of builtin functions that no longer
matches the yaml documentation.

Signed-off-by: Liam Beguin <[email protected]>
  • Loading branch information
liambeguin authored and eli-schwartz committed Sep 7, 2023
1 parent ba1ba1f commit 983562c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
20 changes: 9 additions & 11 deletions data/syntax-highlighting/vim/syntax/meson.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" License: VIM License
" Maintainer: Nirbheek Chauhan <[email protected]>
" Liam Beguin <[email protected]>
" Last Change: 2021 Aug 16
" Last Change: 2023 Aug 27
" Credits: Zvezdan Petkovic <[email protected]>
" Neil Schemenauer <[email protected]>
" Dmitry Vasiliev
Expand Down Expand Up @@ -64,6 +64,11 @@ syn keyword mesonBoolean false true

" Built-in functions
syn keyword mesonBuiltin
\ build_machine
\ host_machine
\ meson
\ option
\ target_machine
\ add_global_arguments
\ add_global_link_arguments
\ add_languages
Expand All @@ -75,42 +80,38 @@ syn keyword mesonBuiltin
\ assert
\ benchmark
\ both_libraries
\ build_machine
\ build_target
\ configuration_data
\ configure_file
\ custom_target
\ debug
\ declare_dependency
\ dependency
\ disabler
\ environment
\ error
\ executable
\ files
\ find_library
\ find_program
\ generator
\ get_option
\ get_variable
\ gettext
\ host_machine
\ import
\ include_directories
\ install_data
\ install_emptydir
\ install_headers
\ install_man
\ install_subdir
\ install_symlink
\ install_emptydir
\ is_disabler
\ is_variable
\ jar
\ join_paths
\ library
\ meson
\ message
\ option
\ project
\ range
\ run_command
\ run_target
\ set_variable
Expand All @@ -122,13 +123,10 @@ syn keyword mesonBuiltin
\ subdir_done
\ subproject
\ summary
\ target_machine
\ test
\ unset_variable
\ vcs_tag
\ warning
\ range
\ debug

if exists("meson_space_error_highlight")
" trailing whitespace
Expand Down
2 changes: 0 additions & 2 deletions mesonbuild/ast/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,12 @@ def __init__(self, source_root: str, subdir: str, subproject: str, visitors: T.O
'is_disabler': self.func_do_nothing,
'is_variable': self.func_do_nothing,
'disabler': self.func_do_nothing,
'gettext': self.func_do_nothing,
'jar': self.func_do_nothing,
'warning': self.func_do_nothing,
'shared_module': self.func_do_nothing,
'option': self.func_do_nothing,
'both_libraries': self.func_do_nothing,
'add_test_setup': self.func_do_nothing,
'find_library': self.func_do_nothing,
'subdir_done': self.func_do_nothing,
'alias_target': self.func_do_nothing,
'summary': self.func_do_nothing,
Expand Down
11 changes: 0 additions & 11 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,10 @@ def build_func_dict(self) -> None:
'error': self.func_error,
'executable': self.func_executable,
'files': self.func_files,
'find_library': self.func_find_library,
'find_program': self.func_find_program,
'generator': self.func_generator,
'get_option': self.func_get_option,
'get_variable': self.func_get_variable,
'gettext': self.func_gettext,
'import': self.func_import,
'include_directories': self.func_include_directories,
'install_data': self.func_install_data,
Expand Down Expand Up @@ -848,9 +846,6 @@ def run_command_impl(self,
self.environment.get_build_command() + ['introspect'],
in_builddir=in_builddir, check=check, capture=capture)

def func_gettext(self, nodes, args, kwargs):
raise InterpreterException('Gettext() function has been moved to module i18n. Import it and use i18n.gettext() instead')

def func_option(self, nodes, args, kwargs):
raise InterpreterException('Tried to call option() in build description file. All options must be in the option file.')

Expand Down Expand Up @@ -1754,12 +1749,6 @@ def func_find_program(self, node: mparser.BaseNode, args: T.Tuple[T.List[mesonli
silent=False, wanted=kwargs['version'],
search_dirs=search_dirs)

def func_find_library(self, node, args, kwargs):
raise InvalidCode('find_library() is removed, use meson.get_compiler(\'name\').find_library() instead.\n'
'Look here for documentation: http://mesonbuild.com/Reference-manual.html#compiler-object\n'
'Look here for example: http://mesonbuild.com/howtox.html#add-math-library-lm-portably\n'
)

# When adding kwargs, please check if they make sense in dependencies.get_dep_identifier()
@FeatureNewKwargs('dependency', '0.57.0', ['cmake_package_version'])
@FeatureNewKwargs('dependency', '0.56.0', ['allow_fallback'])
Expand Down

0 comments on commit 983562c

Please sign in to comment.