diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-22 02:57:56 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-22 02:58:10 -0500 |
commit | 6e9ba966a1fd097196394f00c43eca15ac571843 (patch) | |
tree | 9761348cb4fac4a50a4b2ae90932a2e8d78fd444 /src/shell.pest | |
parent | fea9c70861326fdc1c670e965b1c214741f27be7 (diff) | |
download | nbsh-6e9ba966a1fd097196394f00c43eca15ac571843.tar.gz nbsh-6e9ba966a1fd097196394f00c43eca15ac571843.zip |
start writing a parser
Diffstat (limited to 'src/shell.pest')
-rw-r--r-- | src/shell.pest | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shell.pest b/src/shell.pest new file mode 100644 index 0000000..f1f39ab --- /dev/null +++ b/src/shell.pest @@ -0,0 +1,17 @@ +char = { ASCII_ALPHANUMERIC } + +word = @{ char+ } + +exe = { word+ } + +and = { "&&" ~ command } +or = { "||" ~ command } +both = { ";" ~ command } +pipe = { "|" ~ command } + +command = { exe ~ (and | or | both | pipe)? } + +line = { SOI ~ command ~ EOI } + +WHITESPACE = _{ " " } +COMMENT = _{ "#" ~ ANY* } |