Repository navigation
feat: migrate P4 whitespace to pinned shared layout definitions - #250
Merged
Merged
Conversation
8 tasks done
18 tasks done
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.
P4 の grammar default と Formula / ImportDeclaration / VariableDeclaration が、明示 import した固定
std/layout@1.0.0のlayout.SPACES_AND_COMMENTSを参照します。従来の rule interleave は同じ位置の@whitespace(named)へ置換し、適用範囲と優先順位を保持しました。標準 artifact・manifest・exact lock/hash を同梱するため、parse/生成/LSP はオフラインで再現できます。unlaxer 3.3.0-SNAPSHOT は.github/unlaxer-source-pinの到達可能な exact commit から専用 Maven repository へ install して検証します。本番の固定 ubnfc は名前付き空白を直接扱えません。最小で可逆な選択として、std/layout の exact ID/version/hash・全定義・4 policy scopesを検証した場合だけ旧 javaStyle に下げる共通 adapter を再生成の Java/Rust 両経路へ追加しました。混在・未知・独自定義・改ざんは変換前に拒否します。汎用 package 対応とは扱わず、範囲表と後続 #249 に受け入れ条件を記録しています。標準集合が同じであるため、grammar→IR→本番生成物は旧 pin と byte 一致します。
実 P4 の14入力を Java old/new と本番 ubnfc Java/Rust で比較し、空白/TAB/LF/CRLF/行・block・未閉鎖コメント、文字列/Java code token 内部、import/declaration の受理・消費/最大一致位置・全 AST field/node spans・CST 原文・owned source positions を確認します。対応する P4 token/layout projection の29入力では Java・Java経由Rust・native Rust の生成物 bytes、独立 AST/span/診断 oracle、memo OFF/ON、局所 none を比較します。実 P4 全体の既存 portability 制限は範囲表に記載しています。
検証: 専用 repository の upstream fc75fe1e install、統合54tests/0 failure/0 skip(上記3生成器を実行)、P4 smoke171tests、LSP/DAP58tests、本番 Rust shared14入力 memo OFF/ON、strict adapter6tests、Java/Rust full regeneration byte一致。CI に同じ試験と comparison TSV の必須保存を追加しています。実 grammar の authoring snapshot でも定義全文・code-point 位置・std ID/version/hash を検証します。
unlaxer-parser #368 / PR417 に依存します。upstream PR merge後、必要なら exact source pin を最終統合headへ更新します。
Closes #248
CI の grammar fingerprint 旧値を修正し、API定数を --write 再生成時にも自動同期します。strict adapter は ubnfc 不在のoffline生成物検査でも実行します。Rust1.85 fmt、wholeworkspace test/clippy、release/C ABI、wasm32/release-smallと実Node smokeをローカルで成功させました。