@@ -31,52 +31,52 @@ type fieldSet struct {
3131 env * adt.Environment
3232 id adt.ID
3333
34- // field marks the optional conjuncts of all explicit fields .
35- // Required fields are marked as empty
36- fields []field
34+ // field marks the optional conjuncts of all explicit Fields .
35+ // Required Fields are marked as empty
36+ Fields []FieldInfo
3737
3838 // excluded are all literal fields that already exist.
39- bulk []bulkField
39+ Bulk []bulkField
4040
41- additional []adt.Expr
42- isOpen bool // has a ...
41+ Additional []adt.Expr
42+ IsOpen bool // has a ...
4343}
4444
4545func (o * fieldSet ) OptionalTypes () (mask adt.OptionalType ) {
46- for _ , f := range o .fields {
47- if len (f .optional ) > 0 {
46+ for _ , f := range o .Fields {
47+ if len (f .Optional ) > 0 {
4848 mask = adt .HasField
4949 break
5050 }
5151 }
52- for _ , b := range o .bulk {
52+ for _ , b := range o .Bulk {
5353 if b .expr == nil {
5454 mask |= adt .HasDynamic
5555 } else {
5656 mask |= adt .HasPattern
5757 }
5858 }
59- if o .additional != nil {
59+ if o .Additional != nil {
6060 mask |= adt .HasAdditional
6161 }
62- if o .isOpen {
62+ if o .IsOpen {
6363 mask |= adt .IsOpen
6464 }
6565 return mask
6666}
6767
6868func (o * fieldSet ) IsOptional (label adt.Feature ) bool {
69- for _ , f := range o .fields {
70- if f .label == label && len (f .optional ) > 0 {
69+ for _ , f := range o .Fields {
70+ if f .Label == label && len (f .Optional ) > 0 {
7171 return true
7272 }
7373 }
7474 return false
7575}
7676
77- type field struct {
78- label adt.Feature
79- optional []adt.Node
77+ type FieldInfo struct {
78+ Label adt.Feature
79+ Optional []adt.Node
8080}
8181
8282type bulkField struct {
@@ -86,13 +86,13 @@ type bulkField struct {
8686}
8787
8888func (o * fieldSet ) Accept (c * adt.OpContext , f adt.Feature ) bool {
89- if len (o .additional ) > 0 {
89+ if len (o .Additional ) > 0 {
9090 return true
9191 }
9292 if o .fieldIndex (f ) >= 0 {
9393 return true
9494 }
95- for _ , b := range o .bulk {
95+ for _ , b := range o .Bulk {
9696 if b .check .Match (c , o .env , f ) {
9797 return true
9898 }
@@ -109,9 +109,9 @@ func (o *fieldSet) MatchAndInsert(c *adt.OpContext, arc *adt.Vertex) {
109109 // Match normal fields
110110 matched := false
111111outer:
112- for _ , f := range o .fields {
113- if f .label == arc .Label {
114- for _ , e := range f .optional {
112+ for _ , f := range o .Fields {
113+ if f .Label == arc .Label {
114+ for _ , e := range f .Optional {
115115 arc .AddConjunct (adt .MakeConjunct (env , e , o .id ))
116116 }
117117 matched = true
@@ -129,7 +129,7 @@ outer:
129129 bulkEnv .Cycles = nil
130130
131131 // match bulk optional fields / pattern properties
132- for _ , f := range o .bulk {
132+ for _ , f := range o .Bulk {
133133 if matched && f .additional {
134134 continue
135135 }
@@ -149,14 +149,14 @@ outer:
149149 addEnv .Cycles = nil
150150
151151 // match others
152- for _ , x := range o .additional {
152+ for _ , x := range o .Additional {
153153 arc .AddConjunct (adt .MakeConjunct (& addEnv , x , o .id ))
154154 }
155155}
156156
157157func (o * fieldSet ) fieldIndex (f adt.Feature ) int {
158- for i := range o .fields {
159- if o .fields [i ].label == f {
158+ for i := range o .Fields {
159+ if o .Fields [i ].Label == f {
160160 return i
161161 }
162162 }
@@ -165,22 +165,22 @@ func (o *fieldSet) fieldIndex(f adt.Feature) int {
165165
166166func (o * fieldSet ) MarkField (c * adt.OpContext , f adt.Feature ) {
167167 if o .fieldIndex (f ) < 0 {
168- o .fields = append (o .fields , field { label : f })
168+ o .Fields = append (o .Fields , FieldInfo { Label : f })
169169 }
170170}
171171
172172func (o * fieldSet ) AddOptional (c * adt.OpContext , x * adt.OptionalField ) {
173173 p := o .fieldIndex (x .Label )
174174 if p < 0 {
175- p = len (o .fields )
176- o .fields = append (o .fields , field { label : x .Label })
175+ p = len (o .Fields )
176+ o .Fields = append (o .Fields , FieldInfo { Label : x .Label })
177177 }
178- o .fields [p ].optional = append (o .fields [p ].optional , x )
178+ o .Fields [p ].Optional = append (o .Fields [p ].Optional , x )
179179}
180180
181181func (o * fieldSet ) AddDynamic (c * adt.OpContext , x * adt.DynamicField ) {
182182 // not in bulk: count as regular field?
183- o .bulk = append (o .bulk , bulkField {dynamicMatcher {x .Key }, nil , false })
183+ o .Bulk = append (o .Bulk , bulkField {dynamicMatcher {x .Key }, nil , false })
184184}
185185
186186func (o * fieldSet ) AddBulk (c * adt.OpContext , x * adt.BulkOptionalField ) {
@@ -191,7 +191,7 @@ func (o *fieldSet) AddBulk(c *adt.OpContext, x *adt.BulkOptionalField) {
191191 }
192192
193193 if m := o .getMatcher (c , v ); m != nil {
194- o .bulk = append (o .bulk , bulkField {m , x , false })
194+ o .Bulk = append (o .Bulk , bulkField {m , x , false })
195195 }
196196}
197197
@@ -211,10 +211,10 @@ func (o *fieldSet) getMatcher(c *adt.OpContext, v adt.Value) fieldMatcher {
211211func (o * fieldSet ) AddEllipsis (c * adt.OpContext , x * adt.Ellipsis ) {
212212 expr := x .Value
213213 if x .Value == nil {
214- o .isOpen = true
214+ o .IsOpen = true
215215 expr = & adt.Top {}
216216 }
217- o .additional = append (o .additional , expr )
217+ o .Additional = append (o .Additional , expr )
218218}
219219
220220type fieldMatcher interface {
0 commit comments