-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlanguage-definitions.json
134 lines (132 loc) · 14 KB
/
language-definitions.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[
{ "name": "BREAK", "type": "command", "abbreviation": "B", "description": "Suspend execution or exit a block" },
{ "name": "CLOSE", "type": "command", "abbreviation": "C", "description": "Release an I/O device" },
{ "name": "DO", "type": "command", "abbreviation": "D", "description": "Execute a program, section of code or block" },
{ "name": "ELSE", "type": "command", "abbreviation": "E", "description": "Conditional execution based on $test" },
{ "name": "FOR", "type": "command", "abbreviation": "F", "description": "Iterative execution of a line or block" },
{ "name": "GOTO", "type": "command", "abbreviation": "G", "description": "Transfer of control to a label or program" },
{ "name": "HALT", "type": "command", "abbreviation": "H", "description": "Terminate execution" },
{ "name": "HANG", "type": "command", "abbreviation": "H", "description": "Delay execution for a specified period of time" },
{ "name": "IF", "type": "command", "abbreviation": "I", "description": "Conditional execution of remainder of line" },
{ "name": "JOB", "type": "command", "abbreviation": "J", "description": "Start an independent process" },
{ "name": "LOCK", "type": "command", "abbreviation": "L", "description": "Exclusive access/release named resource" },
{ "name": "KILL", "type": "command", "abbreviation": "K", "description": "Delete a local or global variable" },
{ "name": "MERGE", "type": "command", "abbreviation": "M", "description": "Copy arrays" },
{ "name": "NEW", "type": "command", "abbreviation": "N", "description": "Create new copies of local variables" },
{ "name": "OPEN", "type": "command", "abbreviation": "O", "description": "Obtain ownership of a device" },
{ "name": "QUIT", "type": "command", "abbreviation": "Q", "description": "End a for loop or exit a block" },
{ "name": "READ", "type": "command", "abbreviation": "R", "description": "Read from a device" },
{ "name": "SET", "type": "command", "abbreviation": "S", "description": "Assign a value to a global or local variable" },
{ "name": "TCOMMIT", "type": "command", "abbreviation": "TC", "description": "Commit a transaction" },
{ "name": "TRESTART", "type": "command", "abbreviation": "TRE", "description": "Roll back / restart a transaction" },
{ "name": "TROLLBACK", "type": "command", "abbreviation": "TRO", "description": "Roll back a transaction" },
{ "name": "TSTART", "type": "command", "abbreviation": "TS", "description": "Begin a transaction" },
{ "name": "USE", "type": "command", "abbreviation": "U", "description": "Select which device to read/write" },
{ "name": "VIEW", "type": "command", "abbreviation": "V", "description": "Implementation defined" },
{ "name": "WRITE", "type": "command", "abbreviation": "W", "description": "Write to device" },
{ "name": "XECUTE", "type": "command", "abbreviation": "X", "description": "Dynamically execute strings" },
{ "name": "$DEVICE", "type": "variable", "abbreviation": "$D", "description": "Status of the current device" },
{ "name": "$ECODE", "type": "variable", "abbreviation": "$EC", "description": "List of unresolved error codes" },
{ "name": "$ESTACK", "type": "variable", "abbreviation": "$ES", "description": "Number of stack levels; NEWing $ESTACK resets it to 0" },
{ "name": "$ETRAP", "type": "variable", "abbreviation": "$ET", "description": "Code to execute on error" },
{ "name": "$HOROLOG", "type": "variable", "abbreviation": "$H", "description": "Days,seconds time stamp" },
{ "name": "$IO", "type": "variable", "abbreviation": "$I", "description": "Current IO unit" },
{ "name": "$JOB", "type": "variable", "abbreviation": "$J", "description": "Current process ID" },
{ "name": "$KEY", "type": "variable", "abbreviation": "$K", "description": "String that terminated the most recent READ command" },
{ "name": "$PRINCIPAL", "type": "variable", "abbreviation": "$P", "description": "Principal I/O device" },
{ "name": "$QUIT", "type": "variable", "abbreviation": "$Q", "description": "Whether the current block of code was called as an extrinsic function (e.g. via $$)" },
{ "name": "$STACK", "type": "variable", "abbreviation": "$ST", "description": "Current process stack level" },
{ "name": "$STORAGE", "type": "variable", "abbreviation": "$S", "description": "Amount of memory available, in bytes" },
{ "name": "$SYSTEM", "type": "variable", "abbreviation": "$SY", "description": "System ID" },
{ "name": "$TEST", "type": "variable", "abbreviation": "$T", "description": "Result of prior IF command or READ/OPEN/LOCK command if invoked with a timeout" },
{ "name": "$TLEVEL", "type": "variable", "abbreviation": "$TL", "description": "Number transactions in process" },
{ "name": "$TRESTART", "type": "variable", "abbreviation": "$TR", "description": "Number of restarts on current transaction" },
{ "name": "$X", "type": "variable", "abbreviation": "$X", "description": "Position of horizontal cursor in current I/O device" },
{ "name": "$Y", "type": "variable", "abbreviation": "$Y", "description": "Position of vertical cursor in current I/O device" },
{ "name": "$ASCII", "type": "function", "abbreviation": "$A", "description": "ASCII numeric code of a character", "parameters": [
{ "name": "VALUE", "type": "string", "description": "A string to get a code from" },
{ "name": "POS", "type": "number", "optional": true, "description": "The 1-based position of the character in VALUE; defaults to 1" }
], "returns": { "type": "number" } },
{ "name": "$CHAR", "type": "function", "abbreviation": "$C", "description": "ASCII character from numeric code", "parameters": [
{ "name": "CODE", "type": "number", "description": "Numeric code to convert to a character" },
{ "name": "...", "type": "number", "optional": true, "description": "Additional codes to convert to characters" }
], "returns": { "type": "string" } },
{ "name": "$DATA", "type": "function", "abbreviation": "$D", "description": "Returns data about a variable: 0: if undefined, 1: if valued but has no descendants, 10: if has descendants but no value; 11: if has both a value and descendants", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The variable to get data about, e.g. ^X" }
], "returns": { "type": "number" } },
{ "name": "$EXTRACT", "type": "function", "abbreviation": "$E", "description": "Extract a substring", "parameters": [
{ "name": "VALUE", "type": "string", "description": "The string to get a substring from" },
{ "name": "START", "type": "number", "optional": true, "description": "The 1-based start index; defaults to 1" },
{ "name": "END", "type": "number", "optional": true, "description": "The 1-based end index; defaults to 2" }
], "returns": { "type": "string" } },
{ "name": "$FIND", "type": "function", "abbreviation": "$F", "description": "Find the 1-based index after the end of a substring or 0 if not found", "parameters": [
{ "name": "WITHIN", "type": "string", "description": "The string to search in" },
{ "name": "SUBSTRING", "type": "string", "description": "The substring to search for" },
{ "name": "START", "type": "number", "optional": true, "description": "The 1-based index to start searching from; defaults to 1" }
], "returns": { "type": "number" } },
{ "name": "$FNUMBER", "type": "function", "abbreviation": "$FN", "description": "Format a number", "parameters": [
{ "name": "NUMBER", "type": "number", "description": "The number to format" },
{ "name": "FORMAT", "type": "string", "description": "One or more of the following: +: forces \"+\" on positive numbers; -: omits the \"-\" on negative numbers; ,: comma-separates the number by thousands; T: puts the sign in the trailing position; P: wraps negative numbers in parentheses and wraps positive numbers in spaces and may only be combined with comma (,)" },
{ "name": "DIGITS", "type": "number", "optional": true, "description": "The numer of digits after the decimal point" }
], "returns": { "type": "any" } },
{ "name": "$GET", "type": "function", "abbreviation": "$G", "description": "Get default or actual value", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The variable to query, e.g. ^X(THIS,THAT)" },
{ "name": "DEFAULT", "type": "any", "optional": true, "description": "A value to use if VAR has no value; defaults to \"\"" }
], "returns": { "type": "any" } },
{ "name": "$JUSTIFY", "type": "function", "abbreviation": "$J", "description": "Right-justify a number or string by prefixing with spaces", "parameters": [
{ "name": "VALUE", "type": "string", "description": "The string to justify" },
{ "name": "MINLENGTH", "type": "number", "description": "The minimum length of the result" },
{ "name": "DIGITS", "type": "number", "description": "The number of digits after the decimal point; providing this argument makes $JUSTIFY treat VALUE as a number" }
], "returns": { "type": "string" } },
{ "name": "$LENGTH", "type": "function", "abbreviation": "$L", "description": "Determine string length", "parameters": [
{ "name": "VALUE", "type": "string", "description": "The string" },
{ "name": "SUBSTRING", "type": "string", "optional": true, "description": "If present, $LENGTH returns one more than the number of occurences of SUBSTRING in VALUE" }
], "returns": { "type": "number" } },
{ "name": "$NAME", "type": "function", "abbreviation": "$NA", "description": "Evaluate and describe a variable", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The variable to evaluate, including naked references" },
{ "name": "MAXSUBSCRIPT", "type": "number", "optional": true, "description": "The maximum number of subscripts to evaluate if VAR is an array" }
], "returns": { "type": "string" } },
{ "name": "$ORDER", "type": "function", "abbreviation": "$O", "description": "Find the subscript of the next or previous node", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The array to query, e.g. ^AR" },
{ "name": "DIRECTION", "type": "number", "optional": true, "description": "1: forward, -1: reverse; defaults to 1" }
], "returns": { "type": "string|number" } },
{ "name": "$PIECE", "type": "function", "abbreviation": "$P", "description": "Extract substring based on pattern", "parameters": [
{ "name": "VALUE", "type": "string", "description": "The string" },
{ "name": "SUBSTRING", "type": "string", "description": "A delimiting string within VALUE" },
{ "name": "PIECE", "type": "number", "optional": true, "description": "Which 1-based piece of the split string to return; defaults to 1" },
{ "name": "LASTPIECE", "type": "number", "optional": true, "description": "The 1-based index of the last piece of the split string to return; defaults to PIECE" }
], "returns": { "type": "any" } },
{ "name": "$QLENGTH", "type": "function", "abbreviation": "$QL", "description": "Number of subscripts in an array reference", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The array to query, e.g. ^AR" }
], "returns": { "type": "any" } },
{ "name": "$QSUBSCRIPT", "type": "function", "abbreviation": "$QS", "description": "Value of specified subscript", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The array to query, e.g. ^AR" },
{ "name": "SUBSCRIPT", "type": "number", "description": "The 1-based index of the subscript to find; special values include -1: environment and 0: unsubscripted name" }
], "returns": { "type": "string|number" } },
{ "name": "$QUERY", "type": "function", "abbreviation": "$Q", "description": "Next item in an array; invoke multiple times to iterate the entire array", "parameters": [
{ "name": "VAR", "type": "reference", "description": "The array to query, e.g. ^AR" }
], "returns": { "type": "any" } },
{ "name": "$RANDOM", "type": "function", "abbreviation": "$R", "description": "Random number", "parameters": [
{ "name": "LIMIT", "type": "number", "description": "The generated random number will be between 0 (inclusive) and this LIMIT (exclusive)" }
], "returns": { "type": "number" } },
{ "name": "$REVERSE", "type": "function", "abbreviation": "$RE", "description": "String in reverse order", "parameters": [
{ "name": "VALUE", "type": "string", "description": "A string to reverse" }
], "returns": { "type": "string" } },
{ "name": "$SELECT", "type": "function", "abbreviation": "$S", "description": "Value of first true argument", "parameters": [
{ "name": "TVEXPR", "type": "expression", "description": "An expression to test for truth, followed by a colon and a value, e.g. i=42:\"Answered!\"" },
{ "name": "...", "type": "expression", "optional": true, "description": "Additional truth value expressions to test; the last expression often starts with 1: to avoid errors" }
], "returns": { "type": "any" } },
{ "name": "$STACK", "type": "function", "abbreviation": "$ST", "description": "Returns information about the process stack", "parameters": [
{ "name": "LEVEL", "type": "number", "description": "-1: returns the highest stack level; 0: returns information about how the program was started; 1 to $STACK(-1): returns information about how the stack level was created" },
{ "name": "FIELD", "type": "string", "optional": true, "description": "\"MCODE\": the line of code that was executed; \"PLACE\": location of the executed code; \"ECODE\": the error code(s) added at the stack level, if any" }
], "returns": { "type": "string|number" } },
{ "name": "$TEXT", "type": "function", "abbreviation": "$T", "description": "Returns the text of a line of M[UMPS] code", "parameters": [
{ "name": "REFERENCE", "type": "string", "description": "A reference to a code location, e.g. 'LABEL' or '+4^PROGRAM' or 'LABEL^PROGRAM', etc." }
], "returns": { "type": "string" } },
{ "name": "$TRANSLATE", "type": "function", "abbreviation": "$TR", "description": "Translate characters in a string", "parameters": [
{ "name": "VALUE", "type": "string", "description": "The value to translate" },
{ "name": "OLD", "type": "string", "description": "Characters in VALUE to replace" },
{ "name": "NEW", "type": "string", "optional": true, "description": "Characters to replace OLD characters with; if not provided then OLD characters will be removed" }
], "returns": { "type": "string" } },
{ "name": "$VIEW", "type": "function", "abbreviation": "$V", "description": "Implementation defined" }
]