1
0
Fork 0

Adding prob7, unfinished.

This commit is contained in:
Florent DENEF 2023-03-02 10:33:47 +01:00
parent ce2778a09f
commit 17740888b5
2 changed files with 1044 additions and 0 deletions

1027
prob7.txt Normal file

File diff suppressed because it is too large Load Diff

17
src/prob7.rs Normal file
View File

@ -0,0 +1,17 @@
use nom::{branch::alt, bytes::complete::tag, combinator::map, IResult};
use crate::prob7::Instructions::{Cd, Dir, Ls};
enum Instructions {
Ls,
Cd,
Dir,
}
fn parse_instruction(i: &str) -> IResult<&str, Instructions> {
alt((
map(tag("ls"), |_| Ls),
map(tag("cd"), |_| Cd),
map(tag("dir"), |_| Dir),
))(i)
}