This commit is contained in:
Peter Harpending
2026-07-04 12:19:44 -06:00
parent ca49ffac2c
commit 8c8a048efc
2 changed files with 28 additions and 0 deletions
+1
View File
@@ -70,6 +70,7 @@ f2f_op(OpStr, Fst) ->
% never saw the op
f2f_op(_opstr, Stk, []) ->
lists:reverse(Stk);
% see op
f2f_op(OpStr, LhsStk, [#tk{str = OpStr} = OpTk | Rest]) ->
Lhf = lists:reverse(LhsStk),
+27
View File
@@ -0,0 +1,27 @@
-module(gsc_test_ytree).
-include("$gsc_include/gsc.hrl").
-export([main/0]).
% @doc ys = syntax stem
-record(ys,
{tks :: [tk()],
sig :: [tk()],
mta :: any(),
fst :: list(any())}).
% syntax tree
-type yt(StemT, LeafT) :: LeafT
| #ys{mta :: StemT,
fst :: [yt(StemT, LeafT)]}.
% syntax forest
-type yf(StemT, LeafT) :: [yt(StemT, LeafT)].
main() ->
Src = "type foo = bar",
io:format("~ts~n", [Src]).