Remove "ExprRange" from zcl.Attribute

Now that expressions themselves have Range and StartRange methods, this
is redundant.
This commit is contained in:
Martin Atkins 2017-05-21 09:50:29 -07:00
parent 4fcad1f493
commit 64c1036f80
3 changed files with 0 additions and 34 deletions

View File

@ -99,7 +99,6 @@ func (b *body) PartialContent(schema *zcl.BodySchema) (*zcl.BodyContent, zcl.Bod
Expr: &expression{src: jsonAttr.Value},
Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()),
NameRange: jsonAttr.NameRange,
ExprRange: jsonAttr.Value.Range(),
}
usedNames[attrS.Name] = struct{}{}
}
@ -136,7 +135,6 @@ func (b *body) JustAttributes() (map[string]*zcl.Attribute, zcl.Diagnostics) {
Expr: &expression{src: jsonAttr.Value},
Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()),
NameRange: jsonAttr.NameRange,
ExprRange: jsonAttr.Value.Range(),
}
}

View File

@ -81,19 +81,6 @@ func TestBodyPartialContent(t *testing.T) {
Column: 8,
},
},
ExprRange: zcl.Range{
Filename: "test.json",
Start: zcl.Pos{
Byte: 8,
Line: 1,
Column: 9,
},
End: zcl.Pos{
Byte: 20,
Line: 1,
Column: 21,
},
},
},
},
},
@ -161,19 +148,6 @@ func TestBodyPartialContent(t *testing.T) {
Column: 8,
},
},
ExprRange: zcl.Range{
Filename: "test.json",
Start: zcl.Pos{
Byte: 8,
Line: 1,
Column: 9,
},
End: zcl.Pos{
Byte: 20,
Line: 1,
Column: 21,
},
},
},
},
},
@ -634,11 +608,6 @@ func TestJustAttributes(t *testing.T) {
Start: zcl.Pos{Byte: 1, Line: 1, Column: 2},
End: zcl.Pos{Byte: 6, Line: 1, Column: 7},
},
ExprRange: zcl.Range{
Filename: "test.json",
Start: zcl.Pos{Byte: 8, Line: 1, Column: 9},
End: zcl.Pos{Byte: 12, Line: 1, Column: 13},
},
},
},
},

View File

@ -79,7 +79,6 @@ type Attribute struct {
Range Range
NameRange Range
ExprRange Range
}
// Expression is a literal value or an expression provided in the