das_hash_map: drop redundant includes, fix EASTL/no-exception support#2716
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cleans up daslang_hash_map so it uses the das:: namespace abstraction instead of directly importing selected std:: names, improving compatibility with the EASTL configuration.
Changes:
- Removed local standard-library includes from
das_hash_map.hand documented reliance ondas_config.h. - Replaced direct/unqualified standard-library type usage with
das::-qualified equivalents. - Added local EASTL verification directories to
.gitignore.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
include/das_hash_map/das_hash_map.h |
Routes hash map/set types and helpers through das:: namespace abstraction. |
.gitignore |
Ignores local EASTL/EABase checkout and build directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Three issues in include/das_hash_map/das_hash_map.h:
(1) 10 redundant #includes. The header is only ever pulled via
das_config.h, which already includes <vector>, <utility>, <functional>,
<string>, <type_traits>, <initializer_list> etc. before reaching us, so
the local includes were dead weight in every TU. Dropped.
(2) `using std::vector;` / `pair;` / `hash;` / `equal_to;` / `move;` /
`forward;` / `forward_iterator_tag;` block. Harmless in the default
build, but actively wrong in the EASTL config (das_config_eastl does
`using namespace eastl;`): those using-declarations would shadow
eastl::* with std::* and defeat the abstraction. Switched all
references to das:: prefix, which routes to std:: or eastl:: depending
on the active using-directive in the config.
(3) `throw std::out_of_range(...)` in at(). EASTL doesn't define
eastl::out_of_range (it uses std::out_of_range directly throughout its
own headers), and on libstdc++ <stdexcept> isn't transitively pulled by
das_config.h's includes — CI was failing on this on both Linux jobs and
the EASTL job. More importantly, games embedding daslang frequently
disable C++ exceptions entirely, so a raw `throw` in a low-level header
is the wrong primitive regardless. Switched to das::das_throw, which is
daslang's own setjmp/longjmp panic mechanism. Required widening
das_throw to be declared/defined unconditionally (it was previously
gated on DAS_ENABLE_EXCEPTIONS=0):
- das_config.h, das_config_eastl/das_config.h, include_fmt.h: move
the `void das_throw(const char *)` declaration out of the
DAS_ENABLE_EXCEPTIONS=0 #if. FMT_THROW macro stays conditional.
- runtime_string.cpp: add an implementation for the
DAS_ENABLE_EXCEPTIONS=1 case that routes through dasException, so
catch(dasException&) handlers in simulate_exceptions.cpp pick up
C++-side panics from low-level headers too.
Verified:
- Default libc++/std: full Release build clean, ctest 34/34 pass
- EASTL (das_config_eastl + cloned EASTL/EABase): daslang target builds
clean, binary runs and reports version
.gitignore: hide the local-verify checkout dirs (eastl/, eabase/,
build_eastl/).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4617cd1 to
6183e3f
Compare
2 tasks
pull Bot
pushed a commit
to forksnd/daScript
that referenced
this pull request
May 18, 2026
Eight blind-mouse cache cards accumulated across PRs GaijinEntertainment#2712/GaijinEntertainment#2714 (linq_fold work) and GaijinEntertainment#2716 (das_hash_map cleanup): - das-namespace-abstraction-std-vs-eastl-swap — how das:: routes to std:: or eastl:: via `namespace das { using namespace ...; }` in the two configs; why explicit `using std::vector` blocks inside `namespace das` are harmful for EASTL builds. - das-throw-universal-panic-primitive-low-level-headers — das_throw is daslang's setjmp/longjmp panic primitive; embedded games disable C++ exceptions, so raw `throw` is the wrong primitive in low-level headers. Captures the unconditional-declaration change from GaijinEntertainment#2716. - daslang-eastl-config-local-build-setup — clone EASTL + EABase separately (no longer submoduled), cmake invocation, what to test, the common `error: no member named 'X' in namespace 'das'` failure mode. - libstdcpp-vs-libcpp-transitive-stdexcept-asymmetry — why CI failed on Linux only on the first push of GaijinEntertainment#2716; libstdc++ doesn't pull <stdexcept> transitively via <vector>/<string>, libc++ does. - github-pr-body-angle-brackets-stripped-in-backticks — GitHub strips <vector> inside backticks in PR body markdown; use `<X>` entities and re-read after every update. - how-do-i-dedupe-a-select-projection-... — Phase 3d projection double-eval root cause and PR GaijinEntertainment#2714 fix. - inlining-a-sort-comparator-key-body-... — both forms evaluate the key body twice per comparison; sort-cmp inlining saves dispatch only. - qmacro-multi-arg-block-declaration-... — parser dup-check fires on `MACRO TAG` placeholder name before macro substitution can rename; PR GaijinEntertainment#2714 parser fix details. skills/das_macros.md: add a section about pre-setting `_type` on emitted ExprVar (and similar nodes) before they flow into typed positions — captures the 30165 trap from PR GaijinEntertainment#2714's try_make_inline_cmp work, since Expression::clone deep-copies _type faithfully and the typer's generic-instantiation pass runs before local-variable-resolution. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three issues in
include/das_hash_map/das_hash_map.h:1. 10 redundant
#includes. The header is only ever pulled viadas_config.h, which already includes<vector>,<utility>,<functional>,<string>,<type_traits>,<initializer_list>etc. before reaching us — so the local includes were dead weight in every TU.2.
using std::vector;/pair;/hash;/equal_to;/move;/forward;/forward_iterator_tag;block. Harmless in the default build, but actively wrong in the EASTL config (cmake/das_config_eastl/das_config.hdoesusing namespace eastl;): those using-declarations would shadoweastl::*withstd::*and defeat the abstraction. Switched all references to thedas::prefix throughout, which routes to eitherstd::oreastl::depending on the activeusing namespace ...directive.3.
throw std::out_of_range(...)inat(). EASTL doesn't defineeastl::out_of_range(it usesstd::out_of_rangedirectly throughout its own headers), and on libstdc++<stdexcept>isn't transitively pulled by das_config.h's includes — CI was failing on this on both Linux jobs and the EASTL job. More importantly, games embedding daslang frequently disable C++ exceptions entirely, so a rawthrowin a low-level header is the wrong primitive regardless. Switched todas::das_throw, which is daslang's ownsetjmp/longjmppanic mechanism. Required wideningdas_throwto be declared/defined unconditionally (it was previously gated onDAS_ENABLE_EXCEPTIONS=0):das_config.h,das_config_eastl/das_config.h,include_fmt.h: move thevoid das_throw(const char *)declaration out of theDAS_ENABLE_EXCEPTIONS=0#if.FMT_THROWmacro stays conditional.runtime_string.cpp: add an implementation for theDAS_ENABLE_EXCEPTIONS=1case that routes throughdasException, socatch(dasException&)handlers insimulate_exceptions.cpppick up C++-side panics from low-level headers too.Test plan
ctest --test-dir build: 34/34 pass-DDAS_CONFIG_INCLUDE_DIR=cmake/das_config_eastlagainst cloned EASTL + EABase):daslangtarget builds clean, binary runs and reports version.gitignore: hide local-verify checkout dirs (eastl/,eabase/,build_eastl/)🤖 Generated with Claude Code