limbo_sqlite3_parser/parser/ast/
unaryoperator_traits.rs1use crate::dialect::TokenType::*;
12use crate::parser::parse::YYCODETYPE;
13
14use super::types_10::UnaryOperator;
15
16impl From<YYCODETYPE> for UnaryOperator {
17 fn from(token_type: YYCODETYPE) -> Self {
18 match token_type {
19 x if x == TK_BITNOT as YYCODETYPE => Self::BitwiseNot,
20 x if x == TK_MINUS as YYCODETYPE => Self::Negative,
21 x if x == TK_NOT as YYCODETYPE => Self::Not,
22 x if x == TK_PLUS as YYCODETYPE => Self::Positive,
23 _ => unreachable!(),
24 }
25 }
26}