Changeset View
Changeset View
Standalone View
Standalone View
src/script/data/indentation/pascal.js
Context not available. | |||||
94 | - procedure/function declarations in 'interface' should be indented | 94 | - procedure/function declarations in 'interface' should be indented | ||
---|---|---|---|---|---|
95 | */ | 95 | */ | ||
96 | 96 | | |||
97 | "use strict"; | | |||
98 | | ||||
99 | // required katepart js libraries | 97 | // required katepart js libraries | ||
100 | require ("range.js"); | 98 | require ("range.js"); | ||
101 | require ("cursor.js"); | | |||
102 | require ("string.js"); | 99 | require ("string.js"); | ||
103 | 100 | | |||
104 | //BEGIN USER CONFIGURATION | 101 | //BEGIN USER CONFIGURATION | ||
Context not available. | |||||
110 | //END USER CONFIGURATION | 107 | //END USER CONFIGURATION | ||
111 | 108 | | |||
112 | 109 | | |||
113 | const patTrailingSemi = /;\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/; | 110 | var patTrailingSemi = /;\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/; | ||
114 | const patMatchEnd = /\b(begin|case|record)\b/i; | 111 | var patMatchEnd = /\b(begin|case|record)\b/i; | ||
115 | const patDeclaration = /^\s*(program|module|unit|uses|import|implementation|interface|label|const|type|var|function|procedure|operator)\b/i; | 112 | var patDeclaration = /^\s*(program|module|unit|uses|import|implementation|interface|label|const|type|var|function|procedure|operator)\b/i; | ||
116 | const patTrailingBegin = /\bbegin\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | 113 | var patTrailingBegin = /\bbegin\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | ||
117 | const patTrailingEnd = /\bend;?\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | 114 | var patTrailingEnd = /\bend;?\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | ||
118 | const patCaseValue = /^(\s*[^,:;]+\s*(,\s*[^,:;]+\s*)*):(?!=)/; | 115 | var patCaseValue = /^(\s*[^,:;]+\s*(,\s*[^,:;]+\s*)*):(?!=)/; | ||
119 | const patEndOfStatement = /(;|end)\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | 116 | var patEndOfStatement = /(;|end)\s*(\/\/.*|\{.*\}|\(\*.*\*\))?\s*$/i; | ||
120 | 117 | | |||
121 | function dbg() { | 118 | function dbg() { | ||
122 | if (debugMode) { | 119 | if (debugMode) { | ||
Context not available. | |||||
1392 | triggerCharacters = " \t)]}#;"; | 1389 | triggerCharacters = " \t)]}#;"; | ||
1393 | 1390 | | |||
1394 | // possible outdent for lines that match this regexp | 1391 | // possible outdent for lines that match this regexp | ||
1395 | const PascalReIndent = /^\s*((end|const|type|var|begin|until|function|procedure|operator|else|otherwise|\w+\s*:)\s+|[#\)\]\}]|end;)(.*)$/; | 1392 | var PascalReIndent = /^\s*((end|const|type|var|begin|until|function|procedure|operator|else|otherwise|\w+\s*:)\s+|[#\)\]\}]|end;)(.*)$/; | ||
1396 | 1393 | | |||
1397 | // check if the trigger characters are in the right context, | 1394 | // check if the trigger characters are in the right context, | ||
1398 | // otherwise running the indenter might be annoying to the user | 1395 | // otherwise running the indenter might be annoying to the user | ||
Context not available. |