diff --git a/README.md b/README.md index d075921..fb424ae 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,14 @@ See [HowItWorks.md](https://github.com/cmur2/joe-syntax/blob/master/HowItWorks.m Every .jsf file from the original repository is under GPL as [JOE](http://sourceforge.net/projects/joe-editor/). There are efforts to move JOE to GPL v2 or any later version. -Every .jsf file created and modified exclusively by [me](https://github.com/cmur2) is under GPL v2 or any later version. +Every .jsf file created and modified exclusively by [me (Christian Nicolai)](https://github.com/cmur2) is under GPL v2 or any later version. Files with contributions (or unclear license info): * [elixir.jsf](https://github.com/cmur2/joe-syntax/blob/master/elixir.jsf) which is created by [Andrew Lisin](https://github.com/avli) under GPL v2 or any later version ([comment](https://github.com/cmur2/joe-syntax/pull/18#issuecomment-78036115)) * [erlang.jsf](https://github.com/cmur2/joe-syntax/blob/master/erlang.jsf) which is created by [Christian Nicolai](https://github.com/cmur2) and then modified by Jonas Rosling and enhanced with a small tweak from [raev](https://github.com/raev) * [go.jsf](https://github.com/cmur2/joe-syntax/blob/master/go.jsf) which is entirely contributed by [Daniel Vargas](https://github.com/danielvargas) +* [ini.jsf](https://github.com/cmur2/joe-syntax/blob/master/ini.jsf) which is created by [Christian Nicolai](https://github.com/cmur2) with contributions from [Todd Lewis](https://github.com/utoddl) * [js.jsf](https://github.com/cmur2/joe-syntax/blob/master/js.jsf) which is created by [Christian Nicolai](https://github.com/cmur2) and then modified by [Rebecca Turner](https://github.com/iarna) under GPL v2 or any later version and compatible ISC license ([comment](https://github.com/cmur2/joe-syntax/pull/13#issuecomment-78058267)) * [json.jsf](https://github.com/cmur2/joe-syntax/blob/master/json.jsf) which is entirely contributed by [Rebecca Turner](https://github.com/iarna) under GPL v2 or any later version and compatible ISC license ([comment](https://github.com/cmur2/joe-syntax/pull/14#issuecomment-78058037)) * [lsl.jsf](https://github.com/cmur2/joe-syntax/blob/master/lsl.jsf) which is from [Zai Lynch](https://wiki.secondlife.com/wiki/User:Zai_Lynch) under GPL v1 (delivered by [Rebecca Turner](https://github.com/iarna)) diff --git a/ini.jsf b/ini.jsf index bf4aa83..1927c36 100644 --- a/ini.jsf +++ b/ini.jsf @@ -1,76 +1,104 @@ # JOE syntax highlight file for INI files +# License: GPL +# by Christian Nicolai (http://mycrobase.de) +# contributions by Todd Lewis (https://github.com/utoddl) =Idle =Comment green -=Constant cyan -=Escape bold cyan -=Bad bold red - +=Constant cyan dim +=Escape cyan bold +=Bad red bold =Key -=Separator bold -=Section bold magenta +=Separator bold +=Section white bold bg_MAGENTA +=SectionBracket white bg_MAGENTA :line_start Idle - * key noeat + * key noeat mark "\n" line_start " \t\r" line_start # leading spaces ";#" line_comment recolor=-1 - "[" section recolor=-1 + "[" section_start noeat "=" missing_key recolor=-1 :line_comment Comment * line_comment "\n" line_start +:section_start SectionBracket + * section mark noeat + "[" section_start + :section Section * section - "]" section_end - "\n" section_unexp_end recolor=-2 + "]" section_end noeat + "\n" unexpected_end noeat recolormark -:section_end Bad - * section_end +:section_end SectionBracket + * unexpected_end noeat + "]" section_end mark "\n" line_start -:section_unexp_end Bad - * line_start noeat +:unexpected_end Bad + * unexpected_end + "\n" line_start :missing_key Bad * value_pre noeat :key Key * key - " \t\r" key_post noeat - "=" sep recolor=-1 - "\n" key_error recolor=-2 - -:key_post Idle - * value_pre noeat - " \t\r" key_post - "=" sep recolor=-1 - -:key_error Bad - * key noeat + "=:" sep noeat mark + "\n" unexpected_end noeat recolormark :sep Separator * value_pre noeat + "=:" value_pre :value_pre Idle - * value noeat + * value noeat mark " \t\r" value_pre + "\n" unexpected_end noeat recolormark :value Constant * value - "\\" value_esc + "\\" value_esc mark "\n" line_start - " \t\r" maybe_comment recolor=-1 + " " value_maybe_comment recolor=-1 -:value_esc Escape - * value - "\n" value_error recolor=-2 - -:value_error Bad - * value noeat - -:maybe_comment Idle +:value_maybe_comment Idle * value noeat ";#" line_comment recolor=-1 + +:value_esc Escape + * value_esc_bad noeat recolormark + "0abtrn;#=:\\" value_esc_end recolormark + "x" value_esc_unicode1 + "\n" value mark + +:value_esc_bad Bad + * value noeat mark + +:value_esc_end Escape + * value noeat mark + +:value_esc_unicode1 Escape + * value_esc_bad noeat recolormark + "0-9a-fA-F" value_esc_unicode2 + "\n" unexpected_end noeat recolormark + +:value_esc_unicode2 Escape + * value_esc_bad noeat recolormark + "0-9a-fA-F" value_esc_unicode3 + "\n" unexpected_end noeat recolormark + +:value_esc_unicode3 Escape + * value_esc_bad noeat recolormark + "0-9a-fA-F" value_esc_unicode4 + "\n" unexpected_end noeat recolormark + +:value_esc_unicode4 Escape + * value_esc_bad noeat recolormark + "0-9a-fA-F" value_esc_end recolormark + "\n" unexpected_end noeat recolormark + diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..214d367 --- /dev/null +++ b/test/README.md @@ -0,0 +1,6 @@ +# Test Files for JOE Syntax Highlighting + +This directory contains files for testing and validating .jsf files. +Select features and problematic cases should be added to these files +to ensure that new features and bug fixes don't break existing +functionality. diff --git a/test/ini-test.ini b/test/ini-test.ini new file mode 100644 index 0000000..60d95d2 --- /dev/null +++ b/test/ini-test.ini @@ -0,0 +1,40 @@ +; ini-test.ini -- file for testing ini.jsf +; License: GPL +; by Todd Lewis (https://github.com/utoddl) +; +; See https://en.wikipedia.org/wiki/INI_file for .ini specs +; Normal (;) line comment +# Alternative (#) line comment +[broken_section_head) +bsh1=normal_value_with_equals_sign_as_separator +bsh2:normal_value_with_colon_as_separator + +[escape_char_section] with evil trailing chars +; Valid esc chars: \ 0 a b t r n ; # : +; and unicode "Basic Multilingual Plane" (4 hex digits) after "\x" +alphas=\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +valid_esc=~\\~\0~\a~\b~\t~\r~\n~\;~\#~ +unicodes=~~\x~~\x1~~\x12~~\x123\a~~\x1234~~\x12345~~ +# another comment +ecs1_missing_value ; Not a trailing comment b/c no equal sign! +ecs2 = # value w/ leading whitespace! +ecs3=value with continuation \ + on the next line. + +[quotes_and_trailing_comments] +; The following quotes should be insignificant according +; to https://en.wikipedia.org/wiki/INI_file, but some +; implementations allow it. Likewise, trailing comments are +; not spec, but often honored. +qatc3="quoted value" # not technically a comment, but lovely green. +qatc4="quoted value \# w/o comment" +qatc5="quoted value # w/ comment?" ; No right answer! +qatc6_missing_value + +[second_borken_section +sbs1='val \x \'' ; These single quotes aren't spec either. + +differently_borken_section] +dbs1_no_val_but_with_equals= +dbs2 = good_value_with_whitespace_around_equals +