@xano/xanoscript-language-server 12.16.4 → 12.16.5
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/lexer/query.js +8 -0
- package/package.json +1 -1
- package/parser/query_parser.js +21 -1
package/lexer/query.js
CHANGED
|
@@ -40,6 +40,12 @@ export const ResponseTypeToken = createTokenByName("response_type", {
|
|
|
40
40
|
categories: [Identifier], // could also be an identifier
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
// external_access
|
|
44
|
+
export const ExternalAccessToken = createTokenByName("external_access", {
|
|
45
|
+
longer_alt: Identifier,
|
|
46
|
+
categories: [Identifier], // could also be an identifier
|
|
47
|
+
});
|
|
48
|
+
|
|
43
49
|
// dblink
|
|
44
50
|
export const DbLinkToken = createTokenByName("dblink", {
|
|
45
51
|
longer_alt: Identifier,
|
|
@@ -60,6 +66,7 @@ export const AddonToken = createTokenByName("addon", {
|
|
|
60
66
|
|
|
61
67
|
export const QueryTokens = [
|
|
62
68
|
ResponseTypeToken,
|
|
69
|
+
ExternalAccessToken,
|
|
63
70
|
QueryToken,
|
|
64
71
|
VerbToken,
|
|
65
72
|
GETToken,
|
|
@@ -81,6 +88,7 @@ export function mapTokenToType(token) {
|
|
|
81
88
|
case QueryToken.name:
|
|
82
89
|
case VerbToken.name:
|
|
83
90
|
case ResponseTypeToken.name:
|
|
91
|
+
case ExternalAccessToken.name:
|
|
84
92
|
return "keyword";
|
|
85
93
|
case GETToken.name:
|
|
86
94
|
case PATCHToken.name:
|
package/package.json
CHANGED
package/parser/query_parser.js
CHANGED
|
@@ -4,6 +4,7 @@ import { EqualToken, LCurly, RCurly } from "../lexer/control.js";
|
|
|
4
4
|
import { StringLiteral } from "../lexer/literal.js";
|
|
5
5
|
import {
|
|
6
6
|
DELETEToken,
|
|
7
|
+
ExternalAccessToken,
|
|
7
8
|
GETToken,
|
|
8
9
|
PATCHToken,
|
|
9
10
|
POSTToken,
|
|
@@ -12,7 +13,13 @@ import {
|
|
|
12
13
|
ResponseTypeToken,
|
|
13
14
|
VerbToken,
|
|
14
15
|
} from "../lexer/query.js";
|
|
15
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
AuthToken,
|
|
18
|
+
FalseToken,
|
|
19
|
+
Identifier,
|
|
20
|
+
NewlineToken,
|
|
21
|
+
TrueToken,
|
|
22
|
+
} from "../lexer/tokens.js";
|
|
16
23
|
import { getVarName } from "./generic/utils.js";
|
|
17
24
|
|
|
18
25
|
export function queryDeclaration($) {
|
|
@@ -30,6 +37,7 @@ export function queryDeclaration($) {
|
|
|
30
37
|
let hasTags = false;
|
|
31
38
|
let hasApiGroup = false;
|
|
32
39
|
let hasResponseType = false;
|
|
40
|
+
let hasExternalAccess = false;
|
|
33
41
|
let responseType = "standard";
|
|
34
42
|
|
|
35
43
|
const testNames = [];
|
|
@@ -120,6 +128,18 @@ export function queryDeclaration($) {
|
|
|
120
128
|
$.CONSUME3(StringLiteral);
|
|
121
129
|
},
|
|
122
130
|
},
|
|
131
|
+
{
|
|
132
|
+
GATE: () => !hasExternalAccess,
|
|
133
|
+
ALT: () => {
|
|
134
|
+
hasExternalAccess = true;
|
|
135
|
+
$.CONSUME(ExternalAccessToken); // "external_access"
|
|
136
|
+
$.CONSUME3(EqualToken); // "="
|
|
137
|
+
$.OR3([
|
|
138
|
+
{ ALT: () => $.CONSUME(TrueToken) }, // true
|
|
139
|
+
{ ALT: () => $.CONSUME(FalseToken) }, // false
|
|
140
|
+
]);
|
|
141
|
+
},
|
|
142
|
+
},
|
|
123
143
|
{
|
|
124
144
|
GATE: () => !hasDocs,
|
|
125
145
|
ALT: () => {
|