Skip to content

parse_chunk/1 returns ANSI escape codes #382

Closed

Description

@kevinschweikert
iex(1)> Lua.parse_chunk("asdf")
{:error,
 ["\e[31m\e[1mParse Error\e[0m\n\n  at line 1, column 1:\n\n  A bare variable reference isn't a Lua statement.\n\n\n\e[31m   1 │ asdf\e[0m\n       \e[31m^\e[0m\n\n\e[36mSuggestion:\e[0m\n  To call it as a function, add parentheses: 'name(...)'. To assign to it, write 'name = value'."]}

Claude says

"Lua.parse_chunk/1 returns ANSI-colored strings in its {:error, reasons} tuple; Lua.Parser.Error.format/2 bypasses the #304 TTY gating"

Activity

  1. kevinschweikert commented on Jul 8, 2026

    @kevinschweikert
    ContributorAuthor

    Additionally i woud be i favour to get structured errors instead of a string like {:error, %Lua.CompilerException{}}. We could still get a string representation with Exception.message/1

  2. kevinschweikert commented on Jul 13, 2026

    @kevinschweikert
    ContributorAuthor

    Should be closed by #383 AFAIk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions