Skip to content

Commit bff6282

Browse files
committed
fix doc
1 parent e1dc41b commit bff6282

12 files changed

+231
-231
lines changed

src/common/key_part.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ use base::error::ParseSQLError;
1010
use common::OrderType;
1111
use common::{sql_identifier, ws_sep_comma};
1212

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

2020
impl KeyPart {
21-
/// key_part: {col_name [(length)] | (expr)} [ASC | DESC]
21+
/// key_part: {col_name \[(length)] | (expr)} \[ASC | DESC]
2222
fn parse(i: &str) -> IResult<&str, KeyPart, ParseSQLError<&str>> {
2323
map(
2424
tuple((
@@ -33,7 +33,7 @@ impl KeyPart {
3333
}
3434

3535
/// (key_part,...)
36-
/// key_part: {col_name [(length)] | (expr)} [ASC | DESC]
36+
/// key_part: {col_name \[(length)] | (expr)} \[ASC | DESC]
3737
pub fn key_part_list(i: &str) -> IResult<&str, Vec<KeyPart>, ParseSQLError<&str>> {
3838
map(
3939
tuple((
@@ -53,7 +53,7 @@ impl KeyPart {
5353
}
5454
}
5555

56-
/// {col_name [(length)] | (expr)}
56+
/// {col_name \[(length)] | (expr)}
5757
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
5858
pub enum KeyPartType {
5959
ColumnNameWithLength {
@@ -66,7 +66,7 @@ pub enum KeyPartType {
6666
}
6767

6868
impl KeyPartType {
69-
/// {col_name [(length)] | (expr)}
69+
/// {col_name \[(length)] | (expr)}
7070
fn parse(i: &str) -> IResult<&str, KeyPartType, ParseSQLError<&str>> {
7171
// {col_name [(length)]
7272
let col_name_with_length = tuple((

src/common/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl IndexOrKeyType {
322322
}
323323
}
324324

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

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

391-
/// [index_name]
391+
/// \[index_name]
392392
pub fn opt_index_name(i: &str) -> IResult<&str, Option<String>, ParseSQLError<&str>> {
393393
opt(map(
394394
delimited(multispace1, sql_identifier, multispace0),

src/common/reference_definition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl ReferenceDefinition {
2222
/// REFERENCES tbl_name (key_part,...)
2323
/// [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]
2424
/// [ON DELETE reference_option]
25-
/// [ON UPDATE reference_option]
25+
/// \[ON UPDATE reference_option]
2626
pub fn parse(i: &str) -> IResult<&str, ReferenceDefinition, ParseSQLError<&str>> {
2727
let opt_on_delete = opt(map(
2828
tuple((

0 commit comments

Comments
 (0)