Skip to content

Commit 3c4c6db

Browse files
Resolved conflict
2 parents e878a33 + 671f4ca commit 3c4c6db

File tree

8 files changed

+37
-21
lines changed

8 files changed

+37
-21
lines changed

components/prism-javascript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
1111
pattern: /((?:^|})\s*)(?:catch|finally)\b/,
1212
lookbehind: true
1313
},
14-
/\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/
14+
/\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/
1515
],
1616
'number': /\b(?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
1717
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
@@ -48,7 +48,7 @@ Prism.languages.insertBefore('javascript', 'keyword', {
4848
inside: Prism.languages.javascript
4949
},
5050
{
51-
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
51+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
5252
lookbehind: true,
5353
inside: Prism.languages.javascript
5454
}

components/prism-javascript.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-scss.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ Prism.languages.insertBefore('scss', 'function', {
6464
alias: 'keyword'
6565
},
6666
'boolean': /\b(?:true|false)\b/,
67-
'null': /\bnull\b/,
67+
'null': {
68+
pattern: /\bnull\b/,
69+
alias: 'keyword'
70+
},
6871
'operator': {
6972
pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,
7073
lookbehind: true

components/prism-scss.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var gulp = require('gulp'),
44
header = require('gulp-header'),
55
concat = require('gulp-concat'),
66
replace = require('gulp-replace'),
7+
pump = require('pump'),
78
fs = require('fs'),
89

910
paths = {
@@ -52,12 +53,17 @@ var gulp = require('gulp'),
5253
);
5354
};
5455

55-
gulp.task('components', function() {
56-
return gulp.src(paths.components)
57-
.pipe(inlineRegexSource())
58-
.pipe(uglify())
59-
.pipe(rename({ suffix: '.min' }))
60-
.pipe(gulp.dest('components'));
56+
gulp.task('components', function(cb) {
57+
pump(
58+
[
59+
gulp.src(paths.components),
60+
inlineRegexSource(),
61+
uglify(),
62+
rename({ suffix: '.min' }),
63+
gulp.dest('components')
64+
],
65+
cb
66+
);
6167
});
6268

6369
gulp.task('build', function() {
@@ -69,12 +75,17 @@ gulp.task('build', function() {
6975
.pipe(gulp.dest('./'));
7076
});
7177

72-
gulp.task('plugins', ['languages-plugins'], function() {
73-
return gulp.src(paths.plugins)
74-
.pipe(inlineRegexSource())
75-
.pipe(uglify())
76-
.pipe(rename({ suffix: '.min' }))
77-
.pipe(gulp.dest('plugins'));
78+
gulp.task('plugins', ['languages-plugins'], function(cb) {
79+
pump(
80+
[
81+
gulp.src(paths.plugins),
82+
inlineRegexSource(),
83+
uglify(),
84+
rename({ suffix: '.min' }),
85+
gulp.dest('plugins')
86+
],
87+
cb
88+
);
7889
});
7990

8091
gulp.task('components-json', function (cb) {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
"gulp-concat": "^2.3.4",
2828
"gulp-header": "^1.0.5",
2929
"gulp-rename": "^1.2.0",
30-
"gulp-uglify": "^0.3.1",
3130
"gulp-replace": "^0.5.4",
31+
"gulp-uglify": "^0.3.1",
3232
"mocha": "^2.2.5",
33+
"pump": "^3.0.0",
3334
"yargs": "^3.26.0"
3435
},
3536
"jspm": {

prism.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
720720
pattern: /((?:^|})\s*)(?:catch|finally)\b/,
721721
lookbehind: true
722722
},
723-
/\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/
723+
/\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/
724724
],
725725
'number': /\b(?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
726726
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
@@ -757,7 +757,7 @@ Prism.languages.insertBefore('javascript', 'keyword', {
757757
inside: Prism.languages.javascript
758758
},
759759
{
760-
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
760+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
761761
lookbehind: true,
762762
inside: Prism.languages.javascript
763763
}

tests/languages/javascript/keyword_feature.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import; in; instanceof; interface; let;
99
new; null; of; package; private;
1010
protected; public; return; set; static;
1111
super; switch; this; throw; try;
12-
typeof; var; void; while;
12+
typeof; undefined; var; void; while;
1313
with; yield;
1414

1515
----------------------------------------------------
@@ -61,6 +61,7 @@ with; yield;
6161
["keyword", "throw"], ["punctuation", ";"],
6262
["keyword", "try"], ["punctuation", ";"],
6363
["keyword", "typeof"], ["punctuation", ";"],
64+
["keyword", "undefined"], ["punctuation", ";"],
6465
["keyword", "var"], ["punctuation", ";"],
6566
["keyword", "void"], ["punctuation", ";"],
6667
["keyword", "while"], ["punctuation", ";"],

0 commit comments

Comments
 (0)