elixir-makeup / makeup_erlang

Erlang lexer for Makeup
3 stars 6 forks source link

Highlight errors in shell examples correctly #26

Closed garazdawi closed 7 months ago

garazdawi commented 7 months ago

It should be rare that a line starts with "* " or "** " unless it is an example of an error in the shell.

Question, is :error the correct token type for this?

josevalim commented 7 months ago

@garazdawi for Elixir they use:

  stacktrace =
    string("** (")
    # The rest of the line is part of the traceback
    |> concat(line)
    # All lines indented by 4 spaces are part of the traceback
    |> repeat(string("\n    ") |> concat(line))
    |> token(:generic_traceback)

So I think it is :generic_traceback. I think :error is literally for invalid syntax.

josevalim commented 7 months ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: