-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preprocessor: refactor sanitiser and comparator code sharing
In a later CL, we introduce script node per-statement sanitisers by means of a tag directive (located in the doc comment for a statement). This requires us to use a sanitiser for its sanitising capabilities, but does not require us to use the "match against this command" capability. As such, our reuse pattern of different capabilities is a bit upside down, for both sanitiser and comparators. Refactor to extract an explicit matcher interface, distinct from sanitiser/comparator. This allows a sanitiser/comparator to only be responsible for its principle task. A patternSanitiser is just that: a sanitiser. The newly introduced patternSanitiserMatcher is a pattern sanitiser that includes a specification of which commands it should be run against. The same refactor is applied for comparators. Corresponding changes are made in the CUE schema for the preprocessor. Some of the naming is likely a bit off, but I think I need to see/work with it a bit to work out where it's good/bad and rework in a later CL. Preprocessor-No-Write-Cache: true Signed-off-by: Paul Jolly <[email protected]> Change-Id: Id5dad562e992c1fdbb505b958597c896861845cc Dispatch-Trailer: {"type":"trybot","CL":1176700,"patchset":7,"ref":"refs/changes/00/1176700/7","targetBranch":"alpha"}
- Loading branch information
Showing
5 changed files
with
126 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters