From 1bfb7426d4925090b5b8e93aa401f68d5231dcf7 Mon Sep 17 00:00:00 2001 From: cnc Date: Thu, 4 Jun 2026 16:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E7=BB=84=EF=BC=8C=E5=AE=8C=E6=88=90=E5=B0=BD=E9=87=8F=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E3=80=82=E7=A6=81=E6=AD=A2=E9=A1=BA?= =?UTF-8?q?=E6=89=8B=E6=89=A9=E5=8A=9F=E8=83=BD=20smoke=EF=BC=9A=E9=94=81?= =?UTF-8?q?=E5=AE=9A=E6=B5=8F=E8=A7=88=E5=99=A8=E5=BA=94=E7=94=A8=E6=BA=90?= =?UTF-8?q?=E7=A0=81=E6=98=A0=E5=B0=84=E7=BB=93=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check-linuxcnc-browser-app-source-map.sh | 102 +++++++++++++++++++++++ docs/linuxcnc-browser-app-source-map.md | 50 +++++++++++ test-all-native.sh | 6 ++ test-linuxcnc-source-link.sh | 1 + test-native.sh | 1 + 5 files changed, 160 insertions(+) create mode 100755 check-linuxcnc-browser-app-source-map.sh create mode 100644 docs/linuxcnc-browser-app-source-map.md diff --git a/check-linuxcnc-browser-app-source-map.sh b/check-linuxcnc-browser-app-source-map.sh new file mode 100755 index 0000000..bb54b39 --- /dev/null +++ b/check-linuxcnc-browser-app-source-map.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")" + +# LinuxCNC source basis: this guard ties the browser app entry point to +# LinuxCNC RS274 parameter-file defaults, rs274ngc_pre.cc restore/save/read +# file semantics, and the existing OPFS-backed wasm-core bridge. It validates +# app integration policy only; it does not add CNC behavior or expand smoke +# parsing. +linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc} +linuxcnc_root=$(cd "$linuxcnc_root" && pwd) + +grep -F '#define RS274NGC_PARAMETER_FILE_NAME_DEFAULT "rs274ngc.var"' \ + "$linuxcnc_root/src/emc/rs274ngc/interp_internal.hh" >/dev/null +grep -F '#define RS274NGC_PARAMETER_FILE_BACKUP_SUFFIX ".bak"' \ + "$linuxcnc_root/src/emc/rs274ngc/interp_internal.hh" >/dev/null +grep -F 'int Interp::restore_parameters(const char *filename)' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'int Interp::save_parameters(const char *filename,' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'std::string tempfile = std::string(filename) + ".new";' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F '+ RS274NGC_PARAMETER_FILE_BACKUP_SUFFIX;' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'read_text(command, _setup.file_pointer, _setup.linetext,' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null + +grep -F 'LinuxCNC browser app source map' docs/linuxcnc-browser-app-source-map.md >/dev/null +grep -F 'must not add CNC behavior' docs/linuxcnc-browser-app-source-map.md >/dev/null +grep -F 'must not expand the temporary smoke parser' docs/linuxcnc-browser-app-source-map.md >/dev/null +grep -F '`RS274NGC_PARAMETER_FILE_NAME_DEFAULT` as `rs274ngc.var`' \ + docs/linuxcnc-browser-app-source-map.md >/dev/null +grep -F '`parseFileWithParameterFile(programPath, parameterPath, "linuxcnc", ...)`' \ + docs/linuxcnc-browser-app-source-map.md >/dev/null + +grep -F '' web/index.html >/dev/null +grep -F '' web/index.html >/dev/null +if [[ "$(grep -Fc '