lang: funcs: structs: Improve naming

These could print nicer for debugging.
This commit is contained in:
James Shubin
2024-12-08 16:24:42 -05:00
parent 5ff4f0456a
commit 28f5b8331a
34 changed files with 247 additions and 243 deletions

View File

@@ -31,5 +31,5 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const: bool(false)
Vertex: const: bool(true)

View File

@@ -8,19 +8,19 @@ class c1($b) {
-- OUTPUT --
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: call -> composite # 0
Edge: const -> composite # 0
Edge: const -> composite # 1
Edge: const -> composite # 2
Edge: const -> composite # 3
Edge: call -> composite: []str # 0
Edge: const: int(-37) -> composite: []int # 3
Edge: const: int(0) -> composite: []int # 2
Edge: const: int(13) -> composite: []int # 0
Edge: const: int(42) -> composite: []int # 1
Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: composite
Vertex: composite
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: composite: []int
Vertex: composite: []str
Vertex: const: int(-37)
Vertex: const: int(0)
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: str("len is: %d")

View File

@@ -24,9 +24,9 @@ Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: call -> composite # 0
Edge: call -> composite # 0
Edge: call -> composite # 0
Edge: call -> composite: []str # 0
Edge: call -> composite: []str # 0
Edge: call -> composite: []str # 0
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
@@ -45,23 +45,23 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: composite
Vertex: composite
Vertex: composite
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: composite: []str
Vertex: composite: []str
Vertex: composite: []str
Vertex: const: int(1)
Vertex: const: int(13)
Vertex: const: int(2)
Vertex: const: int(3)
Vertex: const: int(4)
Vertex: const: int(4)
Vertex: const: int(4)
Vertex: const: int(42)
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("test-%d-%d")
Vertex: const: str("test-%d-%d")
Vertex: const: str("test-%d-%d")

View File

@@ -8,6 +8,6 @@ class c1($a) {
}
$foo = "hey"
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("hey")
Vertex: const: str("t1")
Vertex: const: str("t2")

View File

@@ -20,11 +20,11 @@ pkg "cowsay" {
Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("/tmp/foo")
Vertex: const: str("/tmp/foo")
Vertex: const: str("cowsay")
Vertex: const: str("cowsay")
Vertex: const: str("hello world")
Vertex: const: str("hello world")
Vertex: const: str("installed")
Vertex: const: str("newest")

View File

@@ -15,5 +15,5 @@ Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const: str("a")
Vertex: const: str("b")

View File

@@ -4,4 +4,4 @@
# unification solving, but now we can support it without that.
test [] {}
-- OUTPUT --
Vertex: composite
Vertex: composite: []str

View File

@@ -9,12 +9,12 @@ test $names {}
# multiples resources, defined by list
test ["hello", "world",] {}
-- OUTPUT --
Edge: const -> composite # 0
Edge: const -> composite # 0
Edge: const -> composite # 1
Vertex: composite
Vertex: composite
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Edge: const: str("hello") -> composite: []str # 0
Edge: const: str("hey") -> composite: []str # 0
Edge: const: str("world") -> composite: []str # 1
Vertex: composite: []str
Vertex: composite: []str
Vertex: const: str("hello")
Vertex: const: str("hey")
Vertex: const: str("name")
Vertex: const: str("world")

View File

@@ -8,6 +8,6 @@ test "t" {
stringptr => $x,
}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: str("hello")
Vertex: const: str("t")

View File

@@ -9,6 +9,6 @@ if true {
}
}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: str("t")
Vertex: const: str("world")

View File

@@ -12,8 +12,8 @@ test "t1" {
stringptr => $x,
}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: str("hello")
Vertex: const: str("t1")
Vertex: const: str("t2")
Vertex: const: str("world")

View File

@@ -8,7 +8,7 @@ pkg "cowsay" {
state => "newest",
}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("cowsay")
Vertex: const: str("cowsay")
Vertex: const: str("installed")
Vertex: const: str("newest")

View File

@@ -7,5 +7,5 @@ $c = $b
$b = $a
$a = 42
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const: int(42)
Vertex: const: str("t")

View File

@@ -4,4 +4,4 @@ if $b {
}
$b = true
-- OUTPUT --
Vertex: const
Vertex: const: bool(true)

View File

@@ -7,7 +7,7 @@ test "t" {
Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: str("+")
Vertex: const: str("t")

View File

@@ -10,9 +10,9 @@ Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: int(99)
Vertex: const: str("+")
Vertex: const: str("-")
Vertex: const: str("t")

View File

@@ -11,8 +11,8 @@ $i = 13
Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: str("+")
Vertex: const: str("t")

View File

@@ -10,6 +10,6 @@ test "greeting" {
Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("greeting")
Vertex: const: str("hello: %s")
Vertex: const: str("world")

View File

@@ -18,11 +18,11 @@ class xclass {
-- OUTPUT --
Edge: FuncValue -> call # fn
Edge: call -> if # c
Edge: const -> if # a
Edge: const -> if # b
Edge: const: str("bbb") -> if # a
Edge: const: str("ccc") -> if # b
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("bbb")
Vertex: const: str("ccc")
Vertex: const: str("hello")
Vertex: if

View File

@@ -17,11 +17,11 @@ class xclass {
-- OUTPUT --
Edge: FuncValue -> call # fn
Edge: call -> if # c
Edge: const -> if # a
Edge: const -> if # b
Edge: const: str("bbb") -> if # a
Edge: const: str("ccc") -> if # b
Vertex: FuncValue
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("bbb")
Vertex: const: str("ccc")
Vertex: const: str("hello")
Vertex: if

View File

@@ -17,4 +17,4 @@ Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: const
Vertex: const: str("world")

View File

@@ -83,21 +83,21 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: int(3)
Vertex: const: int(42)
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("hello")
Vertex: const: str("hello2")
Vertex: const: str("hello3")
Vertex: const: str("i am github.com/purpleidea/mgmt-example1/ and i contain: ")
Vertex: const: str("i am github.com/purpleidea/mgmt-example1/ and i contain: ")
Vertex: const: str("i imported local: %s")
Vertex: const: str("i imported remote: %s and %s")
Vertex: const: str("the answer is: %d")
Vertex: const: str("this is module mod1 which contains: ")
Vertex: const: str("this is the nested git module mod1")
Vertex: const: str("this is the nested git module mod1")
Vertex: const: str("this is the nested local module mod1")

View File

@@ -14,10 +14,10 @@ Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: const -> composite # 0
Edge: const -> composite # 1
Edge: const -> composite # 2
Edge: const -> composite # 3
Edge: const: int(-37) -> composite: []int # 3
Edge: const: int(0) -> composite: []int # 2
Edge: const: int(13) -> composite: []int # 0
Edge: const: int(42) -> composite: []int # 1
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
@@ -26,13 +26,13 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: composite
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: composite: []int
Vertex: const: int(-37)
Vertex: const: int(0)
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: str("hello")
Vertex: const: str("len is: %d")
Vertex: const: str("len is: %d")
Vertex: const: str("t1")
Vertex: const: str("t2")

View File

@@ -81,21 +81,21 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: int(3)
Vertex: const: int(42)
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("+")
Vertex: const: str("hello")
Vertex: const: str("hello2")
Vertex: const: str("hello3")
Vertex: const: str("i am github.com/purpleidea/mgmt-example1/ and i contain: ")
Vertex: const: str("i am github.com/purpleidea/mgmt-example1/ and i contain: ")
Vertex: const: str("i imported local: %s")
Vertex: const: str("i imported remote: %s and %s")
Vertex: const: str("the answer is: %d")
Vertex: const: str("this is module mod1 which contains: ")
Vertex: const: str("this is the nested git module mod1")
Vertex: const: str("this is the nested git module mod1")
Vertex: const: str("this is the nested local module mod1")

View File

@@ -25,41 +25,41 @@ test "test" {
#},
}
-- OUTPUT --
Edge: composite -> composite # sema
Edge: const -> composite # 0
Edge: const -> composite # 1
Edge: const -> composite # autoedge
Edge: const -> composite # autogroup
Edge: const -> composite # burst
Edge: const -> composite # delay
Edge: const -> composite # dollar
Edge: const -> composite # limit
Edge: const -> composite # noop
Edge: const -> composite # poll
Edge: const -> composite # realize
Edge: const -> composite # reset
Edge: const -> composite # retry
Edge: const -> composite # retryreset
Edge: const -> composite # reverse
Edge: const -> composite # rewatch
Vertex: composite
Vertex: composite
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Edge: composite: []str -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # sema
Edge: const: bool(false) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # dollar
Edge: const: bool(false) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # noop
Edge: const: bool(false) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # reset
Edge: const: bool(false) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # retryreset
Edge: const: bool(false) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # rewatch
Edge: const: bool(true) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # autoedge
Edge: const: bool(true) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # autogroup
Edge: const: bool(true) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # realize
Edge: const: bool(true) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # reverse
Edge: const: float(4.2) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # limit
Edge: const: int(-1) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # retry
Edge: const: int(0) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # delay
Edge: const: int(3) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # burst
Edge: const: int(5) -> composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool} # poll
Edge: const: str("bar:3") -> composite: []str # 1
Edge: const: str("foo:1") -> composite: []str # 0
Vertex: composite: []str
Vertex: composite: struct{noop bool; retry int; retryreset bool; delay int; poll int; limit float; burst int; reset bool; sema []str; rewatch bool; realize bool; dollar bool; reverse bool; autoedge bool; autogroup bool}
Vertex: const: bool(false)
Vertex: const: bool(false)
Vertex: const: bool(false)
Vertex: const: bool(false)
Vertex: const: bool(false)
Vertex: const: bool(true)
Vertex: const: bool(true)
Vertex: const: bool(true)
Vertex: const: bool(true)
Vertex: const: bool(true)
Vertex: const: float(4.2)
Vertex: const: int(-1)
Vertex: const: int(0)
Vertex: const: int(3)
Vertex: const: int(5)
Vertex: const: str("bar:3")
Vertex: const: str("foo:1")
Vertex: const: str("test")
Vertex: const: str("test")

View File

@@ -6,5 +6,5 @@ if true {
}
test "${x}" {}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: str("hello")

View File

@@ -6,5 +6,5 @@ if true {
test "${x}" {}
}
-- OUTPUT --
Vertex: const
Vertex: const
Vertex: const: bool(true)
Vertex: const: str("world")

View File

@@ -11,12 +11,12 @@ test [$out1 + $out2,] {}
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: call -> composite # 0
Edge: call -> composite: []str # 0
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: composite
Vertex: const
Vertex: composite: []str
Vertex: const: str("+")

View File

@@ -14,11 +14,11 @@ test [$out1 + $out2,] {}
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: call -> composite # 0
Edge: call -> composite: []str # 0
Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: composite
Vertex: const
Vertex: composite: []str
Vertex: const: str("+")

View File

@@ -73,33 +73,33 @@ Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("")
Vertex: const: str("/tmp/mgmt/state")
Vertex: const: str("/tmp/mgmt/state")
Vertex: const: str("/tmp/mgmt/state")
Vertex: const: str("/usr/bin/sleep 1s")
Vertex: const: str("/usr/bin/sleep 1s")
Vertex: const: str("/usr/bin/sleep 1s")
Vertex: const: str("==")
Vertex: const: str("==")
Vertex: const: str("==")
Vertex: const: str("==")
Vertex: const: str("default")
Vertex: const: str("default")
Vertex: const: str("estate")
Vertex: const: str("one")
Vertex: const: str("one")
Vertex: const: str("or")
Vertex: const: str("state: one\n")
Vertex: const: str("state: three\n")
Vertex: const: str("state: two\n")
Vertex: const: str("three")
Vertex: const: str("three")
Vertex: const: str("timer")
Vertex: const: str("timer")
Vertex: const: str("timer")
Vertex: const: str("timer")
Vertex: const: str("timer")
Vertex: const: str("timer")
Vertex: const: str("two")
Vertex: const: str("two")

View File

@@ -23,6 +23,6 @@ Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("greeting1")
Vertex: const: str("greeting2")
Vertex: const: str("greeting3")

View File

@@ -25,6 +25,6 @@ Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: const
Vertex: const
Vertex: const
Vertex: const: str("greeting1")
Vertex: const: str("greeting2")
Vertex: const: str("greeting3")