Files
tree-sitter-nix-shell/corpus/payload.txt
Colin c9d79b0734 rework grammar to be friendly to injections
want to later support the case of multiple nix-shell directives in injection
2023-07-05 00:01:38 +00:00

70 lines
1.0 KiB
Plaintext

==================
empty
==================
---
(source_file)
==================
nix-shell with a bash payload
==================
#!/usr/bin/env nix-shell
#!nix-shell -i bash
echo "hello, world!"
---
(source_file
(nix_shell_directive
(interpreter)))
==================
nix-shell with interspersed payload
==================
#!/usr/bin/env nix-shell
echo hello
echo again
#!nix-shell -i bash
echo everybody
---
(source_file
(nix_shell_directive
(interpreter)))
==================
nix-shell with multiple directives
==================
#!/usr/bin/env nix-shell
echo hello
#!nix-shell -p gnused
#!nix-shell -i bash
echo again
#!nix-shell
echo everybody
---
(source_file
(nix_shell_directive)
(nix_shell_directive
(interpreter))
(nix_shell_directive))
==================
nix-shell with conflicting interpreters (last wins, but good luck with that)
==================
#!/usr/bin/env nix-shell
#!nix-shell -i bash
#!nix-shell -i python3
---
(source_file
(nix_shell_directive
(interpreter))
(nix_shell_directive
(interpreter)))