tree-sitter-cmake/corpus/condition.txt
2021-06-17 23:06:32 +02:00

86 lines
1.2 KiB
Plaintext

====================
Empty if [condition]
====================
if(cond)
endif()
---
(source_file
(if_condition
(if_command
(if)
(argument (unquoted_argument))
)
(endif_command (endif))
)
)
===========================
Empty if elseif [condition]
===========================
if(cond)
elseif(cond)
endif()
---
(source_file
(if_condition
(if_command
(if)
(argument (unquoted_argument))
)
(elseif_command
(elseif)
(argument (unquoted_argument))
)
(endif_command (endif))
)
)
================================
Empty if elseif else [condition]
================================
if(cond)
elseif(cond)
else()
endif()
---
(source_file
(if_condition
(if_command
(if)
(argument (unquoted_argument))
)
(elseif_command
(elseif)
(argument (unquoted_argument))
)
(else_command (else))
(endif_command (endif))
)
)
==========================================
If with one command invocation [condition]
==========================================
if(cond)
message(STATUS)
endif()
---
(source_file
(if_condition
(if_command
(if)
(argument (unquoted_argument))
)
(message_command (message))
(endif_command (endif))
)
)