mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-12 22:42:23 +00:00
Compare commits
No commits in common. "ba50934005e0040e36de58f215a84eea1ec96cf2" and "b43501da98548ac831ead7c6eaa16e2fa10c5524" have entirely different histories.
ba50934005
...
b43501da98
@ -2,4 +2,4 @@ require "./**"
|
|||||||
|
|
||||||
lexer = Tartrazine.lexer("crystal")
|
lexer = Tartrazine.lexer("crystal")
|
||||||
theme = Tartrazine.theme(ARGV[1])
|
theme = Tartrazine.theme(ARGV[1])
|
||||||
puts Tartrazine::Html.new.format(File.read(ARGV[0]), lexer, theme)
|
puts Tartrazine::Ansi.new.format(File.read(ARGV[0]), lexer, theme)
|
||||||
|
@ -97,7 +97,7 @@ module Tartrazine
|
|||||||
class Re2 < Regex
|
class Re2 < Regex
|
||||||
@source = "fa"
|
@source = "fa"
|
||||||
@options = Regex::Options::None
|
@options = Regex::Options::None
|
||||||
@jit = true
|
@jit = true
|
||||||
|
|
||||||
def initialize(pattern : String, multiline = false, dotall = false, ignorecase = false, anchored = false)
|
def initialize(pattern : String, multiline = false, dotall = false, ignorecase = false, anchored = false)
|
||||||
flags = LibPCRE2::UTF | LibPCRE2::DUPNAMES |
|
flags = LibPCRE2::UTF | LibPCRE2::DUPNAMES |
|
||||||
@ -106,7 +106,6 @@ module Tartrazine
|
|||||||
flags |= LibPCRE2::DOTALL if dotall
|
flags |= LibPCRE2::DOTALL if dotall
|
||||||
flags |= LibPCRE2::CASELESS if ignorecase
|
flags |= LibPCRE2::CASELESS if ignorecase
|
||||||
flags |= LibPCRE2::ANCHORED if anchored
|
flags |= LibPCRE2::ANCHORED if anchored
|
||||||
flags |= LibPCRE2::NO_UTF_CHECK | LibPCRE2::JIT_PARTIAL_SOFT
|
|
||||||
@re = Regex::PCRE2.compile(pattern, flags) do |error_message|
|
@re = Regex::PCRE2.compile(pattern, flags) do |error_message|
|
||||||
raise Exception.new(error_message)
|
raise Exception.new(error_message)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user