surrealpatch/core/src/sql/v2/tokenizer.rs

26 lines
561 B
Rust
Raw Normal View History

use revision::revisioned;
2023-05-10 02:08:09 +00:00
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fmt::Display;
2023-08-18 22:51:56 +00:00
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
2024-01-09 15:34:52 +00:00
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
2023-05-10 02:08:09 +00:00
pub enum Tokenizer {
Blank,
Camel,
Class,
Punct,
2023-05-10 02:08:09 +00:00
}
impl Display for Tokenizer {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(match self {
Self::Blank => "BLANK",
Self::Camel => "CAMEL",
Self::Class => "CLASS",
Self::Punct => "PUNCT",
2023-05-10 02:08:09 +00:00
})
}
}