feat: add start column and end column to position struct
This commit is contained in:
@@ -148,6 +148,8 @@ func (v *Dumper) dumpPosition(pos *position.Position) {
|
||||
|
||||
v.print(v.indent, "StartLine: "+strconv.Itoa(pos.StartLine)+",\n")
|
||||
v.print(v.indent, "EndLine: "+strconv.Itoa(pos.EndLine)+",\n")
|
||||
v.print(v.indent, "StartCol: "+strconv.Itoa(pos.StartCol)+",\n")
|
||||
v.print(v.indent, "EndCol: "+strconv.Itoa(pos.EndCol)+",\n")
|
||||
v.print(v.indent, "StartPos: "+strconv.Itoa(pos.StartPos)+",\n")
|
||||
v.print(v.indent, "EndPos: "+strconv.Itoa(pos.EndPos)+",\n")
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@ package dumper_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
"testing"
|
||||
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
@@ -45,6 +46,8 @@ func TestDumper_root(t *testing.T) {
|
||||
Position: &position.Position{
|
||||
StartLine: 1,
|
||||
EndLine: 2,
|
||||
StartCol: 0,
|
||||
EndCol: 0,
|
||||
StartPos: 3,
|
||||
EndPos: 4,
|
||||
},
|
||||
@@ -60,6 +63,8 @@ func TestDumper_root(t *testing.T) {
|
||||
Position: &position.Position{
|
||||
StartLine: 1,
|
||||
EndLine: 2,
|
||||
StartCol: 0,
|
||||
EndCol: 0,
|
||||
StartPos: 3,
|
||||
EndPos: 4,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user