This commit is contained in:
Roberto Alsina 2024-08-19 12:43:51 -03:00
parent 3ebedec6c1
commit 91b973f464
4 changed files with 4 additions and 6 deletions

View File

@ -1,5 +1,5 @@
name: tartrazine
version: 0.4.0
version: 0.5.1
authors:
- Roberto Alsina <roberto.alsina@gmail.com>

View File

@ -14,7 +14,7 @@ module Tartrazine
def format(text : String, lexer : Lexer) : String
outp = String::Builder.new("")
format(text, lexer, outp)
return outp.to_s
outp.to_s
end
def format(text : String, lexer : Lexer, outp : IO) : Nil

View File

@ -37,10 +37,9 @@ module Tartrazine
def format(text : String, lexer : Lexer) : String
outp = String::Builder.new("")
format(text, lexer, outp)
return outp.to_s
outp.to_s
end
def format(text : String, lexer : Lexer, io : IO) : Nil
pre, post = wrap_standalone
io << pre if standalone?

View File

@ -7,10 +7,9 @@ module Tartrazine
def format(text : String, lexer : Lexer) : String
outp = String::Builder.new("")
format(text, lexer, outp)
return outp.to_s
outp.to_s
end
def format(text : String, lexer : Lexer, io : IO) : Nil
tokenizer = Tokenizer.new(lexer, text)
io << Tartrazine::Lexer.collapse_tokens(tokenizer.to_a).to_json