Hello. I would like to create a parser that can find LPAREN (IDENTIFIER COLON TYPE (COMMA IDENTIFIER COLON TYPE)*)? RPAREN. How can I repeatedly find a specific pattern?
pub enum DeclarationContent {
Function {
name : String,
argTypes : HashMap<String, Types>, // <- I would like to find multiple of these
returnTypes : Types,
body : FunctionBody
}
}
pub struct FunctionBody {
expressions : Vec<Expression> // and multiple of these.
}
pub enum Types {
Void,
Integer,
FloatingPoint,
String,
Character,
Boolean,
Array {
length : i32,
types : Box<Types>
},
UnsizedArray {
types : Box<Types>
},
Tuple {
types : Box<Vec<Types>>
},
Dictionary {
keyTypes : Box<Types>,
valueTypes : Box<Types>
},
Function {
argsTypes : Box<Vec<Types>>,
returnTypes : Box<Types>
},
Other {
name : String
}
}
Hello. I would like to create a parser that can find
LPAREN (IDENTIFIER COLON TYPE (COMMA IDENTIFIER COLON TYPE)*)? RPAREN
. How can I repeatedly find a specific pattern?