Skip to content

Commit

Permalink
better highlighting demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurnikov committed Jun 4, 2024
1 parent 0d95b49 commit 8992ba2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/main/resources/colors/highlighterDemoText.move
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module M {
module 0x1::<MODULE>main</MODULE> {
const <CONSTANT>MAX_INT</CONSTANT>: <PRIMITIVE_TYPE>u8</PRIMITIVE_TYPE> = 255;

/// this is docstring
/// with two lines
struct MyStruct<T> {
Expand All @@ -7,11 +9,26 @@ module M {
field: <TYPE_PARAMETER>T</TYPE_PARAMETER>
}

fun main(signer: &<BUILTIN_TYPE>signer</BUILTIN_TYPE>, val: <PRIMITIVE_TYPE>u8</PRIMITIVE_TYPE>, s: MyStruct) {
fun <FUNCTION>main</FUNCTION>(signer: &<BUILTIN_TYPE>signer</BUILTIN_TYPE>, val: <PRIMITIVE_TYPE>u8</PRIMITIVE_TYPE>, s: MyStruct) {
// this is comment
let local_val = val;

<FUNCTION_CALL>call</FUNCTION_CALL>(1);
let myresource = <BUILTIN_FUNCTION_CALL>move_from</BUILTIN_FUNCTION_CALL>(signer);
<MACRO>assert!</MACRO>(true, 1);

<VECTOR_LITERAL>vector</VECTOR_LITERAL>[];
}

entry fun <ENTRY_FUNCTION>entry_fun</ENTRY_FUNCTION>() {}
inline fun <INLINE_FUNCTION>inline_fun</INLINE_FUNCTION>() {}
#[view]
public fun <VIEW_FUNCTION>view_fun</VIEW_FUNCTION>() {}

fun <METHOD>receiver</METHOD>(<SELF_PARAMETER>self</SELF_PARAMETER>: S, <VARIABLE>self</VARIABLE>: u8): u8 {
<SELF_PARAMETER>self</SELF_PARAMETER>.field
}
fun main(s: S) {
s.<METHOD_CALL>receiver</METHOD_CALL>();
}
}

0 comments on commit 8992ba2

Please sign in to comment.