Pack-pattern parsing #
This module parses the fixed axes surrounding a unique packed * axis and
proves canonical rendering round trips.
def
TorchLean.Tensor.Internal.Syntax.parsePackPattern
(source : String)
(policy : IdentifierPolicy := IdentifierPolicy.pythonUnicode)
:
Parse the separate pack and unpack pattern grammar.
Instances For
theorem
TorchLean.Tensor.Internal.Syntax.parsePackPattern_render_eq_ok
(source : String)
(pattern : PackPattern)
(hParse : parsePackPattern source = Except.ok pattern)
:
Parsing a successful pack or unpack pattern's canonical rendering
succeeds with the same ordered fixed axes and packed-segment boundary.
The reparsed pattern has fresh source spans. Comparing renderings intentionally ignores those diagnostic locations while preserving every syntactic choice used by pack and unpack checking.