feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -28,30 +28,34 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef CHAR_UTILS_H
|
||||
#define CHAR_UTILS_H
|
||||
#pragma once
|
||||
|
||||
#include "core/typedefs.h"
|
||||
|
||||
#include "char_range.inc"
|
||||
|
||||
#define BSEARCH_CHAR_RANGE(m_array) \
|
||||
int low = 0; \
|
||||
int high = sizeof(m_array) / sizeof(m_array[0]) - 1; \
|
||||
int middle = (low + high) / 2; \
|
||||
\
|
||||
while (low <= high) { \
|
||||
if (p_char < m_array[middle].start) { \
|
||||
high = middle - 1; \
|
||||
} else if (p_char > m_array[middle].end) { \
|
||||
low = middle + 1; \
|
||||
} else { \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
middle = (low + high) / 2; \
|
||||
} \
|
||||
\
|
||||
#include <iterator>
|
||||
|
||||
static constexpr char hex_char_table_upper[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||
static constexpr char hex_char_table_lower[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
#define BSEARCH_CHAR_RANGE(m_array) \
|
||||
int low = 0; \
|
||||
int high = std::size(m_array) - 1; \
|
||||
int middle = (low + high) / 2; \
|
||||
\
|
||||
while (low <= high) { \
|
||||
if (p_char < m_array[middle].start) { \
|
||||
high = middle - 1; \
|
||||
} else if (p_char > m_array[middle].end) { \
|
||||
low = middle + 1; \
|
||||
} else { \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
middle = (low + high) / 2; \
|
||||
} \
|
||||
\
|
||||
return false
|
||||
|
||||
constexpr bool is_unicode_identifier_start(char32_t p_char) {
|
||||
|
|
@ -132,4 +136,6 @@ constexpr bool is_underscore(char32_t p_char) {
|
|||
return (p_char == '_');
|
||||
}
|
||||
|
||||
#endif // CHAR_UTILS_H
|
||||
constexpr bool is_hyphen(char32_t p_char) {
|
||||
return (p_char == '-') || (p_char == 0x2010) || (p_char == 0x2011);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue