-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersunit-syntax-treeRelated to the syntax tree moduleRelated to the syntax tree module
Milestone
Description
Description
generateFromSnapshot function in src/syntax/tree/syntaxTree.ts generates the syntax tree from a snapshot. However, there is no construct to validate the input snapshot.
Also, attachment checking functions and attaching functions have no connections — the idea is that the connection checks will externally be performed first before the connection is made. In this way, if a connection is known to be valid, we can skip the additional cost of reverifying. However, it would be nice to optionally check connection validity before the connections, as a direct step and not a two step process in certain use cases.
Objectives
Snapshot validation
- Add a function to validate an input snapshot
- Validate shape of snapshot components; refer
ITreeSnapshotData,ITreeSnapshotExpression,ITreeSnapshotStatement,ITreeSnapshotBlock(discuss your approach before proceeding as the interfaces listed as TypeScript specific and JavaScript doesn't have them) - Validate attachments — whether the snapshot describes valid instruction or argument attachments
- Validate shape of snapshot components; refer
- Call the snapshot validation function before generating the syntax tree from it, in
generateFromSnapshot
Connection validation
- Add an optional flag to
attachArgumentCheckto indicate whether to perform a validation - Add an optional flag to
attachInstructionBelowCheckto indicate whether to perform a validation - Add an optional flag to
attachInstructionInsideCheckto indicate whether to perform a validation
This can be done as two separate PRs.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersunit-syntax-treeRelated to the syntax tree moduleRelated to the syntax tree module