-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Description
For example, this test, if put in parser.rs
, would fail:
#[test]
fn can_parse_two_with_prototypes_at_same_stack_level() {
let syntax = r#"
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.example-wp
contexts:
main:
- match: a
scope: a
push:
- match: b
scope: b
set:
- match: c
scope: c
with_prototype:
- match: '2'
scope: '2'
with_prototype:
- match: '1'
scope: '1'
"#;
let syntax = SyntaxDefinition::load_from_str(&syntax, true, None).unwrap();
expect_scope_stacks_with_syntax("abc12", &["<1>", "<2>"], syntax);
}
failures:
---- parsing::parser::tests::can_parse_two_with_prototypes_at_same_stack_level stdout ----
abc12
^ +source.example-wp
abc12
^ +a
abc12
^ pop 1
abc12
^ +b
abc12
^ pop 1
abc12
^ +c
abc12
^ pop 1
abc12
^ +2
abc12
^ pop 1
ScopeStack { clear_stack: [], scopes: [<source.example-wp>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>, <a>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>, <b>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>, <c>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>, <2>] }
ScopeStack { clear_stack: [], scopes: [<source.example-wp>] }
thread 'parsing::parser::tests::can_parse_two_with_prototypes_at_same_stack_level' panicked at 'expected scope stack '<1>' missing', src/parsing/parser.rs:1324:13
but using this syntax definition in Sublime Text, the 1
and the 2
both receive scopes.
Metadata
Metadata
Assignees
Labels
No labels