tree-sitter-cmake/corpus/block_commands.txt

196 lines
3.2 KiB
Plaintext

======================================================
Function definition with no arguments [block_commands]
======================================================
function(fn)
endfunction()
---
(source_file
(function_def
(function_command
(function)
(argument_list
(argument
(unquoted_argument)
)
)
)
(body)
(endfunction_command
(endfunction)
)
)
)
========================================================
Function definition with many arguments [block_commands]
========================================================
function(fn arg1 arg2 arg3)
endfunction()
---
(source_file
(function_def
(function_command
(function)
(argument_list
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
)
)
(body)
(endfunction_command
(endfunction)
)
)
)
===================================================
Macro definition with no arguments [block_commands]
===================================================
macro(fn)
endmacro()
---
(source_file
(macro_def
(macro_command
(macro)
(argument_list
(argument
(unquoted_argument)
)
)
)
(body)
(endmacro_command
(endmacro)
)
)
)
========================================================
macro definition with many arguments [block_commands]
========================================================
macro(fn arg1 arg2 arg3)
endmacro()
---
(source_file
(macro_def
(macro_command
(macro)
(argument_list
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
)
)
(body)
(endmacro_command
(endmacro)
)
)
)
============================
Block scope [block_commands]
============================
block(SCOPE_FOR POLICIES VARIABLES PROPAGATE var)
endblock()
---
(source_file
(block_def
(block_command
(block)
(argument_list
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
(argument
(unquoted_argument)
)
)
)
(body)
(endblock_command
(endblock)
)
)
)
================================
Nested function [block_commands]
================================
function(a)
function(b)
endfunction()
endfunction()
---
(source_file
(function_def
(function_command
(function)
(argument_list
(argument
(unquoted_argument)
)
)
)
(body
(function_def
(function_command
(function)
(argument_list
(argument
(unquoted_argument)
)
)
)
(body)
(endfunction_command
(endfunction)
)
)
)
(endfunction_command
(endfunction)
)
)
)