Skip to content

[debug]: Debugging expression lang failures #49

@justinmchase

Description

@justinmchase

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:

  1. The hierarchical Pattern structure of the matches, using the names of the patterns
  2. The values matched, not matched, and the values expected
  3. Pipelines, which pipeline is failing, and the output of prior successful pipelines should be shown
  4. The final match failure should be tied back to a module and file path if possible

Expected

  1. The resulting match is a failure
  2. The visualization shows that the # specifically is where the match failed
  3. Matches for pipeline patterns are clearly denoted, in this case the expression step should be the one that is noted as the failure

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions