@@ -22,6 +22,8 @@ public class ModuleState
22
22
public SyntaxErrorException ModuleException { get ; private set ; }
23
23
public IDictionary < Tuple < string , DeclarationType > , Attributes > ModuleAttributes { get ; private set ; }
24
24
25
+ public bool IsNew { get ; private set ; }
26
+
25
27
public ModuleState ( ConcurrentDictionary < Declaration , byte > declarations )
26
28
{
27
29
Declarations = declarations ;
@@ -42,6 +44,8 @@ public ModuleState(ConcurrentDictionary<Declaration, byte> declarations)
42
44
Annotations = new List < IAnnotation > ( ) ;
43
45
ModuleException = null ;
44
46
ModuleAttributes = new Dictionary < Tuple < string , DeclarationType > , Attributes > ( ) ;
47
+
48
+ IsNew = true ;
45
49
}
46
50
47
51
public ModuleState ( ParserState state )
@@ -55,6 +59,8 @@ public ModuleState(ParserState state)
55
59
Annotations = new List < IAnnotation > ( ) ;
56
60
ModuleException = null ;
57
61
ModuleAttributes = new Dictionary < Tuple < string , DeclarationType > , Attributes > ( ) ;
62
+
63
+ IsNew = true ;
58
64
}
59
65
60
66
public ModuleState ( SyntaxErrorException moduleException )
@@ -68,6 +74,8 @@ public ModuleState(SyntaxErrorException moduleException)
68
74
Annotations = new List < IAnnotation > ( ) ;
69
75
ModuleException = moduleException ;
70
76
ModuleAttributes = new Dictionary < Tuple < string , DeclarationType > , Attributes > ( ) ;
77
+
78
+ IsNew = true ;
71
79
}
72
80
73
81
public ModuleState ( IDictionary < Tuple < string , DeclarationType > , Attributes > moduleAttributes )
@@ -81,6 +89,8 @@ public ModuleState(IDictionary<Tuple<string, DeclarationType>, Attributes> modul
81
89
Annotations = new List < IAnnotation > ( ) ;
82
90
ModuleException = null ;
83
91
ModuleAttributes = moduleAttributes ;
92
+
93
+ IsNew = true ;
84
94
}
85
95
86
96
public ModuleState SetTokenStream ( ITokenStream tokenStream )
@@ -104,6 +114,7 @@ public ModuleState SetState(ParserState state)
104
114
public ModuleState SetModuleContentHashCode ( int moduleContentHashCode )
105
115
{
106
116
ModuleContentHashCode = moduleContentHashCode ;
117
+ IsNew = false ;
107
118
return this ;
108
119
}
109
120
0 commit comments