Skip to content

Commit 7e9b3d5

Browse files
fix numbers
1 parent e2d74f8 commit 7e9b3d5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "highlightjs-4d",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "highlight.js syntax definition for 4d",
55
"main": "src/4d.js",
66
"scripts": {

src/4d.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = function(hljs) {
3636

3737
var NUMBERS = {
3838
className: 'number',
39-
begin: '(0[xX])?[0-9]+(\\.?,?\\^?[eE]?)[0-9]*',
39+
begin: '\\b(0[xX])?[0-9]+(\\.?,?\\^?[eE]?)[0-9]*',
4040
};
4141

4242
var VARIABLE = {
@@ -72,28 +72,31 @@ module.exports = function(hljs) {
7272
}
7373

7474
var INLINE_COMMENT = hljs.COMMENT('//', '[^\\\\]$');
75+
var INLINE_COMMENT_OLD = hljs.COMMENT('`', '[^\\\\]$');
7576

7677
return {
7778
aliases: [ '4d' ],
7879
keyword:KEYWORDS,
7980
contains: [
8081
INLINE_COMMENT, // single-line comments
8182
hljs.C_BLOCK_COMMENT_MODE, // comment blocks
83+
INLINE_COMMENT_OLD,
8284
{
8385
begin: 'Begin SQL', end: 'End SQL',
8486
subLanguage: 'sql',
8587
relevance: 0
8688
},
87-
NUMBERS,
88-
LITERALS,
89+
8990
DATE,
9091
HOUR,
9192
KEYWORDS,
9293
INTERPROCESS_VARIABLE,
9394
LOCAL_VARIABLE,
9495
VARIABLE_ARRAY,
9596
STRINGS,
96-
FUNCTIONS
97+
FUNCTIONS,
98+
NUMBERS,
99+
LITERALS,
97100
]
98101
};
99102
}

0 commit comments

Comments
 (0)