yanki 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actionscript-3-D6NljDpC.js → actionscript-3-BigF1UXR.js} +1 -1
- package/dist/bin/cli.js +9 -9
- package/dist/lib/index.d.ts +6 -1
- package/dist/lib/index.js +1 -1
- package/dist/move-DOHBU7tp.js +1 -0
- package/dist/pascal-BvCdDh2R.js +1 -0
- package/dist/{sync-CNzgYCr4.js → sync-4dSh1bTq.js} +157 -156
- package/package.json +11 -9
- package/readme.md +44 -14
- package/dist/move-MN12aA4C.js +0 -1
- package/dist/pascal-B6ZnTe72.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yanki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "An ultra-simple CLI tool and TypeScript library for syncing Markdown to Anki flashcards.",
|
|
6
6
|
"repository": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"npm-package"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@types/hast": "^3.0.4",
|
|
51
52
|
"@types/lodash-es": "^4.17.12",
|
|
52
53
|
"@types/mdast": "^4.0.4",
|
|
53
54
|
"@types/node": "^20.14.2",
|
|
@@ -59,11 +60,12 @@
|
|
|
59
60
|
"yargs": "^17.7.2"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@kitschpatrol/shared-config": "^4.
|
|
63
|
-
"@shikijs/rehype": "^1.6.
|
|
64
|
-
"@types/hast": "^3.0.4",
|
|
63
|
+
"@kitschpatrol/shared-config": "^4.7.1",
|
|
64
|
+
"@shikijs/rehype": "^1.6.4",
|
|
65
65
|
"bumpp": "^9.4.1",
|
|
66
66
|
"deepmerge-ts": "^7.0.3",
|
|
67
|
+
"filenamify": "^6.0.0",
|
|
68
|
+
"nanoid": "^5.0.7",
|
|
67
69
|
"path-browserify-esm": "^1.0.4",
|
|
68
70
|
"pkgroll": "^2.1.1",
|
|
69
71
|
"plur": "^5.1.0",
|
|
@@ -82,17 +84,17 @@
|
|
|
82
84
|
"remark-wiki-link": "^2.0.1",
|
|
83
85
|
"sort-keys": "^5.0.0",
|
|
84
86
|
"string-strip-html": "^13.4.8",
|
|
85
|
-
"tsx": "^4.
|
|
86
|
-
"type-fest": "^4.
|
|
87
|
+
"tsx": "^4.15.4",
|
|
88
|
+
"type-fest": "^4.20.0",
|
|
87
89
|
"typescript": "^5.4.5",
|
|
88
90
|
"unified": "^11.0.4",
|
|
89
91
|
"unist-builder": "^4.0.0",
|
|
90
92
|
"unist-util-visit": "^5.0.0",
|
|
91
93
|
"untildify": "^5.0.0",
|
|
92
|
-
"vite": "^5.
|
|
94
|
+
"vite": "^5.3.0",
|
|
93
95
|
"vitest": "^1.6.0",
|
|
94
|
-
"yaml": "^2.4.
|
|
95
|
-
"yanki-connect": "^1.0.
|
|
96
|
+
"yaml": "^2.4.5",
|
|
97
|
+
"yanki-connect": "^1.0.4"
|
|
96
98
|
},
|
|
97
99
|
"publishConfig": {
|
|
98
100
|
"access": "public"
|
package/readme.md
CHANGED
|
@@ -22,6 +22,26 @@
|
|
|
22
22
|
> \[!IMPORTANT]
|
|
23
23
|
> Yanki is feature-complete but will remain zero-versioned until it's been thoroughly tested. Please exercise caution and make backups of your Anki notes until the 1.0.0 release.
|
|
24
24
|
|
|
25
|
+
<!-- table-of-contents { depth: 2 } -->
|
|
26
|
+
|
|
27
|
+
## Table of contents
|
|
28
|
+
|
|
29
|
+
- [Overview](#overview)
|
|
30
|
+
- [Quick start](#quick-start)
|
|
31
|
+
- [Features](#features)
|
|
32
|
+
- [Markdown note types](#markdown-note-types)
|
|
33
|
+
- [Getting started](#getting-started)
|
|
34
|
+
- [Usage](#usage)
|
|
35
|
+
- [Advanced features](#advanced-features)
|
|
36
|
+
- [Background](#background)
|
|
37
|
+
- [The future](#the-future)
|
|
38
|
+
- [Maintainers](#maintainers)
|
|
39
|
+
- [Acknowledgments](#acknowledgments)
|
|
40
|
+
- [Contributing](#contributing)
|
|
41
|
+
- [License](#license)
|
|
42
|
+
|
|
43
|
+
<!-- /table-of-contents -->
|
|
44
|
+
|
|
25
45
|
## Overview
|
|
26
46
|
|
|
27
47
|
Yanki simply syncs a folder of Markdown notes to Anki. The primary novelty of its approach is in how Markdown is translated into Anki notes. The **structure** of a Markdown note determines the **type** of Anki note it becomes, so no extra syntax or Anki-specific markup is required — just pure Markdown.
|
|
@@ -107,6 +127,14 @@ An extended palette of markdown syntax is available out of the box:
|
|
|
107
127
|
|
|
108
128
|
Yanki uses Anki's built-in CSS stylesheet to style cards by default, but it makes it simple to set a custom stylesheet for all of your Yanki-managed notes without having to go on a click-quest in the Anki user interface.
|
|
109
129
|
|
|
130
|
+
### Filename management
|
|
131
|
+
|
|
132
|
+
The "one Markdown file = one Anki note" can make for a lot of individual files, and thinking up and renaming files as content is revised can be tedious. So, if you want, Yanki can manage the names of your note files based on their content.
|
|
133
|
+
|
|
134
|
+
Yanki looks inside each note, and extracts either the text of the prompt (e.g. the front of the card in most cases), or the "response" (e.g. the back of the card in most cases) to use as the filename. Truncation, deduplication, and sanitization are all taken care of.
|
|
135
|
+
|
|
136
|
+
Edge cases are carefully managed to ensure that there's always _some kind_ of best-effort semantically valuable file name assigned.
|
|
137
|
+
|
|
110
138
|
## Markdown note types
|
|
111
139
|
|
|
112
140
|
Yanki automatically infers the _type_ of Note you'd like to create in Anki based on the presence or absence of certain element in your Markdown files.
|
|
@@ -280,17 +308,19 @@ yanki sync <directory> [options]
|
|
|
280
308
|
| ------------------- | ------------------------------------------------------------------------ | -------- |
|
|
281
309
|
| `directory` | The path to the local directory of Markdown files to sync. _(Required.)_ | `string` |
|
|
282
310
|
|
|
283
|
-
| Option
|
|
284
|
-
|
|
|
285
|
-
| `--dry-run`
|
|
286
|
-
| `--namespace`
|
|
287
|
-
| `--anki-connect`
|
|
288
|
-
| `--anki-auto-launch`
|
|
289
|
-
| `--anki-web`
|
|
290
|
-
| `--
|
|
291
|
-
| `--
|
|
292
|
-
| `--
|
|
293
|
-
| `--
|
|
311
|
+
| Option | Alias | Argument | Description | Type | Default |
|
|
312
|
+
| ----------------------- | ----- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------------------- |
|
|
313
|
+
| `--dry-run` | `-d` | | Run without making any changes to the Anki database. See a report of what would have been done. | `boolean` | `false` |
|
|
314
|
+
| `--namespace` | `-n` | | Advanced option for managing multiple Yanki synchronization groups. Case insensitive. See the readme for more information. | `string` | `"Yanki"` |
|
|
315
|
+
| `--anki-connect` | | | Host and port of the Anki-Connect server. The default is usually fine. See the Anki-Connect documentation for more information. | `string` | `"http://127.0.0.1:8765"` |
|
|
316
|
+
| `--anki-auto-launch` | `-l` | | Attempt to open the Anki desktop app if it's not already running. (Experimental, macOS only.) | `boolean` | `false` |
|
|
317
|
+
| `--anki-web` | `-w` | | Automatically sync any changes to AnkiWeb after Yanki has finished syncing locally. If false, only local Anki data is updated and you must manually invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync" button in the Anki app. | `boolean` | `true` |
|
|
318
|
+
| `--manage-filenames` | `-m` | | Rename local note files to match their content. Useful if you want to feel have semantically reasonable note file names without managing them by hand. The `"prompt"` option will attempt to create the filename based on the "front" of the card, while `"response"` will prioritize the "back", "Cloze", or "type in the answer" portions of the card. Truncation, sanitization, and deduplication are taken care of. | `string` | `"off"` |
|
|
319
|
+
| `--max-filename-length` | | `[number]` | If `manage-filenames` is enabled, this option specifies the maximum length of the filename in characters. | | `60` |
|
|
320
|
+
| `--json` | | | Output the sync report as JSON. | `boolean` | `false` |
|
|
321
|
+
| `--verbose` | | | Enable verbose logging. | `boolean` | `false` |
|
|
322
|
+
| `--help` | `-h` | | Show help | `boolean` | |
|
|
323
|
+
| `--version` | `-v` | | Show version number | `boolean` | |
|
|
294
324
|
|
|
295
325
|
#### Subcommand: `yanki list`
|
|
296
326
|
|
|
@@ -389,7 +419,7 @@ function setStyle(options: PartialDeep<StyleOptions>): Promise<StyleReport>
|
|
|
389
419
|
|
|
390
420
|
See the [source code](https://github.com/kitschpatrol/yanki/blob/main/src/lib/index.ts) for additional exports and inline documentation.
|
|
391
421
|
|
|
392
|
-
## Advanced
|
|
422
|
+
## Advanced features
|
|
393
423
|
|
|
394
424
|
### Namespaces
|
|
395
425
|
|
|
@@ -496,7 +526,7 @@ Behind the scenes, Yanki creates new note type models to match the four default
|
|
|
496
526
|
|
|
497
527
|
Areas of improvement before a 1.0.0 release:
|
|
498
528
|
|
|
499
|
-
- [
|
|
529
|
+
- [x] Refine handling of duplicate note ID edge cases.
|
|
500
530
|
|
|
501
531
|
Possible features on the horizon:
|
|
502
532
|
|
|
@@ -512,7 +542,7 @@ Possible features on the horizon:
|
|
|
512
542
|
|
|
513
543
|
[@kitschpatrol](https://github.com/kitschpatrol)
|
|
514
544
|
|
|
515
|
-
##
|
|
545
|
+
## Acknowledgments
|
|
516
546
|
|
|
517
547
|
Thanks to Alex Yatskov for creating [Anki-Connect](https://foosoft.net/projects/anki-connect/).
|
|
518
548
|
|
package/dist/move-MN12aA4C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=Object.freeze({displayName:"Move",name:"move",patterns:[{include:"#address"},{include:"#comments"},{include:"#module"},{include:"#script"},{include:"#attributes"},{begin:"\\b(while)\\b",comment:"While experiment",name:"keyword.control.while.whaaat.move",while:"[a-z]"}],repository:{"=== DEPRECATED_BELOW ===":{},abilities:{comment:"Ability",match:"\\b(store|key|drop|copy)\\b",name:"support.type.ability.move"},address:{begin:"\\b(address)\\b",beginCaptures:{1:{name:"storage.modifier.type.address.keyword.move"}},comment:"Address block",end:"(?<=})",name:"meta.address_block.move",patterns:[{include:"#comments"},{begin:"(?<=address)",comment:"Address value/const",end:"(?=[{])",name:"meta.address.definition.move",patterns:[{include:"#comments"},{include:"#address_literal"},{comment:"Named Address",match:"\\b(\\w+)\\b",name:"entity.name.type.move"}]},{include:"#module"}]},as:{comment:"Keyword as (highlighted)",match:"\\b(as)\\b",name:"keyword.control.as.move"},"as-import":{comment:"Keyword as in import statement; not highlighted",match:"\\b(as)\\b",name:"meta.import.as.move"},attributes:{match:'#\\[(?:[\\w0-9=,_\\(\\)\\s"\\:=]+)\\]',name:"support.constant.attribute.move"},block:{begin:"{",comment:"Block expression or definition",end:"}",name:"meta.block.move",patterns:[{include:"#expr"}]},"block-comments":{comment:"Supported since https://github.com/diem/diem/pull/3714",patterns:[{begin:"/\\*[\\*!](?![\\*/])",comment:"Block documentation comment",end:"\\*/",name:"comment.block.documentation.move"},{begin:"/\\*",comment:"Block comment",end:"\\*/",name:"comment.block.move"}]},capitalized:{comment:"MyType - capitalized type name",match:"\\b([A-Z][a-zA-Z_0-9]*)\\b",name:"entity.name.type.use.move"},comments:{name:"meta.comments.move",patterns:[{include:"#doc-comments"},{include:"#line-comments"},{include:"#block-comments"}]},const:{begin:"\\b(const)\\b",beginCaptures:{1:{name:"storage.modifier.const.move"}},end:";",name:"meta.const.move",patterns:[{include:"#comments"},{include:"#primitives"},{include:"#literals"},{match:"\\b([\\w_]+)\\b",name:"constant.other.move"}]},control:{comment:"Control flow",match:"\\b(return|while|loop|if|else|break|continue|abort)\\b",name:"keyword.control.move"},"doc-comments":{begin:"///",comment:"Documentation comment",end:"$",name:"comment.block.documentation.move",patterns:[{captures:{1:{name:"markup.underline.link.move"}},comment:"Escaped member / link",match:"`(\\w+)`"}]},entry:{comment:"entry",match:"\\b(entry)\\b",name:"storage.modifier.visibility.entry.move"},enum:{begin:"\\b(enum)\\b",beginCaptures:{1:{name:"keyword.control.enum.move"}},comment:"Enum syntax",end:"(?<=})",name:"meta.enum.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#type_param"},{comment:"Enum name (ident)",match:"\\b[A-Z][a-zA-Z_0-9]*\\b",name:"entity.name.type.enum.move"},{include:"#has"},{include:"#abilities"},{begin:"{",end:"}",name:"meta.enum.definition.move",patterns:[{include:"#comments"},{begin:"\\(",end:"\\)",name:"meta.enum.tuple.move",patterns:[{include:"#comments"},{include:"#types"}]},{begin:"{",end:"}",name:"meta.enum.struct.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#types"}]}]}]},error_const:{match:"\\b(E[A-Z][A-Za-z_]*)\\b",name:"variable.language.error.move"},escaped_identifier:{begin:"`",comment:"Escaped variable",end:"`",name:"variable.language.escaped.move"},expr:{comment:"Aggregate Expression",name:"meta.expression.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#expr_generic"},{include:"#error_const"},{include:"#packed_field"},{include:"#import"},{include:"#as"},{include:"#mut"},{include:"#let"},{include:"#types"},{include:"#literals"},{include:"#control"},{include:"#move_copy"},{include:"#resource_methods"},{include:"#self_access"},{include:"#module_access"},{include:"#label"},{include:"#macro_call"},{include:"#local_call"},{include:"#method_call"},{include:"#path_access"},{match:"\\$(?=[a-z])",name:"keyword.operator.macro.dollar.move"},{match:"(?<=[$])[a-z][A-Z_0-9a-z]*",name:"variable.other.meta.move"},{comment:"ALL_CONST_CAPS",match:"\\b([A-Z][A-Z_]+)\\b",name:"constant.other.move"},{comment:"CustomType",match:"\\b([A-Z][a-zA-Z_0-9]*)\\b",name:"entity.name.type.move"},{include:"#paren"},{include:"#block"}]},expr_generic:{begin:"<(?=([\\sa-z_,0-9A-Z<>]+>))",comment:"< angle brackets >",end:">",name:"meta.expression.generic.type.move",patterns:[{include:"#comments"},{include:"#types"},{include:"#capitalized"},{include:"#expr_generic"}]},friend:{begin:"\\b(friend)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.friend.move",patterns:[{include:"#comments"},{include:"#address_literal"},{comment:"Name of the imported module",match:"\\b([a-zA-Z][A-Za-z_0-9]*)\\b",name:"entity.name.type.module.move"}]},fun:{patterns:[{include:"#fun_signature"},{include:"#block"}]},fun_body:{begin:"{",comment:"Function body",end:"(?<=})",name:"meta.fun_body.move",patterns:[{include:"#expr"}]},fun_call:{begin:"\\b(\\w+)\\s*(?:<[\\w\\s,]+>)?\\s*[(]",beginCaptures:{1:{name:"entity.name.function.call.move"}},comment:"Function call",end:"[)]",name:"meta.fun_call.move",patterns:[{include:"#comments"},{include:"#resource_methods"},{include:"#self_access"},{include:"#module_access"},{include:"#move_copy"},{include:"#literals"},{include:"#fun_call"},{include:"#block"},{include:"#mut"},{include:"#as"}]},fun_signature:{begin:"\\b(fun)\\b",beginCaptures:{1:{name:"storage.modifier.fun.move"}},comment:"Function signature",end:"(?=[;{])",name:"meta.fun_signature.move",patterns:[{include:"#comments"},{include:"#module_access"},{include:"#capitalized"},{include:"#types"},{include:"#mut"},{begin:"(?<=\\bfun)",comment:"Function name",end:"(?=[<(])",name:"meta.function_name.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{match:"\\b(\\w+)\\b",name:"entity.name.function.move"}]},{include:"#type_param"},{begin:"[(]",comment:"Parentheses",end:"[)]",name:"meta.parentheses.move",patterns:[{include:"#comments"},{include:"#self_access"},{include:"#expr_generic"},{include:"#escaped_identifier"},{include:"#module_access"},{include:"#capitalized"},{include:"#types"},{include:"#mut"}]},{comment:"Keyword acquires",match:"\\b(acquires)\\b",name:"storage.modifier"}]},has:{comment:"Has Abilities",match:"\\b(has)\\b",name:"keyword.control.ability.has.move"},has_ability:{begin:"(?<=[})])\\s+(has)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.has.ability.move",patterns:[{include:"#comments"},{include:"#abilities"}]},ident:{match:"\\b([a-zA-Z][A-Z_a-z0-9]*)\\b",name:"meta.identifier.move"},import:{begin:"\\b(use)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.import.move",patterns:[{include:"#comments"},{include:"#use_fun"},{include:"#address_literal"},{include:"#as-import"},{comment:"Uppercase entities",match:"\\b([A-Z]\\w*)\\b",name:"entity.name.type.move"},{begin:"{",comment:"Module members",end:"}",patterns:[{include:"#comments"},{include:"#as-import"},{comment:"Uppercase entities",match:"\\b([A-Z]\\w*)\\b",name:"entity.name.type.move"}]},{comment:"Name of the imported module",match:"\\b(\\w+)\\b",name:"meta.entity.name.type.module.move"}]},label:{comment:"Label",match:"'[a-z][a-z_0-9]*",name:"string.quoted.single.label.move"},let:{comment:"Keyword let",match:"\\b(let)\\b",name:"keyword.control.move"},"line-comments":{begin:"//",comment:"Single-line comment",end:"$",name:"comment.line.double-slash.move"},literals:{comment:"Literals supported in Move",name:"meta.literal.move",patterns:[{comment:"base16 address literal",match:"@0x[A-F0-9a-f]+",name:"support.constant.address.base16.move"},{comment:"named address literal @[ident]",match:"@[a-zA-Z][a-zA-Z_0-9]*",name:"support.constant.address.name.move"},{comment:"Hex literal",match:"0x[_a-fA-F0-9]+(?:u(?:8|16|32|64|128|256))?",name:"constant.numeric.hex.move"},{comment:"Numeric literal",match:"(?<!(?:\\w|(?:(?<!\\.)\\.)))[0-9][_0-9]*(?:\\.(?!\\.)(?:[0-9][_0-9]*)?)?(?:[eE][+\\-]?[_0-9]+)?(?:[u](?:8|16|32|64|128|256))?",name:"constant.numeric.move"},{begin:'\\bb"',comment:"vector ascii bytestring literal",end:'"',name:"meta.vector.literal.ascii.move",patterns:[{comment:"character escape",match:"\\\\.",name:"constant.character.escape.move"},{comment:"Special symbol escape",match:'\\\\[nrt\\0"]',name:"constant.character.escape.move"},{comment:"HEX Escape",match:"\\\\x[a-fA-F0-9][A-Fa-f0-9]",name:"constant.character.escape.hex.move"},{comment:"ASCII Character",match:"[\\x00-\\x7F]",name:"string.quoted.double.raw.move"}]},{begin:'x"',comment:"vector hex literal",end:'"',name:"meta.vector.literal.hex.move",patterns:[{comment:"vector hex literal",match:"[A-Fa-f0-9]+",name:"constant.character.move"}]},{comment:"bool literal",match:"\\b(?:true|false)\\b",name:"constant.language.boolean.move"},{begin:"vector\\[",comment:"vector literal (macro?)",end:"\\]",name:"meta.vector.literal.macro.move",patterns:[{include:"#expr"}]}]},local_call:{comment:"call to a local / imported fun",match:"\\b([a-z][_a-z0-9]*)(?=[<\\(])",name:"entity.name.function.call.local.move"},macro:{begin:"\\b(macro)\\b",beginCaptures:{1:{name:"keyword.control.macro.move"}},comment:"macro fun [ident] {}",end:"(?<=})",name:"meta.macro.move",patterns:[{include:"#comments"},{include:"#fun"}]},macro_call:{captures:{2:{name:"support.function.macro.move"}},comment:"Macro fun call",match:"(\\b|\\.)([a-z][A-Za-z0-9_]*)!",name:"meta.macro.call"},method_call:{captures:{1:{name:"entity.name.function.call.path.move"}},comment:"<expr>.[ident]<>?() call",match:"\\.([a-z][_a-z0-9]*)(?=[<\\(])",name:"meta.path.call.move"},module:{begin:"\\b(module|spec)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},comment:"Module definition",end:"(?<=})",name:"meta.module.move",patterns:[{include:"#comments"},{begin:"(?<=(module|spec))",comment:"Module name",end:"(?={)",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{begin:"(?<=\\b(module|spec))",comment:"Module namespace / address",end:"(?=[(::){])",name:"constant.other.move"},{begin:"(?<=::)",comment:"Module name",end:"(?=[\\s{])",name:"entity.name.type.move"}]},{begin:"{",comment:"Module scope",end:"}",name:"meta.module_scope.move",patterns:[{include:"#comments"},{include:"#attributes"},{include:"#entry"},{include:"#public-scope"},{include:"#public"},{include:"#native"},{include:"#import"},{include:"#friend"},{include:"#const"},{include:"#struct"},{include:"#has_ability"},{include:"#enum"},{include:"#macro"},{include:"#fun"},{include:"#spec"}]}]},module_access:{captures:{1:{name:"meta.entity.name.type.accessed.module.move"},2:{name:"entity.name.function.call.move"}},comment:"Use of module type or method",match:"\\b(\\w+)::(\\w+)\\b",name:"meta.module_access.move"},move_copy:{comment:"Keywords move and copy",match:"\\b(move|copy)\\b",name:"variable.language.move"},mut:{comment:"Mutable reference and let mut",match:"\\b(mut)\\b",name:"storage.modifier.mut.move"},native:{comment:"native",match:"\\b(native)\\b",name:"storage.modifier.visibility.native.move"},packed_field:{comment:"[ident]: ",match:"[a-z][a-z0-9_]+\\s*:\\s*(?=\\s)",name:"meta.struct.field.move"},paren:{begin:"\\(",end:"\\)",name:"meta.paren.move",patterns:[{include:"#expr"}]},path_access:{comment:"<expr>.[ident] access",match:"\\.[a-z][_a-z0-9]*\\b",name:"meta.path.access.move"},phantom:{comment:"Keyword phantom inside type parameters",match:"\\b(phantom)\\b",name:"keyword.control.phantom.move"},primitives:{comment:"Primitive types",match:"\\b(u8|u16|u32|u64|u128|u256|address|bool|signer)\\b",name:"support.type.primitives.move"},public:{comment:"public",match:"\\b(public)\\b",name:"storage.modifier.visibility.public.move"},"public-scope":{begin:"(?<=\\b(public))\\s*\\(",comment:"public (friend/script/package)",end:"\\)",name:"meta.public.scoped.move",patterns:[{include:"#comments"},{match:"\\b(friend|script|package)\\b",name:"keyword.control.public.scope.move"}]},resource_methods:{comment:"Methods to work with resource",match:"\\b(borrow_global|borrow_global_mut|exists|move_from|move_to_sender|move_to)\\b",name:"support.function.typed.move"},script:{begin:"\\b(script)\\b",beginCaptures:{1:{name:"storage.modifier.script.move"}},end:"(?<=})",name:"meta.script.move",patterns:[{include:"#comments"},{begin:"{",comment:"Script scope",end:"}",name:"meta.script_scope.move",patterns:[{include:"#const"},{include:"#comments"},{include:"#import"},{include:"#fun"}]}]},self_access:{captures:{1:{name:"variable.language.self.move"},2:{name:"entity.name.function.call.move"}},comment:"Use of Self",match:"\\b(Self)::(\\w+)\\b",name:"meta.self_access.move"},spec:{begin:"\\b(spec)\\b",beginCaptures:{1:{name:"storage.modifier.spec.move"}},end:"(?<=[;}])",name:"meta.spec.move",patterns:[{comment:"Spec target",match:"\\b(module|schema|struct|fun)",name:"storage.modifier.spec.target.move"},{comment:"Spec define inline",match:"\\b(define)",name:"storage.modifier.spec.define.move"},{comment:"Target name",match:"\\b(\\w+)\\b",name:"entity.name.function.move"},{begin:"{",comment:"Spec block",end:"}",patterns:[{include:"#comments"},{include:"#spec_block"},{include:"#spec_types"},{include:"#spec_define"},{include:"#spec_keywords"},{include:"#control"},{include:"#fun_call"},{include:"#literals"},{include:"#types"},{include:"#let"}]}]},spec_block:{begin:"{",comment:"Spec block",end:"}",name:"meta.spec_block.move",patterns:[{include:"#comments"},{include:"#spec_block"},{include:"#spec_types"},{include:"#fun_call"},{include:"#literals"},{include:"#control"},{include:"#types"},{include:"#let"}]},spec_define:{begin:"\\b(define)\\b",beginCaptures:{1:{name:"keyword.control.move.spec"}},comment:"Spec define keyword",end:"(?=[;{])",name:"meta.spec_define.move",patterns:[{include:"#comments"},{include:"#spec_types"},{include:"#types"},{begin:"(?<=\\bdefine)",comment:"Function name",end:"(?=[(])",patterns:[{include:"#comments"},{match:"\\b(\\w+)\\b",name:"entity.name.function.move"}]}]},spec_keywords:{match:"\\b(global|pack|unpack|pragma|native|include|ensures|requires|invariant|apply|aborts_if|modifies)\\b",name:"keyword.control.move.spec"},spec_types:{comment:"Spec-only types",match:"\\b(range|num|vector|bool|u8|u16|u32|u64|u128|u256|address)\\b",name:"support.type.vector.move"},struct:{begin:"\\b(struct)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:"(?<=[};\\)])",name:"meta.struct.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#has"},{include:"#abilities"},{comment:"Struct name (ident)",match:"\\b[A-Z][a-zA-Z_0-9]*\\b",name:"entity.name.type.struct.move"},{begin:"\\(",comment:"Positional fields",end:"\\)",name:"meta.struct.paren.move",patterns:[{include:"#comments"},{include:"#capitalized"},{include:"#types"}]},{include:"#type_param"},{begin:"\\(",comment:"Simple struct",end:"(?<=[)])",name:"meta.struct.paren.move",patterns:[{include:"#comments"},{include:"#types"}]},{begin:"{",comment:"Struct body",end:"}",name:"meta.struct.body.move",patterns:[{include:"#comments"},{include:"#self_access"},{include:"#escaped_identifier"},{include:"#module_access"},{include:"#expr_generic"},{include:"#capitalized"},{include:"#types"}]},{include:"#has_ability"}]},struct_pack:{begin:"(?<=[A-Za-z0-9_>])\\s*{",comment:"Struct { field: value... }; identified as generic / ident followed by curly's",end:"}",name:"meta.struct.pack.move",patterns:[{include:"#comments"}]},type_param:{begin:"<",comment:"Generic type param",end:">",name:"meta.generic_param.move",patterns:[{include:"#comments"},{include:"#phantom"},{include:"#capitalized"},{include:"#module_access"},{include:"#abilities"}]},types:{comment:"Built-in types + vector",name:"meta.types.move",patterns:[{include:"#primitives"},{include:"#vector"}]},use_fun:{begin:"\\b(fun)\\b",beginCaptures:{1:{name:"storage.modifier.fun.move"}},comment:"use { fun } internals",end:"(?=;)",name:"meta.import.fun.move",patterns:[{include:"#comments"},{comment:"as keyword",match:"\\b(as)\\b",name:"keyword.control.as.move"},{comment:"Self keyword",match:"\\b(Self)\\b",name:"variable.language.self.use.fun.move"},{comment:"Function name",match:"\\b(_______[a-z][a-z_0-9]+)\\b",name:"entity.name.function.use.move"},{include:"#types"},{include:"#escaped_identifier"},{include:"#capitalized"}]},vector:{comment:"vector type",match:"\\b(vector)\\b",name:"support.type.vector.move"}},scopeName:"source.move"});var n=[e];export{n as default};
|
package/dist/pascal-B6ZnTe72.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=Object.freeze({displayName:"Pascal",fileTypes:["pas","p","pp","dfm","fmx","dpr","dpk","lfm","lpr"],name:"pascal",patterns:[{match:"\\b(?i:(absolute|abstract|add|all|and_then|array|as|asc|asm|assembler|async|attribute|autoreleasepool|await|begin|bindable|block|by|case|cdecl|class|concat|const|constref|copy|cppdecl|contains|default|delegate|deprecated|desc|distinct|div|each|else|empty|end|ensure|enum|equals|event|except|export|exports|extension|external|far|file|finalization|finalizer|finally|flags|forward|from|future|generic|goto|group|has|helper|if|implements|implies|import|in|index|inherited|initialization|inline|interrupt|into|invariants|is|iterator|label|library|join|lazy|lifetimestrategy|locked|locking|loop|mapped|matching|method|mod|module|name|namespace|near|nested|new|nostackframe|not|notify|nullable|object|of|old|oldfpccall|on|only|operator|optional|or_else|order|otherwise|out|override|package|packed|parallel|params|partial|pascal|pinned|platform|pow|private|program|protected|public|published|interface|implementation|qualified|queryable|raises|read|readonly|record|reference|register|remove|resident|require|requires|resourcestring|restricted|result|reverse|safecall|sealed|segment|select|selector|sequence|set|shl|shr|skip|specialize|soft|static|stored|stdcall|step|strict|strong|take|then|threadvar|to|try|tuple|type|unconstrained|unit|unmanaged|unretained|unsafe|uses|using|var|view|virtual|volatile|weak|dynamic|overload|reintroduce|where|with|write|xor|yield))\\b",name:"keyword.pascal"},{captures:{1:{name:"storage.type.prototype.pascal"},2:{name:"entity.name.function.prototype.pascal"}},match:"\\b(?i:(function|procedure|constructor|destructor))\\b\\s+(\\w+(\\.\\w+)?)(\\(.*?\\))?;\\s*(?=(?i:attribute|forward|external))",name:"meta.function.prototype.pascal"},{captures:{1:{name:"storage.type.function.pascal"},2:{name:"entity.name.function.pascal"}},match:"\\b(?i:(function|procedure|constructor|destructor|property|read|write))\\b\\s+(\\w+(\\.\\w+)?)",name:"meta.function.pascal"},{match:"\\b(?i:(self|result))\\b",name:"token.variable"},{match:"\\b(?i:(and|or))\\b",name:"keyword.operator.pascal"},{match:"\\b(?i:(break|continue|exit|abort|while|do|downto|for|raise|repeat|until))\\b",name:"keyword.control.pascal"},{begin:"\\{\\$",captures:{0:{name:"string.regexp"}},end:"\\}",name:"string.regexp"},{match:"\\b(?i:(ansichar|ansistring|boolean|byte|cardinal|char|comp|currency|double|dword|extended|file|integer|int8|int16|int32|int64|longint|longword|nativeint|nativeuint|olevariant|pansichar|pchar|pwidechar|pointer|real|shortint|shortstring|single|smallint|string|uint8|uint16|uint32|uint64|variant|widechar|widestring|word|wordbool|uintptr|intptr))\\b",name:"storage.support.type.pascal"},{match:"\\b(\\d+)|(\\d*\\.\\d+([eE][\\-+]?\\d+)?)\\b",name:"constant.numeric.pascal"},{match:"\\$[0-9a-fA-F]{1,16}\\b",name:"constant.numeric.hex.pascal"},{match:"\\b(?i:(true|false|nil))\\b",name:"constant.language.pascal"},{match:"\\b(?i:(Assert))\\b",name:"keyword.control"},{begin:"(^[ \\t]+)?(?=//)",beginCaptures:{1:{name:"punctuation.whitespace.comment.leading.pascal"}},end:"(?!\\G)",patterns:[{begin:"//",beginCaptures:{0:{name:"punctuation.definition.comment.pascal"}},end:"\\n",name:"comment.line.double-slash.pascal.two"}]},{begin:"\\(\\*",captures:{0:{name:"punctuation.definition.comment.pascal"}},end:"\\*\\)",name:"comment.block.pascal.one"},{begin:"\\{(?!\\$)",captures:{0:{name:"punctuation.definition.comment.pascal"}},end:"\\}",name:"comment.block.pascal.two"},{begin:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin.pascal"}},end:"'",endCaptures:{0:{name:"punctuation.definition.string.end.pascal"}},name:"string.quoted.single.pascal",patterns:[{match:"''",name:"constant.character.escape.apostrophe.pascal"}]},{match:"\\#\\d+",name:"string.other.pascal"}],scopeName:"source.pascal"});var a=[e];export{a as default};
|