Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #67

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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