$ check main
= 0
stacks 0
fn my.bare none
fn my.qualified none
fn my.words none
fn my.safe none
fn my.range none
fn my.decimal none
fn my.alias none
fn my.outer none
fn my.path none
fn my.rootpath none
fn app.wide none
fn outward.inner.c.above none
fn outward.inner.c.foo none
fn outward.inner.c.inner none
fn outward.inner.foo none
$ cc main
= 0
$ fmt my.bare
= 0
-- The bare name would be read as digits, 0xb as 11, so the name is
-- written in full: a definition of the root's, and one of any namespace's.
fn bare n int -> int = n + 0@my.xb + 0@xc
$ full my.bare
= 0
-- The bare name would be read as digits, 0xb as 11, so the name is
-- written in full: a definition of the root's, and one of any namespace's.
fn bare n int -> int = n + 0@my.xb + 0@xc
$ fmt my.qualified
= 0
-- A qualifier that begins with x is read so too.
fn qualified n int -> int = n + 0@my.xs.ms + 0@xa.ms
$ full my.qualified
= 0
-- A qualifier that begins with x is read so too.
fn qualified n int -> int = n + 0@my.xs.ms + 0@xa.ms
$ fmt my.words
= 0
-- Whatever follows the x: 0xA is 10, and 0x_b no number.
fn words n int -> int = n + 0@my.xA + 0@my.x_b + 0@my.x_s.ms + 1xA
$ full my.words
= 0
-- Whatever follows the x: 0xA is 10, and 0x_b no number.
fn words n int -> int = n + 0@my.xA + 0@my.x_b + 0@my.x_s.ms + 1@my.xA
$ fmt my.safe
= 0
-- Only the number 0 takes the x, and only a lower-case one.
fn safe n int -> int = n + 1xb + 00xb + 10xb + 1xs.ms + 0X1 + 0lib.unit.KB
$ full my.safe
= 0
-- Only the number 0 takes the x, and only a lower-case one.
fn safe n int -> int = n + 1@my.xb + 00@my.xb + 10@my.xb + 1@my.xs.ms + 0@my.X1 + 0@lib.unit.KB
$ fmt my.decimal
= 0
fn decimal n float -> float = n + 0.0xf
$ full my.decimal
= 0
fn decimal n float -> float = n + 0.0@my.xf
$ fmt my.range
= 0
fn range n int -> int = {
  var sum = n
  for i in 0@my.xb..0@my.xb { sum = sum + i }
  sum
}
$ full my.range
= 0
fn range n int -> int = {
  var sum = n
  for i in 0@my.xb..0@my.xb { sum = sum + i }
  sum
}
$ fmt my.alias
= 0
-- A name that use binds is a qualifier as any other.
fn alias n int -> int = {
  use lib.unit.xs
  let a = n + 1xs.ms + 2xs.ms + 3xs.ms + 4xs.ms + 5xs.ms
  a + 0lib.unit.xs.ms + 0lib.unit.xs.xm
}
$ full my.alias
= 0
-- A name that use binds is a qualifier as any other.
fn alias n int -> int = {
  let a = n + 1@lib.unit.xs.ms + 2@lib.unit.xs.ms + 3@lib.unit.xs.ms + 4@lib.unit.xs.ms + 5@lib.unit.xs.ms
  a + 0@lib.unit.xs.ms + 0@lib.unit.xs.xm
}
$ fmt my.outer
= 0
-- Both names are bound by a use. After 0 the first word is unit, not xs.
fn outer n int -> int = {
  use lib.unit.xs lib.unit
  let a = n + 1xs.ms + 2xs.ms + 3xs.ms + 4xs.ms
  let b = a + 1unit.KB + 2unit.KB + 3unit.KB + 4unit.KB
  b + 0unit.xs.ms + 0unit.KB
}
$ full my.outer
= 0
-- Both names are bound by a use. After 0 the first word is unit, not xs.
fn outer n int -> int = {
  let a = n + 1@lib.unit.xs.ms + 2@lib.unit.xs.ms + 3@lib.unit.xs.ms + 4@lib.unit.xs.ms
  let b = a + 1@lib.unit.KB + 2@lib.unit.KB + 3@lib.unit.KB + 4@lib.unit.KB
  b + 0@lib.unit.xs.ms + 0@lib.unit.KB
}
$ fmt my.path
= 0
-- No number stands before the path of a use, so an x may begin it.
fn path n int -> int = {
  use xs.deeper
  let a = n + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms
  a + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms
}
$ full my.path
= 0
-- No number stands before the path of a use, so an x may begin it.
fn path n int -> int = {
  let a = n + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms
  a + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms + 0@my.xs.deeper.ms
}
$ fmt my.rootpath
= 0
fn rootpath n int -> int = {
  use xa.deeper
  let a = n + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms
  a + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms
}
$ full my.rootpath
= 0
fn rootpath n int -> int = {
  let a = n + 0@xa.deeper.ms + 0@xa.deeper.ms + 0@xa.deeper.ms + 0@xa.deeper.ms
  a + 0@xa.deeper.ms + 0@xa.deeper.ms + 0@xa.deeper.ms + 0@xa.deeper.ms
}
$ fmt app.wide
= 0
-- Every unit of 0 here is safe under its use, so the rule for 0 does not
-- change which names a use binds. longlibs.unit is tried before xs.deeper.
-- With the units of xs.deeper in full until then, the if would pass 100
-- columns and longlibs.unit would pay for its line.
fn wide threshold int -> int = {
  use xs.deeper
  let a = if threshold > 2longlibs.unit.KB then { 3longlibs.unit.KB + 1 } else { 0deeper.ms }
  a + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms + 0deeper.ms
}
$ full app.wide
= 0
-- Every unit of 0 here is safe under its use, so the rule for 0 does not
-- change which names a use binds. longlibs.unit is tried before xs.deeper.
-- With the units of xs.deeper in full until then, the if would pass 100
-- columns and longlibs.unit would pay for its line.
fn wide threshold int -> int = {
  let a = if threshold > 2@longlibs.unit.KB then {
    3@longlibs.unit.KB + 1
  } else {
    0@app.xs.deeper.ms
  }
  a + 0@app.xs.deeper.ms + 0@app.xs.deeper.ms + 0@app.xs.deeper.ms + 0@app.xs.deeper.ms + 0@app.xs.deeper.ms
}
$ fmt outward.inner.c.above
= 0
-- The same for outward.inner, which begins the full names of xs.q and not
-- their short form.
fn above n int -> int = {
  let x = outward.inner.foo n + outward.inner.foo 1
  if n > 1 then {
    use xs.q
    let y = x + 0q.ms + 0q.ms + 0q.ms
    y + 0q.ms + 0q.ms
  } else x
}
$ full outward.inner.c.above
= 0
-- The same for outward.inner, which begins the full names of xs.q and not
-- their short form.
fn above n int -> int = {
  let x = @outward.inner.foo n + @outward.inner.foo 1
  if n > 1 then {
    let y = x + 0@outward.inner.xs.q.ms + 0@outward.inner.xs.q.ms + 0@outward.inner.xs.q.ms
    y + 0@outward.inner.xs.q.ms + 0@outward.inner.xs.q.ms
  } else x
}
