Fix a bunch of typos (#1204)
This commit is contained in:
parent
95de4eb1f8
commit
c87909c220
@ -627,7 +627,7 @@ Changelog
|
|||||||
- Avoid fs::canonicalize (#539)
|
- Avoid fs::canonicalize (#539)
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
- Mention `set shell` as altenative to installing `sh` (#533)
|
- Mention `set shell` as alternative to installing `sh` (#533)
|
||||||
- Refactor Compilation error to contain a Token (#535)
|
- Refactor Compilation error to contain a Token (#535)
|
||||||
- Move lexer comment (#536)
|
- Move lexer comment (#536)
|
||||||
- Add missing `--init` test (#543)
|
- Add missing `--init` test (#543)
|
||||||
|
2
justfile
2
justfile
@ -33,7 +33,7 @@ build:
|
|||||||
fmt:
|
fmt:
|
||||||
cargo fmt --all
|
cargo fmt --all
|
||||||
|
|
||||||
watch +COMMAND='ltest':
|
watch +COMMAND='test':
|
||||||
cargo watch --clear --exec "{{COMMAND}}"
|
cargo watch --clear --exec "{{COMMAND}}"
|
||||||
|
|
||||||
man:
|
man:
|
||||||
|
@ -295,7 +295,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
analysis_error! {
|
analysis_error! {
|
||||||
name: parameter_shadows_varible,
|
name: parameter_shadows_variable,
|
||||||
input: "foo := \"h\"\na foo:",
|
input: "foo := \"h\"\na foo:",
|
||||||
offset: 13,
|
offset: 13,
|
||||||
line: 1,
|
line: 1,
|
||||||
|
@ -101,7 +101,7 @@ impl<'src: 'run, 'run> AssignmentResolver<'src, 'run> {
|
|||||||
self.resolve_expression(c)
|
self.resolve_expression(c)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Expression::Concatination { lhs, rhs } => {
|
Expression::Concatenation { lhs, rhs } => {
|
||||||
self.resolve_expression(lhs)?;
|
self.resolve_expression(lhs)?;
|
||||||
self.resolve_expression(rhs)
|
self.resolve_expression(rhs)
|
||||||
}
|
}
|
||||||
|
@ -665,7 +665,7 @@ mod tests {
|
|||||||
let app = Config::app();
|
let app = Config::app();
|
||||||
let matches = app
|
let matches = app
|
||||||
.get_matches_from_safe(arguments)
|
.get_matches_from_safe(arguments)
|
||||||
.expect("agument parsing failed");
|
.expect("argument parsing failed");
|
||||||
let have = Config::from_matches(&matches).expect("config parsing failed");
|
let have = Config::from_matches(&matches).expect("config parsing failed");
|
||||||
assert_eq!(have, want);
|
assert_eq!(have, want);
|
||||||
}
|
}
|
||||||
@ -702,7 +702,7 @@ mod tests {
|
|||||||
|
|
||||||
let app = Config::app();
|
let app = Config::app();
|
||||||
|
|
||||||
let matches = app.get_matches_from_safe(arguments).expect("Matching failes");
|
let matches = app.get_matches_from_safe(arguments).expect("Matching fails");
|
||||||
|
|
||||||
match Config::from_matches(&matches).expect_err("config parsing succeeded") {
|
match Config::from_matches(&matches).expect_err("config parsing succeeded") {
|
||||||
$error => { $($check)? }
|
$error => { $($check)? }
|
||||||
|
@ -150,7 +150,7 @@ impl<'src, 'run> Evaluator<'src, 'run> {
|
|||||||
Ok(self.run_backtick(contents, token)?)
|
Ok(self.run_backtick(contents, token)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Expression::Concatination { lhs, rhs } => {
|
Expression::Concatenation { lhs, rhs } => {
|
||||||
Ok(self.evaluate_expression(lhs)? + &self.evaluate_expression(rhs)?)
|
Ok(self.evaluate_expression(lhs)? + &self.evaluate_expression(rhs)?)
|
||||||
}
|
}
|
||||||
Expression::Conditional {
|
Expression::Conditional {
|
||||||
|
@ -16,7 +16,7 @@ pub(crate) enum Expression<'src> {
|
|||||||
/// `name(arguments)`
|
/// `name(arguments)`
|
||||||
Call { thunk: Thunk<'src> },
|
Call { thunk: Thunk<'src> },
|
||||||
/// `lhs + rhs`
|
/// `lhs + rhs`
|
||||||
Concatination {
|
Concatenation {
|
||||||
lhs: Box<Expression<'src>>,
|
lhs: Box<Expression<'src>>,
|
||||||
rhs: Box<Expression<'src>>,
|
rhs: Box<Expression<'src>>,
|
||||||
},
|
},
|
||||||
@ -46,7 +46,7 @@ impl<'src> Display for Expression<'src> {
|
|||||||
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
|
||||||
match self {
|
match self {
|
||||||
Expression::Backtick { token, .. } => write!(f, "{}", token.lexeme()),
|
Expression::Backtick { token, .. } => write!(f, "{}", token.lexeme()),
|
||||||
Expression::Concatination { lhs, rhs } => write!(f, "{} + {}", lhs, rhs),
|
Expression::Concatenation { lhs, rhs } => write!(f, "{} + {}", lhs, rhs),
|
||||||
Expression::Conditional {
|
Expression::Conditional {
|
||||||
lhs,
|
lhs,
|
||||||
rhs,
|
rhs,
|
||||||
@ -79,7 +79,7 @@ impl<'src> Serialize for Expression<'src> {
|
|||||||
seq.end()
|
seq.end()
|
||||||
}
|
}
|
||||||
Self::Call { thunk } => thunk.serialize(serializer),
|
Self::Call { thunk } => thunk.serialize(serializer),
|
||||||
Self::Concatination { lhs, rhs } => {
|
Self::Concatenation { lhs, rhs } => {
|
||||||
let mut seq = serializer.serialize_seq(None)?;
|
let mut seq = serializer.serialize_seq(None)?;
|
||||||
seq.serialize_element("concatinate")?;
|
seq.serialize_element("concatinate")?;
|
||||||
seq.serialize_element(lhs)?;
|
seq.serialize_element(lhs)?;
|
||||||
|
@ -970,7 +970,7 @@ f x=`echo hello`:
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
parameter_default_concatination_string,
|
parameter_default_concatenation_string,
|
||||||
r#"
|
r#"
|
||||||
f x=(`echo hello` + "foo"):
|
f x=(`echo hello` + "foo"):
|
||||||
"#,
|
"#,
|
||||||
@ -978,7 +978,7 @@ f x=(`echo hello` + "foo"):
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
parameter_default_concatination_variable,
|
parameter_default_concatenation_variable,
|
||||||
r#"
|
r#"
|
||||||
x := "10"
|
x := "10"
|
||||||
f y=(`echo hello` + x) +z="foo":
|
f y=(`echo hello` + x) +z="foo":
|
||||||
@ -1000,7 +1000,7 @@ f y=(`echo hello` + x) +z=("foo" + "bar"):"#,
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
concatination_in_group,
|
concatenation_in_group,
|
||||||
"x := ('0' + '1')",
|
"x := ('0' + '1')",
|
||||||
"x := ('0' + '1')",
|
"x := ('0' + '1')",
|
||||||
}
|
}
|
||||||
|
@ -1107,7 +1107,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: export_concatination,
|
name: export_concatenation,
|
||||||
text: "export foo = 'foo' + 'bar'",
|
text: "export foo = 'foo' + 'bar'",
|
||||||
tokens: (
|
tokens: (
|
||||||
Identifier:"export",
|
Identifier:"export",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::common::*;
|
use crate::common::*;
|
||||||
|
|
||||||
/// Methods commmon to all AST nodes. Currently only used in parser unit tests.
|
/// Methods common to all AST nodes. Currently only used in parser unit tests.
|
||||||
pub(crate) trait Node<'src> {
|
pub(crate) trait Node<'src> {
|
||||||
/// Construct an untyped tree of atoms representing this Node. This function,
|
/// Construct an untyped tree of atoms representing this Node. This function,
|
||||||
/// and `Tree` type, are only used in parser unit tests.
|
/// and `Tree` type, are only used in parser unit tests.
|
||||||
@ -52,7 +52,7 @@ impl<'src> Node<'src> for Assignment<'src> {
|
|||||||
impl<'src> Node<'src> for Expression<'src> {
|
impl<'src> Node<'src> for Expression<'src> {
|
||||||
fn tree(&self) -> Tree<'src> {
|
fn tree(&self) -> Tree<'src> {
|
||||||
match self {
|
match self {
|
||||||
Expression::Concatination { lhs, rhs } => Tree::atom("+").push(lhs.tree()).push(rhs.tree()),
|
Expression::Concatenation { lhs, rhs } => Tree::atom("+").push(lhs.tree()).push(rhs.tree()),
|
||||||
Expression::Conditional {
|
Expression::Conditional {
|
||||||
lhs,
|
lhs,
|
||||||
rhs,
|
rhs,
|
||||||
|
@ -40,7 +40,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> {
|
|||||||
Self::new(tokens).parse_ast()
|
Self::new(tokens).parse_ast()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Construct a new Paser from a token stream
|
/// Construct a new Parser from a token stream
|
||||||
fn new(tokens: &'tokens [Token<'src>]) -> Parser<'tokens, 'src> {
|
fn new(tokens: &'tokens [Token<'src>]) -> Parser<'tokens, 'src> {
|
||||||
Parser {
|
Parser {
|
||||||
next: 0,
|
next: 0,
|
||||||
@ -399,7 +399,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> {
|
|||||||
if self.accepted(Plus)? {
|
if self.accepted(Plus)? {
|
||||||
let lhs = Box::new(value);
|
let lhs = Box::new(value);
|
||||||
let rhs = Box::new(self.parse_expression()?);
|
let rhs = Box::new(self.parse_expression()?);
|
||||||
Ok(Expression::Concatination { lhs, rhs })
|
Ok(Expression::Concatenation { lhs, rhs })
|
||||||
} else {
|
} else {
|
||||||
Ok(value)
|
Ok(value)
|
||||||
}
|
}
|
||||||
@ -1107,7 +1107,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: recipe_dependency_argument_concatination,
|
name: recipe_dependency_argument_concatenation,
|
||||||
text: "foo: (bar 'a' + 'b' 'c' + 'd')",
|
text: "foo: (bar 'a' + 'b' 'c' + 'd')",
|
||||||
tree: (justfile (recipe foo (deps (bar (+ 'a' 'b') (+ 'c' 'd'))))),
|
tree: (justfile (recipe foo (deps (bar (+ 'a' 'b') (+ 'c' 'd'))))),
|
||||||
}
|
}
|
||||||
@ -1341,7 +1341,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: parameter_default_concatination_variable,
|
name: parameter_default_concatenation_variable,
|
||||||
text: r#"
|
text: r#"
|
||||||
x := "10"
|
x := "10"
|
||||||
|
|
||||||
@ -1636,7 +1636,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: parameter_default_concatination_string,
|
name: parameter_default_concatenation_string,
|
||||||
text: r#"
|
text: r#"
|
||||||
f x=(`echo hello` + "foo"):
|
f x=(`echo hello` + "foo"):
|
||||||
"#,
|
"#,
|
||||||
@ -1644,7 +1644,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: concatination_in_group,
|
name: concatenation_in_group,
|
||||||
text: "x := ('0' + '1')",
|
text: "x := ('0' + '1')",
|
||||||
tree: (justfile (assignment x ((+ "0" "1")))),
|
tree: (justfile (assignment x ((+ "0" "1")))),
|
||||||
}
|
}
|
||||||
@ -1823,7 +1823,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: conditional_concatinations,
|
name: conditional_concatenations,
|
||||||
text: "a := if b0 + b1 == c0 + c1 { d0 + d1 } else { e0 + e1 }",
|
text: "a := if b0 + b1 == c0 + c1 { d0 + d1 } else { e0 + e1 }",
|
||||||
tree: (justfile (assignment a (if (+ b0 b1) == (+ c0 c1) (+ d0 d1) (+ e0 e1)))),
|
tree: (justfile (assignment a (if (+ b0 b1) == (+ c0 c1) (+ d0 d1) (+ e0 e1)))),
|
||||||
}
|
}
|
||||||
@ -2039,7 +2039,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
error! {
|
error! {
|
||||||
name: concatination_in_default,
|
name: concatenation_in_default,
|
||||||
input: "foo a=c+d e:",
|
input: "foo a=c+d e:",
|
||||||
offset: 10,
|
offset: 10,
|
||||||
line: 0,
|
line: 0,
|
||||||
|
@ -185,7 +185,7 @@ pub enum Expression {
|
|||||||
name: String,
|
name: String,
|
||||||
arguments: Vec<Expression>,
|
arguments: Vec<Expression>,
|
||||||
},
|
},
|
||||||
Concatination {
|
Concatenation {
|
||||||
lhs: Box<Expression>,
|
lhs: Box<Expression>,
|
||||||
rhs: Box<Expression>,
|
rhs: Box<Expression>,
|
||||||
},
|
},
|
||||||
@ -249,7 +249,7 @@ impl Expression {
|
|||||||
arguments: vec![Expression::new(a), Expression::new(b), Expression::new(c)],
|
arguments: vec![Expression::new(a), Expression::new(b), Expression::new(c)],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Concatination { lhs, rhs } => Expression::Concatination {
|
Concatenation { lhs, rhs } => Expression::Concatenation {
|
||||||
lhs: Box::new(Expression::new(lhs)),
|
lhs: Box::new(Expression::new(lhs)),
|
||||||
rhs: Box::new(Expression::new(rhs)),
|
rhs: Box::new(Expression::new(rhs)),
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,7 @@ impl<'expression, 'src> Iterator for Variables<'expression, 'src> {
|
|||||||
self.stack.push(lhs);
|
self.stack.push(lhs);
|
||||||
}
|
}
|
||||||
Expression::Variable { name, .. } => return Some(name.token()),
|
Expression::Variable { name, .. } => return Some(name.token()),
|
||||||
Expression::Concatination { lhs, rhs } => {
|
Expression::Concatenation { lhs, rhs } => {
|
||||||
self.stack.push(rhs);
|
self.stack.push(rhs);
|
||||||
self.stack.push(lhs);
|
self.stack.push(lhs);
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@ pub(crate) enum Verbosity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Verbosity {
|
impl Verbosity {
|
||||||
pub(crate) fn from_flag_occurrences(flag_occurences: u64) -> Self {
|
pub(crate) fn from_flag_occurrences(flag_occurrences: u64) -> Self {
|
||||||
match flag_occurences {
|
match flag_occurrences {
|
||||||
0 => Taciturn,
|
0 => Taciturn,
|
||||||
1 => Loquacious,
|
1 => Loquacious,
|
||||||
_ => Grandiloquent,
|
_ => Grandiloquent,
|
||||||
|
@ -917,7 +917,7 @@ test! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: group_recipies,
|
name: group_recipes,
|
||||||
justfile: "
|
justfile: "
|
||||||
foo:
|
foo:
|
||||||
echo foo
|
echo foo
|
||||||
|
@ -1680,7 +1680,7 @@ foo x='bar':
|
|||||||
}
|
}
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: default_concatination,
|
name: default_concatenation,
|
||||||
justfile: "
|
justfile: "
|
||||||
foo x=(`echo foo` + 'bar'):
|
foo x=(`echo foo` + 'bar'):
|
||||||
echo {{x}}
|
echo {{x}}
|
||||||
|
Loading…
Reference in New Issue
Block a user