tree-sitter-dockerfile/test/corpus/env.txt

142 lines
3.7 KiB
Plaintext
Raw Normal View History

2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
Quoted value
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
ENV TEST="okay"
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
2021-05-09 22:11:30 -04:00
(source_file
2021-05-11 10:19:44 -04:00
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string))))
2021-05-09 22:11:30 -04:00
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
Unquoted value
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
ENV TEST_2=value\ 2
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
2021-05-09 22:11:30 -04:00
(source_file
2021-05-11 10:19:44 -04:00
(env_instruction
(env_pair
name: (unquoted_string)
value: (unquoted_string))))
2021-05-09 22:11:30 -04:00
=========================================================
Single-letter variable
=========================================================
ENV X=42
---
(source_file
(env_instruction
(env_pair
(unquoted_string)
(unquoted_string))))
================================================================================
keys can begin or end with underscores
================================================================================
ENV _TEST="foo" TEST__=bar
--------------------------------------------------------------------------------
(source_file
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string))
(env_pair
name: (unquoted_string)
value: (unquoted_string))))
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
Multiple
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
ENV TEST="foo" TEST_2=foo\ bar
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
2021-05-09 22:11:30 -04:00
(source_file
2021-05-11 10:19:44 -04:00
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string))
(env_pair
name: (unquoted_string)
value: (unquoted_string))))
================================================================================
2021-05-09 22:11:30 -04:00
Multiline
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
ENV TEST1="foo" \
TEST2=bar
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
2021-05-09 22:11:30 -04:00
(source_file
2021-05-11 10:19:44 -04:00
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string))
(line_continuation)
(env_pair
name: (unquoted_string)
value: (unquoted_string))))
================================================================================
2021-05-09 22:11:30 -04:00
Multiple instructions
2021-05-11 10:19:44 -04:00
================================================================================
2021-05-09 22:11:30 -04:00
ENV TEST1="foo"
ENV TEST2="bar"
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
2021-05-09 22:11:30 -04:00
(source_file
2021-05-11 10:19:44 -04:00
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string)))
(env_instruction
(env_pair
name: (unquoted_string)
value: (double_quoted_string))))
================================================================================
Space syntax
2021-05-11 10:19:44 -04:00
================================================================================
ENV TEST1 foo
2021-05-11 10:19:44 -04:00
--------------------------------------------------------------------------------
(source_file
(env_instruction
(env_pair
name: (unquoted_string)
value: (unquoted_string))))
================================================================================
Space syntax 2
================================================================================
ENV TZ America/Toronto
--------------------------------------------------------------------------------
(source_file
(env_instruction
(env_pair
name: (unquoted_string)
value: (unquoted_string))))