Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing rebar.config files #3

Open
Wilfred opened this issue Dec 19, 2022 · 1 comment
Open

Support parsing rebar.config files #3

Wilfred opened this issue Dec 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Dec 19, 2022

These are Erlang syntax (e.g. GitHub highlights them as Erlang), but I get ERROR nodes when I try to parse them. For example, the following file:

{erl_opts, [
    {parse_transform, lager_transform},
    debug_info
]}.
{deps, [
    {poolboy, "1.5.2"},
    bcrypt,
    {mcd, {git, "https://github.com/EchoTeam/mcd.git", {ref, "b5b4a32"}}}
]}.

Produces the following parse tree:

source_file (0, 0) - (9, 0)
  ERROR (0, 0) - (8, 3)
    { (0, 0) - (0, 1) "{"
    atom (0, 1) - (0, 9) "erl_opts"
    , (0, 9) - (0, 10) ","
    [ (0, 11) - (0, 12) "["
    { (1, 4) - (1, 5) "{"
    atom (1, 5) - (1, 20) "parse_transform"
    , (1, 20) - (1, 21) ","
    atom (1, 22) - (1, 37) "lager_transform"
    } (1, 37) - (1, 38) "}"
    , (1, 38) - (1, 39) ","
    atom (2, 4) - (2, 14) "debug_info"
    ] (3, 0) - (3, 1) "]"
    } (3, 1) - (3, 2) "}"
    . (3, 2) - (3, 3) "."
    { (4, 0) - (4, 1) "{"
    atom (4, 1) - (4, 5) "deps"
    , (4, 5) - (4, 6) ","
    [ (4, 7) - (4, 8) "["
    { (5, 4) - (5, 5) "{"
    atom (5, 5) - (5, 12) "poolboy"
    , (5, 12) - (5, 13) ","
    string (5, 14) - (5, 21) "\"1.5.2\""
    } (5, 21) - (5, 22) "}"
    , (5, 22) - (5, 23) ","
    atom (6, 4) - (6, 10) "bcrypt"
    , (6, 10) - (6, 11) ","
    { (7, 4) - (7, 5) "{"
    atom (7, 5) - (7, 8) "mcd"
    , (7, 8) - (7, 9) ","
    { (7, 10) - (7, 11) "{"
    atom (7, 11) - (7, 14) "git"
    , (7, 14) - (7, 15) ","
    string (7, 16) - (7, 53) "\"https://github.com/EchoTeam/mcd.git\""
    , (7, 53) - (7, 54) ","
    { (7, 55) - (7, 56) "{"
    atom (7, 56) - (7, 59) "ref"
    , (7, 59) - (7, 60) ","
    string (7, 61) - (7, 70) "\"b5b4a32\""
    } (7, 70) - (7, 71) "}"
    } (7, 71) - (7, 72) "}"
    } (7, 72) - (7, 73) "}"
    ] (8, 0) - (8, 1) "]"
    } (8, 1) - (8, 2) "}"
    . (8, 2) - (8, 3) "."
@Wilfred Wilfred added the bug Something isn't working label Dec 19, 2022
Wilfred added a commit to Wilfred/difftastic that referenced this issue Dec 19, 2022
The Erlang parser doesn't support this syntax apparently:
WhatsApp/tree-sitter-erlang#3
@alanz
Copy link
Member

alanz commented Jan 13, 2023

Thanks for the report. I intend getting to this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants