Skip to content

Commit

Permalink
Change the tracing types
Browse files Browse the repository at this point in the history
  • Loading branch information
oovm committed Jun 17, 2024
1 parent b9ef3f4 commit edb0b42
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 32 deletions.
2 changes: 0 additions & 2 deletions packages/valkyrie-esoteric/source/effect/effect.valkyrie
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ let n: usize = raise Double(1);
# n = 2




class Counter {
count: usize = 99
}
Expand Down
17 changes: 10 additions & 7 deletions packages/valkyrie-esoteric/source/expression/class.vk
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,30 @@ class A4⟨T⟩ {

⍝ https:⍝crates.io/crates/custom_debug_derive
class A3⟨T⟩ {
↯debug(rename="new_name")
show.debug(rename="new_name")
name: u32
↯debug(skip)
show.debug(skip)
skip: u32
}


↯Serialize
↯Deserialize
class B: Serialize + Deserialize {
[Serialize, Deserialize]
derive(Serialize, Deserialize)
class B: !Serialize + !Deserialize {
a: Integer,
b: Integer,
}

class C {
x,
get set x,
↯[get, set]
y,
↯get({ self.x })
↯set
z,
}

let val = @type_of(a);
let val = @typus(a);
let bbb = f(x).m(y)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ if [] {}
if [1:2] {}
if [1:2:3] {}

if constant {}
if function() {}
if @macro {}
if `constant` {}
if `function`() {}
if @micro {}
if @macro() {}
if x.field {}
if x.method() {}


scope {
if expression is not Integer {}
if expression is not Some(Integer) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ if (a is {mutable: bool}) {
if (a is Object {mutable: bool}) {

}
if (a is unity⸬Variant {mutable: bool}) {
if (a is Unity⸬Variant {mutable: bool}) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ match tuple {
case (mut a, ref b) if a > 0 && b > 0:
case Tuple(a, b):
case Tuple((a, b), c):
case Tuple(Some(a), ⁜unity⸬Variant):
case Tuple(Some(a), ⁜Unity⸬Variant):
}

match array {
case []:
case [a, ]:
case [mut a, b]:
case [none]:
case [unity⸬Variant]:
case [Unity⸬Variant]:
case [[a], b]:
case [[a], [b]]:
case [[a, b], c]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ match tuple {
type (Type, ):
type Tuple(Type, Type):
type Tuple((Type, Type), Type):
type Tuple(Some(Type), ⁜unity⸬Variant):
type Tuple(Some(Type), ⁜Unity⸬Variant):
}

match array {
type []:
type [Type]:
type [Type, ]:
type [unity⸬Variant]:
type [Unity⸬Variant]:
type [[Type], Type]:
type [[Type], [Type]]:
type [[Type, Type], Type]:
Expand Down
10 changes: 2 additions & 8 deletions packages/valkyrie-esoteric/source/statement/match-when.valkyrie
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ match tuple {
when (a, ):
when Tuple(a, b):
when Tuple((a, b), c):
when Tuple(Some(a), ⁜unity⸬Variant):
when Tuple(Some(a), ⁜Unity⸬Variant):
}

match array {
when []:
when [a, ]:
when [none]:
when [unity⸬Variant]:
when [Unity⸬Variant]:
when [[a], b]:
when [[a], [b]]:
when [[a, b], c]:
Expand All @@ -34,15 +34,9 @@ match x <- `object` {
when x == call():
when x == x.call():
when x == new B {}:
⍝ when {a: Type, }:
⍝ when {a: Type, b: Type}:
⍝ when Object {a: Type, b: Type}:
⍝ when Object {a: {a: Type, b: Type}, c: Type}:
⍝ when Object {a: Some(_), b: Type}:
}
scope {
();
(a);
(a, );
}

12 changes: 6 additions & 6 deletions packages/valkyrie-standard/test/tracing.vk
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ using package.trace.Tracing.{self, debug, print, alert, error};
class Tracing {
level: u8,
message: String,
namespace: [String],
# `namespace`: [String],
newline: bool,
}

extends Tracing {
print(newline: bool = true) {
raise new Tracing {
level: 30,
namespace: @caller.namepath,
newline,
}
# raise new Tracing {
# level: 30,
# namespace: @caller.namepath,
# newline,
# }
}
}

Expand Down

0 comments on commit edb0b42

Please sign in to comment.