Skip to content

Commit

Permalink
chore: update type annotation instructions in the parser
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Aug 17, 2024
1 parent 10f0506 commit a220703
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kclvm/parser/src/parser/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ impl<'a> Parser<'a> {
/// Syntax:
///
/// type: type_element (OR type_element)*
/// type_element: schema_type | basic_type | compound_type | literal_type
/// type_element: schema_type | function_type | basic_type | compound_type | literal_type
/// function_type: LEFT_PARENTHESES [type_element (COMMA type_element)*] RIGHT_PARENTHESES [RIGHT_ARROW type_element]
/// schema_type: identifier
/// basic_type: STRING_TYPE | INT_TYPE | FLOAT_TYPE | BOOL_TYPE | ANY_TYPE
/// compound_type: list_type | dict_type
/// list_type: LEFT_BRACKETS (type)? RIGHT_BRACKETS
/// dict_type: LEFT_BRACE (type)? COLON (type)? RIGHT_BRACE
/// literal_type: string | number | TRUE | FALSE | NONE
/// literal_type: string | number | TRUE | FALSE
pub(crate) fn parse_type_annotation(&mut self) -> NodeRef<Type> {
let token = self.token;
let mut type_node_list = vec![self.parse_type_element()];
Expand Down

0 comments on commit a220703

Please sign in to comment.