diff --git a/demo/kitchen-sink/docs/cpp.cpp b/demo/kitchen-sink/docs/cpp.cpp index 1dd9e4f3..a2ebdaa2 100644 --- a/demo/kitchen-sink/docs/cpp.cpp +++ b/demo/kitchen-sink/docs/cpp.cpp @@ -16,6 +16,12 @@ #include #include "boost/asio/io_service.hpp" +#include \ + \ + "iostream" \ + "string" \ + + using namespace std; int main () diff --git a/demo/kitchen-sink/docs/sh.sh b/demo/kitchen-sink/docs/sh.sh index 010ad500..b1da400d 100755 --- a/demo/kitchen-sink/docs/sh.sh +++ b/demo/kitchen-sink/docs/sh.sh @@ -30,6 +30,8 @@ get_repo() { fi } +echo ${#x[@]} + if repo=`get_repo $@`; then branch=`git symbolic-ref HEAD 2>/dev/null` echo "http://github.com/$repo/pull/new/${branch##refs/heads/}" diff --git a/lib/ace/mode/_test/tokens_c_cpp.json b/lib/ace/mode/_test/tokens_c_cpp.json index 6ddda060..2818526f 100644 --- a/lib/ace/mode/_test/tokens_c_cpp.json +++ b/lib/ace/mode/_test/tokens_c_cpp.json @@ -52,6 +52,25 @@ ["constant.other"," \"boost/asio/io_service.hpp\""] ],[ "start" +],[ + "directive", + ["keyword","#include"], + ["constant.other.multiline"," \\"] +],[ + "directive", + ["constant.other.multiline"," \\"] +],[ + "directive", + ["constant.other.multiline"," \"iostream\" \\"] +],[ + "directive", + ["constant.other.multiline"," \"string\" \\"] +],[ + "start", + ["constant.other"," "] +],[ + "start", + ["text"," "] ],[ "start", ["keyword.control","using"], diff --git a/lib/ace/mode/_test/tokens_sh.json b/lib/ace/mode/_test/tokens_sh.json index d490692e..811f7db0 100644 --- a/lib/ace/mode/_test/tokens_sh.json +++ b/lib/ace/mode/_test/tokens_sh.json @@ -269,6 +269,18 @@ ["paren.rparen","}"] ],[ "start" +],[ + "start", + ["support.function.builtin","echo"], + ["text"," $"], + ["paren.lparen","{"], + ["text","#"], + ["identifier","x"], + ["paren.lparen","["], + ["text","@"], + ["paren.rparen","]}"] +],[ + "start" ],[ "start", ["keyword","if"], diff --git a/lib/ace/mode/c_cpp_highlight_rules.js b/lib/ace/mode/c_cpp_highlight_rules.js index 427951c6..e75b25db 100644 --- a/lib/ace/mode/c_cpp_highlight_rules.js +++ b/lib/ace/mode/c_cpp_highlight_rules.js @@ -145,6 +145,10 @@ var c_cppHighlightRules = function() { token : "constant.other.multiline", regex : /\\/ }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, { token : "constant.other", regex : "\\s*<.+?>", @@ -160,10 +164,6 @@ var c_cppHighlightRules = function() { regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", next : "start" }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, // "\" implies multiline, while "/" implies comment { token : "constant.other", diff --git a/lib/ace/mode/sh_highlight_rules.js b/lib/ace/mode/sh_highlight_rules.js index 6f5efb54..a73efb5e 100644 --- a/lib/ace/mode/sh_highlight_rules.js +++ b/lib/ace/mode/sh_highlight_rules.js @@ -78,8 +78,8 @@ var ShHighlightRules = function() { this.$rules = { "start" : [ { - token : "comment", - regex : "#.*$" + token : ["text", "comment"], + regex : /(^|\s)(#.*)$/ }, { token : "string", // " string regex : '"(?:[^\\\\]|\\\\.)*?"' @@ -116,9 +116,6 @@ var ShHighlightRules = function() { }, { token : "paren.rparen", regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" } ] }; };