3
3
// http://opensource.org/licenses/MIT>, at your option. This file may not be
4
4
// copied, modified, or distributed except according to those terms.
5
5
6
+ use termcolor:: StandardStreamLock ;
7
+
6
8
use crate :: lexer:: { TLexer , Token } ;
7
9
use crate :: parser:: attributes:: { Attributes , AttributesParser } ;
10
+ use crate :: parser:: dump:: Dump ;
8
11
use crate :: parser:: errors:: ParserError ;
9
12
use crate :: parser:: expressions:: { ExprNode , ExpressionParser } ;
10
13
use crate :: parser:: types:: Type ;
@@ -16,14 +19,32 @@ pub struct Dimension {
16
19
pub attributes : Option < Attributes > ,
17
20
}
18
21
22
+ impl Dump for Dimension {
23
+ fn dump ( & self , name : & str , prefix : & str , last : bool , stdout : & mut StandardStreamLock ) {
24
+ dump_obj ! ( self , name, "" , prefix, last, stdout, size, attributes) ;
25
+ }
26
+ }
27
+
19
28
pub type Dimensions = Vec < Dimension > ;
20
29
30
+ impl Dump for Dimensions {
31
+ fn dump ( & self , name : & str , prefix : & str , last : bool , stdout : & mut StandardStreamLock ) {
32
+ dump_vec ! ( name, self , "dim" , prefix, last, stdout) ;
33
+ }
34
+ }
35
+
21
36
#[ derive( Clone , Debug , PartialEq ) ]
22
37
pub struct Array {
23
38
pub base : Option < Type > ,
24
39
pub dimensions : Dimensions ,
25
40
}
26
41
42
+ impl Dump for Array {
43
+ fn dump ( & self , name : & str , prefix : & str , last : bool , stdout : & mut StandardStreamLock ) {
44
+ dump_obj ! ( self , name, "array" , prefix, last, stdout, base, dimensions) ;
45
+ }
46
+ }
47
+
27
48
pub struct ArrayParser < ' a , L : TLexer > {
28
49
lexer : & ' a mut L ,
29
50
}
0 commit comments