PhoenixmlDb.Core

SchemaPatternCharacters

Rewrites a pattern facet so that everything in it that stands for one character matches one character as XML Schema counts it: a code point. System.Xml hands the pattern to a .NET expression, which counts UTF-16 units, so a character outside the Basic Multilingual Plane (a surrogate pair) was two characters to ".", to a negated class and to a negated category, and no character at all to a category it belongs to.

#SchemaPatternCharacters

Namespace: PhoenixmlDb.Core.Schema

Rewrites a pattern facet so that everything in it that stands for one character matches one character as XML Schema counts it: a code point. System.Xml hands the pattern to a .NET expression, which counts UTF-16 units, so a character outside the Basic Multilingual Plane (a surrogate pair) was two characters to ".", to a negated class and to a negated category, and no character at all to a category it belongs to.

Each atom that stands for one character becomes an alternation: the atom as written, kept from matching half a pair, or one of the pairs that are the characters above U+FFFF the atom stands for. Which those are is worked out from the atom: a category by the Unicode data of the runtime, a class from its members, a negation as the complement, a subtraction as the difference. An atom that stands for no such character and cannot match half a pair is left exactly as written, so a pattern with nothing of the kind is not changed at all.

A block escape (\p{IsGreek}) is taken to hold no character above U+FFFF: .NET knows no block there. \i and \c hold none either, as in System.Xml.

#Methods

#EscapeAbove(String,Boolean@)

The characters above U+FFFF that an escape stands for, and whether the escape as written matches half a pair (a negated set does: half a pair is not a letter, not a space).

#ParseClass(String,Int32@)

Reads a class expression from

, which is on its "[", and leaves

after its "]".

#ReadCharacter(String,Int32@,String@)

One character of a class: itself, a single-character escape, or a pair.

#Rewrite(String)

The pattern with every atom that stands for one character made to match one code point.