Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
sourcemeta::core::Diff::Operation Struct Reference

Public Types

enum class  Type : std::uint8_t { Equal , Delete , Insert }
 The kind of transformation that a difference operation represents. More...

Public Attributes

Type type
 The kind of transformation.
std::size_t original_start
 The index of the first affected token of the original input.
std::size_t original_end
 The index one past the last affected token of the original input.
std::size_t modified_start
 The index of the first affected token of the modified input.
std::size_t modified_end
 The index one past the last affected token of the modified input.

Detailed Description

A single contiguous transformation between two inputs, expressed as a half-open range into the tokens of each of them.

A deletion carries an empty modified range that marks where in the modified input the removal occurred, and an insertion carries an empty original range that marks where in the original input the addition occurred.

Member Enumeration Documentation

◆ Type

enum class sourcemeta::core::Diff::Operation::Type : std::uint8_t
strong

The kind of transformation that a difference operation represents.

Enumerator
Equal 

The spans are present in both inputs.

Delete 

The span is only present in the original input.

Insert 

The span is only present in the modified input.


The documentation for this struct was generated from the following file:
  • /__w/core/core/src/core/diff/include/sourcemeta/core/diff.h