Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions meta/src/meta/grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,12 @@ attribute
$4: Sequence[logic.Value] = $$.args

algorithm
: "(" "algorithm" relation_id* script ")"
construct: $$ = logic.Algorithm(global=$3, body=$4)
: "(" "algorithm" relation_id* script attrs? ")"
construct: $$ = logic.Algorithm(global=$3, body=$4, attrs=builtin.unwrap_option_or($5, list[logic.Attribute]()))
deconstruct:
$3: Sequence[logic.RelationId] = $$.global
$4: logic.Script = $$.body
$5: Optional[Sequence[logic.Attribute]] = $$.attrs if not builtin.is_empty($$.attrs) else None

script
: "(" "script" construct* ")"
Expand All @@ -913,11 +914,12 @@ construct
$1: logic.Instruction = $$.instruction

loop
: "(" "loop" init script ")"
construct: $$ = logic.Loop(init=$3, body=$4)
: "(" "loop" init script attrs? ")"
construct: $$ = logic.Loop(init=$3, body=$4, attrs=builtin.unwrap_option_or($5, list[logic.Attribute]()))
deconstruct:
$3: Sequence[logic.Instruction] = $$.init
$4: logic.Script = $$.body
$5: Optional[Sequence[logic.Attribute]] = $$.attrs if not builtin.is_empty($$.attrs) else None

init
: "(" "init" instruction* ")"
Expand Down
2 changes: 2 additions & 0 deletions proto/relationalai/lqp/v1/logic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ message FunctionalDependency {
message Algorithm {
repeated RelationId global = 1;
Script body = 2;
repeated Attribute attrs = 3;
}

message Script {
Expand All @@ -51,6 +52,7 @@ message Construct {
message Loop {
repeated Instruction init = 1;
Script body = 2;
repeated Attribute attrs = 3;
}

message Instruction {
Expand Down
1,467 changes: 746 additions & 721 deletions sdks/go/src/lqp/v1/logic.pb.go

Large diffs are not rendered by default.

5,528 changes: 2,774 additions & 2,754 deletions sdks/go/src/parser.go

Large diffs are not rendered by default.

Loading
Loading