File: //home/ubuntu/neovim/.deps/build/src/treesitter_vim/test/corpus/if_statement.txt
================================================================================
Single if statement
================================================================================
if foo
Bar
endif
--------------------------------------------------------------------------------
(script_file
(if_statement
condition: (identifier)
(body
(user_command
(command_name)))))
================================================================================
If - else statement
================================================================================
if foo
Bar
else
Baz
end
--------------------------------------------------------------------------------
(script_file
(if_statement
condition: (identifier)
(body
(user_command
(command_name)))
(else_statement
(body
(user_command
(command_name))))))
================================================================================
If - elseif - else statement
================================================================================
if foo
Bar
elseif baz
Bux
else
Quux
end
--------------------------------------------------------------------------------
(script_file
(if_statement
condition: (identifier)
(body
(user_command
(command_name)))
(elseif_statement
condition: (identifier)
(body
(user_command
(command_name))))
(else_statement
(body
(user_command
(command_name))))))
================================================================================
If - elseif statement
================================================================================
if foo
Bar
elseif bar
Baz
Qux
end
--------------------------------------------------------------------------------
(script_file
(if_statement
condition: (identifier)
(body
(user_command
(command_name)))
(elseif_statement
condition: (identifier)
(body
(user_command
(command_name))
(user_command
(command_name))))))
================================================================================
If - elseif statement with a:var
================================================================================
if a:foo == 0
Bar
elseif a:bar == 1
Baz
Qux
end
--------------------------------------------------------------------------------
(script_file
(if_statement
condition: (binary_operation
left: (argument
(identifier))
right: (integer_literal))
(body
(user_command
(command_name)))
(elseif_statement
condition: (binary_operation
left: (argument
(identifier))
right: (integer_literal))
(body
(user_command
(command_name))
(user_command
(command_name))))))