From 274891d96e1127f6bcf264db470e519641f57291 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 15 Nov 2023 20:46:45 -0500 Subject: [PATCH] Add yield syntax --- examples/yield.ds | 4 ++-- tree-sitter-dust/corpus/yield.txt | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/examples/yield.ds b/examples/yield.ds index e734edb..bbde2fe 100644 --- a/examples/yield.ds +++ b/examples/yield.ds @@ -1,4 +1,4 @@ -1 -> output +1 -> (output) add_one = |list| { transform number in list { @@ -6,4 +6,4 @@ add_one = |list| { } } -[1, 2, 3] -> add_one +[1, 2, 3] -> (add_one) diff --git a/tree-sitter-dust/corpus/yield.txt b/tree-sitter-dust/corpus/yield.txt index 4f94c01..932b0f4 100644 --- a/tree-sitter-dust/corpus/yield.txt +++ b/tree-sitter-dust/corpus/yield.txt @@ -6,6 +6,16 @@ Simple Yield -------------------------------------------------------------------------------- +(root + (statement + (expression + (yield + (expression + (value + (integer))) + (function_call + (built_in_function)))))) + ================================================================================ Yield Chain ================================================================================ @@ -13,3 +23,20 @@ Yield Chain x -> (foo) -> (bar) -> (abc) -------------------------------------------------------------------------------- + +(root + (statement + (expression + (yield + (expression + (yield + (expression + (yield + (expression + (identifier)) + (function_call + (identifier)))) + (function_call + (identifier)))) + (function_call + (identifier))))))