Skip to content

Commit

Permalink
[theme] Highlighting for enums and match blocks (#85)
Browse files Browse the repository at this point in the history
* fix links, little formatting
* adds match, enum highlighting
  • Loading branch information
damirka authored Jul 16, 2024
1 parent 91886d6 commit e73a9bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions book/src/move-basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This chapter is all about the basic syntax of the Move language. It covers the b
language, such as types, modules, functions, and control flow. It focuses on the language without a
storage model or a blockchain, and explains the essential concepts of the language. To learn
features specific to Sui, such as storage functions and abilities, refer to the
[Using Objects](../storage/README.md) chapter, however, it is recommended to start with this chapter
first.
[Using Objects](../storage/) chapter, however, it is recommended to start with this chapter first.

<!-- TODO: cross link with Reference -->
8 changes: 4 additions & 4 deletions theme/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ hljs.registerLanguage('move', function(hljs) {
let KEYWORDS = [
...'public native friend entry macro'.split(' '),
...'let mut abort'.split(' '),
...'if else while loop break continue'.split(' '),
...'if else while loop break continue match'.split(' '),
];

return {
Expand Down Expand Up @@ -497,8 +497,8 @@ hljs.registerLanguage('move', function(hljs) {
{
// struct definition
scope: 'struct',
begin: 'struct',
keywords: 'struct',
begin: '\\b(struct|enum)\\b',
keywords: ['struct', 'enum'],
end: /(?=[\)}])/,
relevance: 10,
contains: [
Expand Down Expand Up @@ -613,7 +613,7 @@ hljs.registerLanguage('move', function(hljs) {
{
// function call
scope: 'title.function.invoke',
match: /\b[a-z_][a-z_0-9]*(?=\()/,
match: /\b[a-z_][a-z_0-9]*(\!?)(?=\()/,
}
]
};
Expand Down

0 comments on commit e73a9bf

Please sign in to comment.