expressir 2.4.51 → 2.4.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env bash
2
2
  # Corpus parity (issue #578 STEP 1 gate): every .exp fixture must parse
3
3
  # identically through the DSL and the edition-2 artifact.
4
- # PARITY_LIB: a parsanol checkout whose lib/ carries the compiler fix —
5
- # PARITY_LIB=~/src/lutaml/parsanol-capfix/lib ./parity.sh
4
+ # PARITY_LIB: a parsanol checkout whose lib/ carries unreleased fixes —
5
+ # PARITY_LIB=~/src/lutaml/parsanol-noedition1/lib ./parity.sh
6
+ # (applies to the CLI artifact lane too, not just the in-process one)
6
7
  set -uo pipefail
7
8
  cd "$(dirname "$0")"
8
- EXE=/Users/mulgogi/.local/share/mise/installs/ruby/3.4.8/lib/ruby/gems/3.4.0/gems/parsanol-1.3.121-arm64-darwin/exe/parsanol
9
+ EXE="${PARSANOL_EXE:-$(bundle exec which parsanol)}"
10
+ ARTIFACT="$(pwd)/express-grammar.artifact.json"
9
11
  LIB="${PARITY_LIB:-}"
10
12
 
11
13
  # Oversized fixtures bypass the CLI argv limit: parse through the
@@ -13,14 +15,16 @@ LIB="${PARITY_LIB:-}"
13
15
  big_parity() {
14
16
  ruby ${LIB:+-I "$LIB"} -e '
15
17
  require "parsanol"
16
- require "json"
17
- artifact = Parsanol::PARG::Artifact.from_json(File.read("/tmp/serialized.json"))
18
+ # The split artifact replays its source; the component sources must
19
+ # sit beside it (imports_dir), exactly as the gem lane passes them.
20
+ artifact = Parsanol::PARG::Artifact.from_json(
21
+ File.read(ARGV[1]), imports_dir: File.dirname(ARGV[1]))
18
22
  begin
19
23
  artifact.parse("syntax", File.read(ARGV[0]), mode: :ruby)
20
24
  exit 0
21
25
  rescue StandardError
22
26
  exit 1
23
- end' "$1" > /dev/null 2>&1
27
+ end' "$1" "$ARTIFACT" > /dev/null 2>&1
24
28
  }
25
29
 
26
30
  pass=0; fail=0; skipped=0
@@ -43,7 +47,7 @@ for f in $(find /Users/mulgogi/src/lutaml/expressir/spec -name "*.exp" | sort);
43
47
  fi
44
48
  src="$(cat "$f")"
45
49
  # artifact accept?
46
- if ruby "$EXE" parg parse /tmp/serialized.json --entry syntax "$src" \
50
+ if ruby ${LIB:+-I "$LIB"} "$EXE" parg parse "$ARTIFACT" --entry syntax "$src" \
47
51
  > /tmp/par-artifact.log 2>&1; then art=ok; else art=fail; fi
48
52
  # DSL accept?
49
53
  if bundle exec ruby -e '
@@ -40,6 +40,13 @@ module Expressir
40
40
  JSON.parse(::Expressir::Core.parse_to_model_hash(source, path))
41
41
  end
42
42
 
43
+ # Scan remarks (issue #20): an Array of Hashes mirroring
44
+ # RemarkScanner::Remark's fields (position, end_position, line,
45
+ # text, tag, format), straight from the Rust scanner.
46
+ def self.scan_remarks(source)
47
+ ::Expressir::Core.scan_remarks(source)
48
+ end
49
+
43
50
  # Parse EXPRESS source into the hydrated model directly: the
44
51
  # extension walks the wire definition once and constructs every
45
52
  # node through Serializable.instantiate (lutaml-model's fast