Skip to content

Commit a868453

Browse files
committed
v1.1.0
1 parent d4fe777 commit a868453

File tree

4 files changed

+69
-55
lines changed

4 files changed

+69
-55
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
## 1.1.0 - 2023-02-14
4+
5+
- Updated for Gleam v0.26.0
6+
7+
## 1.0.0 - 2022-09-18
8+
9+
- Initial release

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This package adds [Gleam](https://gleam.run/) language support to [highlight.js](https://highlightjs.org/).
44

5+
6+
```
7+
npm install --save @gleam-lang/highlight.js-gleam
8+
```
9+
510
## License
611

712
Released under the Apache 2.0 license, see [LICENSE](/LICENSE) file for details.

index.js

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
11
module.exports = function (hljs) {
22
const KEYWORDS =
3-
'as assert case const external fn if import let ' +
4-
'opaque pub todo try tuple type'
3+
"as assert case const external fn if import let " +
4+
"opaque pub todo try tuple type use";
55
const STRING = {
6-
className: 'string',
6+
className: "string",
77
variants: [{ begin: /"/, end: /"/ }],
88
contains: [hljs.BACKSLASH_ESCAPE],
9-
relevance: 0
10-
}
9+
relevance: 0,
10+
};
1111
const NAME = {
12-
className: 'variable',
13-
begin: '\\b[a-z][a-z0-9_]*\\b',
14-
relevance: 0
15-
}
12+
className: "variable",
13+
begin: "\\b[a-z][a-z0-9_]*\\b",
14+
relevance: 0,
15+
};
1616
const DISCARD_NAME = {
17-
className: 'comment',
18-
begin: '\\b_[a-z][a-z0-9_]*\\b',
19-
relevance: 0
20-
}
17+
className: "comment",
18+
begin: "\\b_[a-z][a-z0-9_]*\\b",
19+
relevance: 0,
20+
};
2121
const NUMBER = {
22-
className: 'number',
22+
className: "number",
2323
variants: [
2424
{
2525
// binary
26-
begin: '\\b0[bB](?:_?[01]+)+'
26+
begin: "\\b0[bB](?:_?[01]+)+",
2727
},
2828
{
2929
// octal
30-
begin: '\\b0[oO](?:_?[0-7]+)+'
30+
begin: "\\b0[oO](?:_?[0-7]+)+",
3131
},
3232
{
3333
// hex
34-
begin: '\\b0[xX](?:_?[0-9a-fA-F]+)+'
34+
begin: "\\b0[xX](?:_?[0-9a-fA-F]+)+",
3535
},
3636
{
3737
// dec, float
38-
begin: '\\b\\d(?:_?\\d+)*(?:\\.(?:\\d(?:_?\\d+)*)*)?'
39-
}
38+
begin: "\\b\\d(?:_?\\d+)*(?:\\.(?:\\d(?:_?\\d+)*)*)?",
39+
},
4040
],
41-
relevance: 0
42-
}
41+
relevance: 0,
42+
};
4343

4444
return {
45-
name: 'Gleam',
46-
aliases: ['gleam'],
45+
name: "Gleam",
46+
aliases: ["gleam"],
4747
contains: [
4848
hljs.C_LINE_COMMENT_MODE,
4949
STRING,
5050
{
5151
// bit string
52-
begin: '<<',
53-
end: '>>',
52+
begin: "<<",
53+
end: ">>",
5454
contains: [
5555
{
56-
className: 'keyword',
56+
className: "keyword",
5757
beginKeywords:
58-
'binary bytes int float bit_string bits utf8 utf16 utf32 ' +
59-
'utf8_codepoint utf16_codepoint utf32_codepoint signed unsigned ' +
60-
'big little native unit size'
58+
"binary bytes int float bit_string bits utf8 utf16 utf32 " +
59+
"utf8_codepoint utf16_codepoint utf32_codepoint signed unsigned " +
60+
"big little native unit size",
6161
},
6262
KEYWORDS,
6363
STRING,
6464
NAME,
6565
DISCARD_NAME,
66-
NUMBER
66+
NUMBER,
6767
],
68-
relevance: 10
68+
relevance: 10,
6969
},
7070
{
71-
className: 'function',
72-
beginKeywords: 'fn',
73-
end: '\\(',
71+
className: "function",
72+
beginKeywords: "fn",
73+
end: "\\(",
7474
excludeEnd: true,
7575
contains: [
7676
{
77-
className: 'title',
78-
begin: '[a-z][a-z0-9_]*\\w*',
79-
relevance: 0
80-
}
81-
]
77+
className: "title",
78+
begin: "[a-z][a-z0-9_]*\\w*",
79+
relevance: 0,
80+
},
81+
],
8282
},
8383
{
84-
className: 'keyword',
85-
beginKeywords: KEYWORDS
84+
className: "keyword",
85+
beginKeywords: KEYWORDS,
8686
},
8787
{
8888
// Type names and constructors
89-
className: 'title',
90-
begin: '\\b[A-Z][A-Za-z0-9]*\\b',
91-
relevance: 0
89+
className: "title",
90+
begin: "\\b[A-Z][A-Za-z0-9]*\\b",
91+
relevance: 0,
9292
},
9393
{
94-
className: 'operator',
95-
begin: '[+\\-*/%!=<>&|.]+',
96-
relevance: 0
94+
className: "operator",
95+
begin: "[+\\-*/%!=<>&|.]+",
96+
relevance: 0,
9797
},
9898
NAME,
9999
DISCARD_NAME,
100-
NUMBER
101-
]
102-
}
103-
}
100+
NUMBER,
101+
],
102+
};
103+
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gleam-lang/highlight.js-gleam",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Adds support for the Gleam language to highlight.js.",
55
"main": "index.js",
66
"scripts": {
@@ -9,14 +9,14 @@
99
},
1010
"repository": {
1111
"type": "git",
12-
"url": "git+https://github.com/aflatter/highlight.js-gleam.git"
12+
"url": "git+https://github.com/gleam-lang/highlight.js-gleam.git"
1313
},
1414
"author": "",
1515
"license": "Apache-2.0",
1616
"bugs": {
17-
"url": "https://github.com/aflatter/highlight.js-gleam/issues"
17+
"url": "https://github.com/gleam-lang/highlight.js-gleam/issues"
1818
},
19-
"homepage": "https://github.com/aflatter/highlight.js-gleam#readme",
19+
"homepage": "https://github.com/gleam-lang/highlight.js-gleam#readme",
2020
"devDependencies": {
2121
"standard": "^17.0.0"
2222
}

0 commit comments

Comments
 (0)