Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linsyking committed Apr 7, 2023
1 parent b5142c1 commit aebc9e3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
proof/
!proof/main.tex
38 changes: 38 additions & 0 deletions examples/raw.meow
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
enraw(s) {
"1" = "01";
"0" = "00";
s
}

encode(s) {
var rep = enraw(s);
"11"+ rep +"11"
}

decode(s) {
var rep = {
"11" = "";
s
};
"00" = "0";
"01" = "1";
rep
}

tail(x) {
var pre = {
"1101" = "";
"1100" = "";
"1111" = "11";
encode(x)
};
decode("11" + pre)
}

head(x) {
var r = {
enraw(tail(x))+"11" = "11";
encode(x)
};
decode(r)
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn repl(context: &mut Box<prog::Context>) {
context.clean();
} else if cmd == &"load" {
let path = cmds.get(1).unwrap();
let res = read_file(path);
let res = read_file(format!("examples/{}.meow", path).as_str());
prog::eval_prog(&res, context);
println!("loaded {}", path);
} else {
Expand Down

0 comments on commit aebc9e3

Please sign in to comment.