You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a pattern matching control flow structure, as shown below:
match (variable) {
when :ok >> something()
when :error >> something_else()
default >> some_default_thing()
}
Update the lexer to recognize match, when, default, and >> as language keywords and operators, respectively.
Update the parser to recognize the match statement.
Modify the AST to accommodate the match statement and its branches. This can be modeled with the ControlFlowNode, though it may need to be modified to add flexibility.
Implement the necessary changes in the type checker and code generator.
Ensure that match can handle various patterns and data types.
Ensure that typechecking is honored during the pattern match
The text was updated successfully, but these errors were encountered:
Add a pattern matching control flow structure, as shown below:
match
,when
,default
, and>>
as language keywords and operators, respectively.match
statement.match
statement and its branches. This can be modeled with theControlFlowNode
, though it may need to be modified to add flexibility.match
can handle various patterns and data types.The text was updated successfully, but these errors were encountered: