tree-sitter-plpgsql/test/corpus/create_function/parameters.txt

99 lines
3.0 KiB
Plaintext
Raw Normal View History

2021-08-21 20:15:42 +03:00
================================================================================
2021-08-28 13:46:32 +03:00
empty
2021-08-21 20:15:42 +03:00
================================================================================
2021-08-28 13:46:32 +03:00
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql;
2021-08-21 20:15:42 +03:00
--------------------------------------------------------------------------------
(source_file
(create_function_statement
(function_signature
(identifier)
(function_parameters))
2021-08-28 13:46:32 +03:00
(function_return
(identifier))
(string)
2021-08-21 20:15:42 +03:00
(identifier)))
================================================================================
2021-08-28 13:46:32 +03:00
with argument
2021-08-21 20:15:42 +03:00
================================================================================
2021-08-28 13:46:32 +03:00
CREATE FUNCTION FOO (_foo bar.baz) RETURNS void AS 'select' LANGUAGE sql;
2021-08-21 20:15:42 +03:00
--------------------------------------------------------------------------------
(source_file
(create_function_statement
(function_signature
(identifier)
(function_parameters
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))))
2021-08-28 13:46:32 +03:00
(function_return
(identifier))
(string)
2021-08-21 20:15:42 +03:00
(identifier)))
================================================================================
2021-08-28 13:46:32 +03:00
default value
2021-08-21 20:15:42 +03:00
================================================================================
2021-08-28 13:46:32 +03:00
CREATE FUNCTION FOO (_foo bar.baz default '42') RETURNS void AS 'select' LANGUAGE sql;
2021-08-21 20:15:42 +03:00
--------------------------------------------------------------------------------
(source_file
(create_function_statement
(function_signature
(identifier)
(function_parameters
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))
2021-08-28 13:46:32 +03:00
(string)))
(function_return
(identifier))
(string)
2021-08-21 20:15:42 +03:00
(identifier)))
================================================================================
2021-08-28 13:46:32 +03:00
with arguments
2021-08-21 20:15:42 +03:00
================================================================================
2021-08-28 13:46:32 +03:00
CREATE FUNCTION FOO (foo bar, foo bar) RETURNS void AS 'select' LANGUAGE sql;
2021-08-21 20:15:42 +03:00
--------------------------------------------------------------------------------
(source_file
(create_function_statement
(function_signature
(identifier)
(function_parameters
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))))
2021-08-28 13:46:32 +03:00
(function_return
(identifier))
(string)
2021-08-21 20:15:42 +03:00
(identifier)))
================================================================================
arrays
================================================================================
2021-08-28 13:46:32 +03:00
CREATE FUNCTION FOO (foo bar[], foo bar[][]) RETURNS void AS 'select' LANGUAGE sql;
2021-08-21 20:15:42 +03:00
--------------------------------------------------------------------------------
(source_file
(create_function_statement
(function_signature
(identifier)
(function_parameters
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))
2021-08-28 13:46:32 +03:00
(var_declaration
2021-08-21 20:15:42 +03:00
(identifier)
(identifier))))
2021-08-28 13:46:32 +03:00
(function_return
(identifier))
(string)
2021-08-21 20:15:42 +03:00
(identifier)))