2886 if (name.startsWith("In")) { |
2886 if (name.startsWith("In")) { |
2887 // \p{InBlockName} |
2887 // \p{InBlockName} |
2888 p = CharPredicates.forUnicodeBlock(name.substring(2)); |
2888 p = CharPredicates.forUnicodeBlock(name.substring(2)); |
2889 } else if (name.startsWith("Is")) { |
2889 } else if (name.startsWith("Is")) { |
2890 // \p{IsGeneralCategory} and \p{IsScriptName} |
2890 // \p{IsGeneralCategory} and \p{IsScriptName} |
2891 name = name.substring(2); |
2891 String shortName = name.substring(2); |
2892 p = CharPredicates.forUnicodeProperty(name); |
2892 p = CharPredicates.forUnicodeProperty(shortName); |
2893 if (p == null) |
2893 if (p == null) |
2894 p = CharPredicates.forProperty(name); |
2894 p = CharPredicates.forProperty(shortName); |
2895 if (p == null) |
2895 if (p == null) |
2896 p = CharPredicates.forUnicodeScript(name); |
2896 p = CharPredicates.forUnicodeScript(shortName); |
2897 } else { |
2897 } else { |
2898 if (has(UNICODE_CHARACTER_CLASS)) { |
2898 if (has(UNICODE_CHARACTER_CLASS)) { |
2899 p = CharPredicates.forPOSIXName(name); |
2899 p = CharPredicates.forPOSIXName(name); |
2900 } |
2900 } |
2901 if (p == null) |
2901 if (p == null) |
2902 p = CharPredicates.forProperty(name); |
2902 p = CharPredicates.forProperty(name); |
2903 } |
2903 } |
2904 if (p == null) |
2904 if (p == null) |
2905 throw error("Unknown character property name {In/Is" + name + "}"); |
2905 throw error("Unknown character property name {" + name + "}"); |
2906 } |
2906 } |
2907 if (isComplement) { |
2907 if (isComplement) { |
2908 // it might be too expensive to detect if a complement of |
2908 // it might be too expensive to detect if a complement of |
2909 // CharProperty can match "certain" supplementary. So just |
2909 // CharProperty can match "certain" supplementary. So just |
2910 // go with StartS. |
2910 // go with StartS. |