Skip to content

Fix error parsing TOML files that use dotted keys#438

Closed
mitchellhenke wants to merge 6 commits intoerlef:mainfrom
mitchellhenke:main
Closed

Fix error parsing TOML files that use dotted keys#438
mitchellhenke wants to merge 6 commits intoerlef:mainfrom
mitchellhenke:main

Conversation

@mitchellhenke
Copy link
Copy Markdown
Contributor

@mitchellhenke mitchellhenke commented Mar 19, 2026

Description

I have a relatively small mise.toml file, but erlef/setup-beam fails to parse it due to the use of dotted keys. The current version of toml lists support for TOML v0.4.0, and dotted key support was added in v0.5.0 (in 2018).

An example file that will fail:

# mise.toml
[tools]
elixir = "1.19.5"
erlang = "28.3"

[env]
_.file = ".env"

The logs for the above result in:

Run erlef/setup-beam@v1
  with:
    version-file: mise.toml
    version-type: strict
    github-token: ***
    otp-architecture: 64
    install-hex: true
    install-rebar: true
    disable_problem_matchers: false
    hexpm-mirrors: https://builds.hex.pm
  
  env:
    MIX_ENV: test
Parsing mise.toml file at mise.toml
  Error: Expected "=", [ \t] or [A-Za-z0-9_\-] but "." found.

Given that, it may make sense to consider switching parsers. The smol-toml package is already in package-lock.json as a transitive dependency of another one, and so I chose that since it seemed more straightforward. Mise itself uses js-toml as another potential alternative. I've also updated a test and confirmed the test fails on main and passes with the later changes.

If there's anything I can do to help get something merged to solve this issue, just let me know!

@paulo-ferraz-oliveira
Copy link
Copy Markdown
Collaborator

Changes look sane. If you'd just rebase on top of the main branch, fixing conflicts, and running npm run build-dist we could merge it. Thanks.

@mitchellhenke
Copy link
Copy Markdown
Contributor Author

Changes look sane. If you'd just rebase on top of the main branch, fixing conflicts, and running npm run build-dist we could merge it. Thanks.

Done!

@paulo-ferraz-oliveira
Copy link
Copy Markdown
Collaborator

CI not running. Strange...

@paulo-ferraz-oliveira
Copy link
Copy Markdown
Collaborator

CI's not running. Could you close this one and open a new one from a branch? Thanks.

@mitchellhenke
Copy link
Copy Markdown
Contributor Author

CI's not running. Could you close this one and open a new one from a branch? Thanks.

Yep!

@mitchellhenke
Copy link
Copy Markdown
Contributor Author

Replaced with #444

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants