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
HashThis
LengthShorthand:id &( ( _+ ( ( Not __ In ) / In ) ) )?:beforeIn ->
if (beforeIn) ...
but ended up needing to do:
LengthShorthand:id ( &( _+ ( ( Not __ In ) / In ) ) "" )?:beforeIn ->
if (beforeIn != null) ...
This is because assertions always return undefined since they fail the parse if not met. This causes issue with ? because it returns undefined if the parse wasn't matched so there's not a simple way find out whether the optional assertion matched or not.
It would be nice if optional assertions translated to true/false for whether the assertion passes or fails.
Rule
A &B?:b ->
// b is `true` or `false`
The text was updated successfully, but these errors were encountered:
I recently wanted to do something like:
but ended up needing to do:
This is because assertions always return
undefined
since they fail the parse if not met. This causes issue with?
because it returnsundefined
if the parse wasn't matched so there's not a simple way find out whether the optional assertion matched or not.It would be nice if optional assertions translated to
true/false
for whether the assertion passes or fails.The text was updated successfully, but these errors were encountered: