Skip to content

Commit 0ee1892

Browse files
Merge pull request #2 from F4r3n/master
Fix unicode characters
2 parents 1121922 + be6abe1 commit 0ee1892

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

dist/4d.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.

src/4d.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function(hljs) {
1818

1919
var FUNCTIONS = {
2020
className: 'function',
21-
begin: '\\w[\\w ]+\\w(?=\\()',
21+
begin: '[^\\s].+(?=\\()',
2222
}
2323

2424
var DATE = {
@@ -37,23 +37,20 @@ module.exports = function(hljs) {
3737
className: 'number',
3838
begin: '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b[\\d]+(\\.[\\d]*)?|\\.[\\d]+)([eE][-+]?[\\d]+)?)(?!D)'
3939
};
40-
40+
//Does not support unicode characters (should be replaced by \p{L} when possible)
4141
var VARIABLE = {
4242
className: 'variable',
43-
begin: '[\\w]+',
44-
end: '(?!\\w)|$'
43+
begin: '[^:\\(\\)*\\/\\|\\.=\\$\\<\\>\\#\\\'\\[\\]\"\\-\\!\\%\\&\\~\\+\\,\\;\\s]+'
4544
}
4645

4746
var LOCAL_VARIABLE = {
4847
className: 'variable',
49-
begin: '\\$',
50-
end: VARIABLE.end
48+
begin: '\\$' + VARIABLE.begin,
5149
}
5250

5351
var INTERPROCESS_VARIABLE = {
5452
className: 'variable',
55-
begin: '<>',
56-
end: VARIABLE.end
53+
begin: '<>'+ VARIABLE.begin,
5754
}
5855

5956
var STRINGS = {

0 commit comments

Comments
 (0)