按规划继续工作
结论:解释器 WASM、SDK 统一入口、浏览器解释器 smoke 与兼容性文档已闭环,native 和 host/WASM/browser 验证全部通过。
This commit is contained in:
@@ -4,7 +4,8 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
TMP_FILE="$(mktemp)"
|
||||
trap 'rm -f "$TMP_FILE"' EXIT
|
||||
VIOLATION_FILE="$(mktemp)"
|
||||
trap 'rm -f "$TMP_FILE" "$VIOLATION_FILE"' EXIT
|
||||
|
||||
find \
|
||||
"$ROOT_DIR/runtime" \
|
||||
@@ -15,11 +16,44 @@ find \
|
||||
! -path "$ROOT_DIR/vendor/*" \
|
||||
! -path "$ROOT_DIR/runtime/ui/ini-panel/linuxcnc_ini.js" \
|
||||
-print0 |
|
||||
xargs -0 grep -nE '^[[:space:]]*int[[:space:]]+Interp::convert_g[[:space:]]*\(' > "$TMP_FILE" || true
|
||||
xargs -0 grep -nE '^[[:space:]]*([A-Za-z_][A-Za-z0-9_:<>~*&[:space:]]+[[:space:]]+)?Interp::[A-Za-z_~][A-Za-z0-9_]*[[:space:]]*\(' > "$TMP_FILE" || true
|
||||
|
||||
if [[ -s "$TMP_FILE" ]]; then
|
||||
echo "standalone Interp::convert_g definitions are not allowed:" >&2
|
||||
cat "$TMP_FILE" >&2
|
||||
ALLOWED_STUB_FILE="$ROOT_DIR/runtime/core/linuxcnc_wrap/linuxcnc_interp_edge_stubs.cpp"
|
||||
|
||||
is_allowed_interp_stub() {
|
||||
local line="$1"
|
||||
|
||||
case "$line" in
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_pycallable\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_user_defined_g_code\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_any_m_code_remapped\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_user_defined_m_code\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_m_code_remappable\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::is_g_code_remappable\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::remap_in_progress\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::remapping\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::parse_remap\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::convert_remapped_code\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::add_parameters\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::pycall\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::py_execute\(* | \
|
||||
"$ALLOWED_STUB_FILE":*Interp::py_reload\(*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
while IFS= read -r line; do
|
||||
if ! is_allowed_interp_stub "$line"; then
|
||||
printf '%s\n' "$line" >> "$VIOLATION_FILE"
|
||||
fi
|
||||
done < "$TMP_FILE"
|
||||
|
||||
if [[ -s "$VIOLATION_FILE" ]]; then
|
||||
echo "standalone Interp member definitions are not allowed outside documented runtime-edge stubs:" >&2
|
||||
cat "$VIOLATION_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user