Fix a bunch of typos (#1204)
This commit is contained in:
parent
95de4eb1f8
commit
c87909c220
@ -627,7 +627,7 @@ Changelog
|
||||
- Avoid fs::canonicalize (#539)
|
||||
|
||||
### 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)
|
||||
- Move lexer comment (#536)
|
||||
- Add missing `--init` test (#543)
|
||||
|
2
justfile
2
justfile
@ -33,7 +33,7 @@ build:
|
||||
fmt:
|
||||
cargo fmt --all
|
||||
|
||||
watch +COMMAND='ltest':
|
||||
watch +COMMAND='test':
|
||||
cargo watch --clear --exec "{{COMMAND}}"
|
||||
|
||||
man:
|
||||
|
@ -295,7 +295,7 @@ mod tests {
|
||||
}
|
||||
|
||||
analysis_error! {
|
||||
name: parameter_shadows_varible,
|
||||
name: parameter_shadows_variable,
|
||||
input: "foo := \"h\"\na foo:",
|
||||
offset: 13,
|
||||
line: 1,
|
||||
|
@ -101,7 +101,7 @@ impl<'src: 'run, 'run> AssignmentResolver<'src, 'run> {
|
||||
self.resolve_expression(c)
|
||||
}
|
||||
},
|
||||
Expression::Concatination { lhs, rhs } => {
|
||||
Expression::Concatenation { lhs, rhs } => {
|
||||
self.resolve_expression(lhs)?;
|
||||
self.resolve_expression(rhs)
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ mod tests {
|
||||
let app = Config::app();
|
||||
let matches = app
|
||||
.get_matches_from_safe(arguments)
|
||||
.expect("agument parsing failed");
|
||||
.expect("argument parsing failed");
|
||||
let have = Config::from_matches(&matches).expect("config parsing failed");
|
||||
assert_eq!(have, want);
|
||||
}
|
||||
@ -702,7 +702,7 @@ mod tests {
|
||||
|
||||
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") {
|
||||
$error => { $($check)? }
|
||||
|
@ -150,7 +150,7 @@ impl<'src, 'run> Evaluator<'src, 'run> {
|
||||
Ok(self.run_backtick(contents, token)?)
|
||||
}
|
||||
}
|
||||
Expression::Concatination { lhs, rhs } => {
|
||||
Expression::Concatenation { lhs, rhs } => {
|
||||
Ok(self.evaluate_expression(lhs)? + &self.evaluate_expression(rhs)?)
|
||||
}
|
||||
Expression::Conditional {
|
||||
|
@ -16,7 +16,7 @@ pub(crate) enum Expression<'src> {
|
||||
/// `name(arguments)`
|
||||
Call { thunk: Thunk<'src> },
|
||||
/// `lhs + rhs`
|
||||
Concatination {
|
||||
Concatenation {
|
||||
lhs: 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> {
|
||||
match self {
|
||||
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 {
|
||||
lhs,
|
||||
rhs,
|
||||
@ -79,7 +79,7 @@ impl<'src> Serialize for Expression<'src> {
|
||||
seq.end()
|
||||
}
|
||||
Self::Call { thunk } => thunk.serialize(serializer),
|
||||
Self::Concatination { lhs, rhs } => {
|
||||
Self::Concatenation { lhs, rhs } => {
|
||||
let mut seq = serializer.serialize_seq(None)?;
|
||||
seq.serialize_element("concatinate")?;
|
||||
seq.serialize_element(lhs)?;
|
||||
|
@ -970,7 +970,7 @@ f x=`echo hello`:
|
||||
}
|
||||
|
||||
test! {
|
||||
parameter_default_concatination_string,
|
||||
parameter_default_concatenation_string,
|
||||
r#"
|
||||
f x=(`echo hello` + "foo"):
|
||||
"#,
|
||||
@ -978,7 +978,7 @@ f x=(`echo hello` + "foo"):
|
||||
}
|
||||
|
||||
test! {
|
||||
parameter_default_concatination_variable,
|
||||
parameter_default_concatenation_variable,
|
||||
r#"
|
||||
x := "10"
|
||||
f y=(`echo hello` + x) +z="foo":
|
||||
@ -1000,7 +1000,7 @@ f y=(`echo hello` + x) +z=("foo" + "bar"):"#,
|
||||
}
|
||||
|
||||
test! {
|
||||
concatination_in_group,
|
||||
concatenation_in_group,
|
||||
"x := ('0' + '1')",
|
||||
"x := ('0' + '1')",
|
||||
}
|
||||
|
@ -1107,7 +1107,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: export_concatination,
|
||||
name: export_concatenation,
|
||||
text: "export foo = 'foo' + 'bar'",
|
||||
tokens: (
|
||||
Identifier:"export",
|
||||
|
@ -1,6 +1,6 @@
|
||||
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> {
|
||||
/// Construct an untyped tree of atoms representing this Node. This function,
|
||||
/// 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> {
|
||||
fn tree(&self) -> Tree<'src> {
|
||||
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 {
|
||||
lhs,
|
||||
rhs,
|
||||
|
@ -40,7 +40,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> {
|
||||
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> {
|
||||
Parser {
|
||||
next: 0,
|
||||
@ -399,7 +399,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> {
|
||||
if self.accepted(Plus)? {
|
||||
let lhs = Box::new(value);
|
||||
let rhs = Box::new(self.parse_expression()?);
|
||||
Ok(Expression::Concatination { lhs, rhs })
|
||||
Ok(Expression::Concatenation { lhs, rhs })
|
||||
} else {
|
||||
Ok(value)
|
||||
}
|
||||
@ -1107,7 +1107,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: recipe_dependency_argument_concatination,
|
||||
name: recipe_dependency_argument_concatenation,
|
||||
text: "foo: (bar 'a' + 'b' 'c' + 'd')",
|
||||
tree: (justfile (recipe foo (deps (bar (+ 'a' 'b') (+ 'c' 'd'))))),
|
||||
}
|
||||
@ -1341,7 +1341,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: parameter_default_concatination_variable,
|
||||
name: parameter_default_concatenation_variable,
|
||||
text: r#"
|
||||
x := "10"
|
||||
|
||||
@ -1636,7 +1636,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: parameter_default_concatination_string,
|
||||
name: parameter_default_concatenation_string,
|
||||
text: r#"
|
||||
f x=(`echo hello` + "foo"):
|
||||
"#,
|
||||
@ -1644,7 +1644,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: concatination_in_group,
|
||||
name: concatenation_in_group,
|
||||
text: "x := ('0' + '1')",
|
||||
tree: (justfile (assignment x ((+ "0" "1")))),
|
||||
}
|
||||
@ -1823,7 +1823,7 @@ mod tests {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: conditional_concatinations,
|
||||
name: conditional_concatenations,
|
||||
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)))),
|
||||
}
|
||||
@ -2039,7 +2039,7 @@ mod tests {
|
||||
}
|
||||
|
||||
error! {
|
||||
name: concatination_in_default,
|
||||
name: concatenation_in_default,
|
||||
input: "foo a=c+d e:",
|
||||
offset: 10,
|
||||
line: 0,
|
||||
|
@ -185,7 +185,7 @@ pub enum Expression {
|
||||
name: String,
|
||||
arguments: Vec<Expression>,
|
||||
},
|
||||
Concatination {
|
||||
Concatenation {
|
||||
lhs: Box<Expression>,
|
||||
rhs: Box<Expression>,
|
||||
},
|
||||
@ -249,7 +249,7 @@ impl Expression {
|
||||
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)),
|
||||
rhs: Box::new(Expression::new(rhs)),
|
||||
},
|
||||
|
@ -53,7 +53,7 @@ impl<'expression, 'src> Iterator for Variables<'expression, 'src> {
|
||||
self.stack.push(lhs);
|
||||
}
|
||||
Expression::Variable { name, .. } => return Some(name.token()),
|
||||
Expression::Concatination { lhs, rhs } => {
|
||||
Expression::Concatenation { lhs, rhs } => {
|
||||
self.stack.push(rhs);
|
||||
self.stack.push(lhs);
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ pub(crate) enum Verbosity {
|
||||
}
|
||||
|
||||
impl Verbosity {
|
||||
pub(crate) fn from_flag_occurrences(flag_occurences: u64) -> Self {
|
||||
match flag_occurences {
|
||||
pub(crate) fn from_flag_occurrences(flag_occurrences: u64) -> Self {
|
||||
match flag_occurrences {
|
||||
0 => Taciturn,
|
||||
1 => Loquacious,
|
||||
_ => Grandiloquent,
|
||||
|
@ -917,7 +917,7 @@ test! {
|
||||
}
|
||||
|
||||
test! {
|
||||
name: group_recipies,
|
||||
name: group_recipes,
|
||||
justfile: "
|
||||
foo:
|
||||
echo foo
|
||||
|
@ -1680,7 +1680,7 @@ foo x='bar':
|
||||
}
|
||||
|
||||
test! {
|
||||
name: default_concatination,
|
||||
name: default_concatenation,
|
||||
justfile: "
|
||||
foo x=(`echo foo` + 'bar'):
|
||||
echo {{x}}
|
||||
|
Loading…
Reference in New Issue
Block a user