Skip to content

Commit

Permalink
init the move.js
Browse files Browse the repository at this point in the history
  • Loading branch information
YouNeedWork committed May 6, 2023
0 parents commit ed4c68d
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_module/
.idea/
old.js
87 changes: 87 additions & 0 deletions move.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
Language: move
Author: Yusong Wang <[email protected]>
Contributors: Yusong Wang <[email protected]>
Website:
Category: common, system
*/

/** @type LanguageFn */
export default function move(hljs) {
//const regex = hljs.regex;

const KEYWORDS = [
"abort",
"acquires",
"has",
"as",
"break",
"continue",
"copy",
"drop",
"key",
"mut",
"store",
"define",
"else",
"false",
"fun",
"if",
"invariant",
"let",
"loop",
"module",
"entry",
"move",
"native",
"public",
"const",
"return",
"spec",
"struct",
"true",
"use",
"while"
];

const LITERALS = [
"true",
"false"
];

const BUILTINS = [
"move_to_sender",
"borrow_global",
"emit_event",
"borrow_global_mut",
"has",
"move_from",
"exists",
];

const TYPES = [
"u8",
"u64",
"u128",
"u256",
"vector",
"address",
"bool"
];

return {
name: 'move',
aliases: ['move'],
keywords: {
$pattern: hljs.IDENT_RE + '!?',
type: TYPES,
keyword: KEYWORDS,
literal: LITERALS,
built_in: BUILTINS
},
illegal: '</',
contains: []
};
}

//export registerLanguage("move", move)

0 comments on commit ed4c68d

Please sign in to comment.