diff --git a/e2e/99_bottles_verbose/main/main.neva b/e2e/99_bottles_verbose/main/main.neva index 9f759334..e2912cd8 100644 --- a/e2e/99_bottles_verbose/main/main.neva +++ b/e2e/99_bottles_verbose/main/main.neva @@ -4,24 +4,28 @@ import { fmt } def Main(start any) (stop any) { // we use explicit lock to implement fan-in to printNext2Lines - s Switch, PrintNext2Lines, Lock + s Switch + print_next_2_lines PrintNext2Lines + lock Lock --- :start -> lock:sig 99 -> lock:data - [lock:data, s:else] -> printNext2Lines - printNext2Lines -> s:data + [lock:data, s:else] -> print_next_2_lines + print_next_2_lines -> s:data -1 -> s:case[0] -> :stop } def PrintNext2Lines(n int) (n int) { - Dec, PrintFirstLine, PrintSecondLine + dec Dec + print_first_line PrintFirstLine + print_second_line PrintSecondLine --- - // printFirstLine and printSecondLine won't work in parallel + // print_first_line and print_second_line won't work in parallel // because they are in the loop at the level of Main - :n -> printFirstLine:n - printFirstLine:n -> dec:data - dec:res -> printSecondLine:n - printSecondLine:n -> :n + :n -> print_first_line:n + print_first_line:n -> dec:data + dec:res -> print_second_line:n + print_second_line:n -> :n } // === First Line === @@ -31,7 +35,12 @@ const firstLine2 string = '1 bottle of beer on the wall, 1 bottle of beer.' const firstLine3 string = 'No more bottles of beer on the wall, no more bottles of beer.' def PrintFirstLine(n int) (n int) { - s Switch, p1 fmt.Println, p2 fmt.Println, fmt.Printf, Lock, Panic + s Switch + p1 fmt.Println + p2 fmt.Println + printf fmt.Printf + lock Lock + panic Panic --- :n -> [s:data, lock:data] @@ -45,7 +54,7 @@ def PrintFirstLine(n int) (n int) { $firstLine1 -> printf:tpl ] - [p1:sig, p2:sig, printf:sig] -> lock:sig + [p1:res, p2:res, printf:sig] -> lock:sig printf:err -> panic lock:data -> :n } @@ -58,7 +67,13 @@ const secondLine3 string = 'Take one down and pass it around, no more bottles of const secondLine4 string = 'Go to the store and buy some more, 99 bottles of beer on the wall.' def PrintSecondLine(n int) (n int) { - s Switch, p1 fmt.Println, p2 fmt.Println, p3 fmt.Println, fmt.Printf, Lock, Panic + s Switch + p1 fmt.Println + p2 fmt.Println + p3 fmt.Println + printf fmt.Printf + lock Lock + panic Panic --- :n -> [s:data, lock:data] @@ -75,7 +90,7 @@ def PrintSecondLine(n int) (n int) { $secondLine1 -> printf:tpl ] - [p1:sig, p2:sig, p3:sig, printf:sig] -> lock:sig + [p1:res, p2:res, p3:res, printf:sig] -> lock:sig printf:err -> panic lock:data -> :n } \ No newline at end of file diff --git a/e2e/add_nums_from_stdin_with_default_any/main/main.neva b/e2e/add_nums_from_stdin_with_default_any/main/main.neva index c67f0fac..e59316a9 100644 --- a/e2e/add_nums_from_stdin_with_default_any/main/main.neva +++ b/e2e/add_nums_from_stdin_with_default_any/main/main.neva @@ -1,11 +1,14 @@ import { strconv, fmt } def Main(start any) (stop any) { - Aux, fmt.Println + aux Aux + println fmt.Println + panic Panic --- - :start -> aux:sig - [aux:res, aux:err] -> println:data - println:res -> :stop + :start -> aux:sig + aux:res -> println:data + aux:err -> panic + println:res -> :stop } def Aux(sig any) (res int, err error) { @@ -13,18 +16,19 @@ def Aux(sig any) (res int, err error) { reader2 IntReader add Add --- - :sig -> reader1:sig - reader1:num -> [add:left, reader2:sig] + :sig -> reader1:sig + reader1:num -> [add:left, reader2:sig] [reader1:err, reader2:err] -> :err - reader2:num -> add:right - add:res -> :res + reader2:num -> add:right + add:res -> :res } def IntReader(sig any) (num int, err error) { - fmt.Scanln, strconv.ParseNum + scanln fmt.Scanln + parse_num strconv.ParseNum --- - :sig -> scanln:res - scanln:res -> parseNum:data - parseNum:res -> :num - parseNum:err -> :err + :sig -> scanln:sig + scanln:res -> parse_num:data + parse_num:res -> :num + parse_num:err -> :err } diff --git a/e2e/add_nums_from_stdin_with_multuple_senders/main/main.neva b/e2e/add_nums_from_stdin_with_multuple_senders/main/main.neva index 2a3f01c1..fd362d36 100644 --- a/e2e/add_nums_from_stdin_with_multuple_senders/main/main.neva +++ b/e2e/add_nums_from_stdin_with_multuple_senders/main/main.neva @@ -1,7 +1,8 @@ import { strconv, fmt } def Main(start any) (stop any) { - Aux, fmt.Println + aux Aux, + println fmt.Println --- :start -> aux:sig [aux:res, aux:err] -> println:data @@ -21,10 +22,11 @@ def Aux(sig any) (res int, err error) { } def IntReader(sig any) (num int, err error) { - fmt.Scanln, strconv.ParseNum + scanln fmt.Scanln + parse_num strconv.ParseNum --- - :sig -> scanln:res - scanln:res -> parseNum:data - parseNum:res -> :num - parseNum:err -> :err + :sig -> scanln:sig + scanln:res -> parse_num:data + parse_num:res -> :num + parse_num:err -> :err } diff --git a/e2e/add_nums_from_stdin_with_sub_components/main/main.neva b/e2e/add_nums_from_stdin_with_sub_components/main/main.neva index dbf91ccf..21f64033 100644 --- a/e2e/add_nums_from_stdin_with_sub_components/main/main.neva +++ b/e2e/add_nums_from_stdin_with_sub_components/main/main.neva @@ -1,7 +1,8 @@ import { strconv, fmt } def Main(start any) (stop any) { - Aux, fmt.Println + aux Aux + println fmt.Println --- :start -> aux:sig [aux:res, aux:err] -> println:data @@ -21,10 +22,11 @@ def Aux(sig any) (res int, err error) { } def IntReader(sig any) (num int, err error) { - fmt.Scanln, strconv.ParseNum + scanln fmt.Scanln + parse_num strconv.ParseNum --- - :sig -> scanln:res - scanln:res -> parseNum:data - parseNum:res -> :num - parseNum:err -> :err + :sig -> scanln:sig + scanln:res -> parse_num:data + parse_num:res -> :num + parse_num:err -> :err } diff --git a/e2e/echo_verbose/main/main.neva b/e2e/echo_verbose/main/main.neva index e37ebd51..ab667b56 100644 --- a/e2e/echo_verbose/main/main.neva +++ b/e2e/echo_verbose/main/main.neva @@ -1,10 +1,10 @@ import { fmt } def Main(start any) (stop any) { - fmt.Scanln - fmt.Println + scanln fmt.Scanln + println fmt.Println --- - :start -> scanln:res + :start -> scanln:sig scanln:res -> println:data println:res -> :stop } diff --git a/e2e/filter_list/neva.yml b/e2e/filter_list/neva.yml deleted file mode 100644 index f25b3e9f..00000000 --- a/e2e/filter_list/neva.yml +++ /dev/null @@ -1 +0,0 @@ -neva: 0.28.2 \ No newline at end of file diff --git a/e2e/interface_anonymous/main/main.neva b/e2e/interface_anonymous/main/main.neva index a2040184..2d670d69 100644 --- a/e2e/interface_anonymous/main/main.neva +++ b/e2e/interface_anonymous/main/main.neva @@ -1,17 +1,17 @@ import { fmt } def Main(start any) (stop any) { - second_flow Secondflow {fmt.Println} + second_flow Secondflow{fmt.Println} --- :start -> second_flow:data second_flow:res -> :stop } def Secondflow (data any) (res any) { - iPrinter IPrinter + printer IPrinter --- - :data -> iPrinter:res - iPrinter:sig -> :res + :data -> printer:data + printer:res -> :res } -interface IPrinter(T) (T) +interface IPrinter(data T) (res T) diff --git a/e2e/interface_verbose/main/main.neva b/e2e/interface_verbose/main/main.neva index 1cd1cfaf..4fa45f0f 100644 --- a/e2e/interface_verbose/main/main.neva +++ b/e2e/interface_verbose/main/main.neva @@ -2,7 +2,7 @@ import { fmt } def Main(start any) (stop any) { second_flow Secondflow { - dep_node fmt.Println + printer fmt.Println } --- :start -> second_flow:data @@ -10,10 +10,10 @@ def Main(start any) (stop any) { } def Secondflow (data any) (res any) { - dep_node IPrinter + printer IPrinter --- - :data -> dep_node:res - dep_node:sig -> :res + :data -> printer:data + printer:res -> :res } -interface IPrinter(T) (T) +interface IPrinter(data T) (res T) diff --git a/e2e/interface_with_imports/main/main.neva b/e2e/interface_with_imports/main/main.neva index 5fc5edd9..189027fa 100644 --- a/e2e/interface_with_imports/main/main.neva +++ b/e2e/interface_with_imports/main/main.neva @@ -1,17 +1,17 @@ import { github.com/nevalang/x:main } def Main(start any) (stop any) { - second_flow Secondflow{main.Println} + sub_component SubComponent{main.Println} --- - :start -> second_flow:data - second_flow:res -> :stop + :start -> sub_component:data + sub_component:res -> :stop } -def Secondflow (data any) (res any) { +def SubComponent(data any) (res any) { printer IPrinter --- - :data -> printer:res - printer:sig -> :res + :data -> printer:data + printer:res -> :res } -interface IPrinter(T) (T) +interface IPrinter(data T) (res T) diff --git a/e2e/map_list_verbose/main/main.neva b/e2e/map_list_verbose/main/main.neva index 8229ec77..5722b17c 100644 --- a/e2e/map_list_verbose/main/main.neva +++ b/e2e/map_list_verbose/main/main.neva @@ -7,7 +7,7 @@ const lst list = [50, 30, 20, 100] def Main(start any) (stop any) { map_decr Map{Dec} s2l StreamToList - println fmt.Println + println fmt.Println> l2s ListToStream --- :start -> $lst -> l2s -> map_decr -> s2l -> println -> :stop diff --git a/e2e/slow_iteration_with_map/main/main.neva b/e2e/slow_iteration_with_map/main/main.neva index ff1de75e..1ce061ed 100644 --- a/e2e/slow_iteration_with_map/main/main.neva +++ b/e2e/slow_iteration_with_map/main/main.neva @@ -7,17 +7,17 @@ import { time, fmt } const lst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def Main(start any) (stop any) { - ListToStream - Map{Slow} - List - fmt.Println> + l2s ListToStream + map Map{Slow} + s2l StreamToList + println fmt.Println> --- - :start -> $lst -> listToStream -> map -> list -> println -> :stop + :start -> $lst -> l2s -> map -> s2l -> println -> :stop } def Slow(data int) (res int) { - time.Delay - Dec + delay time.Delay + dec Dec --- :data -> delay:data $time.second -> delay:dur diff --git a/e2e/filter_list/e2e_test.go b/examples/filter_list/e2e_test.go similarity index 95% rename from e2e/filter_list/e2e_test.go rename to examples/filter_list/e2e_test.go index 80ed4992..b18adc9b 100644 --- a/e2e/filter_list/e2e_test.go +++ b/examples/filter_list/e2e_test.go @@ -11,8 +11,6 @@ import ( ) func Test(t *testing.T) { - t.Skip("skipping for now") // TODO - err := os.Chdir("..") require.NoError(t, err) diff --git a/e2e/filter_list/main/main.neva b/examples/filter_list/main.neva similarity index 57% rename from e2e/filter_list/main/main.neva rename to examples/filter_list/main.neva index dcbf0a5b..3495b4f7 100644 --- a/e2e/filter_list/main/main.neva +++ b/examples/filter_list/main.neva @@ -1,14 +1,14 @@ import { fmt } -const lst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +const numbers list = [2, 4, 6, 8, 10] def Main(start any) (stop any) { - l2s ListToStream + list_to_stream1 ListToStream filter_even Filter{predicate Even} for_print For{fmt.Println} wait Wait --- - :start -> $lst -> l2s -> filter_even -> for_print -> wait -> :stop + :start -> $numbers -> list_to_stream1-> filter_even -> for_print -> wait -> :stop } def Even(data int) (res bool) {