Skip to content

build_bin panics on unterminated property string #165

Description

@Crauzer

Summary

Cst::build_bin panics instead of returning a diagnostic when an entry's value is an unterminated string literal. The tokenizer correctly reports UnterminatedString and the parser recovers, but resolve_value then assumes the recovered Literal node holds a token.

Repro

let text = "name: string = \"\n";
let cst = ltk_ritobin::Cst::parse(text);
let _ = cst.build_bin(text); // panics

thread panicked at crates/ltk_ritobin/src/typecheck/resolve.rs:371:68:
called `Option::unwrap()` on a `None` value

 ltk_ritobin::typecheck::resolve::resolve_value       resolve.rs:371
 ltk_ritobin::typecheck::resolve::resolve_entry       resolve.rs:463
 ltk_ritobin::typecheck::walk::<impl Visitor>::enter_tree  walk.rs:250
 ltk_ritobin::cst::tree::Cst::walk                    visitor.rs:61
 ltk_ritobin::cst::tree::Cst::build_bin               tree.rs:203

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcrate:ltk_ritobinRitobin text format crate

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions