From 2868df4b280960e20c50a17a6643988f6fed2b58 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 15:17:41 +0400 Subject: [PATCH] cleanup and fix tests --- demo/kitchen-sink/doclist.js | 2 +- lib/ace/mode/_test/tokens_actionscript.json | 272 ++++++++++++++++ lib/ace/mode/_test/tokens_erlang.json | 169 ++++++++++ lib/ace/mode/_test/tokens_forth.json | 219 +++++++++++++ lib/ace/mode/_test/tokens_ftl.json | 337 ++++++++++++++++++++ lib/ace/mode/_test/tokens_haskell.json | 162 ++++++++++ lib/ace/mode/_test/tokens_julia.json | 105 ++++++ lib/ace/mode/_test/tokens_livescript.json | 6 + lib/ace/mode/_test/tokens_pascal.json | 6 +- lib/ace/mode/_test/tokens_prolog.json | 265 +++++++++++++++ lib/ace/mode/_test/tokens_rust.json | 136 ++++++++ lib/ace/mode/forth_highlight_rules.js | 24 +- lib/ace/mode/logiql_test.js | 2 +- lib/ace/tokenizer.js | 2 +- 14 files changed, 1689 insertions(+), 18 deletions(-) create mode 100644 lib/ace/mode/_test/tokens_actionscript.json create mode 100644 lib/ace/mode/_test/tokens_erlang.json create mode 100644 lib/ace/mode/_test/tokens_forth.json create mode 100644 lib/ace/mode/_test/tokens_ftl.json create mode 100644 lib/ace/mode/_test/tokens_haskell.json create mode 100644 lib/ace/mode/_test/tokens_julia.json create mode 100644 lib/ace/mode/_test/tokens_livescript.json create mode 100644 lib/ace/mode/_test/tokens_prolog.json create mode 100644 lib/ace/mode/_test/tokens_rust.json diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index f025db5f..5416e169 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -102,7 +102,7 @@ var docs = { "docs/luapage.lp": "LuaPage", "docs/Makefile": "Makefile", "docs/markdown.md": {name: "Markdown", wrapped: true}, - "docs/tinymush.mc": {name: "TinyMUSH"}, + "docs/tinymush.mc": {name: "TinyMUSH", wrapped: true}, "docs/objectivec.m": {name: "Objective-C"}, "docs/ocaml.ml": "OCaml", "docs/OpenSCAD.scad": "OpenSCAD", diff --git a/lib/ace/mode/_test/tokens_actionscript.json b/lib/ace/mode/_test/tokens_actionscript.json new file mode 100644 index 00000000..00223583 --- /dev/null +++ b/lib/ace/mode/_test/tokens_actionscript.json @@ -0,0 +1,272 @@ +[[ + "start", + ["text","package code"] +],[ + "start", + ["text","{"] +],[ + "punctuation.definition.comment.actionscript.2", + ["text"," "], + ["punctuation.definition.comment.actionscript.2","/*"], + ["comment.block.actionscript.2","****************************************"] +],[ + "punctuation.definition.comment.actionscript.2", + ["comment.block.actionscript.2","\t * based on textmate actionscript bundle"] +],[ + "start", + ["comment.block.actionscript.2","\t ***************************************"], + ["punctuation.definition.comment.actionscript.2","*/"] +],[ + "start", + ["text","\t "] +],[ + "start", + ["text","\t"], + ["keyword.control.actionscript.2","import"], + ["text"," fl.events.SliderEvent;"] +],[ + "start", + ["text","\t"] +],[ + "start", + ["text","\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["storage.type.class.actionscript.2","class"], + ["meta.class.actionscript.2"," "], + ["entity.name.type.class.actionscript.2","Foo"], + ["meta.class.actionscript.2"," "], + ["storage.modifier.extends.actionscript.2","extends"], + ["meta.class.actionscript.2"," "], + ["entity.other.inherited-class.actionscript.2","MovieClip"] +],[ + "start", + ["text","\t{"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2","*************************"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Properties:"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["keyword.control.actionscript.2","var"], + ["text"," activeSwatch"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.class.actionscript.2","MovieClip"], + ["text",";"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Color offsets"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["keyword.control.actionscript.2","var"], + ["text"," c1"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["storage.type.actionscript.2","Number"], + ["text"," "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["constant.numeric.actionscript.2","0"], + ["text",";\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," R"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2","*************************"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Constructor:"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","Foo"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["punctuation.definition.parameters.end.actionscript.2",")"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Respond to mouse events"] +],[ + "start", + ["text","\t\t\tswatch1_btn."], + ["support.function.actionscript.2","addEventListener"], + ["text","(MouseEvent.CLICK,swatchHandler,"], + ["constant.language.actionscript.2","false"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.language.actionscript.2","false"], + ["text",");"] +],[ + "start", + ["text","\t\t\tpreviewBox_btn."], + ["support.function.actionscript.2","addEventListener"], + ["text","(MouseEvent.MOUSE_DOWN,dragPressHandler);"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Respond to drag events"] +],[ + "start", + ["text","\t\t\tred_slider."], + ["support.function.actionscript.2","addEventListener"], + ["text","(SliderEvent.THUMB_DRAG,sliderHandler);"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Draw a frame later"] +],[ + "start", + ["text","\t\t\t"], + ["support.function.actionscript.2","addEventListener"], + ["text","(Event.ENTER_FRAME,"], + ["support.function.actionscript.2","draw"], + ["text",");"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text","\t\tprotected "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","clickHandler"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["variable.parameter.function.actionscript.2","event:MouseEvent"], + ["punctuation.definition.parameters.end.actionscript.2",")"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.function.actionscript.2","void"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\tcar.transform.colorTransform "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["keyword.control.actionscript.2","new"], + ["text"," ColorTransform("], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","1"], + ["text",",c1,c2,c3);"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\tprotected "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","changeRGBHandler"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["variable.parameter.function.actionscript.2","event:Event"], + ["punctuation.definition.parameters.end.actionscript.2",")"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.function.actionscript.2","void"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\tc1 "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["storage.type.actionscript.2","Number"], + ["text","(c1_txt."], + ["support.function.actionscript.2","text"], + ["text",");"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text","\t\t\t"], + ["keyword.control.actionscript.2","if"], + ["text","("], + ["keyword.operator.symbolic.actionscript.2","!"], + ["text","(c1>"], + ["keyword.operator.symbolic.actionscript.2","="], + ["constant.numeric.actionscript.2","0"], + ["text",")){"] +],[ + "start", + ["text","\t\t\t\tc1 "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["constant.numeric.actionscript.2","0"], + ["text",";"] +],[ + "start", + ["text","\t\t\t}\t\t\t"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\tupdateSliders();"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text","\t}"] +],[ + "start", + ["text","}"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_erlang.json b/lib/ace/mode/_test/tokens_erlang.json new file mode 100644 index 00000000..5a1fa366 --- /dev/null +++ b/lib/ace/mode/_test/tokens_erlang.json @@ -0,0 +1,169 @@ +[[ + "start", + ["text"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang","% A process whose only job is to keep a counter."] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang","% First version"] +],[ + "start", + ["meta.directive.module.erlang"," "], + ["punctuation.section.directive.begin.erlang","-"], + ["keyword.control.directive.module.erlang","module"], + ["punctuation.definition.parameters.begin.erlang","("], + ["entity.name.type.class.module.definition.erlang","counter"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.section.directive.end.erlang","."] +],[ + "start", + ["meta.directive.export.erlang"," "], + ["punctuation.section.directive.begin.erlang","-"], + ["keyword.control.directive.export.erlang","export"], + ["punctuation.definition.parameters.begin.erlang","("], + ["punctuation.definition.list.begin.erlang","["], + ["entity.name.function.erlang","start"], + ["punctuation.separator.function-arity.erlang","/"], + ["constant.numeric.integer.decimal.erlang","0"], + ["punctuation.separator.list.erlang",","], + ["meta.structure.list.function.erlang"," "], + ["entity.name.function.erlang","codeswitch"], + ["punctuation.separator.function-arity.erlang","/"], + ["constant.numeric.integer.decimal.erlang","1"], + ["punctuation.definition.list.end.erlang","]"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.section.directive.end.erlang","."] +],[ + "start", + ["text"," "] +],[ + "start", + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","start"], + ["punctuation.section.expression.begin.erlang","("], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"], + ["text"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["constant.numeric.integer.decimal.erlang","0"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.terminator.function.erlang","."] +],[ + "start", + ["text"," "] +],[ + ["text6","meta.function.erlang"], + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","loop"], + ["punctuation.section.expression.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["text"," "], + ["keyword.control.receive.erlang","receive"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","increment"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Count"], + ["punctuation.definition.tuple.end.erlang","}"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["keyword.operator.symbolic.erlang","+"], + ["variable.other.erlang","Count"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.separator.clauses.erlang",";"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","counter"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Pid"], + ["punctuation.definition.tuple.end.erlang","}"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["variable.other.erlang","Pid"], + ["meta.expression.receive.erlang"," "], + ["keyword.operator.symbolic.erlang","!"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","counter"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Sum"], + ["punctuation.definition.tuple.end.erlang","}"], + ["punctuation.separator.expressions.erlang",","] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.separator.clauses.erlang",";"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["constant.other.symbol.unquoted.erlang","code_switch"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["keyword.operator.macro.erlang","?"], + ["entity.name.function.macro.erlang","MODULE"], + ["meta.expression.receive.erlang",":"], + ["entity.name.function.erlang","codeswitch"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang"," Force the use of 'codeswitch/1' from the latest MODULE version"] +],[ + "start", + ["meta.expression.receive.erlang"," "], + ["keyword.control.end.erlang","end"], + ["punctuation.terminator.function.erlang","."] +],[ + "start", + ["text"," "] +],[ + "start", + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","codeswitch"], + ["punctuation.section.expression.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"], + ["text"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.terminator.function.erlang","."] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_forth.json b/lib/ace/mode/_test/tokens_forth.json new file mode 100644 index 00000000..8c8a007e --- /dev/null +++ b/lib/ace/mode/_test/tokens_forth.json @@ -0,0 +1,219 @@ +[[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","HELLO"], + ["meta.block.forth"," "], + ["comment.line.parentheses.forth"," ( -- )"], + ["meta.block.forth"," CR "], + ["string.quoted.double.forth",".\" Hello, world!\""], + ["meta.block.forth"," "], + ["keyword.other.compile-only.forth",";"], + ["text"," "] +],[ + "start" +],[ + "start", + ["text","HELLO "] +],[ + "start", + ["text","Hello, world!"] +],[ + "start" +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","[CHAR]"], + ["meta.block.forth"," "], + ["keyword.other.non-immediate.forth"," CHAR"], + ["meta.block.forth"," "], + ["keyword.other.compile-only.forth"," POSTPONE"], + ["meta.block.forth"," LITERAL "], + ["keyword.other.compile-only.forth",";"], + ["keyword.other.immediate.forth"," IMMEDIATE"] +],[ + "start" +],[ + "start", + ["constant.numeric.forth","0"], + ["storage.type.forth"," value"], + ["text"," ii "], + ["constant.numeric.forth"," 0"], + ["storage.type.forth"," value"], + ["text"," jj"] +],[ + "start", + ["constant.numeric.forth","0"], + ["storage.type.forth"," value"], + ["text"," KeyAddr "], + ["constant.numeric.forth"," 0"], + ["storage.type.forth"," value"], + ["text"," KeyLen"] +],[ + "start", + ["storage.type.forth","create"], + ["text"," SArray "], + ["constant.numeric.forth"," 256"], + ["text"," allot "], + ["comment.line.backslash.forth"," \\ state array of 256 bytes"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","KeyArray"], + ["meta.block.forth"," KeyLen mod KeyAddr "], + ["keyword.other.compile-only.forth",";"] +],[ + "start" +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","get_byte"], + ["meta.block.forth"," + c@ "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","set_byte"], + ["meta.block.forth"," + c! "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","as_byte"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 255"], + ["meta.block.forth"," and "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","reset_ij"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 0"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," ii "], + ["constant.numeric.forth"," 0"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," jj "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","i_update"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 1"], + ["meta.block.forth"," + as_byte"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," ii "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","j_update"], + ["meta.block.forth"," ii SArray get_byte + as_byte"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," jj "], + ["keyword.other.compile-only.forth",";"] +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," jj SArray get_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray get_byte jj SArray set_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray set_byte"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +],[ + "start" +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","rc4_init"], + ["comment.line.parentheses.forth"," ( KeyAddr KeyLen -- )"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["constant.numeric.forth"," 256"], + ["meta.block.forth"," min"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," KeyLen "], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," KeyAddr"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["constant.numeric.forth"," 256 0"], + ["keyword.control.compile-only.forth"," DO"], + ["meta.block.forth"," "], + ["variable.language.forth","i"], + ["meta.block.forth"," "], + ["variable.language.forth","i"], + ["meta.block.forth"," SArray set_byte "], + ["keyword.control.compile-only.forth"," LOOP"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," reset_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["keyword.control.compile-only.forth"," BEGIN"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii KeyArray get_byte jj + j_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii"], + ["constant.numeric.forth"," 255"], + ["meta.block.forth"," <"], + ["keyword.control.compile-only.forth"," WHILE"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii i_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["keyword.control.compile-only.forth"," REPEAT"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," reset_ij"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","rc4_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii i_update jj j_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ftl.json b/lib/ace/mode/_test/tokens_ftl.json new file mode 100644 index 00000000..19773674 --- /dev/null +++ b/lib/ace/mode/_test/tokens_ftl.json @@ -0,0 +1,337 @@ +[[ + "start", + ["keyword.function","<#ftl"], + ["text"," "], + ["entity.other.attribute-name","encoding"], + ["keyword.operator","="], + ["string","\"utf-8\""], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["keyword.function","<#setting"], + ["text"," "], + ["entity.other.attribute-name","locale"], + ["keyword.operator","="], + ["string","\"en_US\""], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["keyword.function","<#import"], + ["text"," "], + ["string","\"library\""], + ["text"," "], + ["keyword.operator","as"], + ["text"," "], + ["variable","lib"], + ["text"," "], + ["keyword","/>"] +],[ + "comment", + ["comment","<#--"] +],[ + "comment", + ["comment"," FreeMarker comment"] +],[ + "comment", + ["comment"," ${abc} <#assign a=12 />"] +],[ + "start", + ["comment","-->"] +],[ + "start" +],[ + "start", + ["xml-pe",""] +],[ + "start", + ["meta.tag","<"], + ["meta.tag.tag-name","html"], + ["text"," "], + ["entity.other.attribute-name","lang"], + ["keyword.operator","="], + ["string","\"en-us\""], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","head"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","meta"], + ["text"," "], + ["entity.other.attribute-name","charset"], + ["keyword.operator","="], + ["string","\"utf-8\""], + ["text"," "], + ["meta.tag.r","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","title"], + ["meta.tag.r",">"], + ["string.interpolated","${"], + ["variable","title"], + ["keyword.operator","!"], + ["string","\"FreeMarker\""], + ["string.interpolated","}"], + ["meta.tag","<"], + ["meta.tag.tag-name","title"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","body"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","h1"], + ["meta.tag.r",">"], + ["text","Hello "], + ["string.interpolated","${"], + ["variable","name"], + ["keyword.operator","!"], + ["string","\"\""], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","p"], + ["meta.tag.r",">"], + ["text","Today is: "], + ["string.interpolated","${"], + ["language.variable",".now"], + ["support.function","?date"], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.function","<#assign"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["constant.numeric","13"], + ["keyword",">"] +],[ + "start", + ["text"," "], + ["keyword.function","<#if"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["constant.character.entity",">"], + ["text"," "], + ["constant.numeric","12"], + ["text"," "], + ["keyword.operator","&&"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["keyword.operator","lt"], + ["text"," "], + ["constant.numeric","14"], + ["keyword",">"], + ["text","x equals 13: "], + ["string.interpolated","${"], + ["variable","x"], + ["string.interpolated","}"], + ["keyword.function",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","ul"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["keyword.function","<#list"], + ["text"," "], + ["variable","items"], + ["text"," "], + ["keyword.operator","as"], + ["text"," "], + ["variable","item"], + ["keyword",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","li"], + ["meta.tag.r",">"], + ["string.interpolated","${"], + ["variable","item_index"], + ["string.interpolated","}"], + ["text",": "], + ["string.interpolated","${"], + ["variable","item.name"], + ["keyword.operator","!"], + ["support.function","?split"], + ["paren.lparen","("], + ["string","\""], + ["constant.character.escape","\\n"], + ["string","\""], + ["paren.rparen",")"], + ["paren.lparen","["], + ["constant.numeric","0"], + ["paren.rparen","]"], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "], + ["keyword.function",""] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," User directive: "], + ["keyword.other","<@lib.function"], + ["text"," "], + ["variable","attr1"], + ["keyword.operator","="], + ["constant.language","true"], + ["text"," "], + ["variable","attr2"], + ["keyword.operator","="], + ["string","'value'"], + ["text"," "], + ["variable","attr3"], + ["keyword.operator","="], + ["constant.numeric","-42.12"], + ["keyword",">"], + ["text","Test"], + ["keyword.other",""] +],[ + "start", + ["text"," "], + ["keyword.other","<@anotherOne"], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.function","<#if"], + ["text"," "], + ["variable","variable"], + ["support.function.deprecated","?exists"], + ["keyword",">"] +],[ + "start", + ["text"," Deprecated"] +],[ + "start", + ["text"," "], + ["keyword.function","<#elseif"], + ["text"," "], + ["variable","variable"], + ["support.function","??"], + ["keyword",">"] +],[ + "start", + ["text"," Better"] +],[ + "start", + ["text"," "], + ["keyword.function","<#else"], + ["keyword",">"] +],[ + "start", + ["text"," Default"] +],[ + "start", + ["text"," "], + ["keyword.function",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name.image","img"], + ["text"," "], + ["entity.other.attribute-name","src"], + ["keyword.operator","="], + ["string","\"images/"], + ["string.interpolated","${"], + ["variable","user.id"], + ["string.interpolated","}"], + ["string",".png\""], + ["text"," "], + ["meta.tag.r","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["meta.tag",""] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haskell.json b/lib/ace/mode/_test/tokens_haskell.json new file mode 100644 index 00000000..2d2d3b6e --- /dev/null +++ b/lib/ace/mode/_test/tokens_haskell.json @@ -0,0 +1,162 @@ +[[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Type annotation (optional)"] +],[ + "start", + ["entity.name.function.haskell","fib"], + ["meta.function.type-declaration.haskell"," "], + ["keyword.other.double-colon.haskell","::"], + ["meta.function.type-declaration.haskell"," "], + ["support.type.prelude.haskell","Int"], + ["meta.function.type-declaration.haskell"," "], + ["keyword.other.arrow.haskell","->"], + ["meta.function.type-declaration.haskell"," "], + ["support.type.prelude.haskell","Integer"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," With self-referencing data"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["support.function.prelude.haskell","scanl"], + ["text"," "], + ["entity.name.function.infix.haskell","(+)"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," fibs"] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," 0,1,1,2,3,5,..."] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Same, coded directly"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," next fibs"] +],[ + "start", + ["text"," next (a "], + ["keyword.operator.haskell",":"], + ["text"," t@(b"], + ["keyword.operator.haskell",":"], + ["text","_)) "], + ["keyword.operator.haskell","="], + ["text"," (a"], + ["keyword.operator.haskell","+"], + ["text","b) "], + ["keyword.operator.haskell",":"], + ["text"," next t"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Similar idea, using zipWith"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["support.function.prelude.haskell","zipWith"], + ["text"," "], + ["entity.name.function.infix.haskell","(+)"], + ["text"," fibs ("], + ["support.function.prelude.haskell","tail"], + ["text"," fibs)"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Using a generator function"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs ("], + ["constant.numeric.haskell","0"], + ["punctuation.separator.comma.haskell",","], + ["constant.numeric.haskell","1"], + ["text",") "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs (a"], + ["punctuation.separator.comma.haskell",","], + ["text","b) "], + ["keyword.operator.haskell","="], + ["text"," a "], + ["keyword.operator.haskell",":"], + ["text"," fibs (b"], + ["punctuation.separator.comma.haskell",","], + ["text","a"], + ["keyword.operator.haskell","+"], + ["text","b)"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_julia.json b/lib/ace/mode/_test/tokens_julia.json new file mode 100644 index 00000000..f4ce4eab --- /dev/null +++ b/lib/ace/mode/_test/tokens_julia.json @@ -0,0 +1,105 @@ +[[ + "start", + ["keyword.control.julia","for"], + ["text"," op "], + ["keyword.operator.update.julia","="], + ["text"," ("], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.arithmetic.julia","+"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.arithmetic.julia","*"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.bitwise.julia","&"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.bitwise.julia","|"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.interpolation.julia","$"], + ["text",")"] +],[ + "start", + ["text"," "], + ["variable.macro.julia","@eval"], + ["text"," ("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(a,b,c) "], + ["keyword.operator.update.julia","="], + ["text"," ("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(a,b),c)"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +],[ + "start" +],[ + "start", + ["keyword.other.julia","function"], + ["meta.function.julia"," "], + ["entity.name.function.julia","g"], + ["text","("], + ["text","x,y)"] +],[ + "start", + ["text"," "], + ["keyword.control.julia","return"], + ["text"," x "], + ["keyword.operator.arithmetic.julia","*"], + ["text"," y"] +],[ + "start", + ["text"," x "], + ["keyword.operator.arithmetic.julia","+"], + ["text"," y"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +],[ + "start", + ["support.function.julia","cd"], + ["text","("], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","data"], + ["punctuation.definition.string.end.julia","\""], + ["text",") "], + ["keyword.control.julia","do"] +],[ + "start", + ["text"," "], + ["support.function.julia","open"], + ["text","("], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","outfile"], + ["punctuation.definition.string.end.julia","\""], + ["text",", "], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","w"], + ["punctuation.definition.string.end.julia","\""], + ["text",") "], + ["keyword.control.julia","do"], + ["text"," f"] +],[ + "start", + ["text"," "], + ["support.function.julia","write"], + ["text","("], + ["text","f, data)"] +],[ + "start", + ["text"," "], + ["keyword.control.julia","end"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_livescript.json b/lib/ace/mode/_test/tokens_livescript.json new file mode 100644 index 00000000..c2bd83df --- /dev/null +++ b/lib/ace/mode/_test/tokens_livescript.json @@ -0,0 +1,6 @@ +[[ + "start", + ["comment","# comment"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pascal.json b/lib/ace/mode/_test/tokens_pascal.json index 0797ca0b..85f47a64 100644 --- a/lib/ace/mode/_test/tokens_pascal.json +++ b/lib/ace/mode/_test/tokens_pascal.json @@ -1,12 +1,12 @@ [[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["punctuation.definition.comment.pascal","(*"], ["comment.block.pascal.one","****************************************************************************"] ],[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] ],[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] ],[ "start", diff --git a/lib/ace/mode/_test/tokens_prolog.json b/lib/ace/mode/_test/tokens_prolog.json new file mode 100644 index 00000000..e42b65b5 --- /dev/null +++ b/lib/ace/mode/_test/tokens_prolog.json @@ -0,0 +1,265 @@ +[[ + "start", + ["entity.name.function.fact.prolog","partition"], + ["punctuation.begin.fact.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.language.anonymous.prolog","_"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.end.fact.parameters.prolog",")"], + ["punctuation.end.fact.prolog","."] +],[ + ["keyword.operator.definition.prolog","meta.rule.prolog"], + ["entity.name.function.rule.prolog","partition"], + ["punctuation.rule.parameters.begin.prolog","("], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Xs"], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Pivot"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Smalls"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Bigs"], + ["punctuation.rule.parameters.end.prolog",")"], + ["meta.rule.signature.prolog"," "], + ["keyword.operator.definition.prolog",":-"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.rule.definition.prolog"," "], + ["meta.expression.prolog","( "], + ["variable.other.prolog","X"], + ["meta.expression.prolog"," @"], + ["keyword.operator.prolog","<"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Pivot"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","->"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Smalls"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","="], + ["meta.expression.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Rest"], + ["punctuation.end.list.prolog","]"], + ["punctuation.control.and.prolog",","] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Pivot"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Rest"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Bigs"], + ["punctuation.end.statement.parameters.prolog",")"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["punctuation.control.or.prolog",";"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Bigs"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","="], + ["meta.expression.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Rest"], + ["punctuation.end.list.prolog","]"], + ["punctuation.control.and.prolog",","] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Pivot"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Smalls"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Rest"], + ["punctuation.end.statement.parameters.prolog",")"] +],[ + "start", + ["meta.expression.prolog"," )"], + ["punctuation.rule.end.prolog","."] +],[ + "start", + ["text"," "] +],[ + "entity.name.function.fact.prolog", + ["entity.name.function.fact.prolog","quicksort"], + ["punctuation.begin.fact.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["invalid.illegal.invalidchar.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","-"], + ["keyword.operator.prolog","->"], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["invalid.illegal.invalidchar.prolog","."] +],[ + "entity.name.function.fact.prolog", + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Xs"], + ["punctuation.end.list.prolog","]"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","-"], + ["keyword.operator.prolog","->"] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","{"], + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","X"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Smaller"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Bigger"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","}"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Smaller"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Bigger"], + ["punctuation.end.statement.parameters.prolog",")"], + ["invalid.illegal.invalidchar.prolog","."] +],[ + "entity.name.function.fact.prolog" +],[ + "entity.name.function.fact.prolog", + ["constant.other.atom.prolog","perfect"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog",":-"] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","between"], + ["punctuation.begin.statement.parameters.prolog","("], + ["constant.numeric.prolog","1"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["constant.other.atom.prolog","inf"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","U"], + ["meta.fact.prolog"," "], + ["keyword.operator.prolog","is"], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","N"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","//"], + ["meta.fact.prolog"," "], + ["constant.numeric.prolog","2"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","findall"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","D"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," ("], + ["constant.other.atom.prolog","between"], + ["punctuation.begin.statement.parameters.prolog","("], + ["constant.numeric.prolog","1"], + ["punctuation.separator.statement.prolog",","], + ["variable.other.prolog","U"], + ["punctuation.separator.statement.prolog",","], + ["variable.other.prolog","D"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["meta.statement.parameters.prolog"," "], + ["constant.other.atom.prolog","mod"], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","D"], + ["meta.statement.parameters.prolog"," "], + ["keyword.operator.prolog","=:="], + ["meta.statement.parameters.prolog"," "], + ["constant.numeric.prolog","0"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","Ds"], + ["invalid.illegal.invalidchar.prolog",")"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","sumlist"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Ds"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["invalid.illegal.invalidchar.prolog","."] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_rust.json b/lib/ace/mode/_test/tokens_rust.json new file mode 100644 index 00000000..6592575b --- /dev/null +++ b/lib/ace/mode/_test/tokens_rust.json @@ -0,0 +1,136 @@ +[[ + "start", + ["keyword.source.rust","use"], + ["text"," "], + ["support.constant","core::rand::"], + ["text","RngUtil"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["keyword.source.rust","fn"], + ["meta.function.source.rust"," "], + ["entity.name.function.source.rust","main"], + ["meta.function.source.rust","("], + ["text",") {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," ["], + ["string.quoted.double.source.rust","\"Alice\""], + ["keyword.operator",","], + ["text"," "], + ["string.quoted.double.source.rust","\"Bob\""], + ["keyword.operator",","], + ["text"," "], + ["string.quoted.double.source.rust","\"Carol\""], + ["text","].each |&name| {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","do"], + ["text"," spawn {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","let"], + ["text"," v "], + ["keyword.operator","="], + ["text"," "], + ["support.constant","rand::"], + ["text","Rng().shuffle(["], + ["constant.numeric.integer.source.rust","1"], + ["keyword.operator",","], + ["text"," "], + ["constant.numeric.integer.source.rust","2"], + ["keyword.operator",","], + ["text"," "], + ["constant.numeric.integer.source.rust","3"], + ["text","])"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," v.each |&num| {"] +],[ + "start", + ["text"," print(fmt"], + ["keyword.operator","!"], + ["text","("], + ["string.quoted.double.source.rust","\"%s says: '%d'"], + ["constant.character.escape.source.rust","\\n"], + ["string.quoted.double.source.rust","\""], + ["keyword.operator",","], + ["text"," name"], + ["keyword.operator",","], + ["text"," num "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.integer.source.rust","1"], + ["text","))"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text","}"] +],[ + "start" +],[ + "start", + ["keyword.source.rust","fn"], + ["meta.function.source.rust"," "], + ["entity.name.function.source.rust","map"], + ["meta.function.source.rust","("], + ["text","vector: &[T]"], + ["keyword.operator",","], + ["text"," function: &fn(v: &T) "], + ["keyword.operator","->"], + ["text"," U) "], + ["keyword.operator","->"], + ["text"," ~[U] {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","let"], + ["text"," "], + ["keyword.source.rust","mut"], + ["text"," accumulator "], + ["keyword.operator","="], + ["text"," ~[]"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," "], + ["support.constant","vec::"], + ["text","each(vector) |element| {"] +],[ + "start", + ["text"," accumulator.push(function(element))"], + ["keyword.operator",";"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","return"], + ["text"," accumulator"], + ["keyword.operator",";"] +],[ + "start", + ["text","}"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/forth_highlight_rules.js b/lib/ace/mode/forth_highlight_rules.js index 31ced17b..2fbe76d5 100644 --- a/lib/ace/mode/forth_highlight_rules.js +++ b/lib/ace/mode/forth_highlight_rules.js @@ -79,11 +79,11 @@ var ForthHighlightRules = function() { '#constant': [ { token: 'constant.language.forth', regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'constant.numeric.forth', - regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)', + regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'}, { token: 'constant.character.forth', - regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)', + regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}], '#forth': [ { include: '#constant' }, { include: '#comment' }, @@ -95,14 +95,14 @@ var ForthHighlightRules = function() { '#storage': [ { token: 'storage.type.forth', regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#string': [ { token: 'string.quoted.double.forth', regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', - caseInsensitive: true, + caseInsensitive: true}, { token: 'string.unquoted.forth', regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#variable': [ { token: 'variable.language.forth', regex: '\\b(?:I|J)\\b', @@ -110,22 +110,22 @@ var ForthHighlightRules = function() { '#word': [ { token: 'keyword.control.immediate.forth', regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.immediate.forth', regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.control.compile-only.forth', regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.compile-only.forth', regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.non-immediate.forth', regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.warning.forth', regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#word-def': [ { token: [ 'keyword.other.compile-only.forth', diff --git a/lib/ace/mode/logiql_test.js b/lib/ace/mode/logiql_test.js index 02e2d4d1..a37b7da2 100644 --- a/lib/ace/mode/logiql_test.js +++ b/lib/ace/mode/logiql_test.js @@ -63,7 +63,7 @@ module.exports = { "test: no auto indent in multi line comment" : function() { assert.equal("", this.mode.getNextLineIndent("start", "/* -->", " ")); assert.equal(" ", this.mode.getNextLineIndent("start", " /* ->", " ")); - assert.equal(" ", this.mode.getNextLineIndent("comment.block0", " abcd", " ")); + assert.equal(" ", this.mode.getNextLineIndent("comment.block", " abcd", " ")); }, "test: no auto indent after -> in single line comment" : function() { diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 8c6417fd..3b683fa5 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -272,7 +272,7 @@ var Tokenizer = function(rules) { if (value) { if (typeof type == "string") { - if ((!rule || rule.merge) && token.type === type) { + if ((!rule || rule.merge !== false) && token.type === type) { token.value += value; } else { if (token.type)