Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 428700 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_html/syntax.js (-36 lines)
Lines 46-87 Link Here
46
						include: "orion.js"
46
						include: "orion.js"
47
					}
47
					}
48
				]
48
				]
49
			}, {
50
				begin: "(?i)<script\\s.*?(?:language\\s*=\\s*(['\"])php\\1|type\\s*=\\s*(['\"])text/x-php\\2).*?>",
51
				end: "(?i)</script>",
52
				captures: {
53
					0: {name: "entity.name.tag.html"}
54
				},
55
				contentName: "source.php.embedded.html",
56
				patterns: [
57
					{
58
						include: "orion.php"
59
					}
60
				]
61
			}, {
62
				begin: "(?i)<\\?(?:=|php)?(?:\\s|$)",
63
				end: "\\?>",
64
				captures: {
65
					0: {name: "entity.name.declaration.php"}
66
				},
67
				contentName: "source.php.embedded.html",
68
				patterns: [
69
					{
70
						include: "orion.php"
71
					}
72
				]
73
			}, {
74
				begin: "<%=?(?:\\s|$)",
75
				end: "%>",
76
				captures: {
77
					0: {name: "entity.name.declaration.php"}
78
				},
79
				contentName: "source.php.embedded.html",
80
				patterns: [
81
					{
82
						include: "orion.php"
83
					}
84
				]
85
			}
49
			}
86
		],
50
		],
87
		repository: {
51
		repository: {
(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-php/syntax.js (-16 / +39 lines)
Lines 44-59 Link Here
44
		contentTypes: ["text/x-php"],
44
		contentTypes: ["text/x-php"],
45
		patterns: [
45
		patterns: [
46
			{
46
			{
47
				include: "orion.lib#doc_block"
47
				include: "orion.html"
48
			}, {
48
			}, {
49
				include: "orion.c-like"
49
				begin: "(?i)<(\\?|%(?!php))(?:=|php)?(?:\\s|$)",
50
			}, {
50
				end: "[\\1]>",
51
				match: "(?i)<\\?(?:=|php)?(?:\\s|$)",
51
				captures: {
52
				name: "entity.name.declaration.php",
52
					0: {name: "entity.name.declaration.php"}
53
			}, {
53
				},
54
				match: "<%=?(?:\\s|$)",
54
				contentName: "source.php.embedded",
55
				name: "entity.name.declaration.php",
55
				patterns: [
56
			}, {
56
					{
57
						include: "orion.lib#doc_block"
58
					}, {
59
						include: "orion.c-like"
60
					}, {
61
						include: "#binary"
62
					}, {
63
						include: "#comment"
64
					}, {
65
						include: "#heredoc"
66
					}, {
67
						include: "#nowdoc"
68
					}, {
69
						include: "#keyword"
70
					}
71
				]
72
			}
73
		],
74
		repository: {
75
			binary: {
76
				match: "\\b0[bB][01]+\\b",
77
				name: "constant.numeric.binary.php"
78
			},
79
			comment: {
57
				match: "#.*",
80
				match: "#.*",
58
				name: "comment.line.number-sign.php",
81
				name: "comment.line.number-sign.php",
59
				patterns: [
82
				patterns: [
Lines 61-82 Link Here
61
						include: "orion.lib#todo_comment_singleLine"
84
						include: "orion.lib#todo_comment_singleLine"
62
					}
85
					}
63
				]
86
				]
64
			}, {
87
			},
88
			heredoc: {
65
				begin: "<<<(\\w+)$",
89
				begin: "<<<(\\w+)$",
66
				end: "^\\1;$",
90
				end: "^\\1;$",
67
				name: "string.unquoted.heredoc.php"
91
				name: "string.unquoted.heredoc.php"
68
			}, {
92
			},
93
			nowdoc: {
69
				begin: "<<<'(\\w+)'$",
94
				begin: "<<<'(\\w+)'$",
70
				end: "^\\1;$",
95
				end: "^\\1;$",
71
				name: "string.unquoted.heredoc.nowdoc.php"
96
				name: "string.unquoted.heredoc.nowdoc.php"
72
			}, {
97
			},
73
				match: "\\b0[bB][01]+\\b",
98
			keyword: {
74
				name: "constant.numeric.binary.php"
75
			}, {
76
				match: "\\b(?:" + keywords.join("|") + ")\\b",
99
				match: "\\b(?:" + keywords.join("|") + ")\\b",
77
				name: "keyword.control.php"
100
				name: "keyword.control.php"
78
			}
101
			}
79
		]
102
		}
80
	});
103
	});
81
104
82
	return {
105
	return {
(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textStyler.js (-3 / +5 lines)
Lines 33-38 Link Here
33
33
34
	var eolRegex = /$/;
34
	var eolRegex = /$/;
35
	var captureReferenceRegex = /\\(\d)/g;
35
	var captureReferenceRegex = /\\(\d)/g;
36
	var ignoreCaseRegex = /^\(\?i\)\s*/;
36
	var linebreakRegex = /(.*)(?:[\r\n]|$)/g;
37
	var linebreakRegex = /(.*)(?:[\r\n]|$)/g;
37
	var spacePattern = {regex: / /g, style: {styleClass: "punctuation separator space", unmergeable: true}}; //$NON-NLS-0$
38
	var spacePattern = {regex: / /g, style: {styleClass: "punctuation separator space", unmergeable: true}}; //$NON-NLS-0$
38
	var tabPattern = {regex: /\t/g, style: {styleClass: "punctuation separator tab", unmergeable: true}}; //$NON-NLS-0$
39
	var tabPattern = {regex: /\t/g, style: {styleClass: "punctuation separator tab", unmergeable: true}}; //$NON-NLS-0$
Lines 390-407 Link Here
390
		getPatterns: function(pattern) {
391
		getPatterns: function(pattern) {
391
			var parentId;
392
			var parentId;
392
			if (!pattern) {
393
			if (!pattern) {
393
				parentId = this._rootId;
394
				parentId = this._rootId + "#" + this._NO_ID;
394
			} else {
395
			} else {
395
				if (typeof(pattern) === "string") { //$NON-NLS-0$
396
				if (typeof(pattern) === "string") { //$NON-NLS-0$
396
					parentId = pattern;
397
					parentId = pattern;
397
				} else {
398
				} else {
398
					parentId = pattern.qualifiedId;
399
					parentId = pattern.qualifiedId;
399
				}
400
				}
401
				parentId += "#";
400
			}
402
			}
401
			/* indexes on patterns are used to break ties when multiple patterns match the same start text */
403
			/* indexes on patterns are used to break ties when multiple patterns match the same start text */
402
			var indexCounter = [0];
404
			var indexCounter = [0];
403
			var resultObject = {};
405
			var resultObject = {};
404
			var regEx = new RegExp("^" + parentId + "#[^#]+$"); //$NON-NLS-0$
406
			var regEx = new RegExp("^" + parentId + "[^#]+$"); //$NON-NLS-0$
405
			var includes = [];
407
			var includes = [];
406
			this._patterns.forEach(function(current) {
408
			this._patterns.forEach(function(current) {
407
				if (regEx.test(current.qualifiedId)) {
409
				if (regEx.test(current.qualifiedId)) {
Lines 598-604 Link Here
598
		_initPatterns: function() {
600
		_initPatterns: function() {
599
			var patterns = this.getPatternManager().getPatterns(this.pattern ? this.pattern.pattern : null);
601
			var patterns = this.getPatternManager().getPatterns(this.pattern ? this.pattern.pattern : null);
600
			var processIgnore = function(matchString) {
602
			var processIgnore = function(matchString) {
601
				var result = /^\(\?i\)\s*/.exec(matchString);
603
				var result = ignoreCaseRegex.exec(matchString);
602
				if (result) {
604
				if (result) {
603
					matchString = matchString.substring(result[0].length);
605
					matchString = matchString.substring(result[0].length);
604
				}
606
				}

Return to bug 428700