ronantakizawa/codereview-bench huggingface dataset:
Repository: godotengine/godot
File: editor/doc/editor_help.h (C/C++)

Code before:
class EditorHelpBitTooltip : public PopupPanel {
	GDCLASS(EditorHelpBitTooltip, PopupPanel);

	static bool _is_tooltip_visible;

	Timer *timer = nullptr;
	uint64_t _enter_tree_time = 0;
	bool _is_mouse_inside_tooltip = false;
	bool _is_shortcut_pressed = false;

	static Control *_make_invisible_control();

	void _start_timer();
	void _target_gui_input(const Ref<InputEvent> &p_event);
	void _shortcut_pressed(Control *p_target);

protected:
	void _notification(int p_what);

public:
	// The returned control is an orphan node, which is to make the standard tooltip invisible.
	[[nodiscard]] static Control *make_tooltip(Control *p_target, const String &p_symbol, const String &p_prologue = String(), bool p_use_class_prefix = false, bool p_shortcut = false);

	void popup_under_position(const Point2 p_point);

	bool is_shortcut_pressed() { return _is_shortcut_pressed; }

	EditorHelpBitTooltip(Control *p_target, bool p_shortcut = false);
};

class EditorSyntaxHighlighter;

class EditorHelpHighlighter {
public:
	enum Language {
		LANGUAGE_GDSCRIPT,
		LANGUAGE_CSHARP,
		LANGUAGE_MAX,
	};

private:
	using HighlightData = Vector<Pair<int, Color>>;

	static EditorHelpHighlighter *singleton;

	HashMap<String, HighlightData> highlight_data_caches[LANGUAGE_MAX];

	TextEdit *text_edits[LANGUAGE_MAX];
	Ref<Script> scripts[LANGUAGE_MAX];
	Ref<EditorSyntaxHighlighter> highlighters[LANGUAGE_MAX];


Review comment (suggestion):
```suggestion
	bool is_shortcut_pressed() const { return _is_shortcut_pressed; }
```

Code after:
class EditorHelpBitTooltip : public PopupPanel {
	GDCLASS(EditorHelpBitTooltip, PopupPanel);

	static bool _is_tooltip_visible;

	Timer *timer = nullptr;
	uint64_t _enter_tree_time = 0;
	bool _is_mouse_inside_tooltip = false;
	bool _is_shortcut_pressed = false;

	static Control *_make_invisible_control();

	void _start_timer();
	void _target_gui_input(const Ref<InputEvent> &p_event);
	void _shortcut_pressed(Control *p_target);

protected:
	void _notification(int p_what);

public:
	// The returned control is an orphan node, which is to make the standard tooltip invisible.
	[[nodiscard]] static Control *make_tooltip(Control *p_target, const String &p_symbol, const String &p_prologue = String(), bool p_use_class_prefix = false, bool p_shortcut = false);

	void popup_under_position(const Point2 &p_point);

	bool is_shortcut_pressed() const { return _is_shortcut_pressed; }

	EditorHelpBitTooltip(Control *p_target, bool p_shortcut = false);
};

class EditorSyntaxHighlighter;

class EditorHelpHighlighter {
public:
	enum Language {
		LANGUAGE_GDSCRIPT,
		LANGUAGE_CSHARP,
		LANGUAGE_MAX,
	};

private:
	using HighlightData = Vector<Pair<int, Color>>;

	static EditorHelpHighlighter *singleton;

	HashMap<String, HighlightData> highlight_data_caches[LANGUAGE_MAX];

	TextEdit *text_edits[LANGUAGE_MAX];
	Ref<Script> scripts[LANGUAGE_MAX];
	Ref<EditorSyntaxHighlighter> highlighters[LANGUAGE_MAX];
Repository: godotengine/godot
File: editor/scene/3d/node_3d_editor_plugin.h (C/C++)

Code before:
		MENU_GROUP_SELECTED,
		MENU_UNGROUP_SELECTED,
		MENU_SNAP_TO_FLOOR,
		MENU_RULER,
	};

	Button *tool_button[TOOL_MAX];
	Button *tool_option_button[TOOL_OPT_MAX];

	MenuButton *transform_menu = nullptr;
	PopupMenu *gizmos_menu = nullptr;
	MenuButton *view_layout_menu = nullptr;

	AcceptDialog *accept = nullptr;

	ConfirmationDialog *snap_dialog = nullptr;
	ConfirmationDialog *xform_dialog = nullptr;
	ConfirmationDialog *settings_dialog = nullptr;

	bool snap_enabled;
	bool snap_key_enabled;
	EditorSpinSlider *snap_translate = nullptr;
	EditorSpinSlider *snap_rotate = nullptr;
	EditorSpinSlider *snap_scale = nullptr;

	bool trackball_enabled;

	LineEdit *xform_translate[3];
	LineEdit *xform_rotate[3];
	LineEdit *xform_scale[3];
	OptionButton *xform_type = nullptr;

	VBoxContainer *settings_vbc = nullptr;
	SpinBox *settings_fov = nullptr;
	SpinBox *settings_znear = nullptr;
	SpinBox *settings_zfar = nullptr;

	void _snap_changed();
	void _snap_update();
	void _xform_dialog_action();
	void _menu_item_pressed(int p_option);
	void _menu_item_toggled(bool pressed, int p_option);
	void _menu_gizmo_toggled(int p_option);
	// Used for secondary menu items which are displayed depending on the currently selected node
	// (such as MeshInstance's "Mesh" menu).
	PanelContainer *context_toolbar_panel = nullptr;
	HBoxContainer *context_toolbar_hbox = nullptr;
	HashMap<Control *, VSeparator *> context_toolbar_separators;

	void _update_context_toolbar();


Review comment (suggestion):
```suggestion
	bool trackball_enabled = false;
```
Instead of initializing it in the constructor.

Code after:
		MENU_GROUP_SELECTED,
		MENU_UNGROUP_SELECTED,
		MENU_SNAP_TO_FLOOR,
		MENU_RULER,
	};

	Button *tool_button[TOOL_MAX];
	Button *tool_option_button[TOOL_OPT_MAX];

	MenuButton *transform_menu = nullptr;
	PopupMenu *gizmos_menu = nullptr;
	MenuButton *view_layout_menu = nullptr;

	AcceptDialog *accept = nullptr;

	ConfirmationDialog *snap_dialog = nullptr;
	ConfirmationDialog *xform_dialog = nullptr;
	ConfirmationDialog *settings_dialog = nullptr;

	bool snap_enabled = false;
	bool snap_key_enabled = false;
	EditorSpinSlider *snap_translate = nullptr;
	EditorSpinSlider *snap_rotate = nullptr;
	EditorSpinSlider *snap_scale = nullptr;

	bool trackball_enabled = false;

	LineEdit *xform_translate[3];
	LineEdit *xform_rotate[3];
	LineEdit *xform_scale[3];
	OptionButton *xform_type = nullptr;

	VBoxContainer *settings_vbc = nullptr;
	SpinBox *settings_fov = nullptr;
	SpinBox *settings_znear = nullptr;
	SpinBox *settings_zfar = nullptr;

	void _snap_changed();
	void _snap_update();
	void _xform_dialog_action();
	void _menu_item_pressed(int p_option);
	void _menu_item_toggled(bool pressed, int p_option);
	void _menu_gizmo_toggled(int p_option);
	// Used for secondary menu items which are displayed depending on the currently selected node
	// (such as MeshInstance's "Mesh" menu).
	PanelContainer *context_toolbar_panel = nullptr;
	HBoxContainer *context_toolbar_hbox = nullptr;
	HashMap<Control *, VSeparator *> context_toolbar_separators;

	void _update_context_toolbar();
Repository: godotengine/godot
File: editor/settings/input_event_configuration_dialog.cpp (C++)

Code before:
	key_mode->hide();
	additional_options_container->add_child(key_mode);

	// Key Location Selection

	location_container = memnew(HBoxContainer);
	location_container->hide();

	location_container->add_child(memnew(Label(TTRC("Physical location"))));

	key_location = memnew(OptionButton);
	key_location->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	key_location->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
	// Item texts will be set in `NOTIFICATION_TRANSLATION_CHANGED`.
	key_location->add_item(String(), (int)KeyLocation::UNSPECIFIED);
	key_location->add_item(String(), (int)KeyLocation::LEFT);
	key_location->add_item(String(), (int)KeyLocation::RIGHT);
	key_location->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_location_selected));
	key_location->set_accessibility_name(TTRC("Physical location"));

	location_container->add_child(key_location);
	additional_options_container->add_child(location_container);

	main_vbox->add_child(additional_options_container);

	event_exists = memnew(Label(TTRC("Error: this action already contains this input event.")));
	event_exists->set_theme_type_variation("HeaderSmall");
	event_exists->set_visible(false);
	main_vbox->add_child(event_exists);
}


Review comment (suggestion):
```suggestion
	event_exists = memnew(Label(TTRC("Error: This action already contains this input event.")));
```

Code after:
	key_mode->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_mode_selected));
	key_mode->hide();
	additional_options_container->add_child(key_mode);

	// Key Location Selection

	location_container = memnew(HBoxContainer);
	location_container->hide();

	location_container->add_child(memnew(Label(TTRC("Physical location"))));

	key_location = memnew(OptionButton);
	key_location->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	key_location->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
	// Item texts will be set in `NOTIFICATION_TRANSLATION_CHANGED`.
	key_location->add_item(String(), (int)KeyLocation::UNSPECIFIED);
	key_location->add_item(String(), (int)KeyLocation::LEFT);
	key_location->add_item(String(), (int)KeyLocation::RIGHT);
	key_location->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_location_selected));
	key_location->set_accessibility_name(TTRC("Physical location"));

	location_container->add_child(key_location);
	additional_options_container->add_child(location_container);

	main_vbox->add_child(additional_options_container);

	event_exists = memnew(Label(TTRC("Error: This action already contains this input event.")));
	event_exists->set_theme_type_variation("HeaderSmall");
	event_exists->set_visible(false);
	main_vbox->add_child(event_exists);
}
Repository: godotengine/godot
File: editor/docks/dock_tab_container.cpp (C++)

Code before:
	} else if (p_layout->has_section_key(p_section, tab_key)) {
		p_layout->erase_section_key(p_section, tab_key);
	}
}

void DockTabContainer::load_selected_tab(int p_idx) {
	EditorDock *selected_dock = get_dock(p_idx);
	if (!selected_dock) {
		return;
	}
	set_block_signals(true);
	set_current_tab(p_idx);
	set_block_signals(false);
}

void DockTabContainer::set_dock_context_popup(DockContextPopup *p_popup) {
	dock_context_popup = p_popup;
	set_popup(dock_context_popup);
}

void DockTabContainer::move_dock_index(EditorDock *p_dock, int p_to_index, bool p_set_current) {
	set_block_signals(true);
	int target_index = CLAMP(p_to_index, 0, get_tab_count() - 1);
	move_child(p_dock, get_dock(target_index)->get_index(false));

	if (p_set_current) {
		set_current_tab(target_index);
	}
	set_block_signals(false);
}

EditorDock *DockTabContainer::get_dock(int p_idx) const {
	return Object::cast_to<EditorDock>(get_tab_control(p_idx));
}

void DockTabContainer::show_drag_hint() {
	if (!is_visible_in_tree()) {
		return;
	}
	drag_hint->set_rect(get_global_rect());
	drag_hint->show();
}

DockTabContainer::DockTabContainer(EditorDock::DockSlot p_slot) {
	ERR_FAIL_INDEX(p_slot, EditorDock::DOCK_SLOT_MAX);
	dock_slot = p_slot;

	set_drag_to_rearrange_enabled(true);
	set_tabs_rearrange_group(1);
	hide();


Review comment (suggestion):
It looks like this causes an issue, when loading the default dock layout repeatedly it alternates between the first two tabs in each dock container. This condition is hit and prevents it from being set correctly.
The default layout doesn't have `_selected_tab_idx` entries, so other layouts seem fine.

Code after:
	} else if (p_layout->has_section_key(p_section, tab_key)) {
		p_layout->erase_section_key(p_section, tab_key);
	}
}

void DockTabContainer::load_selected_tab(int p_idx) {
	EditorDock *selected_dock = get_dock(p_idx);
	if (!selected_dock) {
		return;
	}
	set_block_signals(true);
	set_current_tab(p_idx);
	set_block_signals(false);
}

void DockTabContainer::set_dock_context_popup(DockContextPopup *p_popup) {
	dock_context_popup = p_popup;
	set_popup(dock_context_popup);
}

void DockTabContainer::move_dock_index(EditorDock *p_dock, int p_to_index, bool p_set_current) {
	set_block_signals(true);
	int target_index = CLAMP(p_to_index, 0, get_tab_count() - 1);
	move_child(p_dock, get_dock(target_index)->get_index(false));

	if (p_set_current && !p_dock->is_visible_in_tree()) {
		set_current_tab(target_index);
	}
	set_block_signals(false);
}

EditorDock *DockTabContainer::get_dock(int p_idx) const {
	return Object::cast_to<EditorDock>(get_tab_control(p_idx));
}

void DockTabContainer::show_drag_hint() {
	if (!is_visible_in_tree()) {
		return;
	}
	drag_hint->set_rect(get_global_rect());
	drag_hint->show();
}

DockTabContainer::DockTabContainer(EditorDock::DockSlot p_slot) {
	ERR_FAIL_INDEX(p_slot, EditorDock::DOCK_SLOT_MAX);
	dock_slot = p_slot;

	set_drag_to_rearrange_enabled(true);
	set_tabs_rearrange_group(1);
	hide();
Repository: godotengine/godot
File: scene/gui/tree.cpp (C++)

Code before:
	}
	int height = compute_item_height(p_item);
	height += theme_cache.v_separation;

	if (!p_item->collapsed) { // If not collapsed, check the children.

		TreeItem *c = p_item->first_child;

		while (c) {
			height += get_item_height(c);

			c = c->next;
		}
	}

	return height;
}

Point2i Tree::convert_rtl_position(const Point2i &pos, int width) const {
	if (cache.rtl) {
		return Point2i(get_size().width - pos.x - width, pos.y);
	}
	return pos;
}

Point2 Tree::convert_rtl_position(const Point2 &pos, int width) const {
	if (cache.rtl) {
		return Point2(get_size().width - pos.x - width, pos.y);
	}
	return pos;
}

Rect2i Tree::convert_rtl_rect(const Rect2i &rect) const {
	if (cache.rtl) {
		return Rect2i(Point2i(get_size().width - rect.position.x - rect.size.x, rect.position.y), rect.size);
	}
	return rect;
}

void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color, int p_ol_size, const Color &p_ol_color) const {
	ERR_FAIL_COND(theme_cache.font.is_null());

	Rect2i rect = p_rect;
	Size2 ts = p_cell.text_buf->get_size();
	bool rtl = is_layout_rtl();

	Size2i icon_size;
	if (p_cell.icon.is_valid()) {
		icon_size = _get_cell_icon_size(p_cell);
	}


Review comment (suggestion):
```suggestion
Point2 Tree::convert_rtl_position(const Point2 &p_pos, int p_width) const {
```

Code after:
	}
	int height = compute_item_height(p_item);
	height += theme_cache.v_separation;

	if (!p_item->collapsed) { // If not collapsed, check the children.

		TreeItem *c = p_item->first_child;

		while (c) {
			height += get_item_height(c);

			c = c->next;
		}
	}

	return height;
}

Point2i Tree::convert_rtl_position(const Point2i &p_pos, int p_width) const {
	if (cache.rtl) {
		return Point2i(get_size().width - p_pos.x - p_width, p_pos.y);
	}
	return p_pos;
}

Point2 Tree::convert_rtl_position(const Point2 &p_pos, int p_width) const {
	if (cache.rtl) {
		return Point2(get_size().width - p_pos.x - p_width, p_pos.y);
	}
	return p_pos;
}

Rect2i Tree::convert_rtl_rect(const Rect2i &p_rect) const {
	if (cache.rtl) {
		return Rect2i(Point2i(get_size().width - p_rect.position.x - p_rect.size.x, p_rect.position.y), p_rect.size);
	}
	return p_rect;
}

void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color, int p_ol_size, const Color &p_ol_color) const {
	ERR_FAIL_COND(theme_cache.font.is_null());

	Rect2i rect = p_rect;
	Size2 ts = p_cell.text_buf->get_size();
	bool rtl = is_layout_rtl();

	Size2i icon_size;
	if (p_cell.icon.is_valid()) {
		icon_size = _get_cell_icon_size(p_cell);
	}
Repository: godotengine/godot
File: editor/editor_node.cpp (C++)

Code before:
	}

	if (!to_reopen.is_empty()) {
		args.push_back(to_reopen);
	}

	OS::get_singleton()->set_restart_on_exit(true, args);
}

void EditorNode::_scene_tab_closed(int p_tab) {
	current_menu_option = SCENE_TAB_CLOSE;
	tab_closing_idx = p_tab;
	Node *scene = editor_data.get_edited_scene_root(p_tab);
	if (!scene) {
		_discard_changes();
		return;
	}

	String scene_filename = scene->get_scene_file_path();
	String unsaved_message;

	if (EditorUndoRedoManager::get_singleton()->is_history_unsaved(editor_data.get_scene_history_id(p_tab))) {
		if (scene_filename.is_empty()) {
			unsaved_message = TTR("This scene was never saved.");
		} else {
			uint32_t time_opened = editor_data.get_edited_scenes()[p_tab].time_opened;
			unsaved_message = _get_unsaved_scene_dialog_text(scene_filename, time_opened);
		}
	} else {
		// Check if any plugin has unsaved changes in that scene.
		for (int i = 0; i < editor_data.get_editor_plugin_count(); i++) {
			unsaved_message = editor_data.get_editor_plugin(i)->get_unsaved_status(scene_filename);
			if (!unsaved_message.is_empty()) {
				break;
			}
		}
	}

	if (!unsaved_message.is_empty()) {
		if (scene_tabs->get_current_tab() != p_tab) {
			_set_current_scene(p_tab);
		}

		save_confirmation->set_ok_button_text(TTR("Save & Close"));
		save_confirmation->set_text(unsaved_message + "\n\n" + TTR("Save before closing?"));
		save_confirmation->reset_size();
		save_confirmation->popup_centered();
	} else {
		_discard_changes();
	}


Review comment (suggestion):
You should add a `get_scene_time_opened()` to EditorData, instead of fetching the whole array (it makes a copy).

Same above.

Code after:
	}

	if (!to_reopen.is_empty()) {
		args.push_back(to_reopen);
	}

	OS::get_singleton()->set_restart_on_exit(true, args);
}

void EditorNode::_scene_tab_closed(int p_tab) {
	current_menu_option = SCENE_TAB_CLOSE;
	tab_closing_idx = p_tab;
	Node *scene = editor_data.get_edited_scene_root(p_tab);
	if (!scene) {
		_discard_changes();
		return;
	}

	String scene_filename = scene->get_scene_file_path();
	String unsaved_message;

	if (EditorUndoRedoManager::get_singleton()->is_history_unsaved(editor_data.get_scene_history_id(p_tab))) {
		if (scene_filename.is_empty()) {
			unsaved_message = TTR("This scene was never saved.");
		} else {
			uint32_t time_opened = editor_data.get_scene_time_opened(p_tab);
			unsaved_message = _get_unsaved_scene_dialog_text(scene_filename, time_opened);
		}
	} else {
		// Check if any plugin has unsaved changes in that scene.
		for (int i = 0; i < editor_data.get_editor_plugin_count(); i++) {
			unsaved_message = editor_data.get_editor_plugin(i)->get_unsaved_status(scene_filename);
			if (!unsaved_message.is_empty()) {
				break;
			}
		}
	}

	if (!unsaved_message.is_empty()) {
		if (scene_tabs->get_current_tab() != p_tab) {
			_set_current_scene(p_tab);
		}

		save_confirmation->set_ok_button_text(TTR("Save & Close"));
		save_confirmation->set_text(unsaved_message + "\n\n" + TTR("Save before closing?"));
		save_confirmation->reset_size();
		save_confirmation->popup_centered();
	} else {
		_discard_changes();
	}
Repository: godotengine/godot
File: core/string/char_utils.h (C/C++)

Code before:
extern CharRange xid_continue[806];
extern CharRange uppercase_letter[660];
extern CharRange lowercase_letter[677];
extern CharRange unicode_letter[761];

#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

inline bool is_unicode_identifier_start(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_start);
}

inline bool is_unicode_identifier_continue(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_continue);
}

inline bool is_unicode_upper_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(uppercase_letter);
}

inline bool is_unicode_lower_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(lowercase_letter);
}

inline bool is_unicode_letter(char32_t p_char) {
	BSEARCH_CHAR_RANGE(unicode_letter);
}

#undef BSEARCH_CHAR_RANGE

constexpr bool is_ascii_upper_case(char32_t p_char) {
	return (p_char >= 'A' && p_char <= 'Z');
}

constexpr bool is_ascii_lower_case(char32_t p_char) {

Review comment (suggestion):
```suggestion
	BSEARCH_CHAR_RANGE(xid_start, xid_start_size);
```

Code after:
extern const int xid_start_size;
extern const CharRange xid_continue[];
extern const int xid_continue_size;
extern const CharRange uppercase_letter[];
extern const int uppercase_letter_size;
extern const CharRange lowercase_letter[];
extern const int lowercase_letter_size;
extern const CharRange unicode_letter[];
extern const int unicode_letter_size;

#define BSEARCH_CHAR_RANGE(m_array, m_size) \
	int low = 0; \
	int high = m_size - 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

inline bool is_unicode_identifier_start(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_start, xid_start_size);
}

inline bool is_unicode_identifier_continue(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_continue, xid_continue_size);
}

inline bool is_unicode_upper_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(uppercase_letter, uppercase_letter_size);
}

inline bool is_unicode_lower_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(lowercase_letter, lowercase_letter_size);
}

inline bool is_unicode_letter(char32_t p_char) {
	BSEARCH_CHAR_RANGE(unicode_letter, unicode_letter_size);
}

#undef BSEARCH_CHAR_RANGE
Repository: godotengine/godot
File: core/string/char_utils.h (C/C++)

Code before:

#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

inline bool is_unicode_identifier_start(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_start);
}

inline bool is_unicode_identifier_continue(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_continue);
}

inline bool is_unicode_upper_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(uppercase_letter);
}

inline bool is_unicode_lower_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(lowercase_letter);
}

inline bool is_unicode_letter(char32_t p_char) {
	BSEARCH_CHAR_RANGE(unicode_letter);
}

#undef BSEARCH_CHAR_RANGE

constexpr bool is_ascii_upper_case(char32_t p_char) {
	return (p_char >= 'A' && p_char <= 'Z');
}

constexpr bool is_ascii_lower_case(char32_t p_char) {
	return (p_char >= 'a' && p_char <= 'z');
}

constexpr bool is_digit(char32_t p_char) {

Review comment (suggestion):
```suggestion
	BSEARCH_CHAR_RANGE(xid_continue, xid_continue_size);
```

Code after:
extern const int uppercase_letter_size;
extern const CharRange lowercase_letter[];
extern const int lowercase_letter_size;
extern const CharRange unicode_letter[];
extern const int unicode_letter_size;

#define BSEARCH_CHAR_RANGE(m_array, m_size) \
	int low = 0; \
	int high = m_size - 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

inline bool is_unicode_identifier_start(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_start, xid_start_size);
}

inline bool is_unicode_identifier_continue(char32_t p_char) {
	BSEARCH_CHAR_RANGE(xid_continue, xid_continue_size);
}

inline bool is_unicode_upper_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(uppercase_letter, uppercase_letter_size);
}

inline bool is_unicode_lower_case(char32_t p_char) {
	BSEARCH_CHAR_RANGE(lowercase_letter, lowercase_letter_size);
}

inline bool is_unicode_letter(char32_t p_char) {
	BSEARCH_CHAR_RANGE(unicode_letter, unicode_letter_size);
}

#undef BSEARCH_CHAR_RANGE

constexpr bool is_ascii_upper_case(char32_t p_char) {
	return (p_char >= 'A' && p_char <= 'Z');
}