| 1 |
ace.define("ace/mode/apache_conf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){ |
| 2 |
"use strict"; |
| 3 |
var oop = require("../lib/oop"); |
| 4 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
| 5 |
var ApacheConfHighlightRules = function () { |
| 6 |
this.$rules = { start: [{ token: ['punctuation.definition.comment.apacheconf', |
| 7 |
'comment.line.hash.ini', |
| 8 |
'comment.line.hash.ini'], |
| 9 |
regex: '^((?:\\s)*)(#)(.*$)' }, |
| 10 |
{ token: ['punctuation.definition.tag.apacheconf', |
| 11 |
'entity.tag.apacheconf', |
| 12 |
'text', |
| 13 |
'string.value.apacheconf', |
| 14 |
'punctuation.definition.tag.apacheconf'], |
| 15 |
regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, |
| 16 |
{ token: ['punctuation.definition.tag.apacheconf', |
| 17 |
'entity.tag.apacheconf', |
| 18 |
'punctuation.definition.tag.apacheconf'], |
| 19 |
regex: '(</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(>)' }, |
| 20 |
{ token: ['keyword.alias.apacheconf', 'text', |
| 21 |
'string.regexp.apacheconf', 'text', |
| 22 |
'string.replacement.apacheconf', 'text'], |
| 23 |
regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, |
| 24 |
{ token: ['keyword.alias.apacheconf', 'text', |
| 25 |
'entity.status.apacheconf', 'text', |
| 26 |
'string.regexp.apacheconf', 'text', |
| 27 |
'string.path.apacheconf', 'text'], |
| 28 |
regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, |
| 29 |
{ token: ['keyword.alias.apacheconf', 'text', |
| 30 |
'entity.status.apacheconf', 'text', |
| 31 |
'string.path.apacheconf', 'text', |
| 32 |
'string.path.apacheconf', 'text'], |
| 33 |
regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, |
| 34 |
{ token: ['keyword.alias.apacheconf', 'text', |
| 35 |
'string.regexp.apacheconf', 'text', |
| 36 |
'string.path.apacheconf', 'text'], |
| 37 |
regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, |
| 38 |
{ token: ['keyword.alias.apacheconf', 'text', |
| 39 |
'string.path.apacheconf', 'text', |
| 40 |
'string.path.apacheconf', 'text'], |
| 41 |
regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, |
| 42 |
{ token: 'keyword.core.apacheconf', |
| 43 |
regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, |
| 44 |
{ token: 'keyword.mpm.apacheconf', |
| 45 |
regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, |
| 46 |
{ token: 'keyword.access.apacheconf', |
| 47 |
regex: '\\b(?:Allow|Deny|Order)\\b' }, |
| 48 |
{ token: 'keyword.actions.apacheconf', |
| 49 |
regex: '\\b(?:Action|Script)\\b' }, |
| 50 |
{ token: 'keyword.alias.apacheconf', |
| 51 |
regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, |
| 52 |
{ token: 'keyword.auth.apacheconf', |
| 53 |
regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, |
| 54 |
{ token: 'keyword.auth_anon.apacheconf', |
| 55 |
regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, |
| 56 |
{ token: 'keyword.auth_dbm.apacheconf', |
| 57 |
regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, |
| 58 |
{ token: 'keyword.auth_digest.apacheconf', |
| 59 |
regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, |
| 60 |
{ token: 'keyword.auth_ldap.apacheconf', |
| 61 |
regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, |
| 62 |
{ token: 'keyword.autoindex.apacheconf', |
| 63 |
regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, |
| 64 |
{ token: 'keyword.cache.apacheconf', |
| 65 |
regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, |
| 66 |
{ token: 'keyword.cern_meta.apacheconf', |
| 67 |
regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, |
| 68 |
{ token: 'keyword.cgi.apacheconf', |
| 69 |
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, |
| 70 |
{ token: 'keyword.cgid.apacheconf', |
| 71 |
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, |
| 72 |
{ token: 'keyword.charset_lite.apacheconf', |
| 73 |
regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, |
| 74 |
{ token: 'keyword.dav.apacheconf', |
| 75 |
regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, |
| 76 |
{ token: 'keyword.deflate.apacheconf', |
| 77 |
regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, |
| 78 |
{ token: 'keyword.dir.apacheconf', |
| 79 |
regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, |
| 80 |
{ token: 'keyword.disk_cache.apacheconf', |
| 81 |
regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, |
| 82 |
{ token: 'keyword.dumpio.apacheconf', |
| 83 |
regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, |
| 84 |
{ token: 'keyword.env.apacheconf', |
| 85 |
regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, |
| 86 |
{ token: 'keyword.expires.apacheconf', |
| 87 |
regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, |
| 88 |
{ token: 'keyword.ext_filter.apacheconf', |
| 89 |
regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, |
| 90 |
{ token: 'keyword.file_cache.apacheconf', |
| 91 |
regex: '\\b(?:CacheFile|MMapFile)\\b' }, |
| 92 |
{ token: 'keyword.headers.apacheconf', |
| 93 |
regex: '\\b(?:Header|RequestHeader)\\b' }, |
| 94 |
{ token: 'keyword.imap.apacheconf', |
| 95 |
regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, |
| 96 |
{ token: 'keyword.include.apacheconf', |
| 97 |
regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, |
| 98 |
{ token: 'keyword.isapi.apacheconf', |
| 99 |
regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, |
| 100 |
{ token: 'keyword.ldap.apacheconf', |
| 101 |
regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, |
| 102 |
{ token: 'keyword.log.apacheconf', |
| 103 |
regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, |
| 104 |
{ token: 'keyword.mem_cache.apacheconf', |
| 105 |
regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, |
| 106 |
{ token: 'keyword.mime.apacheconf', |
| 107 |
regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, |
| 108 |
{ token: 'keyword.misc.apacheconf', |
| 109 |
regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, |
| 110 |
{ token: 'keyword.negotiation.apacheconf', |
| 111 |
regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, |
| 112 |
{ token: 'keyword.nw_ssl.apacheconf', |
| 113 |
regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, |
| 114 |
{ token: 'keyword.proxy.apacheconf', |
| 115 |
regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, |
| 116 |
{ token: 'keyword.rewrite.apacheconf', |
| 117 |
regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, |
| 118 |
{ token: 'keyword.setenvif.apacheconf', |
| 119 |
regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, |
| 120 |
{ token: 'keyword.so.apacheconf', |
| 121 |
regex: '\\b(?:LoadFile|LoadModule)\\b' }, |
| 122 |
{ token: 'keyword.ssl.apacheconf', |
| 123 |
regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, |
| 124 |
{ token: 'keyword.usertrack.apacheconf', |
| 125 |
regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, |
| 126 |
{ token: 'keyword.vhost_alias.apacheconf', |
| 127 |
regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, |
| 128 |
{ token: ['keyword.php.apacheconf', |
| 129 |
'text', |
| 130 |
'entity.property.apacheconf', |
| 131 |
'text', |
| 132 |
'string.value.apacheconf', |
| 133 |
'text'], |
| 134 |
regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, |
| 135 |
{ token: ['punctuation.variable.apacheconf', |
| 136 |
'variable.env.apacheconf', |
| 137 |
'variable.misc.apacheconf', |
| 138 |
'punctuation.variable.apacheconf'], |
| 139 |
regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' }, |
| 140 |
{ token: ['entity.mime-type.apacheconf', 'text'], |
| 141 |
regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' }, |
| 142 |
{ token: 'entity.helper.apacheconf', |
| 143 |
regex: '\\b(?:from|unset|set|on|off)\\b', |
| 144 |
caseInsensitive: true }, |
| 145 |
{ token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' }, |
| 146 |
{ token: ['text', |
| 147 |
'punctuation.definition.flag.apacheconf', |
| 148 |
'string.flag.apacheconf', |
| 149 |
'punctuation.definition.flag.apacheconf', |
| 150 |
'text'], |
| 151 |
regex: '(\\s)(\\[)(.*?)(\\])(\\s)' }] }; |
| 152 |
this.normalizeRules(); |
| 153 |
}; |
| 154 |
ApacheConfHighlightRules.metaData = { fileTypes: ['conf', |
| 155 |
'CONF', |
| 156 |
'htaccess', |
| 157 |
'HTACCESS', |
| 158 |
'htgroups', |
| 159 |
'HTGROUPS', |
| 160 |
'htpasswd', |
| 161 |
'HTPASSWD', |
| 162 |
'.htaccess', |
| 163 |
'.HTACCESS', |
| 164 |
'.htgroups', |
| 165 |
'.HTGROUPS', |
| 166 |
'.htpasswd', |
| 167 |
'.HTPASSWD'], |
| 168 |
name: 'Apache Conf', |
| 169 |
scopeName: 'source.apacheconf' }; |
| 170 |
oop.inherits(ApacheConfHighlightRules, TextHighlightRules); |
| 171 |
exports.ApacheConfHighlightRules = ApacheConfHighlightRules; |
| 172 |
|
| 173 |
}); |
| 174 |
|
| 175 |
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict"; |
| 176 |
var oop = require("../../lib/oop"); |
| 177 |
var Range = require("../../range").Range; |
| 178 |
var BaseFoldMode = require("./fold_mode").FoldMode; |
| 179 |
var FoldMode = exports.FoldMode = function (commentRegex) { |
| 180 |
if (commentRegex) { |
| 181 |
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)); |
| 182 |
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)); |
| 183 |
} |
| 184 |
}; |
| 185 |
oop.inherits(FoldMode, BaseFoldMode); |
| 186 |
(function () { |
| 187 |
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; |
| 188 |
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; |
| 189 |
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/; |
| 190 |
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; |
| 191 |
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; |
| 192 |
this._getFoldWidgetBase = this.getFoldWidget; |
| 193 |
this.getFoldWidget = function (session, foldStyle, row) { |
| 194 |
var line = session.getLine(row); |
| 195 |
if (this.singleLineBlockCommentRe.test(line)) { |
| 196 |
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) |
| 197 |
return ""; |
| 198 |
} |
| 199 |
var fw = this._getFoldWidgetBase(session, foldStyle, row); |
| 200 |
if (!fw && this.startRegionRe.test(line)) |
| 201 |
return "start"; |
| 202 |
return fw; |
| 203 |
}; |
| 204 |
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) { |
| 205 |
var line = session.getLine(row); |
| 206 |
if (this.startRegionRe.test(line)) |
| 207 |
return this.getCommentRegionBlock(session, line, row); |
| 208 |
var match = line.match(this.foldingStartMarker); |
| 209 |
if (match) { |
| 210 |
var i = match.index; |
| 211 |
if (match[1]) |
| 212 |
return this.openingBracketBlock(session, match[1], row, i); |
| 213 |
var range = session.getCommentFoldRange(row, i + match[0].length, 1); |
| 214 |
if (range && !range.isMultiLine()) { |
| 215 |
if (forceMultiline) { |
| 216 |
range = this.getSectionRange(session, row); |
| 217 |
} |
| 218 |
else if (foldStyle != "all") |
| 219 |
range = null; |
| 220 |
} |
| 221 |
return range; |
| 222 |
} |
| 223 |
if (foldStyle === "markbegin") |
| 224 |
return; |
| 225 |
var match = line.match(this.foldingStopMarker); |
| 226 |
if (match) { |
| 227 |
var i = match.index + match[0].length; |
| 228 |
if (match[1]) |
| 229 |
return this.closingBracketBlock(session, match[1], row, i); |
| 230 |
return session.getCommentFoldRange(row, i, -1); |
| 231 |
} |
| 232 |
}; |
| 233 |
this.getSectionRange = function (session, row) { |
| 234 |
var line = session.getLine(row); |
| 235 |
var startIndent = line.search(/\S/); |
| 236 |
var startRow = row; |
| 237 |
var startColumn = line.length; |
| 238 |
row = row + 1; |
| 239 |
var endRow = row; |
| 240 |
var maxRow = session.getLength(); |
| 241 |
while (++row < maxRow) { |
| 242 |
line = session.getLine(row); |
| 243 |
var indent = line.search(/\S/); |
| 244 |
if (indent === -1) |
| 245 |
continue; |
| 246 |
if (startIndent > indent) |
| 247 |
break; |
| 248 |
var subRange = this.getFoldWidgetRange(session, "all", row); |
| 249 |
if (subRange) { |
| 250 |
if (subRange.start.row <= startRow) { |
| 251 |
break; |
| 252 |
} |
| 253 |
else if (subRange.isMultiLine()) { |
| 254 |
row = subRange.end.row; |
| 255 |
} |
| 256 |
else if (startIndent == indent) { |
| 257 |
break; |
| 258 |
} |
| 259 |
} |
| 260 |
endRow = row; |
| 261 |
} |
| 262 |
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); |
| 263 |
}; |
| 264 |
this.getCommentRegionBlock = function (session, line, row) { |
| 265 |
var startColumn = line.search(/\s*$/); |
| 266 |
var maxRow = session.getLength(); |
| 267 |
var startRow = row; |
| 268 |
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; |
| 269 |
var depth = 1; |
| 270 |
while (++row < maxRow) { |
| 271 |
line = session.getLine(row); |
| 272 |
var m = re.exec(line); |
| 273 |
if (!m) |
| 274 |
continue; |
| 275 |
if (m[1]) |
| 276 |
depth--; |
| 277 |
else |
| 278 |
depth++; |
| 279 |
if (!depth) |
| 280 |
break; |
| 281 |
} |
| 282 |
var endRow = row; |
| 283 |
if (endRow > startRow) { |
| 284 |
return new Range(startRow, startColumn, endRow, line.length); |
| 285 |
} |
| 286 |
}; |
| 287 |
}).call(FoldMode.prototype); |
| 288 |
|
| 289 |
}); |
| 290 |
|
| 291 |
ace.define("ace/mode/apache_conf",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apache_conf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){ |
| 292 |
|
| 293 |
|
| 294 |
"use strict"; |
| 295 |
var oop = require("../lib/oop"); |
| 296 |
var TextMode = require("./text").Mode; |
| 297 |
var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; |
| 298 |
var FoldMode = require("./folding/cstyle").FoldMode; |
| 299 |
var Mode = function () { |
| 300 |
this.HighlightRules = ApacheConfHighlightRules; |
| 301 |
this.foldingRules = new FoldMode(); |
| 302 |
this.$behaviour = this.$defaultBehaviour; |
| 303 |
}; |
| 304 |
oop.inherits(Mode, TextMode); |
| 305 |
(function () { |
| 306 |
this.lineCommentStart = "#"; |
| 307 |
this.$id = "ace/mode/apache_conf"; |
| 308 |
}).call(Mode.prototype); |
| 309 |
exports.Mode = Mode; |
| 310 |
|
| 311 |
}); (function() { |
| 312 |
ace.require(["ace/mode/apache_conf"], function(m) { |
| 313 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 314 |
module.exports = m; |
| 315 |
} |
| 316 |
}); |
| 317 |
})(); |
| 318 |
|