add perl mode to the makefiles and convert tabs to spaces
This commit is contained in:
parent
2d1dda867a
commit
7ad2e99db4
3 changed files with 71 additions and 65 deletions
|
|
@ -169,7 +169,10 @@ copy({
|
||||||
console.log('# ace modes ---------');
|
console.log('# ace modes ---------');
|
||||||
|
|
||||||
project.assumeAllFilesLoaded();
|
project.assumeAllFilesLoaded();
|
||||||
["css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp", "coffee"].forEach(function(mode) {
|
[
|
||||||
|
"css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp",
|
||||||
|
"coffee", "perl"
|
||||||
|
].forEach(function(mode) {
|
||||||
console.log("mode " + mode);
|
console.log("mode " + mode);
|
||||||
copy({
|
copy({
|
||||||
source: [
|
source: [
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,10 @@ console.log('# ace modes ---------');
|
||||||
|
|
||||||
// create modes
|
// create modes
|
||||||
project.assumeAllFilesLoaded();
|
project.assumeAllFilesLoaded();
|
||||||
["css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp", "coffee"].forEach(function(mode) {
|
[
|
||||||
|
"css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp",
|
||||||
|
"coffee", "perl"
|
||||||
|
].forEach(function(mode) {
|
||||||
console.log("mode " + mode);
|
console.log("mode " + mode);
|
||||||
copy({
|
copy({
|
||||||
source: [
|
source: [
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ var oop = require("pilot/oop");
|
||||||
var lang = require("pilot/lang");
|
var lang = require("pilot/lang");
|
||||||
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
PerlHighlightRules = function() {
|
var PerlHighlightRules = function() {
|
||||||
|
|
||||||
var keywords = lang.arrayToMap(
|
var keywords = lang.arrayToMap(
|
||||||
("base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
|
("base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
|
||||||
|
|
@ -82,77 +82,77 @@ PerlHighlightRules = function() {
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
"start" : [
|
"start" : [
|
||||||
{
|
{
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "#.*$"
|
regex : "#.*$"
|
||||||
}, {
|
}, {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string", // single line
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||||
}, {
|
}, {
|
||||||
token : "string", // multi line string start
|
token : "string", // multi line string start
|
||||||
regex : '["].*\\\\$',
|
regex : '["].*\\\\$',
|
||||||
next : "qqstring"
|
next : "qqstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string", // single line
|
||||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // multi line string start
|
token : "string", // multi line string start
|
||||||
regex : "['].*\\\\$",
|
regex : "['].*\\\\$",
|
||||||
next : "qstring"
|
next : "qstring"
|
||||||
}, {
|
}, {
|
||||||
token : "constant.numeric", // hex
|
token : "constant.numeric", // hex
|
||||||
regex : "0x[0-9a-fA-F]+\\b"
|
regex : "0x[0-9a-fA-F]+\\b"
|
||||||
}, {
|
}, {
|
||||||
token : "constant.numeric", // float
|
token : "constant.numeric", // float
|
||||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||||
}, {
|
}, {
|
||||||
token : function(value) {
|
token : function(value) {
|
||||||
if (keywords.hasOwnProperty(value))
|
if (keywords.hasOwnProperty(value))
|
||||||
return "keyword";
|
return "keyword";
|
||||||
else if (buildinConstants.hasOwnProperty(value))
|
else if (buildinConstants.hasOwnProperty(value))
|
||||||
return "constant.language";
|
return "constant.language";
|
||||||
else if (builtinFunctions.hasOwnProperty(value))
|
else if (builtinFunctions.hasOwnProperty(value))
|
||||||
return "support.function";
|
return "support.function";
|
||||||
else
|
else
|
||||||
return "identifier";
|
return "identifier";
|
||||||
},
|
},
|
||||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||||
}, {
|
}, {
|
||||||
token : "keyword.operator",
|
token : "keyword.operator",
|
||||||
regex : "\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
|
regex : "\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
|
||||||
}, {
|
}, {
|
||||||
token : "lparen",
|
token : "lparen",
|
||||||
regex : "[[({]"
|
regex : "[[({]"
|
||||||
}, {
|
}, {
|
||||||
token : "rparen",
|
token : "rparen",
|
||||||
regex : "[\\])}]"
|
regex : "[\\])}]"
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token : "text",
|
||||||
regex : "\\s+"
|
regex : "\\s+"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qqstring" : [
|
"qqstring" : [
|
||||||
{
|
{
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '.+'
|
regex : '.+'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qstring" : [
|
"qstring" : [
|
||||||
{
|
{
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '.+'
|
regex : '.+'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue