Update expression.rs

This commit is contained in:
Yanting Zhang 2022-08-31 14:16:15 +08:00
parent a8f3892fa9
commit 766ed5eded
1 changed files with 18 additions and 4 deletions

View File

@ -45,8 +45,7 @@ impl Expression {
}
fn gen_reference_call(json: &JsonValue) -> (String, Option<(usize, usize)>) {
let json_symbol_identifier = Tools::match_tags(
vec![json],
let json_symbol_identifier_path = [
vec![
Tag::REFERENCE_CALL_BASE,
Tag::REFERENCE,
@ -54,8 +53,23 @@ impl Expression {
Tag::UNQUALIFIED_ID,
Tag::SYMBOL_IDENTIFIER,
],
);
assert_eq!(json_symbol_identifier.len(), 1,);
vec![
Tag::REFERENCE_CALL_BASE,
Tag::REFERENCE,
Tag::LOCAL_ROOT,
Tag::UNQUALIFIED_ID,
Tag::ESCAPEDIDENTIFIER,
],
];
let json_symbol_identifier = {
let json_symbol_identifiers: Vec<_> = json_symbol_identifier_path
.iter()
.flat_map(|x|Tools::match_tags(vec![json], x.to_vec()))
.collect();
//assert_eq!(json_symbol_identifier.len(), 1,);
json_symbol_identifiers[0]
};
let json_scalar = Tools::match_tags(
vec![json],