Skip to content

Instantly share code, notes, and snippets.

@radex
radex / lexer.swift
Last active February 15, 2017 13:08
Wrote a little lexer/tokenizer for fun. (Warning: I have no idea what I'm doing)
import Foundation
struct Stream {
let string: NSString
var position: Int
var matchingRange: NSRange {
return NSRange(location: position, length: string.length - position)
}
}