TODO(jimlarson) "Character offsets" should index the code points within the UTF-8 encoded string. It currently indexes bytes. Can be accomplished by using rune[] instead of string for contents. NewTextSource creates a new Source from the input text string.
(text string)
| 71 | |
| 72 | // NewTextSource creates a new Source from the input text string. |
| 73 | func NewTextSource(text string) Source { |
| 74 | return NewStringSource(text, "<input>") |
| 75 | } |
| 76 | |
| 77 | // NewTextSourceWithLimit creates a new Source from the input text string while |
| 78 | // enforcing a maximum code point count when needed. |