mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implement the Indic grapheme breaking rules
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "Common/GraphemeData.h"
|
||||
#include "../SwiftShims/UnicodeData.h"
|
||||
#include <limits>
|
||||
|
||||
SWIFT_RUNTIME_STDLIB_INTERNAL
|
||||
__swift_uint8_t _swift_stdlib_getGraphemeBreakProperty(__swift_uint32_t scalar) {
|
||||
@@ -57,3 +58,16 @@ __swift_uint8_t _swift_stdlib_getGraphemeBreakProperty(__swift_uint32_t scalar)
|
||||
// property). Return the max value here to indicate .any.
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
SWIFT_RUNTIME_STDLIB_INTERNAL
|
||||
__swift_bool _swift_stdlib_isLinkingConsonant(__swift_uint32_t scalar) {
|
||||
auto idx = _swift_stdlib_getScalarBitArrayIdx(scalar,
|
||||
_swift_stdlib_linkingConsonant,
|
||||
_swift_stdlib_linkingConsonant_ranks);
|
||||
|
||||
if (idx == std::numeric_limits<__swift_intptr_t>::max()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user