casey / casey/shellkit

Scrap

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

```rust
enum Node<'text> {
Text{ text: &'text }
}

struct Text<'text> {
text: &'text str,
// text:
}

struct Chars<'chars> {
chars: &'chars [char],
}

struct Bytes<'input> {
bytes: &'input [u8],
}

struct Parse {
Incomplete,
Completions
Bad,
Good,
}

// https://github.com/kkawakam/rustyline

// keycodes
// bytes from stdin
// - whitespace splitting / string escaping
// - parse if
// - parse while
// - parse loop

#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}

struct Parser;

impl shellkit::Parser for Parser {
fn parse(text: &str) -> Command {
Command::new(text)
}
}

fn basic() -> Shell {
shellkit::Builder().parser(Parser).build()
}

fn test() {
let shell = basic();
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.