1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use super::super::*;
#[test]
fn _0001() {
//---------------------------------------------------------------------------
// Properties should be parsed as paths.
//---------------------------------------------------------------------------
accept(
&scope!(),
StartExpression,
"[1..10].end included",
r#"
Path
├─ Range
│ ├─ IntervalStart (closed)
│ │ └─ Numeric
│ │ └─ `1`
│ └─ IntervalEnd (closed)
│ └─ Numeric
│ └─ `10`
└─ Name
└─ `end included`
"#,
false,
);
}
#[test]
fn _0002() {
//---------------------------------------------------------------------------
// If the name is a built-in property it should be properly parsed
// even if the shorter name already exists in the context.
// In this test case, the whole `end included` name should be parsed,
// not only the `end` name that exists in the parsing context.
//---------------------------------------------------------------------------
let scope = scope!();
scope.set_entry_name("end".into());
accept(
&scope,
StartExpression,
"[1..10].end included",
r#"
Path
├─ Range
│ ├─ IntervalStart (closed)
│ │ └─ Numeric
│ │ └─ `1`
│ └─ IntervalEnd (closed)
│ └─ Numeric
│ └─ `10`
└─ Name
└─ `end included`
"#,
false,
);
}