diff --git a/daslib/imgui_node_editor_lint.das b/daslib/imgui_node_editor_lint.das index d31559d..c4462f2 100644 --- a/daslib/imgui_node_editor_lint.das +++ b/daslib/imgui_node_editor_lint.das @@ -36,7 +36,6 @@ module imgui_node_editor_lint shared private //! lint / daspkg install). require daslib/ast_boost -require strings let private ALLOWED_NE : table <- { // Geometry / topology / selection reads — pure queries, no host needed (the @@ -75,8 +74,9 @@ class NodeEditorLintVisitor : AstVisitor { } def override preVisitExprCall(var expr : ExprCall?) : void { - // Also skips macro-synthesized call sites: their `at` points at the macro template's file, not the user's. + // a spliced wrapper body is `generated` and carries the CALL SITE's location, so the file compare below cannot see it if (expr.func == null || expr.func._module == null + || expr.genFlags.generated || (current_function != null && (current_function.flags.generated || (current_function.at.fileInfo != null @@ -86,7 +86,7 @@ class NodeEditorLintVisitor : AstVisitor { let fname = string(expr.func.name) if (!key_exists(ALLOWED_NE, fname)) { compiling_program() |> macro_error(expr.at, - "NODEEDITOR001: raw imgui_node_editor::{fname} is forbidden — use the wrapper in modules/dasImguiNodeEditor/daslib/imgui_node_editor_boost_v2.das (node/pin/link, begin_create/begin_delete + query/accept/reject, get_selected_*/select_*/clear_selection, create_node_editor/node_editor). Bypassing the create/delete wrappers breaks live-command queue injection. If {fname} is a genuinely host-agnostic read, extend ALLOWED_NE in imgui_node_editor_lint.das. Per-file escape: `options _allow_node_editor_native = true`.") + "NODEEDITOR001: raw imgui_node_editor::{fname} is forbidden - use the wrapper in modules/dasImguiNodeEditor/daslib/imgui_node_editor_boost_v2.das (node/pin/link, begin_create/begin_delete + query/accept/reject, get_selected_*/select_*/clear_selection, create_node_editor/node_editor). Bypassing the create/delete wrappers breaks live-command queue injection. If {fname} is a genuinely host-agnostic read, extend ALLOWED_NE in imgui_node_editor_lint.das. Per-file escape: `options _allow_node_editor_native = true`.") } } } diff --git a/src/cb_dasIMGUI_NODE_EDITOR.h b/src/cb_dasIMGUI_NODE_EDITOR.h index 48dfe67..2ad7ea1 100644 --- a/src/cb_dasIMGUI_NODE_EDITOR.h +++ b/src/cb_dasIMGUI_NODE_EDITOR.h @@ -8,7 +8,7 @@ namespace das { template <> struct typeFactory { static TypeDeclPtr make(const ModuleLibrary &) { - auto t = new TypeDecl(Type::tInt); + auto t = new TypeDecl(Type::tInt, cppBindingLineInfo()); t->alias = "ax::NodeEditor::NodeId"; t->aotAlias = true; return t; @@ -31,7 +31,7 @@ template <> struct cast_res { template <> struct typeFactory { static TypeDeclPtr make(const ModuleLibrary &) { - auto t = new TypeDecl(Type::tInt); + auto t = new TypeDecl(Type::tInt, cppBindingLineInfo()); t->alias = "ax::NodeEditor::PinId"; t->aotAlias = true; return t; @@ -54,7 +54,7 @@ template <> struct cast_res { template <> struct typeFactory { static TypeDeclPtr make(const ModuleLibrary &) { - auto t = new TypeDecl(Type::tInt); + auto t = new TypeDecl(Type::tInt, cppBindingLineInfo()); t->alias = "ax::NodeEditor::LinkId"; t->aotAlias = true; return t; diff --git a/tests/integration/test_clipboard_tutorial.das b/tests/integration/test_clipboard_tutorial.das index 8e322cf..b459c09 100644 --- a/tests/integration/test_clipboard_tutorial.das +++ b/tests/integration/test_clipboard_tutorial.das @@ -16,8 +16,10 @@ require daslib/json_boost public //! it. The node count confirms the app's clipboard recreated the topology. //! //! imgui-node-editor checks io.KeyCtrl directly, so the user chord is Ctrl on every platform -//! (NOT Cmd on macOS — unlike an ImGui InputText). The synthetic AddKeyEvent path swaps -//! Ctrl/Super under ConfigMacOSXBehaviors, so this test feeds Super there to surface io.KeyCtrl. +//! (NOT Cmd on macOS - unlike an ImGui InputText). Synth keys are LOGICAL: dasImgui pre-swaps +//! Ctrl/Super under ConfigMacOSXBehaviors to cancel ImGui's own AddKeyEvent swap +//! (imgui_boost_runtime.das), so feeding Ctrl lands as io.KeyCtrl everywhere - feeding Super +//! there double-swaps and no chord fires. //! Distinct from test_clipboard.das / test_shortcuts.das, which drive shader_graph through the //! ne_shortcut INJECTION rail; this proves the real key chord routes through the same //! accept_ path end to end. @@ -31,9 +33,7 @@ def test_clipboard_tutorial(t : T?) { t |> success(s.handle != uint64(0), "editor handle present") if (s.handle == uint64(0)) return let canvas = s.canvas - var initial_snap = ne_snapshot(s) - let macos = initial_snap?["io"]?["config_macos_behaviors"] ?? false - let shortcut_mod = macos ? "Super" : "Ctrl" + let shortcut_mod = "Ctrl" t |> success(ne_wait_widget(s, "node_1", 15.0f) != null, "seed graph rendered") t |> equal(ne_node_count(s), 2, "2 seed nodes initially")