Vixen
02b45cc4
csharp
public static class CandidateScanner

Finds the class names a project might be using.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Deliberately over-inclusive, and that is the whole design. It does not parse VXML or C#; it pulls out every run of characters that could be a class name and lets the generator throw away what is not one. A false positive costs one unused rule that no element matches; a false negative is a style silently missing at runtime, which someone debugs for an hour. The asymmetry is enormous and the design follows it.

It also means the scanner cannot be defeated by cleverness, which a parser can. A class name built by string concatenation is invisible to any analysis, but the pieces are usually literals, and a scanner that takes every literal finds them.

The one thing it must not do is find so much that generation slows down. Runs are bounded by the characters a utility can contain, which excludes whitespace, quotes and most punctuation, so a paragraph of prose yields its words and nothing longer.

Methods (1)

  • public static void Scan(string text, ISet<string> into)

    Pulls candidate class names out of a file's text.

Used by (1)

  • ThemeAndScannerTestsVixen.Ui.Styling.Utilities.Tests