This commit is contained in:
Peter Harpending
2026-06-08 15:24:54 -07:00
parent ba70aace96
commit 7c98182bcb
+18 -15
View File
@@ -47,16 +47,19 @@ do(["test" | Tests]) ->
do(["tokens", Foo]) -> do_tokens(Foo);
% print source file to screen with token boundaries
% highlighted
do(["tcat", Foo]) -> do_color_tokens(Foo);
do(["ctokens", Foo]) -> do_color_tokens(Foo);
do(["color_tokens", Foo]) -> do_color_tokens(Foo);
do(["colour_tokens" | _]) -> do_doi();
do(["tokens", "-c", Foo]) -> do_color_tokens(Foo);
do(["tokens", "--color", Foo]) -> do_color_tokens(Foo);
do(["tcat", Foo]) -> do_color_tokens(Foo);
do(["ctokens", Foo]) -> do_color_tokens(Foo);
do(["color_tokens", Foo]) -> do_color_tokens(Foo);
do(["tokens", "--colour" | _]) -> do_doi();
do(["colour_tokens" | _]) -> do_doi();
% so_tokens = so_scan tokens
do(["so", "tokens", Foo]) -> do_so_tokens(Foo);
do(["so_tokens", Foo]) -> do_so_tokens(Foo);
do(["so_tokens", Foo]) -> do_so_tokens(Foo);
% gso_tokens = our mockery
do(["gso", "tokens", Foo]) -> do_gso_tokens(Foo);
do(["gso_tokens", Foo]) -> do_gso_tokens(Foo);
do(["gso_tokens", Foo]) -> do_gso_tokens(Foo);
% script utility
do(["rmm", Foo]) ->
do_rmm(Foo);
@@ -200,13 +203,13 @@ colorize_token_str(Color, T = #tk{str = Str}) ->
% dim noisy tokens
color_fixes(noise, Color) ->
{P, S} = color_fixes(signal, Color),
{[?ANSI_DIM, P], [S, ?ANSI_UNDIM]};
color_fixes(signal, red) -> {?ANSI_FG_RED, ?ANSI_FG_RESET};
color_fixes(signal, green) -> {?ANSI_FG_GREEN, ?ANSI_FG_RESET};
color_fixes(signal, yellow) -> {?ANSI_FG_YELLOW, ?ANSI_FG_RESET};
color_fixes(signal, blue) -> {?ANSI_FG_BLUE, ?ANSI_FG_RESET};
color_fixes(signal, magenta) -> {?ANSI_FG_MAGENTA, ?ANSI_FG_RESET};
color_fixes(signal, cyan) -> {?ANSI_FG_CYAN, ?ANSI_FG_RESET}.
%color_fixes(noise, Color) ->
% {P, S} = color_fixes(signal, Color),
% {[?ANSI_DIM, P], [S, ?ANSI_UNDIM]};
color_fixes(_, red) -> {?ANSI_FG_RED, ?ANSI_FG_RESET};
color_fixes(_, green) -> {?ANSI_FG_GREEN, ?ANSI_FG_RESET};
color_fixes(_, yellow) -> {?ANSI_FG_YELLOW, ?ANSI_FG_RESET};
color_fixes(_, blue) -> {?ANSI_FG_BLUE, ?ANSI_FG_RESET};
color_fixes(_, magenta) -> {?ANSI_FG_MAGENTA, ?ANSI_FG_RESET};
color_fixes(_, cyan) -> {?ANSI_FG_CYAN, ?ANSI_FG_RESET}.