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