-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
406 support enabling/disabling particular atoms #426
406 support enabling/disabling particular atoms #426
Conversation
fail (name <> ": Couldn't find bytes in RHS: " <> printTree (hideRho r)) | ||
return (result, ()) | ||
ctx <- getContext | ||
if HashSet.member (DisabledAtomName name) ctx.disabledAtomNames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the correct place for this check. Instead, use the check in the dataizeStepChain
function, before evaluateBuiltinFunChain
is called.
- calculate and store in the dataization context only enabled atoms
- move existing command for preparing tests into the 'pipeline' command - add command for printing 'normalizer dataize' configs into the 'pipeline' command
@fizruk Thanks for the review! You've earned +25 points for this. |
To enable or disable particular atoms for a pipeline test set, add an If you enable particular atoms, only these atoms are enabled. Here's an example of a test set where the - eo:
original: eo/eo-runtime/src/test/eo/org/eolang/as-phi-tests.eo
yaml: pipeline/eo-yaml/as-phi-tests.yaml
filtered: pipeline/eo-filtered/as-phi-tests.eo
phi:
initial: pipeline/phi-initial/as-phi-tests.phi
normalized: pipeline/phi-normalized/as-phi-tests.phi
bindings-path-initial: org.eolang
bindings-path-normalized: org.eolang
atoms:
enable:
- foo
disable:
- bar |
eb93f5b
to
ffe4119
Compare
ctx <- getContext | ||
return (ctx, Left obj') | ||
ctx' <- getContext | ||
if HashSet.member funcName knownAtomNames && not (HashSet.member funcName ctx'.enabledAtomNames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would factor this condition into a separate function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 32be6c9
However, I'm not sure I understood your suggestion correctly.
@@ -270,87 +278,129 @@ evaluateBytesBytesFunChain name = evaluateUnaryDataizationFunChain name intToByt | |||
evaluateFloatFloatFloatFunChain :: String -> (Double -> Double -> Double) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState) | |||
evaluateFloatFloatFloatFunChain name = evaluateBinaryDataizationFunChain name floatToBytes bytesToFloat wrapBytesInFloat extractRho (extractLabel "x") | |||
|
|||
knownAtoms :: [(String, String -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState))] | |||
knownAtoms = | |||
[ ("Lorg_eolang_int_gt", \name obj -> evaluateIntIntBoolFunChain name (>) obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change the order of arguments, you can avoid lambdas and simply write evaluateIntIntBoolFunChain (>)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 9653b2e
|
||
evaluateBuiltinFunChainUnknown :: String -> a -> b1 -> Chain (Either a b2) (a, b1) | ||
evaluateBuiltinFunChainUnknown atomName obj state = do | ||
logStep [fmt|[WARNING]: unknown atom ({atomName})|] (Left obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown atoms are normal and should not be warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 75fb769
Issues
PR-Codex overview
This PR updates the
eo-phi-normalizer
package by adding new phi files, updating pipeline configurations, and introducing new rules.Detailed summary
error
,dataized
,cti
,try
,rust
,string
,cage
,true
,false
,nan
,go
, andwhile
TH.hs
,Config.hs
,RunYegor.hs
,Fast.hs