dust/tree-sitter-dust/corpus/commands.txt

162 lines
4.1 KiB
Plaintext

================================================================================
Simple Command
================================================================================
^ls
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(command
(command_text))))))
================================================================================
Command Sequence
================================================================================
^less ^ls
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(command
(command_text)))))
(statement
(statement_kind
(expression
(command
(command_text))))))
================================================================================
Command with Arguments
================================================================================
^ls --long -a
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument)
(command_argument))))))
================================================================================
Command Sequence with Arguments
================================================================================
^cargo run -- -c "output('hi there')"
^ls --long -a
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument)
(command_argument)
(command_argument)
(command_argument)))))
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument)
(command_argument))))))
================================================================================
Command Assignment
================================================================================
ls_output = ^ls;
cat_output = ^cat Cargo.toml;
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(assignment
(identifier)
(assignment_operator)
(statement
(statement_kind
(expression
(command
(command_text))))))))
(statement
(statement_kind
(assignment
(identifier)
(assignment_operator)
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument)))))))))
================================================================================
Command with Semicolon
================================================================================
ls_output = ^ls --long -a; ls_output
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(assignment
(identifier)
(assignment_operator)
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument)
(command_argument))))))))
(statement
(statement_kind
(expression
(identifier)))))
================================================================================
Command with Quoted Semicolon
================================================================================
ls_output = ^echo ';'; ls_output
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(assignment
(identifier)
(assignment_operator)
(statement
(statement_kind
(expression
(command
(command_text)
(command_argument))))))))
(statement
(statement_kind
(expression
(identifier)))))