feat: add <<< and >>> abbreviating operations to default stream

Resolves #16.
This commit is contained in:
Glen Whitney 2021-02-18 12:18:47 -08:00
parent 2772fd0c5c
commit 7d4d3b93c9
8 changed files with 37 additions and 12 deletions

View file

@ -231,3 +231,15 @@ run desugar-fostr to TopLevel(Sequence([
Terminate(Sum(Int("11"), To(Int("12"), Stream()))),
To(To(Int("13"), Stream()), Stream())
]))
test emit_several_default [[
<<< 1 + 2; 3 >>>
(4 + 5) >>> >> stream; stream << 6;
<<< 7 << 75
<<< 8
+ (9+10);
11 + 12 >>>; 13 >>>
>>>
]] parse succeeds
/** writes
3399677527121313*/

View file

@ -1,7 +1,7 @@
stream << 1 + 2; 3 >> stream
(4 + 5) >> stream; stream << 6;
stream << 7
stream << 8
<<< 1 + 2; 3 >>>
(4 + 5) >>> >> stream; stream << 6;
<<< 7 << 75
<<< 8
+ (9+10);
11 + 12 >> stream; 13 >> stream
>> stream
11 + 12 >>>; 13 >>>
>>>

View file

@ -1 +1 @@
stream << 'Hello, world!'
<<< 'Hello, world!'