Bump version, use variable for quine text
This commit is contained in:
parent
0a16803247
commit
ec41eaf0e7
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "j"
|
name = "j"
|
||||||
version = "0.2.3"
|
version = "0.2.4"
|
||||||
authors = ["Casey Rodarmor <casey@rodarmor.com>"]
|
authors = ["Casey Rodarmor <casey@rodarmor.com>"]
|
||||||
license = "WTFPL/MIT/Apache-2.0"
|
license = "WTFPL/MIT/Apache-2.0"
|
||||||
description = "a command runner"
|
description = "a command runner"
|
||||||
|
4
justfile
4
justfile
@ -34,10 +34,12 @@ quine: create
|
|||||||
diff tmp/gen1.c tmp/gen2.c
|
diff tmp/gen1.c tmp/gen2.c
|
||||||
@echo 'It was a quine!'
|
@echo 'It was a quine!'
|
||||||
|
|
||||||
|
quine-text = "'int printf(const char*, ...); int main() { char *s = \"int printf(const char*, ...); int main() { char *s = %c%s%c; printf(s, 34, s, 34); return 0; }\"; printf(s, 34, s, 34); return 0; }'"
|
||||||
|
|
||||||
# create our quine
|
# create our quine
|
||||||
create:
|
create:
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
echo 'int printf(const char*, ...); int main() { char *s = "int printf(const char*, ...); int main() { char *s = %c%s%c; printf(s, 34, s, 34); return 0; }"; printf(s, 34, s, 34); return 0; }' > tmp/gen0.c
|
echo {{quine-text}} > tmp/gen0.c
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
clean:
|
clean:
|
||||||
|
@ -21,7 +21,7 @@ macro_rules! die {
|
|||||||
|
|
||||||
pub fn app() {
|
pub fn app() {
|
||||||
let matches = App::new("j")
|
let matches = App::new("j")
|
||||||
.version("0.2.3")
|
.version("0.2.4")
|
||||||
.author("Casey R. <casey@rodarmor.com>")
|
.author("Casey R. <casey@rodarmor.com>")
|
||||||
.about("Just a command runner - https://github.com/casey/j")
|
.about("Just a command runner - https://github.com/casey/j")
|
||||||
.arg(Arg::with_name("list")
|
.arg(Arg::with_name("list")
|
||||||
|
@ -959,7 +959,6 @@ fn tokenize(text: &str) -> Result<Vec<Token>, Error> {
|
|||||||
if escape || content_end >= rest.len() {
|
if escape || content_end >= rest.len() {
|
||||||
return error!(ErrorKind::UnterminatedString);
|
return error!(ErrorKind::UnterminatedString);
|
||||||
}
|
}
|
||||||
println!("{} {} {:?}", start, content_end, contents.chars().collect::<Vec<_>>());
|
|
||||||
(prefix, &rest[start..content_end + 1], StringToken)
|
(prefix, &rest[start..content_end + 1], StringToken)
|
||||||
} else if rest.starts_with("#!") {
|
} else if rest.starts_with("#!") {
|
||||||
return error!(ErrorKind::OuterShebang)
|
return error!(ErrorKind::OuterShebang)
|
||||||
|
Loading…
Reference in New Issue
Block a user