Skip to content

Commit

Permalink
Merge pull request #67 from gwenn/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
gwenn committed Aug 25, 2024
2 parents d98b3f2 + 836162a commit 376a5c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/simple.y
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Context {
#[derive(Debug)]
pub enum Operator {
Add,
Substract,
Subtract,
Multiply,
Divide,
}
Expand Down Expand Up @@ -115,7 +115,7 @@ fn init_logger() -> Result<(), SetLoggerError> {
program ::= expr(A). { self.ctx.expr = Some(A); }

%type expr { Expr }
expr(A) ::= expr(B) MINUS expr(C). { A = Expr::binary(Operator::Substract, B, C); }
expr(A) ::= expr(B) MINUS expr(C). { A = Expr::binary(Operator::Subtract, B, C); }
expr(A) ::= expr(B) PLUS expr(C). { A = Expr::binary(Operator::Add, B, C); }
expr(A) ::= expr(B) TIMES expr(C). { A = Expr::binary(Operator::Multiply, B, C); }
expr(A) ::= expr(B) DIVIDE expr(C). { A = Expr::binary(Operator::Divide, B, C); }
Expand Down
2 changes: 1 addition & 1 deletion src/parser/ast/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ impl ToTokens for Operator {
Self::NotEquals => s.append(TK_NE, None),
Self::Or => s.append(TK_OR, None),
Self::RightShift => s.append(TK_RSHIFT, None),
Self::Substract => s.append(TK_MINUS, None),
Self::Subtract => s.append(TK_MINUS, None),
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/parser/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub enum Stmt {
tbl_name: QualifiedName,
/// `INDEXED`
indexed: Option<Indexed>,
/// `SET` assigments
/// `SET` assignments
sets: Vec<Set>,
/// `FROM`
from: Option<FromClause>,
Expand Down Expand Up @@ -603,7 +603,7 @@ pub enum Operator {
/// `>>`
RightShift,
/// `-`
Substract,
Subtract,
}

impl From<YYCODETYPE> for Operator {
Expand All @@ -622,7 +622,7 @@ impl From<YYCODETYPE> for Operator {
x if x == TK_LSHIFT as YYCODETYPE => Self::LeftShift,
x if x == TK_RSHIFT as YYCODETYPE => Self::RightShift,
x if x == TK_PLUS as YYCODETYPE => Self::Add,
x if x == TK_MINUS as YYCODETYPE => Self::Substract,
x if x == TK_MINUS as YYCODETYPE => Self::Subtract,
x if x == TK_STAR as YYCODETYPE => Self::Multiply,
x if x == TK_SLASH as YYCODETYPE => Self::Divide,
x if x == TK_REM as YYCODETYPE => Self::Modulus,
Expand Down Expand Up @@ -1583,7 +1583,7 @@ pub enum TriggerCmd {
or_conflict: Option<ResolveType>,
/// table name
tbl_name: Name,
/// `SET` assigments
/// `SET` assignments
sets: Vec<Set>,
/// `FROM`
from: Option<FromClause>,
Expand Down Expand Up @@ -1758,7 +1758,7 @@ pub struct FunctionTail {
// https://sqlite.org/syntax/over-clause.html
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Over {
/// Window defintion
/// Window definition
Window(Window),
/// Window name
Name(Name),
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ columnname(A) ::= nm(X) typetoken(Y). {A = (X, Y);}
//
%token_class id ID|INDEXED.

// And "ids" is an identifer-or-string.
// And "ids" is an identifier-or-string.
//
%token_class ids ID|STRING.

Expand Down Expand Up @@ -663,7 +663,7 @@ joinop(X) ::= JOIN_KW(A) nm(B) JOIN.
joinop(X) ::= JOIN_KW(A) nm(B) nm(C) JOIN.
{X = JoinOperator::from(A, Some(B), Some(C))?;/*X-overwrites-A*/}

// There is a parsing abiguity in an upsert statement that uses a
// There is a parsing ambiguity in an upsert statement that uses a
// SELECT on the RHS of a the INSERT:
//
// INSERT INTO tab SELECT * FROM aaa JOIN bbb ON CONFLICT ...
Expand Down
2 changes: 1 addition & 1 deletion third_party/lemon/lempar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
Expand Down

0 comments on commit 376a5c1

Please sign in to comment.