s/sfc/gsc/g

'
This commit is contained in:
2026-10-20 18:42:11 -07:00
parent 2e062bb8c9
commit 70a853ae99
27 changed files with 291 additions and 291 deletions
+20 -20
View File
@@ -4,7 +4,7 @@
%
% generally assume no whitespace/comment tokens in
% input stream
-module(gsc_token_chunks).
-module(sfc_token_chunks).
%-export_type([
% chunk_shape/0,
@@ -19,8 +19,8 @@
% end_pos/1
%]).
%
%% $gsc_include is so c() works from sfp eshell
%-include("$gsc_include/gsc.hrl").
%% $sfc_include is so c() works from sfp eshell
%-include("$sfc_include/sfc.hrl").
%
%%------------------------------------------
%% Types
@@ -45,25 +45,25 @@
%
%take(block, []) ->
% {[], []};
%take(block, [Hd = #gsc_token{pos = {_, BCol}} | Tl]) ->
% tw(fun(#gsc_token{pos = {_, TkCol}}) -> BCol =< TkCol end, [Hd], Tl);
%take(block, [Hd = #sfc_token{pos = {_, BCol}} | Tl]) ->
% tw(fun(#sfc_token{pos = {_, TkCol}}) -> BCol =< TkCol end, [Hd], Tl);
%take(block_item, []) ->
% {[], []};
%take(block_item, [Hd = #gsc_token{pos = {_, ICol}} | Tl]) ->
% tw(fun(#gsc_token{pos = {_, TkCol}}) -> ICol < TkCol end, Tl).
%take(block_item, [Hd = #sfc_token{pos = {_, ICol}} | Tl]) ->
% tw(fun(#sfc_token{pos = {_, TkCol}}) -> ICol < TkCol end, Tl).
%
%
%
%-spec start_pos([gsc_token()]) -> {value, tk_pos()} | none.
%-spec start_pos([sfc_token()]) -> {value, tk_pos()} | none.
%
%start_pos([#gsc_token{pos = P}]) -> {value, P};
%start_pos([#sfc_token{pos = P}]) -> {value, P};
%start_pos([]) -> none.
%
%
%-spec end_pos([gsc_token()]) -> {value, tk_pos()} | none.
%-spec end_pos([sfc_token()]) -> {value, tk_pos()} | none.
%
%end_pos([#gsc_token{pos = Pos, string = Str}]) ->
% {value, gsc_tokens:new_pos(Pos, Str)};
%end_pos([#sfc_token{pos = Pos, string = Str}]) ->
% {value, sfc_tokens:new_pos(Pos, Str)};
%end_pos([_ | T]) ->
% end_pos(T);
%end_pos([]) ->
@@ -79,7 +79,7 @@
% | [[Token]], % block_as_items
% Rest :: [Token],
% Reason :: choke_reason(),
% Token :: gsc_token().
% Token :: sfc_token().
%
%% @doc
%% slurp/barf terminology comes from paredit mode in
@@ -93,23 +93,23 @@
%
%barf(_, []) ->
% {barf, [], []};
%barf(block, [H = #gsc_token{pos = {_, BlkCol}} | T]) ->
%barf(block, [H = #sfc_token{pos = {_, BlkCol}} | T]) ->
% Take =
% fun(#gsc_token{pos = {_, TkCol}}) ->
% fun(#sfc_token{pos = {_, TkCol}}) ->
% BlkCol =< TkCol
% end,
% {A, B} = tw(Take, T),
% {barf, [H | A], B};
%barf(block_item, [H = #gsc_token{pos = {_, BlkCol}} | T]) ->
%barf(block_item, [H = #sfc_token{pos = {_, BlkCol}} | T]) ->
% Take =
% fun(#gsc_token{pos = {_, TkCol}}) ->
% fun(#sfc_token{pos = {_, TkCol}}) ->
% BlkCol < TkCol
% end,
% {A, B} = tw(Take, T),
% {barf, [H | A], B};
%% not needed for our case, future-proofing. see unsafe_block_to_items
%% for details
%barf({block_item, Level}, Tokens = [#gsc_token{pos = {_, StartLevel}} | _]) ->
%barf({block_item, Level}, Tokens = [#sfc_token{pos = {_, StartLevel}} | _]) ->
% case Level =:= StartLevel of
% false -> {barf, [], Tokens};
% true -> barf(block_item, Tokens)
@@ -124,7 +124,7 @@
% {barf, BlockTokens, Rest} = barf(block, Tokens),
% {barf, unsafe_block_to_items(BlockTokens), Rest};
%barf(_, _) ->
% {choke, #gsc_err_nyi{}}.
% {choke, #sfc_err_nyi{}}.
%
%
%
@@ -132,7 +132,7 @@
%
%
%-spec unsafe_block_to_items([Token]) -> [[Token]]
% when Token :: gsc_token().
% when Token :: sfc_token().
%
%% @doc
%% PITFALL: this ASSUMES that the given list of tokens has the