From 0e80f5935d02d8f2353932ac82464b5af8f7ee95 Mon Sep 17 00:00:00 2001 From: Damir Shamanaev Date: Tue, 16 Jul 2024 17:29:41 +0300 Subject: [PATCH] adds match, enum highlighting --- book/src/move-basics/README.md | 3 +-- theme/highlight.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/book/src/move-basics/README.md b/book/src/move-basics/README.md index 2602923c..adfca5e0 100644 --- a/book/src/move-basics/README.md +++ b/book/src/move-basics/README.md @@ -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. diff --git a/theme/highlight.js b/theme/highlight.js index 25779435..0c23b73a 100644 --- a/theme/highlight.js +++ b/theme/highlight.js @@ -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 { @@ -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: [ @@ -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]*(\!?)(?=\()/, } ] };