You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bare keys may only contain ASCII letters, ASCII digits, underscores, and dashes (A-Za-z0-9_-). Note that bare keys are allowed to be composed of only ASCII digits, e.g. 1234, but are always interpreted as strings.
Following that definition, the key 2024-01-01, even though it looks like a date, is a valid key equivalent to the quoted key "2024-01-01". The vscode plugin recognizes this because using it as a normal key instead of a table key works without errors:
This appears to be date-specific. Invalid dates or keys that look like other values don't cause errors.
I am using version 0.19.2 of the tamasfe.even-better-toml VSCode extension.
The text was updated successfully, but these errors were encountered:
After a quick experiment, this might be a bug in the tokenizer library used by taplo, logos version 0.12.0. The bug persists even in the latest version of logos, namely 0.15.0.
2024-01-01 in identifier position is lexed as INTEGER, which has the definition
#[regex(r"[+-]?[0-9_]+", priority = 4)]INTEGER,
Of course, the regex does not match 2024-01-01 at all.
Removing the DATE_TIME_OFFSET and DATE_TIME_LOCAL variants from SyntaxKind results in the identifier (correctly) being parsed as a DATE instead. This also points to it being a weird bug in logos.
A fix for taplo might be to convert DATE to IDENT in parse_ident, similar to this:
When opening a toml file containing the following table, the plugin reports the error "expected identifier":
[2024-01-01]
According to the toml spec for tables,
Checking the toml spec for keys, we find that
Following that definition, the key

2024-01-01
, even though it looks like a date, is a valid key equivalent to the quoted key "2024-01-01". The vscode plugin recognizes this because using it as a normal key instead of a table key works without errors:This appears to be date-specific. Invalid dates or keys that look like other values don't cause errors.

I am using version 0.19.2 of the
tamasfe.even-better-toml
VSCode extension.The text was updated successfully, but these errors were encountered: