def Node.is_bare

bend-lint-api@0.2.0.0 · linter/lint.bend:256

import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import Base

256# Whether a parameter is written bare (`def f(x)`, filling a law): its quantity is the law's, which its node does not
257# give.
258def Node.is_bare(node: Node) -> Bool:
259  match node:
260    case Node{Parameter{b, q}, n, s, Con{Node{QuantityType{}, kn, ks, kk, kf}, rest}, f}:
261      True{}
262    case _:
263      False{}

Uses (4)

Used by (2)