JSON formatter

This commit is contained in:
2024-08-09 16:58:15 -03:00
parent 89d212b71c
commit 84ee7e6934
5 changed files with 39 additions and 23 deletions

11
src/formatters/json.cr Normal file
View File

@@ -0,0 +1,11 @@
require "../formatter"
module Tartrazine
class Json < Formatter
property name = "json"
def format(text : String, lexer : Lexer, _theme : Theme) : String
lexer.tokenize(text).to_json
end
end
end