rizin/subprojects/rizin-shell-parser/corpus/cmd_substitution.txt
Riccardo Schirone 9d68e9614f
Fix old math commands (#3828)
* core/cmd: Adjust math commands

* shell: make `?x` commands a parsing failure

We have moved the `?x` commands to `%x`, thus now no command should
start with `?`. This patch makes the parser fail to parse `?x`
strings.

* core/tui: use APIs in panels

* There's no `%q` anymore, use `%=`
2023-09-14 08:53:25 +08:00

88 lines
2.1 KiB
Text

=======================================
Command substitution used as simple arg $(
=======================================
echo $(p8 10)
---
(statements
(arged_stmt command: (cmd_identifier)
args: (args
(arg (cmd_substitution_arg
(arged_stmt command: (cmd_identifier)
args: (args (arg (arg_identifier)))))))))
=======================================
Command substitution with multiple statements
=======================================
echo $(p8 10; p8 4 @ 0xdeadbeef)
---
(statements
(arged_stmt command: (cmd_identifier)
args: (args
(arg (cmd_substitution_arg
(arged_stmt command: (cmd_identifier)
args: (args (arg (arg_identifier))))
(tmp_seek_stmt
(arged_stmt command: (cmd_identifier)
args: (args (arg (arg_identifier))))
(args (arg (arg_identifier)))))))))
=======================================
Command substitution used as simple arg `
=======================================
echo `p8 10`
---
(statements
(arged_stmt command: (cmd_identifier)
args: (args
(arg (cmd_substitution_arg
(arged_stmt command: (cmd_identifier)
args: (args (arg (arg_identifier)))))))))
=======================================
Nested command substitution
=======================================
echo $(p8 $(echo 10))
---
(statements
(arged_stmt command: (cmd_identifier)
args: (args (arg (cmd_substitution_arg
(arged_stmt command: (cmd_identifier)
args: (args (arg (cmd_substitution_arg
(arged_stmt command: (cmd_identifier)
args: (args (arg (arg_identifier)))))))))))))
=======================================
Nested command substitution 2
=======================================
echo Hello$(echo Wor$(echo ld))
---
(statements
(arged_stmt (cmd_identifier)
(args (arg (concatenation
(arg_identifier)
(cmd_substitution_arg
(arged_stmt (cmd_identifier)
(args (arg (concatenation
(arg_identifier)
(cmd_substitution_arg
(arged_stmt (cmd_identifier)
(args (arg (arg_identifier)))))))))))))))