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
Within the language we are able to add a condition to a catch handler.
CatchexAsExpectionWhenRetries<3
I think we should also be able extend clause statement with a when expression.
So the body of the case it executed when both clause matches and the when expression evaluates to true.
Syntax WhenExpression
WhenKeyword As WhenKeywordToken
Expression As ExpressionSyntax
End Syntax
The feature would also be useful, combined with #304
Eg
Select TypeOf obj
Case Byte Out value When value > 0
'
Case Int16 Out value When value > 0
Case Int32 Out value When value < 0
Case Else When
Case Else
End Select
The text was updated successfully, but these errors were encountered:
@KathleenDollard An example of a parsing a digit of a some specific number base using Case ... When ....
EnumBaseNone=0BIN=2OCT=8DEC=10HEX=16EndEnumFunctionTryParse_Digit(OfBaseAsBase,HereAsInt32,<Out>OutputAsDigit)AsBoolean' Presumption: The parsing is going to fail, unless proven otherwise.' So set default value for output to nothing.Output=NothingSelectCaseChWhenTryGet(Here,OutCh)Case"0"cTo"1"cWhenOfBase>=Base.BIN:Output=NewDigit(Here,Ch,OfBase)Case"2"cTo"7"cWhenOfBase>=Base.OCT:Output=NewDigit(Here,Ch,OfBase)Case"8"cTo"9"cWhenOfBase>=Base.DEC:Output=NewDigit(Here,Ch,OfBase)Case"A"cTo"F"cWhenOfBase>=Base.Hex:Output=NewDigit(Here,Ch,OfBase)Case"a"cTo"f"cWhenOfBase>=Base.Hex:Output=NewDigit(Here,Ch,OfBase)EndSelectReturn(OutputIsNotNothing)EndFunction
When Expressions on Case Clause Statements
Within the language we are able to add a condition to a catch handler.
I think we should also be able extend clause statement with a when expression.
So the body of the case it executed when both clause matches and the when expression evaluates to true.
Syntax
Syntax Node Layout
The feature would also be useful, combined with #304
Eg
The text was updated successfully, but these errors were encountered: