Skip to content

Commit

Permalink
wip maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Feb 14, 2021
1 parent 88d6ae9 commit 16ccfab
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/languages/tcl.js
Expand Up @@ -10,6 +10,11 @@ import * as regex from '../lib/regex.js';
export default function(hljs) {
const ARRAY_ACCESS = '\\(([a-zA-Z0-9_]+)*\\)';

const NUMBER = {
className: 'number',
variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
};

return {
name: 'Tcl',
aliases: ['tk'],
Expand Down Expand Up @@ -43,14 +48,17 @@ export default function(hljs) {
]
},
{
excludeEnd: true,
className: "variable",
variants: [
{
begin: '\\$(::)?[a-zA-Z_]+((::)?[a-zA-Z0-9_]+)*' + regex.optional(ARRAY_ACCESS),
begin: '\\$(::)?[a-zA-Z_]+((::)?[a-zA-Z0-9_]+)*',
},
{
begin: '\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*' + regex.optional(ARRAY_ACCESS) + '\\}',
begin: '\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*',
end: '\\}',
contains: [
NUMBER
]
}
]
},
Expand All @@ -61,10 +69,7 @@ export default function(hljs) {
hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
]
},
{
className: 'number',
variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
}
NUMBER
]
}
}

0 comments on commit 16ccfab

Please sign in to comment.