Skip to content

Commit

Permalink
Merge pull request #1236 from ajaxorg/mode-updates
Browse files Browse the repository at this point in the history
Mode updates
  • Loading branch information
nightwing committed Feb 7, 2013
2 parents a6d85a6 + f20a6dc commit 6334091
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
6 changes: 6 additions & 0 deletions demo/kitchen-sink/docs/cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
#include <boost/asio/io_service.hpp>
#include "boost/asio/io_service.hpp"

#include \
\
"iostream" \
"string" \
<vector>

using namespace std;

int main ()
Expand Down
2 changes: 2 additions & 0 deletions demo/kitchen-sink/docs/sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/}"
Expand Down
19 changes: 19 additions & 0 deletions lib/ace/mode/_test/tokens_c_cpp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"," <vector>"]
],[
"start",
["text"," "]
],[
"start",
["keyword.control","using"],
Expand Down
12 changes: 12 additions & 0 deletions lib/ace/mode/_test/tokens_sh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
8 changes: 4 additions & 4 deletions lib/ace/mode/c_cpp_highlight_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ var c_cppHighlightRules = function() {
token : "constant.other.multiline",
regex : /\\/
},
{
token : "constant.other.multiline",
regex : /.*\\/
},
{
token : "constant.other",
regex : "\\s*<.+?>",
Expand All @@ -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",
Expand Down
7 changes: 2 additions & 5 deletions lib/ace/mode/sh_highlight_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ var ShHighlightRules = function() {

this.$rules = {
"start" : [ {
token : "comment",
regex : "#.*$"
token : ["text", "comment"],
regex : /(^|\s)(#.*)$/
}, {
token : "string", // " string
regex : '"(?:[^\\\\]|\\\\.)*?"'
Expand Down Expand Up @@ -116,9 +116,6 @@ var ShHighlightRules = function() {
}, {
token : "paren.rparen",
regex : "[\\]\\)\\}]"
}, {
token : "text",
regex : "\\s+"
} ]
};
};
Expand Down

0 comments on commit 6334091

Please sign in to comment.