@@ -19,7 +19,6 @@ extension AST {
1919 self . location = loc
2020 }
2121
22- @frozen
2322 public enum Kind : Hashable {
2423 /// Just a character
2524 ///
@@ -146,7 +145,6 @@ extension AST.Atom {
146145
147146 // Characters, character types, literals, etc., derived from
148147 // an escape sequence.
149- @frozen
150148 public enum EscapedBuiltin : Hashable {
151149 // TODO: better doc comments
152150
@@ -399,7 +397,6 @@ extension AST.Atom {
399397}
400398
401399extension AST . Atom . CharacterProperty {
402- @frozen
403400 public enum Kind : Hashable {
404401 /// Matches any character, equivalent to Oniguruma's '\O'.
405402 case any
@@ -430,27 +427,73 @@ extension AST.Atom.CharacterProperty {
430427 /// Character name in the form `\p{name=...}`
431428 case named( String )
432429
430+ /// Numeric type.
431+ case numericType( Unicode . NumericType )
432+
433+ /// Numeric value.
434+ case numericValue( Double )
435+
436+ /// Case mapping.
437+ case mapping( MapKind , String )
438+
439+ /// Canonical Combining Class.
440+ case ccc( Unicode . CanonicalCombiningClass )
441+
442+ /// Character age, as per UnicodeScalar.Properties.age.
443+ case age( major: Int , minor: Int )
444+
445+ /// A block property.
446+ case block( Unicode . Block )
447+
433448 case posix( Unicode . POSIXProperty )
434449
435450 /// Some special properties implemented by PCRE and Oniguruma.
436451 case pcreSpecial( PCRESpecialCategory )
437- case onigurumaSpecial( OnigurumaSpecialProperty )
452+
453+ /// Some special properties implemented by Java.
454+ case javaSpecial( JavaSpecial )
455+
456+ public enum MapKind : Hashable {
457+ case lowercase
458+ case uppercase
459+ case titlecase
460+ }
438461 }
439462
440- // TODO: erm, separate out or fold into something? splat it in?
441- @frozen
442463 public enum PCRESpecialCategory : String , Hashable {
443464 case alphanumeric = " Xan "
444465 case posixSpace = " Xps "
445466 case perlSpace = " Xsp "
446467 case universallyNamed = " Xuc "
447468 case perlWord = " Xwd "
448469 }
470+
471+ /// Special Java properties that correspond to methods on
472+ /// `java.lang.Character`, with the `java` prefix replaced by `is`.
473+ public enum JavaSpecial : String , Hashable , CaseIterable {
474+ case alphabetic = " javaAlphabetic "
475+ case defined = " javaDefined "
476+ case digit = " javaDigit "
477+ case identifierIgnorable = " javaIdentifierIgnorable "
478+ case ideographic = " javaIdeographic "
479+ case isoControl = " javaISOControl "
480+ case javaIdentifierPart = " javaJavaIdentifierPart " // not a typo, that's actually the name
481+ case javaIdentifierStart = " javaJavaIdentifierStart " // not a typo, that's actually the name
482+ case javaLetter = " javaLetter "
483+ case javaLetterOrDigit = " javaLetterOrDigit "
484+ case lowerCase = " javaLowerCase "
485+ case mirrored = " javaMirrored "
486+ case spaceChar = " javaSpaceChar "
487+ case titleCase = " javaTitleCase "
488+ case unicodeIdentifierPart = " javaUnicodeIdentifierPart "
489+ case unicodeIdentifierStart = " javaUnicodeIdentifierStart "
490+ case upperCase = " javaUpperCase "
491+ case whitespace = " javaWhitespace "
492+ }
449493}
450494
451495extension AST . Atom {
452496 /// Anchors and other built-in zero-width assertions.
453- @frozen
454497 public enum AssertionKind : String {
455498 /// \A
456499 case startOfSubject = #"\A"#
@@ -824,7 +867,7 @@ extension AST.Node {
824867 case . alternation, . concatenation, . group,
825868 . conditional, . quantification, . quote,
826869 . trivia, . customCharacterClass, . empty,
827- . absentFunction:
870+ . absentFunction, . interpolation :
828871 return nil
829872 }
830873 }
0 commit comments