def import_doc

bend-lint-rules@0.2.0.0 · layout/format.bend:2176

import bend-lint-rules@0.2.0.0/layout/format.bend as Format
import Base
import bend-lint-api@0.2.0.0/shared/strings.bend as Strings

2176# Paths and aliases have their own grammar: / and - are not operators there,
2177# so an import keeps its text and only its spacing changes.
2178def import_doc(+head: Token, record: List<&2, Tree>) -> Doc:
2179  import_doc.of(
2180    split_hash(
2181      trim_end(
2182        Strings.take(
2183          Token.from(head),
2184          U32.to_nat((record_end(head, record) - Token.beg(head): U32))
2185        )
2186      )
2187    )
2188  )

Uses (14)

Used by (1)