If you provide code to the epxression language which is an invalid program debugging what the failure is can be hard.
Please add an integration test to the expression lang which has an invalid expression (add 1 #) where the # represents an unexpected expression that the language cannot parse.
Visualizing the Failure
Please create a function visualizeMatchFailure(match: Match): string which emits a helpful human readable visualization for the failure intended to be printed to a console or to a file for debugging where only a text editor is available.
The structure of the match is very robust and can be circular. You will need to visualize these things:
- The hierarchical Pattern structure of the matches, using the names of the patterns
- The values matched, not matched, and the values expected
- Pipelines, which pipeline is failing, and the output of prior successful pipelines should be shown
- The final match failure should be tied back to a module and file path if possible
Expected
- The resulting match is a failure
- The visualization shows that the
# specifically is where the match failed
- Matches for pipeline patterns are clearly denoted, in this case the expression step should be the one that is noted as the failure
If you provide code to the epxression language which is an invalid program debugging what the failure is can be hard.
Please add an integration test to the expression lang which has an invalid expression
(add 1 #)where the#represents an unexpected expression that the language cannot parse.Visualizing the Failure
Please create a function
visualizeMatchFailure(match: Match): stringwhich emits a helpful human readable visualization for the failure intended to be printed to a console or to a file for debugging where only a text editor is available.The structure of the match is very robust and can be circular. You will need to visualize these things:
Expected
#specifically is where the match failed