Table of Contents

Class FieldInstructionTokenizer

Namespace
DocWright.Core.Text
Assembly
DocWright.Core.dll

Splits a field instruction (ECMA-376 Part 1 §17.16.5) into whitespace-separated, quote-aware tokens.

public static class FieldInstructionTokenizer
Inheritance
FieldInstructionTokenizer
Inherited Members

Remarks

This lives in Core, below both consumers, on purpose. The layout resolver tokenizes instructions to recognize the pagination fields it evaluates, and the DOM field engine tokenizes them to parse the instruction model. Two copies of this loop would diverge on exactly the inputs that are hardest to test — nested quotes and switch arguments — so there is one copy and both call it.

Escape handling applies only inside quotes: \" yields a literal quote and \\ a literal backslash. Outside quotes a backslash is literal, because that is where it introduces a switch (\*, \#, \@).

Methods

Render(string, bool)

Renders a token back to instruction syntax, quoting and escaping only when the value needs it, so that an unquoted token round-trips unquoted.

Tokenize(string?)

Tokenizes a field instruction.