inaka / inaka/katana-code

ktn_dodger can't parse -else.

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Erlang
Stars
18
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Bug Description

When running ktn_dodger:parse_file/1,2 on a file with an -else., it reports an error (or, if using no_fail, it just parses that as text instead of an actual attribute).

To Reproduce

Try running ktn_parse:parse_file/1,2 on the following file…

-module x.

-export [x/0].

-ifdef(VAR).
x() ->
    var.
-else.
x() ->
    not_var.
-endif.

Expected Behavior

-else. to be parsed as an attribute.

Additional Context

  • OS: MacOS
  • Erlang version: OTP25

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ktn_dodger:parse_file/1,2 and reproduce the issue using the Erlang file shown in the report. Check how the parser handles -ifdef, -else, and -endif, then verify that -else. is returned as an attribute rather than an error or text.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.