4939c180f8a44b5986493cfbb9b9d787.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. ace.define("ace/mode/qml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var QmlHighlightRules = function () {
  5. var keywordMapper = this.createKeywordMapper({
  6. "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  7. "Namespace|QName|XML|XMLList|" + // E4X
  8. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  9. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  10. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  11. "SyntaxError|TypeError|URIError|" +
  12. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  13. "isNaN|parseFloat|parseInt|" +
  14. "JSON|Math|" + // Other
  15. "this|arguments|prototype|window|document",
  16. "keyword": "const|yield|import|get|set|async|await|" +
  17. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  18. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  19. "__parent__|__count__|escape|unescape|with|__proto__|" +
  20. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|" +
  21. "readonly|string|int|bool|date|color|url|real|double|var|variant|" +
  22. "height|width|anchors|parent|" +
  23. "Abstract3DSeries|AbstractActionInput|AbstractAnimation|AbstractAxis|AbstractAxis3D|AbstractAxisInput|" +
  24. "AbstractBarSeries|AbstractButton|AbstractClipAnimator|AbstractClipBlendNode|AbstractDataProxy|AbstractGraph3D|" +
  25. "AbstractInputHandler3D|AbstractPhysicalDevice|AbstractRayCaster|AbstractSeries|AbstractSkeleton|AbstractTextureImage|" +
  26. "Accelerometer|AccelerometerReading|Accessible|Action|ActionGroup|ActionInput|" +
  27. "AdditiveClipBlend|Address|Affector|Age|AlphaCoverage|AlphaTest|" +
  28. "Altimeter|AltimeterReading|AmbientLightReading|AmbientLightSensor|AmbientTemperatureReading|AmbientTemperatureSensor|" +
  29. "AnalogAxisInput|AnchorAnimation|AnchorChanges|AngleDirection|AnimatedImage|AnimatedSprite|" +
  30. "Animation|AnimationController|AnimationGroup|Animator|ApplicationWindow|ApplicationWindowStyle|" +
  31. "AreaSeries|Armature|AttenuationModelInverse|AttenuationModelLinear|Attractor|Attribute|" +
  32. "Audio|AudioCategory|AudioEngine|AudioListener|AudioSample|AuthenticationDialogRequest|" +
  33. "Axis|AxisAccumulator|AxisSetting|BackspaceKey|Bar3DSeries|BarCategoryAxis|" +
  34. "BarDataProxy|BarSeries|BarSet|Bars3D|BaseKey|Behavior|" +
  35. "Binding|Blend|BlendEquation|BlendEquationArguments|BlendedClipAnimator|BlitFramebuffer|" +
  36. "BluetoothDiscoveryModel|BluetoothService|BluetoothSocket|BorderImage|BorderImageMesh|BoxPlotSeries|" +
  37. "BoxSet|BrightnessContrast|Buffer|BusyIndicator|BusyIndicatorStyle|Button|" +
  38. "ButtonAxisInput|ButtonGroup|ButtonStyle|Calendar|CalendarStyle|Camera|" +
  39. "Camera3D|CameraCapabilities|CameraCapture|CameraExposure|CameraFlash|CameraFocus|" +
  40. "CameraImageProcessing|CameraLens|CameraRecorder|CameraSelector|CandlestickSeries|CandlestickSet|" +
  41. "Canvas|Canvas3D|Canvas3DAbstractObject|Canvas3DActiveInfo|Canvas3DBuffer|Canvas3DContextAttributes|" +
  42. "Canvas3DFrameBuffer|Canvas3DProgram|Canvas3DRenderBuffer|Canvas3DShader|Canvas3DShaderPrecisionFormat|Canvas3DTexture|" +
  43. "Canvas3DTextureProvider|Canvas3DUniformLocation|CanvasGradient|CanvasImageData|CanvasPixelArray|Category|" +
  44. "CategoryAxis|CategoryAxis3D|CategoryModel|CategoryRange|ChangeLanguageKey|ChartView|" +
  45. "CheckBox|CheckBoxStyle|CheckDelegate|CircularGauge|CircularGaugeStyle|ClearBuffers|" +
  46. "ClipAnimator|ClipPlane|CloseEvent|ColorAnimation|ColorDialog|ColorDialogRequest|" +
  47. "ColorGradient|ColorGradientStop|ColorMask|ColorOverlay|Colorize|Column|" +
  48. "ColumnLayout|ComboBox|ComboBoxStyle|Compass|CompassReading|Component|Component3D|" +
  49. "ComputeCommand|ConeGeometry|ConeMesh|ConicalGradient|Connections|ContactDetail|" +
  50. "ContactDetails|Container|Context2D|Context3D|ContextMenuRequest|Control|" +
  51. "CoordinateAnimation|CuboidGeometry|CuboidMesh|CullFace|CumulativeDirection|" +
  52. "Custom3DItem|Custom3DLabel|Custom3DVolume|CustomParticle|CylinderGeometry|CylinderMesh|" +
  53. "Date|DateTimeAxis|DelayButton|DelayButtonStyle|DelegateChoice|DelegateChooser|DelegateModel|" +
  54. "DelegateModelGroup|DepthTest|Desaturate|Dial|DialStyle|Dialog|DialogButtonBox|DiffuseMapMaterial|" +
  55. "DiffuseSpecularMapMaterial|DiffuseSpecularMaterial|Direction|DirectionalBlur|DirectionalLight|DispatchCompute|" +
  56. "Displace|DistanceReading|DistanceSensor|Dithering|DoubleValidator|Drag|DragEvent|DragHandler|Drawer|DropArea|" +
  57. "DropShadow|DwmFeatures|DynamicParameter|EditorialModel|Effect|EllipseShape|Emitter|EnterKey|EnterKeyAction|" +
  58. "Entity|EntityLoader|EnvironmentLight|EventConnection|EventPoint|EventTouchPoint|ExclusiveGroup|ExtendedAttributes|" +
  59. "ExtrudedTextGeometry|ExtrudedTextMesh|FastBlur|FileDialog|FileDialogRequest|FillerKey|FilterKey|FinalState|" +
  60. "FirstPersonCameraController|Flickable|Flipable|Flow|FocusScope|FolderListModel|FontDialog|FontLoader|" +
  61. "FontMetrics|FormValidationMessageRequest|ForwardRenderer|Frame|FrameAction|FrameGraphNode|Friction|" +
  62. "FrontFace|FrustumCulling|FullScreenRequest|GLStateDumpExt|GammaAdjust|Gauge|GaugeStyle|GaussianBlur|" +
  63. "GeocodeModel|Geometry|GeometryRenderer|GestureEvent|Glow|GoochMaterial|Gradient|GradientStop|GraphicsApiFilter|" +
  64. "GraphicsInfo|Gravity|Grid|GridLayout|GridMesh|GridView|GroupBox|GroupGoal|Gyroscope|GyroscopeReading|HBarModelMapper|" +
  65. "HBoxPlotModelMapper|HCandlestickModelMapper|HPieModelMapper|HXYModelMapper|HandlerPoint|HandwritingInputPanel|" +
  66. "HandwritingModeKey|HeightMapSurfaceDataProxy|HideKeyboardKey|HistoryState|HolsterReading|HolsterSensor|HorizontalBarSeries|" +
  67. "|HorizontalPercentBarSeries|HorizontalStackedBarSeries|HoverHandler|HueSaturation|HumidityReading|HumiditySensor|" +
  68. "IRProximityReading|IRProximitySensor|Icon|Image|ImageModel|ImageParticle|InnerShadow|InputChord|InputContext|InputEngine|" +
  69. "InputHandler3D|InputMethod|InputModeKey|InputPanel|InputSequence|InputSettings|Instantiator|IntValidator|InvokedServices|" +
  70. "Item|ItemDelegate|ItemGrabResult|ItemModelBarDataProxy|ItemModelScatterDataProxy|ItemModelSurfaceDataProxy|ItemParticle|" +
  71. "ItemSelectionModel|IviApplication|IviSurface|JavaScriptDialogRequest|Joint|JumpList|JumpListCategory|JumpListDestination|" +
  72. "JumpListLink|JumpListSeparator|Key|KeyEvent|KeyIcon|KeyNavigation|KeyPanel|KeyboardColumn|KeyboardDevice|KeyboardHandler|" +
  73. "KeyboardLayout|KeyboardLayoutLoader|KeyboardRow|KeyboardStyle|KeyframeAnimation|Keys|Label|Layer|LayerFilter|Layout|" +
  74. "LayoutMirroring|Legend|LerpBlend|LevelAdjust|LevelOfDetail|LevelOfDetailBoundingSphere|LevelOfDetailLoader|" +
  75. "LevelOfDetailSwitch|LidReading|LidSensor|Light|Light3D|LightReading|LightSensor|LineSeries|LineShape|LineWidth|" +
  76. "LinearGradient|ListElement|ListModel|ListView|Loader|Locale|Location|LogValueAxis|LogValueAxis3DFormatter|LoggingCategory|" +
  77. "LogicalDevice|Magnetometer|MagnetometerReading|Map|MapCircle|MapCircleObject|MapCopyrightNotice|MapGestureArea|MapIconObject|" +
  78. "MapItemGroup|MapItemView|MapObjectView|MapParameter|MapPinchEvent|MapPolygon|MapPolygonObject|MapPolyline|MapPolylineObject|" +
  79. "MapQuickItem|MapRectangle|MapRoute|MapRouteObject|MapType|Margins|MaskShape|MaskedBlur|Material|Matrix4x4|MediaPlayer|" +
  80. "MemoryBarrier|Menu|MenuBar|MenuBarItem|MenuBarStyle|MenuItem|MenuSeparator|MenuStyle|Mesh|MessageDialog|ModeKey|MorphTarget|" +
  81. "MorphingAnimation|MouseArea|MouseDevice|MouseEvent|MouseHandler|MultiPointHandler|MultiPointTouchArea|MultiSampleAntiAliasing|" +
  82. "Navigator|NdefFilter|NdefMimeRecord|NdefRecord|NdefTextRecord|NdefUriRecord|NearField|NoDepthMask|NoDraw|Node|NodeInstantiator|" +
  83. "NormalDiffuseMapAlphaMaterial|NormalDiffuseMapMaterial|NormalDiffuseSpecularMapMaterial|Number|NumberAnimation|NumberKey|Object3D|" +
  84. "ObjectModel|ObjectPicker|OpacityAnimator|OpacityMask|OpenGLInfo|OrbitCameraController|OrientationReading|OrientationSensor|Overlay|" +
  85. "Package|Page|PageIndicator|Pane|ParallelAnimation|Parameter|ParentAnimation|ParentChange|Particle|ParticleGroup|ParticlePainter|" +
  86. "ParticleSystem|Path|PathAngleArc|PathAnimation|PathArc|PathAttribute|PathCubic|PathCurve|PathElement|PathInterpolator|PathLine|" +
  87. "PathMove|PathPercent|PathQuad|PathSvg|PathView|PauseAnimation|PerVertexColorMaterial|PercentBarSeries|PhongAlphaMaterial|" +
  88. "PhongMaterial|PickEvent|PickLineEvent|PickPointEvent|PickTriangleEvent|PickingSettings|Picture|PieMenu|PieMenuStyle|PieSeries|" +
  89. "PieSlice|PinchArea|PinchEvent|PinchHandler|Place|PlaceAttribute|PlaceSearchModel|PlaceSearchSuggestionModel|PlaneGeometry|" +
  90. "PlaneMesh|PlayVariation|Playlist|PlaylistItem|Plugin|PluginParameter|PointDirection|PointHandler|PointLight|PointSize|" +
  91. "PointerDevice|PointerDeviceHandler|PointerEvent|PointerHandler|PolarChartView|PolygonOffset|Popup|Position|PositionSource|" +
  92. "Positioner|PressureReading|PressureSensor|Product|ProgressBar|ProgressBarStyle|PropertyAction|PropertyAnimation|PropertyChanges|" +
  93. "ProximityFilter|ProximityReading|ProximitySensor|QAbstractState|QAbstractTransition|QSignalTransition|" +
  94. "QVirtualKeyboardSelectionListModel|Qt|QtMultimedia|QtObject|QtPositioning|QuaternionAnimation|QuotaRequest|RadialBlur|" +
  95. "RadialGradient|Radio|RadioButton|RadioButtonStyle|RadioData|RadioDelegate|RangeSlider|Ratings|RayCaster|Rectangle|" +
  96. "RectangleShape|RectangularGlow|RecursiveBlur|RegExpValidator|RegisterProtocolHandlerRequest|RenderCapture|" +
  97. "RenderCaptureReply|RenderPass|RenderPassFilter|RenderSettings|RenderState|RenderStateSet|RenderSurfaceSelector|" +
  98. "RenderTarget|RenderTargetOutput|RenderTargetSelector|Repeater|ReviewModel|Rotation|RotationAnimation|RotationAnimator|" +
  99. "RotationReading|RotationSensor|RoundButton|Route|RouteLeg|RouteManeuver|RouteModel|RouteQuery|RouteSegment|Row|" +
  100. "RowLayout|Scale|ScaleAnimator|Scatter3D|Scatter3DSeries|ScatterDataProxy|ScatterSeries|Scene2D|Scene3D|SceneLoader|" +
  101. "ScissorTest|Screen|ScreenRayCaster|ScriptAction|ScrollBar|ScrollIndicator|ScrollView|ScrollViewStyle|ScxmlStateMachine|" +
  102. "SeamlessCubemap|SelectionListItem|Sensor|SensorGesture|SensorGlobal|SensorReading|SequentialAnimation|Settings|" +
  103. "SettingsStore|ShaderEffect|ShaderEffectSource|ShaderProgram|ShaderProgramBuilder|Shape|ShellSurface|ShellSurfaceItem|" +
  104. "ShiftHandler|ShiftKey|Shortcut|SignalSpy|SignalTransition|SinglePointHandler|Skeleton|SkeletonLoader|Slider|SliderStyle|" +
  105. "SmoothedAnimation|SortPolicy|Sound|SoundEffect|SoundInstance|SpaceKey|SphereGeometry|SphereMesh|SpinBox|SpinBoxStyle|" +
  106. "SplineSeries|SplitView|SpotLight|SpringAnimation|Sprite|SpriteGoal|SpriteSequence|Stack|StackLayout|StackView|" +
  107. "StackViewDelegate|StackedBarSeries|State|StateChangeScript|StateGroup|StateMachine|StateMachineLoader|StatusBar|" +
  108. "StatusBarStyle|StatusIndicator|StatusIndicatorStyle|StencilMask|StencilOperation|StencilOperationArguments|StencilTest|" +
  109. "StencilTestArguments|Store|String|Supplier|Surface3D|Surface3DSeries|SurfaceDataProxy|SwipeDelegate|SwipeView|Switch|" +
  110. "SwitchDelegate|SwitchStyle|SymbolModeKey|SystemPalette|Tab|TabBar|TabButton|TabView|TabViewStyle|TableView|TableViewColumn|" +
  111. "TableViewStyle|TapHandler|TapReading|TapSensor|TargetDirection|TaskbarButton|Technique|TechniqueFilter|TestCase|Text|TextArea|" +
  112. "TextAreaStyle|TextEdit|TextField|TextFieldStyle|TextInput|TextMetrics|TextureImage|TextureImageFactory|Theme3D|ThemeColor|" +
  113. "ThresholdMask|ThumbnailToolBar|ThumbnailToolButton|TiltReading|TiltSensor|TimeoutTransition|Timer|ToggleButton|" +
  114. "ToggleButtonStyle|ToolBar|ToolBarStyle|ToolButton|ToolSeparator|ToolTip|Torch|TorusGeometry|TorusMesh|TouchEventSequence|" +
  115. "TouchInputHandler3D|TouchPoint|Trace|TraceCanvas|TraceInputArea|TraceInputKey|TraceInputKeyPanel|TrailEmitter|Transaction|" +
  116. "Transform|Transition|Translate|TreeView|TreeViewStyle|Tumbler|TumblerColumn|TumblerStyle|Turbulence|UniformAnimator|User|" +
  117. "VBarModelMapper|VBoxPlotModelMapper|VCandlestickModelMapper|VPieModelMapper|VXYModelMapper|ValueAxis|ValueAxis3D|" +
  118. "ValueAxis3DFormatter|Vector3dAnimation|VertexBlendAnimation|Video|VideoOutput|ViewTransition|Viewport|" +
  119. "VirtualKeyboardSettings|Wander|WavefrontMesh|WaylandClient|WaylandCompositor|WaylandHardwareLayer|" +
  120. "WaylandOutput|WaylandQuickItem|WaylandSeat|WaylandSurface|WaylandView|Waypoint|" +
  121. "WebChannel|WebEngine|WebEngineAction|WebEngineCertificateError|WebEngineDownloadItem|WebEngineHistory|" +
  122. "WebEngineHistoryListModel|WebEngineLoadRequest|WebEngineNavigationRequest|WebEngineNewViewRequest|WebEngineProfile|WebEngineScript|" +
  123. "WebEngineSettings|WebEngineView|WebSocket|WebSocketServer|WebView|WebViewLoadRequest|" +
  124. "WheelEvent|Window|WlShell|WlShellSurface|WorkerScript|XAnimator|" +
  125. "XYPoint|XYSeries|XdgDecorationManagerV1|XdgPopup|XdgPopupV5|XdgPopupV6|" +
  126. "XdgShell|XdgShellV5|XdgShellV6|XdgSurface|XdgSurfaceV5|XdgSurfaceV6|" +
  127. "XdgToplevel|XdgToplevelV6|XmlListModel|XmlRole|YAnimator|ZoomBlur",
  128. "storage.type": "const|let|var|function|" + // js
  129. "property|",
  130. "constant.language": "null|Infinity|NaN|undefined",
  131. "support.function": "print|console\\.log",
  132. "constant.language.boolean": "true|false"
  133. }, "identifier");
  134. this.$rules = {
  135. "start": [
  136. {
  137. token: "string",
  138. regex: '"',
  139. next: "string"
  140. }, {
  141. token: "constant.numeric",
  142. regex: "0[xX][0-9a-fA-F]+\\b"
  143. }, {
  144. token: "constant.numeric",
  145. regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  146. }, {
  147. token: "constant.language.boolean",
  148. regex: "(?:true|false)\\b"
  149. }, {
  150. token: "text",
  151. regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  152. }, {
  153. token: "comment",
  154. regex: "\\/\\/.*$"
  155. }, {
  156. token: "comment.start",
  157. regex: "\\/\\*",
  158. next: "comment"
  159. }, {
  160. token: "paren.lparen",
  161. regex: "[[({]"
  162. }, {
  163. token: "paren.rparen",
  164. regex: "[\\])}]"
  165. }, {
  166. token: "text",
  167. regex: "\\s+"
  168. }, {
  169. token: keywordMapper,
  170. regex: "\\b\\w+\\b"
  171. }
  172. ],
  173. "string": [
  174. {
  175. token: "constant.language.escape",
  176. regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
  177. }, {
  178. token: "string",
  179. regex: '"|$',
  180. next: "start"
  181. }, {
  182. defaultToken: "string"
  183. }
  184. ],
  185. "comment": [
  186. {
  187. token: "comment.end",
  188. regex: "\\*\\/",
  189. next: "start"
  190. }, {
  191. defaultToken: "comment"
  192. }
  193. ]
  194. };
  195. };
  196. oop.inherits(QmlHighlightRules, TextHighlightRules);
  197. exports.QmlHighlightRules = QmlHighlightRules;
  198. });
  199. 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";
  200. var oop = require("../../lib/oop");
  201. var Range = require("../../range").Range;
  202. var BaseFoldMode = require("./fold_mode").FoldMode;
  203. var FoldMode = exports.FoldMode = function (commentRegex) {
  204. if (commentRegex) {
  205. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  206. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  207. }
  208. };
  209. oop.inherits(FoldMode, BaseFoldMode);
  210. (function () {
  211. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  212. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  213. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  214. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  215. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  216. this._getFoldWidgetBase = this.getFoldWidget;
  217. this.getFoldWidget = function (session, foldStyle, row) {
  218. var line = session.getLine(row);
  219. if (this.singleLineBlockCommentRe.test(line)) {
  220. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  221. return "";
  222. }
  223. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  224. if (!fw && this.startRegionRe.test(line))
  225. return "start"; // lineCommentRegionStart
  226. return fw;
  227. };
  228. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  229. var line = session.getLine(row);
  230. if (this.startRegionRe.test(line))
  231. return this.getCommentRegionBlock(session, line, row);
  232. var match = line.match(this.foldingStartMarker);
  233. if (match) {
  234. var i = match.index;
  235. if (match[1])
  236. return this.openingBracketBlock(session, match[1], row, i);
  237. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  238. if (range && !range.isMultiLine()) {
  239. if (forceMultiline) {
  240. range = this.getSectionRange(session, row);
  241. }
  242. else if (foldStyle != "all")
  243. range = null;
  244. }
  245. return range;
  246. }
  247. if (foldStyle === "markbegin")
  248. return;
  249. var match = line.match(this.foldingStopMarker);
  250. if (match) {
  251. var i = match.index + match[0].length;
  252. if (match[1])
  253. return this.closingBracketBlock(session, match[1], row, i);
  254. return session.getCommentFoldRange(row, i, -1);
  255. }
  256. };
  257. this.getSectionRange = function (session, row) {
  258. var line = session.getLine(row);
  259. var startIndent = line.search(/\S/);
  260. var startRow = row;
  261. var startColumn = line.length;
  262. row = row + 1;
  263. var endRow = row;
  264. var maxRow = session.getLength();
  265. while (++row < maxRow) {
  266. line = session.getLine(row);
  267. var indent = line.search(/\S/);
  268. if (indent === -1)
  269. continue;
  270. if (startIndent > indent)
  271. break;
  272. var subRange = this.getFoldWidgetRange(session, "all", row);
  273. if (subRange) {
  274. if (subRange.start.row <= startRow) {
  275. break;
  276. }
  277. else if (subRange.isMultiLine()) {
  278. row = subRange.end.row;
  279. }
  280. else if (startIndent == indent) {
  281. break;
  282. }
  283. }
  284. endRow = row;
  285. }
  286. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  287. };
  288. this.getCommentRegionBlock = function (session, line, row) {
  289. var startColumn = line.search(/\s*$/);
  290. var maxRow = session.getLength();
  291. var startRow = row;
  292. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  293. var depth = 1;
  294. while (++row < maxRow) {
  295. line = session.getLine(row);
  296. var m = re.exec(line);
  297. if (!m)
  298. continue;
  299. if (m[1])
  300. depth--;
  301. else
  302. depth++;
  303. if (!depth)
  304. break;
  305. }
  306. var endRow = row;
  307. if (endRow > startRow) {
  308. return new Range(startRow, startColumn, endRow, line.length);
  309. }
  310. };
  311. }).call(FoldMode.prototype);
  312. });
  313. ace.define("ace/mode/qml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/qml_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
  314. THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
  315. */
  316. "use strict";
  317. var oop = require("../lib/oop");
  318. var TextMode = require("./text").Mode;
  319. var QmlHighlightRules = require("./qml_highlight_rules").QmlHighlightRules;
  320. var FoldMode = require("./folding/cstyle").FoldMode;
  321. var Mode = function () {
  322. this.HighlightRules = QmlHighlightRules;
  323. this.foldingRules = new FoldMode();
  324. this.$behaviour = this.$defaultBehaviour;
  325. };
  326. oop.inherits(Mode, TextMode);
  327. (function () {
  328. this.lineCommentStart = "//";
  329. this.blockComment = { start: "/*", end: "*/" };
  330. this.$quotes = { '"': '"', "'": "'" };
  331. this.$id = "ace/mode/qml";
  332. }).call(Mode.prototype);
  333. exports.Mode = Mode;
  334. }); (function() {
  335. ace.require(["ace/mode/qml"], function(m) {
  336. if (typeof module == "object" && typeof exports == "object" && module) {
  337. module.exports = m;
  338. }
  339. });
  340. })();