Skip to content

Commit

Permalink
Fix a bunch of typos (casey#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored May 29, 2022
1 parent 95de4eb commit c87909c
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ build:
fmt:
cargo fmt --all

watch +COMMAND='ltest':
watch +COMMAND='test':
cargo watch --clear --exec "{{COMMAND}}"

man:
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/assignment_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)? }
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>,
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)?;
Expand Down
6 changes: 3 additions & 3 deletions src/justfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,15 +970,15 @@ f x=`echo hello`:
}

test! {
parameter_default_concatination_string,
parameter_default_concatenation_string,
r#"
f x=(`echo hello` + "foo"):
"#,
r#"f x=(`echo hello` + "foo"):"#,
}

test! {
parameter_default_concatination_variable,
parameter_default_concatenation_variable,
r#"
x := "10"
f y=(`echo hello` + x) +z="foo":
Expand All @@ -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')",
}
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ mod tests {
}

test! {
name: export_concatination,
name: export_concatenation,
text: "export foo = 'foo' + 'bar'",
tokens: (
Identifier:"export",
Expand Down
4 changes: 2 additions & 2 deletions src/node.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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'))))),
}
Expand Down Expand Up @@ -1341,7 +1341,7 @@ mod tests {
}

test! {
name: parameter_default_concatination_variable,
name: parameter_default_concatenation_variable,
text: r#"
x := "10"
Expand Down Expand Up @@ -1636,15 +1636,15 @@ mod tests {
}

test! {
name: parameter_default_concatination_string,
name: parameter_default_concatenation_string,
text: r#"
f x=(`echo hello` + "foo"):
"#,
tree: (justfile (recipe f (params (x ((+ (backtick "echo hello") "foo")))))),
}

test! {
name: concatination_in_group,
name: concatenation_in_group,
text: "x := ('0' + '1')",
tree: (justfile (assignment x ((+ "0" "1")))),
}
Expand Down Expand Up @@ -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)))),
}
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub enum Expression {
name: String,
arguments: Vec<Expression>,
},
Concatination {
Concatenation {
lhs: Box<Expression>,
rhs: Box<Expression>,
},
Expand Down Expand Up @@ -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)),
},
Expand Down
2 changes: 1 addition & 1 deletion src/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/verbosity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ test! {
}

test! {
name: group_recipies,
name: group_recipes,
justfile: "
foo:
echo foo
Expand Down
2 changes: 1 addition & 1 deletion tests/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ foo x='bar':
}

test! {
name: default_concatination,
name: default_concatenation,
justfile: "
foo x=(`echo foo` + 'bar'):
echo {{x}}
Expand Down

0 comments on commit c87909c

Please sign in to comment.