yanki 0.2.3 → 0.2.4
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 +1 -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-ESy7H_HY.js} +150 -149
- package/package.json +9 -9
- package/readme.md +23 -3
- package/dist/move-MN12aA4C.js +0 -1
- package/dist/pascal-B6ZnTe72.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Object.freeze({displayName:"ActionScript",fileTypes:["as"],name:"actionscript-3",patterns:[{include:"#comments"},{include:"#package"},{include:"#class"},{include:"#interface"},{include:"#namespace_declaration"},{include:"#import"},{include:"#mxml"},{include:"#strings"},{include:"#regexp"},{include:"#variable_declaration"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#logical_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#control_keywords"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#functions"}],repository:{arithmetic_operators:{match:"(\\+|\\-|/|%|(?<!:)\\*)",name:"keyword.operator.actionscript.3"},array_access_operators:{match:"(\\[|\\])",name:"keyword.operator.actionscript.3"},class:{begin:"(?x) (^|\\s+|;) (\\b(dynamic|final|abstract)\\b\\s+)? (\\b(internal|public)\\b\\s+)? (\\b(dynamic|final|abstract)\\b\\s+)? (?=\\bclass\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"},5:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"}},end:"\\}",name:"meta.class.actionscript.3",patterns:[{include:"#class_declaration"},{include:"#metadata"},{include:"#method"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#other_operators"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#arithmetic_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#variable_declaration"},{include:"#object_literal"}]},class_declaration:{begin:"(?x) \\b(class)\\b \\s+ ([\\.\\w]+|\\*)",beginCaptures:{1:{name:"storage.type.class.actionscript.3"},2:{name:"entity.name.class.actionscript.3"}},end:"\\{",name:"meta.class_declaration.actionscript.3",patterns:[{include:"#extends"},{include:"#implements"},{include:"#comments"}]},code_block:{begin:"\\{",end:"\\}",name:"meta.code_block.actionscript.3",patterns:[{include:"#code_block"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#variable_declaration"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#logical_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#control_keywords"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#functions"},{include:"#import"}]},comments:{patterns:[{begin:"/\\*\\*(?!/)",end:"\\*/",name:"comment.block.documentation.actionscript.3",patterns:[{match:"@(copy|default|eventType|example|exampleText|includeExample|inheritDoc|internal|param|private|return|see|since|throws)\\b",name:"keyword.other.documentation.actionscript.3.asdoc"}]},{begin:"/\\*",end:"\\*/",name:"comment.block.actionscript.3"},{match:"//.*",name:"comment.line.actionscript.3"}]},control_keywords:{match:"\\b(if|else|do|while|for|each|continue|return|switch|case|default|break|try|catch|finally|throw|with)\\b",name:"keyword.control.actionscript.3"},dynamic_type:{captures:{1:{name:"support.type.actionscript.3"}},match:"(?<=:)\\s*(\\*)"},escapes:{match:"\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)",name:"constant.character.escape.actionscript.3"},extends:{captures:{1:{name:"keyword.other.actionscript.3"},2:{name:"entity.other.inherited-class.actionscript.3"},3:{name:"entity.other.inherited-class.actionscript.3"}},match:"(?x) \\b(extends)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*",name:"meta.extends.actionscript.3"},function_arguments:{begin:"\\(",end:"\\)",name:"meta.function_arguments.actionscript.3",patterns:[{include:"#parameters"},{include:"#comments"}]},functions:{begin:"(?x) \\b(function)\\b (?:\\s+\\b(get|set)\\b\\s+)? \\s* ([a-zA-Z0-9_\\$]+\\b)?",beginCaptures:{1:{name:"storage.type.function.actionscript.3"},2:{name:"storage.modifier.actionscript.3"},3:{name:"entity.name.function.actionscript.3"}},end:"($|;|(?=\\{))",name:"meta.function.actionscript.3",patterns:[{include:"#function_arguments"},{include:"#return_type"},{include:"#comments"}]},guess_constant:{captures:{1:{name:"constant.other.actionscript.3"}},comment:"Following convention, let's guess that anything in all caps/digits (possible underscores) is a constant.",match:"\\b([A-Z\\$][A-Z0-9_]+)\\b"},guess_type:{captures:{1:{name:"support.type.actionscript.3"}},comment:"Following convention, let's guess that any word starting with one or more capital letters (that contains at least some lower-case letters so that constants aren't detected) refers to a class/type. May be fully-qualified.",match:"\\b((?:[A-Za-z0-9_\\$]+\\.)*[A-Z][A-Z0-9]*[a-z]+[A-Za-z0-9_\\$]*)\\b"},implements:{captures:{1:{name:"keyword.other.actionscript.3"},2:{name:"entity.other.inherited-class.actionscript.3"},3:{name:"entity.other.inherited-class.actionscript.3"}},match:"(?x) \\b(implements)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*",name:"meta.implements.actionscript.3"},import:{captures:{2:{name:"keyword.control.import.actionscript.3"},3:{name:"support.type.actionscript.3"}},match:"(?x) (^|\\s+|;) \\b(import)\\b \\s+ ([A-Za-z0-9\\$_\\.]+(?:\\.\\*)?) \\s* (?=;|$)",name:"meta.import.actionscript.3"},interface:{begin:"(?x) (^|\\s+|;) (\\b(internal|public)\\b\\s+)? (?=\\binterface\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"}},end:"\\}",name:"meta.interface.actionscript.3",patterns:[{include:"#interface_declaration"},{include:"#metadata"},{include:"#functions"},{include:"#comments"}]},interface_declaration:{begin:"(?x) \\b(interface)\\b \\s+ ([\\.\\w]+)",beginCaptures:{1:{name:"storage.type.interface.actionscript.3"},2:{name:"entity.name.class.actionscript.3"}},end:"\\{",name:"meta.class_declaration.actionscript.3",patterns:[{include:"#extends"},{include:"#comments"}]},language_constants:{match:"\\b(true|false|null|Infinity|-Infinity|NaN|undefined)\\b",name:"constant.language.actionscript.3"},language_variables:{match:"\\b(super|this|arguments)\\b",name:"variable.language.actionscript.3"},logical_operators:{match:"(&|<|~|\\||>|\\^|!|\\?)",name:"keyword.operator.actionscript.3"},metadata:{begin:"\\[\\s*\\b(\\w+)\\b",beginCaptures:{1:{name:"keyword.other.actionscript.3"}},end:"\\]",name:"meta.metadata_info.actionscript.3",patterns:[{include:"#metadata_info"}]},metadata_info:{begin:"\\(",end:"\\)",patterns:[{include:"#strings"},{captures:{1:{name:"variable.parameter.actionscript.3"},2:{name:"keyword.operator.actionscript.3"}},match:"(\\w+)\\s*(=)"}]},method:{begin:"(?x) (^|\\s+) ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? (?=\\bfunction\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"},5:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"},8:{name:"storage.modifier.actionscript.3"}},end:"(?<=(;|\\}))",name:"meta.method.actionscript.3",patterns:[{include:"#functions"},{include:"#code_block"}]},mxml:{begin:"<!\\[CDATA\\[",end:"\\]\\]>",name:"meta.cdata.actionscript.3",patterns:[{include:"#comments"},{include:"#import"},{include:"#metadata"},{include:"#class"},{include:"#namespace_declaration"},{include:"#use_namespace"},{include:"#class_declaration"},{include:"#method"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#other_keywords"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#variable_declaration"}]},namespace_declaration:{captures:{2:{name:"storage.modifier.actionscript.3"},3:{name:"storage.modifier.actionscript.3"}},match:"(?x) ((\\w+)\\s+)? (namespace) \\s+ (?:[A-Za-z0-9_\\$]+)",name:"meta.namespace_declaration.actionscript.3"},numbers:{match:"\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b",name:"constant.numeric.actionscript.3"},object_literal:{begin:"\\{",end:"\\}",name:"meta.object_literal.actionscript.3",patterns:[{include:"#object_literal"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#functions"}]},other_keywords:{match:"\\b(as|delete|in|instanceof|is|native|new|to|typeof)\\b",name:"keyword.other.actionscript.3"},other_operators:{match:"(\\.|=)",name:"keyword.operator.actionscript.3"},package:{begin:"(^|\\s+)(package)\\b",beginCaptures:{2:{name:"keyword.other.actionscript.3"}},end:"\\}",name:"meta.package.actionscript.3",patterns:[{include:"#package_name"},{include:"#variable_declaration"},{include:"#method"},{include:"#comments"},{include:"#return_type"},{include:"#import"},{include:"#use_namespace"},{include:"#strings"},{include:"#numbers"},{include:"#language_constants"},{include:"#metadata"},{include:"#class"},{include:"#interface"},{include:"#namespace_declaration"}]},package_name:{begin:"(?<=package)\\s+([\\w\\._]*)\\b",end:"\\{",name:"meta.package_name.actionscript.3"},parameters:{begin:"(\\.\\.\\.)?\\s*([A-Za-z\\_\\$][A-Za-z0-9_\\$]*)(?:\\s*(\\:)\\s*(?:(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)))?(?:\\s*(=))?",beginCaptures:{1:{name:"keyword.operator.actionscript.3"},2:{name:"variable.parameter.actionscript.3"},3:{name:"keyword.operator.actionscript.3"},4:{name:"support.type.actionscript.3"},5:{name:"support.type.actionscript.3"},6:{name:"support.type.actionscript.3"},7:{name:"keyword.operator.actionscript.3"}},end:",|(?=\\))",patterns:[{include:"#strings"},{include:"#numbers"},{include:"#language_constants"},{include:"#comments"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#guess_type"},{include:"#guess_constant"}]},primitive_error_types:{captures:{1:{name:"support.class.error.actionscript.3"}},match:"\\b((Argument|Definition|Eval|Internal|Range|Reference|Security|Syntax|Type|URI|Verify)?Error)\\b"},primitive_functions:{captures:{1:{name:"support.function.actionscript.3"}},match:"\\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|isFinite|isNaN|isXMLName|parseFloat|parseInt|trace|unescape)(?=\\s*\\()"},primitive_types:{captures:{1:{name:"support.class.builtin.actionscript.3"}},match:"\\b(Array|Boolean|Class|Date|Function|int|JSON|Math|Namespace|Number|Object|QName|RegExp|String|uint|Vector|XML|XMLList|\\*(?<=a))\\b"},regexp:{begin:"(?<=[=(:,\\[]|^|return|&&|\\|\\||!)\\s*(/)(?![/*+{}?])",end:"$|(/)[igm]*",name:"string.regex.actionscript.3",patterns:[{match:"\\\\.",name:"constant.character.escape.actionscript.3"},{match:"\\[(\\\\\\]|[^\\]])*\\]",name:"constant.character.class.actionscript.3"}]},return_type:{captures:{1:{name:"keyword.operator.actionscript.3"},2:{name:"support.type.actionscript.3"},3:{name:"support.type.actionscript.3"},4:{name:"support.type.actionscript.3"}},match:"(\\:)\\s*(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)"},strings:{patterns:[{begin:'"',end:'"',name:"string.quoted.double.actionscript.3",patterns:[{include:"#escapes"}]},{begin:"'",end:"'",name:"string.quoted.single.actionscript.3",patterns:[{include:"#escapes"}]}]},use_namespace:{captures:{2:{name:"keyword.other.actionscript.3"},3:{name:"keyword.other.actionscript.3"},4:{name:"storage.modifier.actionscript.3"}},match:"(?x) (^|\\s+|;) (use\\s+)? (namespace) \\s+ (\\w+) \\s* (;|$)"},variable_declaration:{captures:{2:{name:"storage.modifier.actionscript.3"},4:{name:"storage.modifier.actionscript.3"},6:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"},8:{name:"keyword.operator.actionscript.3"}},match:"(?x) ((static)\\s+)? ((\\w+)\\s+)? ((static)\\s+)? (const|var) \\s+ (?:[A-Za-z0-9_\\$]+)(?:\\s*(:))?",name:"meta.variable_declaration.actionscript.3"},vector_creation_operators:{match:"(<|>)",name:"keyword.operator.actionscript.3"}},scopeName:"source.actionscript.3"});var t=[e];export{t as default};
|
|
1
|
+
const e=Object.freeze({displayName:"ActionScript",fileTypes:["as"],name:"actionscript-3",patterns:[{include:"#comments"},{include:"#package"},{include:"#class"},{include:"#interface"},{include:"#namespace_declaration"},{include:"#import"},{include:"#mxml"},{include:"#strings"},{include:"#regexp"},{include:"#variable_declaration"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#logical_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#control_keywords"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#functions"}],repository:{arithmetic_operators:{match:"(\\+|\\-|/|%|(?<!:)\\*)",name:"keyword.operator.actionscript.3"},array_access_operators:{match:"(\\[|\\])",name:"keyword.operator.actionscript.3"},class:{begin:"(?x) (^|\\s+|;) (\\b(dynamic|final|abstract)\\b\\s+)? (\\b(internal|public)\\b\\s+)? (\\b(dynamic|final|abstract)\\b\\s+)? (?=\\bclass\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"},5:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"}},end:"\\}",name:"meta.class.actionscript.3",patterns:[{include:"#class_declaration"},{include:"#metadata"},{include:"#method"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#other_operators"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#arithmetic_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#variable_declaration"},{include:"#object_literal"}]},class_declaration:{begin:"(?x) \\b(class)\\b \\s+ ([\\.\\w]+|\\*)",beginCaptures:{1:{name:"storage.type.class.actionscript.3"},2:{name:"entity.name.class.actionscript.3"}},end:"\\{",name:"meta.class_declaration.actionscript.3",patterns:[{include:"#extends"},{include:"#implements"},{include:"#comments"}]},code_block:{begin:"\\{",end:"\\}",name:"meta.code_block.actionscript.3",patterns:[{include:"#code_block"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#variable_declaration"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#logical_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#control_keywords"},{include:"#other_keywords"},{include:"#use_namespace"},{include:"#functions"},{include:"#import"}]},comments:{patterns:[{begin:"/\\*\\*(?!/)",end:"\\*/",name:"comment.block.documentation.actionscript.3",patterns:[{match:"@(copy|default|eventType|example|exampleText|includeExample|inheritDoc|internal|param|private|return|see|since|throws)\\b",name:"keyword.other.documentation.actionscript.3.asdoc"}]},{begin:"/\\*",end:"\\*/",name:"comment.block.actionscript.3"},{match:"//.*",name:"comment.line.actionscript.3"}]},control_keywords:{match:"\\b(if|else|do|while|for|each|continue|return|switch|case|default|break|try|catch|finally|throw|with)\\b",name:"keyword.control.actionscript.3"},dynamic_type:{captures:{1:{name:"support.type.actionscript.3"}},match:"(?<=:)\\s*(\\*)"},escapes:{match:"\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)",name:"constant.character.escape.actionscript.3"},extends:{captures:{1:{name:"keyword.other.actionscript.3"},2:{name:"entity.other.inherited-class.actionscript.3"},3:{name:"entity.other.inherited-class.actionscript.3"}},match:"(?x) \\b(extends)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*",name:"meta.extends.actionscript.3"},function_arguments:{begin:"\\(",end:"\\)",name:"meta.function_arguments.actionscript.3",patterns:[{include:"#parameters"},{include:"#comments"}]},functions:{begin:"(?x) \\b(function)\\b (?:\\s+\\b(get|set)\\b\\s+)? \\s* ([a-zA-Z0-9_\\$]+\\b)?",beginCaptures:{1:{name:"storage.type.function.actionscript.3"},2:{name:"storage.modifier.actionscript.3"},3:{name:"entity.name.function.actionscript.3"}},end:"($|;|(?=\\{))",name:"meta.function.actionscript.3",patterns:[{include:"#function_arguments"},{include:"#return_type"},{include:"#comments"}]},guess_constant:{captures:{1:{name:"constant.other.actionscript.3"}},comment:"Following convention, let's guess that anything in all caps/digits (possible underscores) is a constant.",match:"\\b([A-Z\\$][A-Z0-9_]+)\\b"},guess_type:{captures:{1:{name:"support.type.actionscript.3"}},comment:"Following convention, let's guess that any word starting with one or more capital letters (that contains at least some lower-case letters so that constants aren't detected) refers to a class/type. May be fully-qualified.",match:"\\b((?:[A-Za-z0-9_\\$]+\\.)*[A-Z][A-Z0-9]*[a-z]+[A-Za-z0-9_\\$]*)\\b"},implements:{captures:{1:{name:"keyword.other.actionscript.3"},2:{name:"entity.other.inherited-class.actionscript.3"},3:{name:"entity.other.inherited-class.actionscript.3"}},match:"(?x) \\b(implements)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*",name:"meta.implements.actionscript.3"},import:{captures:{2:{name:"keyword.control.import.actionscript.3"},3:{name:"support.type.actionscript.3"}},match:"(?x) (^|\\s+|;) \\b(import)\\b \\s+ ([A-Za-z0-9\\$_\\.]+(?:\\.\\*)?) \\s* (?=;|$)",name:"meta.import.actionscript.3"},interface:{begin:"(?x) (^|\\s+|;) (\\b(internal|public)\\b\\s+)? (?=\\binterface\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"}},end:"\\}",name:"meta.interface.actionscript.3",patterns:[{include:"#interface_declaration"},{include:"#metadata"},{include:"#functions"},{include:"#comments"}]},interface_declaration:{begin:"(?x) \\b(interface)\\b \\s+ ([\\.\\w]+)",beginCaptures:{1:{name:"storage.type.interface.actionscript.3"},2:{name:"entity.name.class.actionscript.3"}},end:"\\{",name:"meta.class_declaration.actionscript.3",patterns:[{include:"#extends"},{include:"#comments"}]},language_constants:{match:"\\b(true|false|null|Infinity|-Infinity|NaN|undefined)\\b",name:"constant.language.actionscript.3"},language_variables:{match:"\\b(super|this|arguments)\\b",name:"variable.language.actionscript.3"},logical_operators:{match:"(&|<|~|\\||>|\\^|!|\\?)",name:"keyword.operator.actionscript.3"},metadata:{begin:"\\[\\s*\\b(\\w+)\\b",beginCaptures:{1:{name:"keyword.other.actionscript.3"}},end:"\\]",name:"meta.metadata_info.actionscript.3",patterns:[{include:"#metadata_info"}]},metadata_info:{begin:"\\(",end:"\\)",patterns:[{include:"#strings"},{captures:{1:{name:"variable.parameter.actionscript.3"},2:{name:"keyword.operator.actionscript.3"}},match:"(\\w+)\\s*(=)"}]},method:{begin:"(?x) (^|\\s+) ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? (?=\\bfunction\\b)",beginCaptures:{3:{name:"storage.modifier.actionscript.3"},5:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"},8:{name:"storage.modifier.actionscript.3"}},end:"(?<=(;|\\}))",name:"meta.method.actionscript.3",patterns:[{include:"#functions"},{include:"#code_block"}]},mxml:{begin:"<!\\[CDATA\\[",end:"\\]\\]>",name:"meta.cdata.actionscript.3",patterns:[{include:"#comments"},{include:"#import"},{include:"#metadata"},{include:"#class"},{include:"#namespace_declaration"},{include:"#use_namespace"},{include:"#class_declaration"},{include:"#method"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#other_keywords"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#other_operators"},{include:"#arithmetic_operators"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#variable_declaration"}]},namespace_declaration:{captures:{2:{name:"storage.modifier.actionscript.3"},3:{name:"storage.modifier.actionscript.3"}},match:"(?x) ((\\w+)\\s+)? (namespace) \\s+ (?:[A-Za-z0-9_\\$]+)",name:"meta.namespace_declaration.actionscript.3"},numbers:{match:"\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b",name:"constant.numeric.actionscript.3"},object_literal:{begin:"\\{",end:"\\}",name:"meta.object_literal.actionscript.3",patterns:[{include:"#object_literal"},{include:"#comments"},{include:"#strings"},{include:"#regexp"},{include:"#numbers"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#primitive_functions"},{include:"#language_constants"},{include:"#language_variables"},{include:"#guess_type"},{include:"#guess_constant"},{include:"#array_access_operators"},{include:"#vector_creation_operators"},{include:"#functions"}]},other_keywords:{match:"\\b(as|delete|in|instanceof|is|native|new|to|typeof)\\b",name:"keyword.other.actionscript.3"},other_operators:{match:"(\\.|=)",name:"keyword.operator.actionscript.3"},package:{begin:"(^|\\s+)(package)\\b",beginCaptures:{2:{name:"keyword.other.actionscript.3"}},end:"\\}",name:"meta.package.actionscript.3",patterns:[{include:"#package_name"},{include:"#variable_declaration"},{include:"#method"},{include:"#comments"},{include:"#return_type"},{include:"#import"},{include:"#use_namespace"},{include:"#strings"},{include:"#numbers"},{include:"#language_constants"},{include:"#metadata"},{include:"#class"},{include:"#interface"},{include:"#namespace_declaration"}]},package_name:{begin:"(?<=package)\\s+([\\w\\._]*)\\b",end:"\\{",name:"meta.package_name.actionscript.3"},parameters:{begin:"(\\.\\.\\.)?\\s*([A-Za-z\\_\\$][A-Za-z0-9_\\$]*)(?:\\s*(\\:)\\s*(?:(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)))?(?:\\s*(=))?",beginCaptures:{1:{name:"keyword.operator.actionscript.3"},2:{name:"variable.parameter.actionscript.3"},3:{name:"keyword.operator.actionscript.3"},4:{name:"support.type.actionscript.3"},5:{name:"support.type.actionscript.3"},6:{name:"support.type.actionscript.3"},7:{name:"keyword.operator.actionscript.3"}},end:",|(?=\\))",patterns:[{include:"#strings"},{include:"#numbers"},{include:"#language_constants"},{include:"#comments"},{include:"#primitive_types"},{include:"#primitive_error_types"},{include:"#dynamic_type"},{include:"#guess_type"},{include:"#guess_constant"}]},primitive_error_types:{captures:{1:{name:"support.class.error.actionscript.3"}},match:"\\b((Argument|Definition|Eval|Internal|Range|Reference|Security|Syntax|Type|URI|Verify)?Error)\\b"},primitive_functions:{captures:{1:{name:"support.function.actionscript.3"}},match:"\\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|isFinite|isNaN|isXMLName|parseFloat|parseInt|trace|unescape)(?=\\s*\\()"},primitive_types:{captures:{1:{name:"support.class.builtin.actionscript.3"}},match:"\\b(Array|Boolean|Class|Date|Function|int|JSON|Math|Namespace|Number|Object|QName|RegExp|String|uint|Vector|XML|XMLList|\\*(?<=a))\\b"},regexp:{begin:"(?<=[=(:,\\[]|^|return|&&|\\|\\||!)\\s*(/)(?![/*+{}?])",end:"$|(/)[igm]*",name:"string.regex.actionscript.3",patterns:[{match:"\\\\.",name:"constant.character.escape.actionscript.3"},{match:"\\[(\\\\\\]|[^\\]])*\\]",name:"constant.character.class.actionscript.3"}]},return_type:{captures:{1:{name:"keyword.operator.actionscript.3"},2:{name:"support.type.actionscript.3"},3:{name:"support.type.actionscript.3"},4:{name:"support.type.actionscript.3"}},match:"(\\:)\\s*(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)"},strings:{patterns:[{begin:'@"',end:'"',name:"string.quoted.verbatim.actionscript.3"},{begin:'"',end:'"',name:"string.quoted.double.actionscript.3",patterns:[{include:"#escapes"}]},{begin:"'",end:"'",name:"string.quoted.single.actionscript.3",patterns:[{include:"#escapes"}]}]},use_namespace:{captures:{2:{name:"keyword.other.actionscript.3"},3:{name:"keyword.other.actionscript.3"},4:{name:"storage.modifier.actionscript.3"}},match:"(?x) (^|\\s+|;) (use\\s+)? (namespace) \\s+ (\\w+) \\s* (;|$)"},variable_declaration:{captures:{2:{name:"storage.modifier.actionscript.3"},4:{name:"storage.modifier.actionscript.3"},6:{name:"storage.modifier.actionscript.3"},7:{name:"storage.modifier.actionscript.3"},8:{name:"keyword.operator.actionscript.3"}},match:"(?x) ((static)\\s+)? ((\\w+)\\s+)? ((static)\\s+)? (const|var) \\s+ (?:[A-Za-z0-9_\\$]+)(?:\\s*(:))?",name:"meta.variable_declaration.actionscript.3"},vector_creation_operators:{match:"(<|>)",name:"keyword.operator.actionscript.3"}},scopeName:"source.actionscript.3"});var t=[e];export{t as default};
|
package/dist/bin/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var $=Object.defineProperty;var u=(e,t)=>$(e,"name",{value:t,configurable:!0});import{y as P,u as y,k as Y,i as J,l as L,b as D,c as M,f as T,s as U,g as I}from"../sync-
|
|
2
|
+
var $=Object.defineProperty;var u=(e,t)=>$(e,"name",{value:t,configurable:!0});import{y as P,u as y,k as Y,i as J,l as L,b as D,c as M,f as T,s as U,g as I}from"../sync-ESy7H_HY.js";import i from"chalk";import{globby as F}from"globby";import H from"node:fs/promises";import j from"node:path";import z from"node:os";import W from"yargs";import{hideBin as q}from"yargs/helpers";import"rehype-mathjax";var B="0.2.4";const C=process?.versions?.node!==void 0,p={verbose:!1,log(...e){if(!this.verbose)return;const t=i.gray("[Log]");C?console.warn(t,...e):console.log(t,...e)},logPrefixed(e,...t){this.info(i.blue(`[${e}]`),...t)},info(...e){if(!this.verbose)return;const t=i.green("[Info]");C?console.warn(t,...e):console.info(t,...e)},infoPrefixed(e,...t){this.info(i.blue(`[${e}]`),...t)},warn(...e){console.warn(i.yellow("[Warning]"),...e)},warnPrefixed(e,...t){this.warn(i.blue(`[${e}]`),...t)},error(...e){console.error(i.red("[Error]"),...e)},errorPrefixed(e,...t){this.error(i.blue(`[${e}]`),...t)}},h={"anki-auto-launch":{alias:"l",default:!1,describe:"Attempt to open the Anki desktop app if it's not already running. (Experimental, macOS only.)",type:"boolean"}},b={"anki-web":{alias:"w",default:!0,describe:'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.',type:"boolean"}},k={"anki-connect":{default:"http://127.0.0.1:8765",describe:"Host and port of the Anki-Connect server. The default is usually fine. See the Anki-Connect documentation for more information.",type:"string"}},v={verbose:{default:!1,describe:"Enable verbose logging.",type:"boolean"}};function w(e){return{json:{default:!1,describe:e,type:"boolean"}}}u(w,"jsonOption");const S={"dry-run":{alias:"d",default:!1,describe:"Run without making any changes to the Anki database. See a report of what would have been done.",type:"boolean"}};function A(e){return{namespace:{alias:"n",default:P,describe:e,type:"string"}}}u(A,"namespaceOption");const N=z.homedir();function G(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return N?e.replace(/^~(?=$|\/|\\)/,N):e}u(G,"untildify");const g=u(e=>{const{code:t}=e.cause;throw t==="ECONNREFUSED"&&(p.error("Failed to connect to Anki. Make sure Anki is running and AnkiConnect is installed."),process.exitCode=1,process.exit()),e instanceof Error?e:new Error("Unknown error")},"ankiNotRunningErrorHandler"),x=W(q(process.argv));await x.scriptName("yanki").usage("$0 [command]","Run a Yanki command. Defaults to `sync` if a command is not provided.").command(["$0 <directory> [options]","sync <directory> [options]"],"Perform a one-way synchronization from a local directory of Markdown files to the Anki database. Any Markdown files in subdirectories are included as well.",e=>e.positional("directory",{demandOption:!0,describe:"The path to the local directory of Markdown files to sync.",type:"string"}).option(S).option(A("Advanced option for managing multiple Yanki synchronization groups. Case insensitive. See the readme for more information.")).option(k).option(h).option(b).option(w("Output the sync report as JSON.")).option(v),async({ankiAutoLaunch:e,ankiConnect:t,ankiWeb:r,directory:o,dryRun:a,json:c,namespace:s,recursive:f=!0,verbose:l})=>{p.verbose=l;const n=G(o),m=f?`${n}/**/*.md`:`${n}/*.md`,d=await F(m,{absolute:!0});if(d.length===0){p.error(`No Markdown files found in "${n}".`),process.exitCode=1;return}const{host:R,port:E}=y(t),O=await Y(d,{ankiConnectOptions:{autoLaunch:e,host:R,port:E},ankiWeb:r,dryRun:a,namespace:s}).catch(g);c?(process.stdout.write(JSON.stringify(O,void 0,2)),process.stdout.write(`
|
|
3
3
|
`)):(process.stderr.write(J(O,l)),process.stderr.write(`
|
|
4
4
|
`))}).command("list [options]","Utility command to list Yanki-created notes in the Anki database.",e=>e.option(A("Advanced option to list notes in a specific namespace. Case insensitive. Notes from the default internal namespace are listed by default. Pass `'*'` to list all Yanki-created notes in the Anki database.")).options(k).options(h).option(w("Output the list of notes as JSON to stdout.")),async({ankiAutoLaunch:e,ankiConnect:t,json:r,namespace:o})=>{const{host:a,port:c}=y(t),s=await L({ankiConnectOptions:{autoLaunch:e,host:a,port:c},namespace:o}).catch(g);r?(process.stdout.write(JSON.stringify(s,void 0,2)),process.stdout.write(`
|
|
5
5
|
`)):(process.stdout.write(D(s)),process.stdout.write(`
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,d as e,a as r,e as l,h as n,f as i,b as f,g as m,i as p,j as d,n as c,o as y,l as u,s as N,k as S,m as F,u as O}from"../sync-
|
|
1
|
+
import{c as o,d as e,a as r,e as l,h as n,f as i,b as f,g as m,i as p,j as d,n as c,o as y,l as u,s as N,k as S,m as F,u as O}from"../sync-ESy7H_HY.js";import"rehype-mathjax";export{o as cleanNotes,e as defaultCleanOptions,r as defaultListOptions,l as defaultStyleOptions,n as defaultSyncOptions,i as formatCleanReport,f as formatListReport,m as formatStyleReport,p as formatSyncReport,d as getDeckNamesFromFilePaths,c as getNoteFromMarkdown,y as hostAndPortToUrl,u as listNotes,N as setStyle,S as syncFiles,F as syncNotes,O as urlToHostAndPort};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Object.freeze({displayName:"Move",name:"move",patterns:[{include:"#address"},{include:"#comments"},{include:"#module"},{include:"#script"},{include:"#annotation"},{begin:"\\b(while)\\b",comment:"While experiment",name:"keyword.control.while.whaaat.move",while:"[a-z]"},{include:"#comments"},{include:"#annotation"},{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"}],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"}]},annotation:{begin:"#\\[",end:"\\]",name:"support.constant.annotation.move",patterns:[{comment:"Annotation name",match:"\\b(\\w+)\\s*(?=\\=)",name:"meta.annotation.name.move"},{begin:"=",comment:"Annotation value",end:"(?=[,\\]])",name:"meta.annotation.value.move",patterns:[{include:"#literals"}]}]},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"},block:{begin:"{",comment:"Block expression or definition",end:"}",name:"meta.block.move",patterns:[{include:"#expr"}]},"block-comments":{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",patterns:[{include:"#comments"},{include:"#escaped_identifier"}]},{begin:"(?<=::)",comment:"Module name",end:"(?=[\\s;{])",name:"entity.name.type.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"}]}]},{begin:"{",comment:"Module scope",end:"}",name:"meta.module_scope.move",patterns:[{include:"#comments"},{include:"#annotation"},{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"},module_label:{begin:"^\\s*(module)\\b",comment:"Module label, inline module definition",end:";\\s*$",name:"meta.module.label.move",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"}]},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};
|
|
@@ -0,0 +1 @@
|
|
|
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|message|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};
|