fix: fix paramter issue

上级 2e31bb4f
......@@ -208,21 +208,21 @@ impl Grammar {
line_tokens.produce(stack, capture_indices[0].start as i32);
let before_push = stack.clone();
let scope_name = rule.get_name(Some(line_text.clone()), Some(capture_indices.clone()));
println!("{:?}", scope_name);
let name_scopes_list = stack.content_name_scopes_list.push(self, scope_name);
let name_scopes_list = stack.content_name_scopes_list.clone().push(self, scope_name);
let mut begin_rule_capture_eol = false;
if capture_indices[0].end == _line_length {
begin_rule_capture_eol = true;
}
// let new_stack = stack.push(
// matched_rule_id,
// line_pos,
// anchor_position,
// begin_rule_capture_eol,
// None,
// name_scopes_list.clone(),
// name_scopes_list.clone()
// );
let new_stack = stack.clone().push(
matched_rule_id,
line_pos,
anchor_position,
begin_rule_capture_eol,
None,
name_scopes_list.clone(),
name_scopes_list.clone()
);
}
if capture_indices[0].end > line_pos as usize {
......
......@@ -51,7 +51,6 @@ impl StackElement {
}
StackElement {
parent,
// todo: this.depth = (this.parent ? this.parent.depth + 1 : 1);
depth,
rule_id,
enter_pos,
......@@ -64,16 +63,15 @@ impl StackElement {
}
pub fn push(self, rule_id: i32, enter_pos: i32, anchor_pos: i32, begin_rule_captured_eol: bool, end_rule: Option<String>, name_scopes_list: ScopeListElement, content_name_scopes_list: ScopeListElement) -> StackElement {
StackElement {
parent: Some(Box::new(self)),
depth: 0,
StackElement::new(
Some(Box::new(self)),
rule_id,
enter_pos,
anchor_pos,
begin_rule_captured_eol,
end_rule,
name_scopes_list,
content_name_scopes_list
}
content_name_scopes_list,
)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册