Skip to content

The last line has to be closed by a newline, which should not be necessary according to TOML specification #7

@nussbaumer-planb

Description

@nussbaumer-planb

Problem: Pasing may fail if the last line of file is not finished with a newline (see as an example tests/pass/T6.toml). The TOML specification clarifies:

There must be a newline (or EOF) after a key/value pair.

Solution: Simply modify the definition of TScanner.IsLineEnding to include the EOF (#0) character:
Result := (c in [TCharSetLineEnding]) or (c = #0);
Note that this modification eventually may imply modifications at callers side.

EDIT: my fault... the TOML specification v1.0.0 and v.1.0.0-rc differ in this point: the latter, which is claimed to be obeyed by fpTOML, does not state that EOF legally finishes a key/value pair.
Feel free to close this issue without changes (though I think adding this may be useful).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions