18 lines
399 B
Swift
Raw Normal View History

2018-08-24 18:42:07 +02:00
/**
* Splash
* Copyright (c) John Sundell 2018
* MIT license - see LICENSE.md
*/
import Foundation
import Splash
guard CommandLine.arguments.count > 1 else {
print("⚠️ Please supply the code to tokenize as a string argument")
exit(1)
}
let code = CommandLine.arguments[1]
let highlighter = SyntaxHighlighter(format: TokenizerOutputFormat())
print(highlighter.highlight(code))