Option Strict On
Option Explicit On

Imports System

Namespace Nexamas.UI.TextInput

    Friend NotInheritable Class MASTextSyntaxSpan

        Public ReadOnly Property Start As Integer
        Public ReadOnly Property Length As Integer
        Public ReadOnly Property Style As MASTextSyntaxStyle

        Public Sub New(start As Integer, length As Integer, style As MASTextSyntaxStyle)
            Me.Start = Math.Max(0, start)
            Me.Length = Math.Max(0, length)
            Me.Style = If(style, New MASTextSyntaxStyle())
        End Sub

        Public ReadOnly Property [End] As Integer
            Get
                Return Start + Length
            End Get
        End Property

    End Class

End Namespace
