Skip to content

Odd error span with invalid float #52

Closed
@CAD97

Description

@CAD97
fn main() {
    let test = r#"
// Nodes can be separated into multiple lines
title \
    "Some title"


// Files must be utf8 encoded!
smile "😁"

// Instead of anonymous nodes, nodes and properties can be wrapped
// in "" for arbitrary node names.
"!@#$@$%Q#$%~@!40" "1.2.3" "!!!!!"=true

// The following is a legal bare identifier:
foo123~!@#$%^&*.:'|?+ "weeee"

// And you can also use unicode!
ノード お名前="☜(゚ヮ゚☜)"

// kdl specifically allows properties and values to be
// interspersed with each other, much like CLI commands.
foo bar=true "baz" quux=false 1 2 3.
"#;

    let err: kdl::KdlError = test.parse::<kdl::KdlDocument>().unwrap_err();
    println!("{:?}", miette::Report::from(err));
}
  × Expected valid value.
    ╭─[21:1]
 21 │ // interspersed with each other, much like CLI commands.
 22 │ foo bar=true "baz" quux=false 1 2 3.
    ·        ─┬
    ·         ╰── invalid float
    ╰────
  help: Floating point numbers must be base 10, and have numbers after the decimal point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions