monaqa / satysfi-parser

SATySFi parser writtern in Rust.
MIT License
14 stars 4 forks source link

Panic when using `is_comment` function on Japanese strings. #6

Closed puripuri2100 closed 3 years ago

puripuri2100 commented 3 years ago
let csttext = CstText::parse("let x = 1 in% foo ほげ \n  2", grammar::program).unwrap();
println!("{}", csttext.is_comment(19))

print error message:

thread 'main' panicked at 'byte index 19 is not a char boundary; it is inside 'ほ' (bytes 18..21) of `let x = 1 in% foo ほげ 
  2`', C:\Users\naoki\.cargo\git\checkouts\satysfi-parser-a9359f2a02b30ab7\c967439\src\types.rs:129:10
monaqa commented 3 years ago

Thank you for reporting this issue. The problem should have been solved by #6.