add options to php mode
This commit is contained in:
parent
dcbbeb7e22
commit
0a61c37a3b
2 changed files with 6 additions and 2 deletions
|
|
@ -35,14 +35,17 @@ var oop = require("../lib/oop");
|
|||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
|
||||
var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var Range = require("../range").Range;
|
||||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var unicode = require("../unicode");
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new PhpHighlightRules().getRules());
|
||||
var Mode = function(opts) {
|
||||
var inline = opts && opts.inline;
|
||||
var HighlightRules = inline ? PhpLangHighlightRules : PhpHighlightRules;
|
||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -1062,4 +1062,5 @@ var PhpHighlightRules = function() {
|
|||
oop.inherits(PhpHighlightRules, HtmlHighlightRules);
|
||||
|
||||
exports.PhpHighlightRules = PhpHighlightRules;
|
||||
exports.PhpLangHighlightRules = PhpLangHighlightRules;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue