diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index f75e6e86..1266c620 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -90,6 +90,7 @@ var docs = { "docs/latex.tex": {name: "LaTeX", wrapped: true}, "docs/less.less": "LESS", "docs/lisp.lisp": "Lisp", + "docs/scheme.scheme": "Scheme", "docs/liquid.liquid": "Liquid", "docs/lua.lua": "Lua", "docs/lucene.lucene": "Lucene", diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index ec2ce2d6..049ac0ef 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -62,7 +62,8 @@ var modesByName = { jsx: ["JSX" , "jsx"], latex: ["LaTeX" , "latex|tex|ltx|bib"], less: ["LESS" , "less"], - lisp: ["Lisp" , "lisp|scm|rkt"], + lisp: ["Lisp" , "lisp"], + scheme: ["Scheme" , "scm|rkt"], liquid: ["Liquid" , "liquid"], lua: ["Lua" , "lua"], luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates diff --git a/lib/ace/mode/_test/tokens_scheme.json b/lib/ace/mode/_test/tokens_scheme.json new file mode 100644 index 00000000..da9f93e0 --- /dev/null +++ b/lib/ace/mode/_test/tokens_scheme.json @@ -0,0 +1,248 @@ +[ + "start", + ["text","("], + ["storage.type.function-type.scheme","define"], + ["text"," "], + ["entity.name.function.scheme","prompt-for-cd"], + ["text"," ()"] +],[ + "start", + ["text"," "], + ["string","\"Prompts"] +],[ + "start", + ["text"," "], + ["identifier","for"], + ["text"," "], + ["identifier","CD"], + ["text","\""] +],[ + "start", + ["text"," ("], + ["identifier","prompt"], + ["text","-"], + ["identifier","read"], + ["text"," "], + ["string","\"Title\""], + ["text"," "], + ["constant.numeric","1.53"], + ["text"," "], + ["constant.numeric","1"], + ["text"," "], + ["constant.numeric","2"], + ["text","/"], + ["constant.numeric","4"], + ["text"," "], + ["constant.numeric","1.7"], + ["text"," "], + ["constant.numeric","1.7e0"], + ["text"," "], + ["constant.numeric","2.9E-4"], + ["text"," "], + ["constant.numeric","+42"], + ["text"," "], + ["constant.numeric","-7"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","b001"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","b001/100"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","o777"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","O777"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","xabc55"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","c"], + ["text","("], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","-5.6"], + ["text","))"] +],[ + "start", + ["text"," ("], + ["identifier","prompt"], + ["text","-"], + ["identifier","read"], + ["text"," "], + ["string","\"Artist\""], + ["text"," &"], + ["identifier","rest"], + ["text",")"] +],[ + "start", + ["text"," ("], + ["keyword.operator","or"], + ["text"," ("], + ["identifier","parse"], + ["text","-"], + ["identifier","integer"], + ["text"," ("], + ["identifier","prompt"], + ["text","-"], + ["identifier","read"], + ["text"," "], + ["string","\"Rating\""], + ["text",") :"], + ["identifier","junk"], + ["text","-"], + ["identifier","allowed"], + ["text"," "], + ["support.function","t"], + ["text",") "], + ["constant.numeric","0"], + ["text",")"] +],[ + "start", + ["text"," ("], + ["keyword.control","if"], + ["text"," "], + ["identifier","x"], + ["text"," ("], + ["support.function","format"], + ["text"," "], + ["support.function","#t"], + ["text"," "], + ["string","\"yes\""], + ["text",") ("], + ["support.function","format"], + ["text"," "], + ["support.function","#t"], + ["text"," "], + ["string","\"no\""], + ["text"," "], + ["constant.language","#f"], + ["text",") "], + ["comment",";and here comment"] +],[ + "start", + ["text"," ) "], + ["constant.numeric","0xFFLL"], + ["text"," "], + ["constant.numeric","-23ull"] +],[ + "start", + ["text"," "], + ["comment",";; second line comment"] +],[ + "start", + ["text"," '(+ "], + ["constant.numeric","1"], + ["text"," "], + ["constant.numeric","2"], + ["text",")"] +],[ + "start", + ["text"," ("], + ["identifier","define"], + ["text"," "], + ["punctuation.definition.variable.scheme","*"], + ["variable.other.global.scheme","lines"], + ["punctuation.definition.variable.scheme","*"], + ["text",") "], + ["comment","; list of all lines"] +],[ + "start", + ["text"," ("], + ["identifier","position"], + ["text","-"], + ["keyword.control","if"], + ["text","-"], + ["identifier","not"], + ["text"," "], + ["punctuation.definition.constant.character.scheme","#"], + ["constant.character.scheme","'sys::whitespacep"], + ["text"," "], + ["identifier","line"], + ["text"," :"], + ["identifier","start"], + ["text"," "], + ["identifier","beg"], + ["text","))"] +],[ + "start", + ["text"," ("], + ["support.function","quote"], + ["text"," ("], + ["identifier","privet"], + ["text"," "], + ["constant.numeric","1"], + ["text"," "], + ["constant.numeric","2"], + ["text"," "], + ["constant.numeric","3"], + ["text","))"] +],[ + "start", + ["text"," '("], + ["identifier","hello"], + ["text"," "], + ["identifier","world"], + ["text",")"] +],[ + "start", + ["text"," (* "], + ["constant.numeric","5"], + ["text"," "], + ["constant.numeric","7"], + ["text",")"] +],[ + "start", + ["text"," ("], + ["constant.numeric","1"], + ["text"," "], + ["constant.numeric","2"], + ["text"," "], + ["constant.numeric","34"], + ["text"," "], + ["constant.numeric","5"], + ["text",")"] +],[ + "start", + ["text"," (:"], + ["identifier","use"], + ["text"," "], + ["string","\"aaaa\""], + ["text",")"] +],[ + "start", + ["text"," ("], + ["keyword.control","let"], + ["text"," (("], + ["identifier","x"], + ["text"," "], + ["constant.numeric","10"], + ["text",") ("], + ["identifier","y"], + ["text"," "], + ["constant.numeric","20"], + ["text","))"] +],[ + "start", + ["text"," ("], + ["identifier","display"], + ["text"," (+ "], + ["identifier","x"], + ["text"," "], + ["identifier","y"], + ["text","))"] +],[ + "start", + ["text"," ) "], + ["support.function","LAmbDa"] +],[ + "start" +],[ + "start", + ["text"," "], + ["string","\"asdad"], + ["constant.character.escape.scheme","\\0"], + ["string","eqweqe\""] +]] diff --git a/lib/ace/mode/scheme_highlight_rules.js b/lib/ace/mode/scheme_highlight_rules.js index e9a58999..489ef0a3 100644 --- a/lib/ace/mode/scheme_highlight_rules.js +++ b/lib/ace/mode/scheme_highlight_rules.js @@ -76,7 +76,7 @@ var SchemeHighlightRules = function() { }, { "token" : "constant.numeric", // hex - "regex" : "#[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + "regex" : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" }, { "token" : "constant.numeric", // float