| 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|" + |
| 7 |
"Namespace|QName|XML|XMLList|" + |
| 8 |
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + |
| 9 |
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + |
| 10 |
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + |
| 11 |
"SyntaxError|TypeError|URIError|" + |
| 12 |
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + |
| 13 |
"isNaN|parseFloat|parseInt|" + |
| 14 |
"JSON|Math|" + |
| 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|" + |
| 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 |
}); |
| 200 |
|
| 201 |
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"; |
| 202 |
var oop = require("../../lib/oop"); |
| 203 |
var Range = require("../../range").Range; |
| 204 |
var BaseFoldMode = require("./fold_mode").FoldMode; |
| 205 |
var FoldMode = exports.FoldMode = function (commentRegex) { |
| 206 |
if (commentRegex) { |
| 207 |
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)); |
| 208 |
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)); |
| 209 |
} |
| 210 |
}; |
| 211 |
oop.inherits(FoldMode, BaseFoldMode); |
| 212 |
(function () { |
| 213 |
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; |
| 214 |
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; |
| 215 |
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/; |
| 216 |
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; |
| 217 |
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; |
| 218 |
this._getFoldWidgetBase = this.getFoldWidget; |
| 219 |
this.getFoldWidget = function (session, foldStyle, row) { |
| 220 |
var line = session.getLine(row); |
| 221 |
if (this.singleLineBlockCommentRe.test(line)) { |
| 222 |
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) |
| 223 |
return ""; |
| 224 |
} |
| 225 |
var fw = this._getFoldWidgetBase(session, foldStyle, row); |
| 226 |
if (!fw && this.startRegionRe.test(line)) |
| 227 |
return "start"; |
| 228 |
return fw; |
| 229 |
}; |
| 230 |
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) { |
| 231 |
var line = session.getLine(row); |
| 232 |
if (this.startRegionRe.test(line)) |
| 233 |
return this.getCommentRegionBlock(session, line, row); |
| 234 |
var match = line.match(this.foldingStartMarker); |
| 235 |
if (match) { |
| 236 |
var i = match.index; |
| 237 |
if (match[1]) |
| 238 |
return this.openingBracketBlock(session, match[1], row, i); |
| 239 |
var range = session.getCommentFoldRange(row, i + match[0].length, 1); |
| 240 |
if (range && !range.isMultiLine()) { |
| 241 |
if (forceMultiline) { |
| 242 |
range = this.getSectionRange(session, row); |
| 243 |
} |
| 244 |
else if (foldStyle != "all") |
| 245 |
range = null; |
| 246 |
} |
| 247 |
return range; |
| 248 |
} |
| 249 |
if (foldStyle === "markbegin") |
| 250 |
return; |
| 251 |
var match = line.match(this.foldingStopMarker); |
| 252 |
if (match) { |
| 253 |
var i = match.index + match[0].length; |
| 254 |
if (match[1]) |
| 255 |
return this.closingBracketBlock(session, match[1], row, i); |
| 256 |
return session.getCommentFoldRange(row, i, -1); |
| 257 |
} |
| 258 |
}; |
| 259 |
this.getSectionRange = function (session, row) { |
| 260 |
var line = session.getLine(row); |
| 261 |
var startIndent = line.search(/\S/); |
| 262 |
var startRow = row; |
| 263 |
var startColumn = line.length; |
| 264 |
row = row + 1; |
| 265 |
var endRow = row; |
| 266 |
var maxRow = session.getLength(); |
| 267 |
while (++row < maxRow) { |
| 268 |
line = session.getLine(row); |
| 269 |
var indent = line.search(/\S/); |
| 270 |
if (indent === -1) |
| 271 |
continue; |
| 272 |
if (startIndent > indent) |
| 273 |
break; |
| 274 |
var subRange = this.getFoldWidgetRange(session, "all", row); |
| 275 |
if (subRange) { |
| 276 |
if (subRange.start.row <= startRow) { |
| 277 |
break; |
| 278 |
} |
| 279 |
else if (subRange.isMultiLine()) { |
| 280 |
row = subRange.end.row; |
| 281 |
} |
| 282 |
else if (startIndent == indent) { |
| 283 |
break; |
| 284 |
} |
| 285 |
} |
| 286 |
endRow = row; |
| 287 |
} |
| 288 |
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); |
| 289 |
}; |
| 290 |
this.getCommentRegionBlock = function (session, line, row) { |
| 291 |
var startColumn = line.search(/\s*$/); |
| 292 |
var maxRow = session.getLength(); |
| 293 |
var startRow = row; |
| 294 |
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; |
| 295 |
var depth = 1; |
| 296 |
while (++row < maxRow) { |
| 297 |
line = session.getLine(row); |
| 298 |
var m = re.exec(line); |
| 299 |
if (!m) |
| 300 |
continue; |
| 301 |
if (m[1]) |
| 302 |
depth--; |
| 303 |
else |
| 304 |
depth++; |
| 305 |
if (!depth) |
| 306 |
break; |
| 307 |
} |
| 308 |
var endRow = row; |
| 309 |
if (endRow > startRow) { |
| 310 |
return new Range(startRow, startColumn, endRow, line.length); |
| 311 |
} |
| 312 |
}; |
| 313 |
}).call(FoldMode.prototype); |
| 314 |
|
| 315 |
}); |
| 316 |
|
| 317 |
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){ |
| 318 |
|
| 319 |
|
| 320 |
"use strict"; |
| 321 |
var oop = require("../lib/oop"); |
| 322 |
var TextMode = require("./text").Mode; |
| 323 |
var QmlHighlightRules = require("./qml_highlight_rules").QmlHighlightRules; |
| 324 |
var FoldMode = require("./folding/cstyle").FoldMode; |
| 325 |
var Mode = function () { |
| 326 |
this.HighlightRules = QmlHighlightRules; |
| 327 |
this.foldingRules = new FoldMode(); |
| 328 |
this.$behaviour = this.$defaultBehaviour; |
| 329 |
}; |
| 330 |
oop.inherits(Mode, TextMode); |
| 331 |
(function () { |
| 332 |
this.lineCommentStart = "//"; |
| 333 |
this.blockComment = { start: "/*", end: "*/" }; |
| 334 |
this.$quotes = { '"': '"', "'": "'" }; |
| 335 |
this.$id = "ace/mode/qml"; |
| 336 |
}).call(Mode.prototype); |
| 337 |
exports.Mode = Mode; |
| 338 |
|
| 339 |
}); (function() { |
| 340 |
ace.require(["ace/mode/qml"], function(m) { |
| 341 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 342 |
module.exports = m; |
| 343 |
} |
| 344 |
}); |
| 345 |
})(); |
| 346 |
|