From 83ddc656b3455f066196c7f535402ec7ee4f34de Mon Sep 17 00:00:00 2001 From: Ashkan Kiani Date: Fri, 18 Oct 2019 21:51:56 -0700 Subject: Improve algorithm performance and correctness. (#15) - Disable highlighting for HEX codes and NAME codes when preceded by alphanumeric codes. - Hand written parser with 1 pass parsing. - Update Trie to be more ergonomic. - Add test file with expected outputs for edge cases. - Cache matcher creation and refactor. - Refactor Faster than ever baby --- test/expectation.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/expectation.txt (limited to 'test') diff --git a/test/expectation.txt b/test/expectation.txt new file mode 100644 index 0000000..915d4de --- /dev/null +++ b/test/expectation.txt @@ -0,0 +1,45 @@ +-- vim:ft=lua +require'colorizer'.attach_to_buffer(0, {css=true}) + +--[[ SUCCESS +#F0F +#FF00FF +#FFF00F8F + #F0F + #FF00FF + #FFF00F8F + #F0F 1 + #FF00FF 1 + #FFF00F8F 1 +Blue Gray LightBlue Gray100 White +White +#def +#deadbeef +rgba(0,0,0,0) +rgb(0,0,0) +rgb(10, 100 , 100) +hsl(300,50%,50%) +hsla(300,50%,50%,0.5) +hsla(300,50%,50%,1.0000000000000001) +hsla(360,50%,50%,1.0000000000000001) +]] + +--[[ FAIL +#F0FF +#F0FFF +#F0FFF0F +#F0FFF0FFF +Blueberry Gray1000 BlueGree BlueGray +#define +#def0 +matcher#add +rgb(10,256,100) +rgb (10,255,100) +rgb(10, 1 00 , 100) +hsla(300,50%,50%,05) +hsla(300,50%,50%,1.000000000000001) +hsla(300,50%,50,1.0000000000000001) +hsla(300,50,50,1.0000000000000001) +hsla(361,50,50,1.0000000000000001) +]] + -- cgit v1.2.3-70-g09d2