-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a highlighter for the Cuttlefish format, used in Erlang applications.
- Loading branch information
1 parent
1e6fcf3
commit 9cddf64
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include extras.conf # overflow config file | ||
|
||
ring_size = 32 | ||
|
||
# experimental | ||
anti_entropy = debug | ||
|
||
# logging | ||
log.error.file = /var/log/error.log | ||
log.console.file = /var/log/console.log | ||
log.syslog = on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use strict"; | ||
|
||
var oop = require("../lib/oop"); | ||
var TextMode = require("./text").Mode; | ||
var CuttlefishHighlightRules = require("./cuttlefish_highlight_rules").CuttlefishHighlightRules; | ||
|
||
var Mode = function() { | ||
this.HighlightRules = CuttlefishHighlightRules; | ||
this.foldingRules = null; | ||
this.$behaviour = this.$defaultBehaviour; | ||
}; | ||
oop.inherits(Mode, TextMode); | ||
|
||
(function() { | ||
this.lineCommentStart = "#"; | ||
this.blockComment = null; | ||
this.$id = "ace/mode/cuttlefish"; | ||
}).call(Mode.prototype); | ||
|
||
exports.Mode = Mode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict"; | ||
|
||
var oop = require("../lib/oop"); | ||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; | ||
|
||
|
||
var CuttlefishHighlightRules = function () { | ||
this.$rules = { | ||
start: [{ | ||
token: ['text', 'comment'], | ||
regex: /^([ \t]*)(#.*)$/ | ||
}, { | ||
token: ['text', 'keyword', 'text', 'string', 'text', 'comment'], | ||
regex: /^([ \t]*)(include)([ \t]*)([A-Za-z0-9-\_\.\*\/]+)([ \t]*)(#.*)?$/ | ||
}, { | ||
token: ['text', 'keyword', 'text', 'operator', 'text', 'string', 'text', 'comment'], | ||
regex: /^([ \t]*)([A-Za-z0-9-_]+(?:\.[A-Za-z0-9-_]+)*)([ \t]*)(=)([ \t]*)([^ \t#][^#]*?)([ \t]*)(#.*)?$/ | ||
}, { | ||
defaultToken: 'invalid' | ||
}] | ||
}; | ||
|
||
this.normalizeRules(); | ||
}; | ||
|
||
CuttlefishHighlightRules.metaData = { | ||
fileTypes: ['conf'], | ||
keyEquivalent: '^~C', | ||
name: 'Cuttlefish', | ||
scopeName: 'source.conf' | ||
}; | ||
|
||
|
||
oop.inherits(CuttlefishHighlightRules, TextHighlightRules); | ||
|
||
exports.CuttlefishHighlightRules = CuttlefishHighlightRules; |