github.com/aretext/aretext@v1.3.0/syntax/parser/edit.go (about)

     1  package parser
     2  
     3  // Edit represents a change to a document.
     4  type Edit struct {
     5  	pos         uint64 // Position of the first character inserted/deleted.
     6  	numInserted uint64
     7  	numDeleted  uint64
     8  }
     9  
    10  func NewInsertEdit(pos, numInserted uint64) Edit {
    11  	return Edit{pos: pos, numInserted: numInserted}
    12  }
    13  
    14  func NewDeleteEdit(pos, numDeleted uint64) Edit {
    15  	return Edit{pos: pos, numDeleted: numDeleted}
    16  }