Closed chappertron closed 7 hours ago
If a string does not end with a " or ' character (depending on the kind), currently the whole node is reported as a syntax error.
"
'
This could be improved by matching on the kind of error nodes in arguments and attempting to parse as a string.
A sketch may look like this.
match node.kind() { // NOTE: need better error handling here. "ERROR" => { let child = node.child(0)?; match child.kind() { '"' => {return string(child,text);}, '\'' => {return raw_string(child,text);}, _ => todo!["handle other cases or just error"] } } _ => todo!("other cases") }
Then, within the raw_string and string functions, we can check for the missing quotes.
raw_string
string
A similar approach could work for parenthesis and expansions.
Support added for this in commit 80aa257
If a string does not end with a
"
or'
character (depending on the kind), currently the whole node is reported as a syntax error.This could be improved by matching on the kind of error nodes in arguments and attempting to parse as a string.
A sketch may look like this.
Then, within the
raw_string
andstring
functions, we can check for the missing quotes.A similar approach could work for parenthesis and expansions.