Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xring committed Apr 6, 2024
1 parent e1dc41b commit bff6282
Show file tree
Hide file tree
Showing 12 changed files with 231 additions and 231 deletions.
10 changes: 5 additions & 5 deletions src/common/key_part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ use base::error::ParseSQLError;
use common::OrderType;
use common::{sql_identifier, ws_sep_comma};

/// key_part: {col_name [(length)] | (expr)} [ASC | DESC]
/// key_part: {col_name \[(length)] | (expr)} \[ASC | DESC]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct KeyPart {
r#type: KeyPartType,
order: Option<OrderType>,
}

impl KeyPart {
/// key_part: {col_name [(length)] | (expr)} [ASC | DESC]
/// key_part: {col_name \[(length)] | (expr)} \[ASC | DESC]
fn parse(i: &str) -> IResult<&str, KeyPart, ParseSQLError<&str>> {
map(
tuple((
Expand All @@ -33,7 +33,7 @@ impl KeyPart {
}

/// (key_part,...)
/// key_part: {col_name [(length)] | (expr)} [ASC | DESC]
/// key_part: {col_name \[(length)] | (expr)} \[ASC | DESC]
pub fn key_part_list(i: &str) -> IResult<&str, Vec<KeyPart>, ParseSQLError<&str>> {
map(
tuple((
Expand All @@ -53,7 +53,7 @@ impl KeyPart {
}
}

/// {col_name [(length)] | (expr)}
/// {col_name \[(length)] | (expr)}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum KeyPartType {
ColumnNameWithLength {
Expand All @@ -66,7 +66,7 @@ pub enum KeyPartType {
}

impl KeyPartType {
/// {col_name [(length)] | (expr)}
/// {col_name \[(length)] | (expr)}
fn parse(i: &str) -> IResult<&str, KeyPartType, ParseSQLError<&str>> {
// {col_name [(length)]
let col_name_with_length = tuple((
Expand Down
6 changes: 3 additions & 3 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl IndexOrKeyType {
}
}

/// [CONSTRAINT [symbol]] CHECK (expr) [[NOT] ENFORCED]
/// \[CONSTRAINT \[symbol]] CHECK (expr) \[\[NOT] ENFORCED]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct CheckConstraintDefinition {
pub symbol: Option<String>,
Expand Down Expand Up @@ -368,7 +368,7 @@ impl IndexType {
)(i)
}

/// [index_type]
/// \[index_type]
/// USING {BTREE | HASH}
pub fn opt_index_type(i: &str) -> IResult<&str, Option<IndexType>, ParseSQLError<&str>> {
opt(map(
Expand All @@ -388,7 +388,7 @@ impl fmt::Display for IndexType {
}
}

/// [index_name]
/// \[index_name]
pub fn opt_index_name(i: &str) -> IResult<&str, Option<String>, ParseSQLError<&str>> {
opt(map(
delimited(multispace1, sql_identifier, multispace0),
Expand Down
2 changes: 1 addition & 1 deletion src/common/reference_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl ReferenceDefinition {
/// REFERENCES tbl_name (key_part,...)
/// [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]
/// [ON DELETE reference_option]
/// [ON UPDATE reference_option]
/// \[ON UPDATE reference_option]
pub fn parse(i: &str) -> IResult<&str, ReferenceDefinition, ParseSQLError<&str>> {
let opt_on_delete = opt(map(
tuple((
Expand Down
Loading

0 comments on commit bff6282

Please sign in to comment.