@sap/cds-compiler 6.7.2 → 6.8.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/CHANGELOG.md +34 -0
- package/bin/cdsc.js +5 -5
- package/bin/cdsse.js +1 -1
- package/lib/api/main.js +9 -8
- package/lib/api/options.js +2 -1
- package/lib/api/validate.js +1 -1
- package/lib/base/error.js +2 -0
- package/lib/base/message-registry.js +7 -2
- package/lib/base/messages.js +2 -2
- package/lib/{optionProcessor.js → base/optionProcessor.js} +3 -3
- package/lib/base/{model.js → specialOptions.js} +16 -39
- package/lib/checks/arrayOfs.js +1 -1
- package/lib/checks/elements.js +1 -1
- package/lib/checks/enricher.js +2 -2
- package/lib/checks/featureFlags.js +54 -24
- package/lib/checks/foreignKeys.js +1 -1
- package/lib/checks/invalidTarget.js +1 -1
- package/lib/checks/managedInType.js +1 -1
- package/lib/checks/onConditions.js +1 -1
- package/lib/checks/queryNoDbArtifacts.js +1 -1
- package/lib/checks/validator.js +10 -14
- package/lib/compiler/builtins.js +1 -1
- package/lib/compiler/checks.js +3 -3
- package/lib/compiler/define.js +5 -2
- package/lib/{base → compiler}/dictionaries.js +2 -0
- package/lib/compiler/extend.js +2 -2
- package/lib/compiler/generate.js +2 -2
- package/lib/compiler/index.js +11 -3
- package/lib/compiler/kick-start.js +1 -1
- package/lib/compiler/populate.js +2 -2
- package/lib/compiler/resolve.js +4 -2
- package/lib/compiler/shared.js +35 -6
- package/lib/compiler/utils.js +2 -4
- package/lib/compiler/xpr-rewrite.js +1 -1
- package/lib/edm/annotations/edmJson.js +2 -4
- package/lib/edm/annotations/genericTranslation.js +2 -1
- package/lib/edm/csn2edm.js +3 -2
- package/lib/edm/edmAnnoPreprocessor.js +1 -1
- package/lib/edm/edmInboundChecks.js +2 -1
- package/lib/edm/edmPreprocessor.js +3 -3
- package/lib/edm/edmUtils.js +2 -2
- package/lib/gen/BaseParser.js +1 -12
- package/lib/gen/CdlGrammar.checksum +1 -1
- package/lib/gen/CdlParser.js +1068 -1067
- package/lib/json/from-csn.js +7 -2
- package/lib/json/to-csn.js +17 -2
- package/lib/main.js +3 -3
- package/lib/model/csnUtils.js +2 -2
- package/lib/modelCompare/compare.js +1 -1
- package/lib/modelCompare/utils/filter.js +1 -0
- package/lib/parsers/AstBuildingParser.js +40 -3
- package/lib/parsers/index.js +1 -1
- package/lib/render/manageConstraints.js +1 -1
- package/lib/render/toCdl.js +3 -3
- package/lib/render/toHdbcds.js +2 -2
- package/lib/render/toSql.js +7 -7
- package/lib/render/utils/common.js +9 -2
- package/lib/render/utils/sql.js +14 -5
- package/lib/render/utils/standardDatabaseFunctions.js +108 -99
- package/lib/sql-identifier.js +9 -1
- package/lib/{model → tool-lib}/enrichCsn.js +2 -2
- package/lib/{model → tool-lib}/revealInternalProperties.js +2 -1
- package/lib/transform/addTenantFields.js +1 -1
- package/lib/transform/db/applyTransformations.js +1 -1
- package/lib/transform/db/assertUnique.js +1 -1
- package/lib/transform/db/assocsToQueries/transformExists.js +1 -1
- package/lib/transform/db/backlinks.js +2 -2
- package/lib/transform/db/expansion.js +2 -2
- package/lib/transform/db/flattening.js +3 -4
- package/lib/transform/db/killAnnotations.js +1 -0
- package/lib/transform/db/processSqlServices.js +2 -1
- package/lib/transform/db/rewriteCalculatedElements.js +2 -2
- package/lib/transform/db/temporal.js +30 -5
- package/lib/transform/db/views.js +16 -20
- package/lib/transform/draft/db.js +1 -2
- package/lib/transform/effective/associations.js +1 -1
- package/lib/transform/effective/flattening.js +1 -1
- package/lib/transform/effective/main.js +19 -4
- package/lib/transform/effective/types.js +1 -1
- package/lib/transform/{odata/fioriTreeViews.js → fioriTreeViews.js} +48 -25
- package/lib/transform/forOdata.js +5 -5
- package/lib/transform/forRelationalDB.js +41 -9
- package/lib/transform/localized.js +2 -2
- package/lib/transform/odata/createForeignKeys.js +1 -1
- package/lib/transform/odata/flattening.js +2 -2
- package/lib/transform/odata/toFinalBaseType.js +3 -2
- package/lib/transform/odata/typesExposure.js +3 -2
- package/lib/transform/transformUtils.js +2 -2
- package/lib/transform/translateAssocsToJoins.js +30 -29
- package/lib/transform/tupleExpansion.js +4 -4
- package/lib/transform/universalCsn/universalCsnEnricher.js +7 -3
- package/lib/transform/universalCsn/utils.js +1 -1
- package/lib/{base → utils}/lazyload.js +9 -0
- package/lib/{base → utils}/node-helpers.js +2 -0
- package/lib/utils/objectUtils.js +29 -6
- package/lib/{base → utils}/optionProcessorHelper.js +16 -6
- package/package.json +2 -2
- /package/lib/{model → base}/cloneCsn.js +0 -0
- /package/lib/{model → base}/csnRefs.js +0 -0
- /package/lib/{model/api.js → base/model-api.js} +0 -0
- /package/lib/{api → base}/trace.js +0 -0
- /package/lib/{model → base}/xprAsTree.js +0 -0
- /package/lib/{inspect → tool-lib}/index.js +0 -0
- /package/lib/{inspect → tool-lib}/inspectModelStatistics.js +0 -0
- /package/lib/{inspect → tool-lib}/inspectPropagation.js +0 -0
- /package/lib/{inspect → tool-lib}/inspectUtils.js +0 -0
- /package/lib/{base → utils}/shuffle.js +0 -0
package/lib/compiler/define.js
CHANGED
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
|
|
123
123
|
const { weakLocation, builtinLocation } = require('../base/location');
|
|
124
124
|
|
|
125
|
-
const shuffleGen = require('../
|
|
125
|
+
const shuffleGen = require('../utils/shuffle');
|
|
126
126
|
const {
|
|
127
127
|
dictAdd, dictAddArray, dictForEach, pushToDict,
|
|
128
|
-
} = require('
|
|
128
|
+
} = require('./dictionaries');
|
|
129
129
|
const { kindProperties } = require('./base');
|
|
130
130
|
const {
|
|
131
131
|
setLink,
|
|
@@ -724,6 +724,9 @@ function define( model ) {
|
|
|
724
724
|
// ORDER BY and LIMIT to be evaluated in leading query
|
|
725
725
|
}
|
|
726
726
|
else { // with parse error (`select from <EOF>`, `select from E { *, ( select }`)
|
|
727
|
+
// TODO: call initQuery() anyway to avoid Error[expr-no-subquery] also for
|
|
728
|
+
// UNIONs (test3/Queries/DollarSelf/CorruptedSource.err.cds), see also
|
|
729
|
+
// resolveExprNode()
|
|
727
730
|
return undefined;
|
|
728
731
|
}
|
|
729
732
|
return query._leadingQuery || query;
|
package/lib/compiler/extend.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
const { weakRefLocation } = require('../base/location');
|
|
6
6
|
const { searchName } = require('../base/messages');
|
|
7
|
-
const { isDeprecatedEnabled } = require('../base/
|
|
8
|
-
const { dictAdd, pushToDict, dictForEach } = require('
|
|
7
|
+
const { isDeprecatedEnabled } = require('../base/specialOptions');
|
|
8
|
+
const { dictAdd, pushToDict, dictForEach } = require('./dictionaries');
|
|
9
9
|
const { kindProperties, dictKinds } = require('./base');
|
|
10
10
|
const {
|
|
11
11
|
setLink,
|
package/lib/compiler/generate.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable no-nested-ternary */
|
|
6
6
|
|
|
7
|
-
const { isDeprecatedEnabled } = require('../base/
|
|
8
|
-
const { dictAdd } = require('
|
|
7
|
+
const { isDeprecatedEnabled } = require('../base/specialOptions');
|
|
8
|
+
const { dictAdd } = require('./dictionaries');
|
|
9
9
|
const {
|
|
10
10
|
setLink,
|
|
11
11
|
setArtifactLink,
|
package/lib/compiler/index.js
CHANGED
|
@@ -32,8 +32,8 @@ const check = require('./checks');
|
|
|
32
32
|
|
|
33
33
|
const { Location, emptyWeakLocation } = require('../base/location');
|
|
34
34
|
const { createMessageFunctions, deduplicateMessages } = require('../base/messages');
|
|
35
|
-
const { checkRemovedDeprecatedFlags } = require('../base/
|
|
36
|
-
const { promiseAllDoNotRejectImmediately } = require('../
|
|
35
|
+
const { checkRemovedDeprecatedFlags } = require('../base/specialOptions');
|
|
36
|
+
const { promiseAllDoNotRejectImmediately } = require('../utils/node-helpers');
|
|
37
37
|
const { cdsFs, fileExtension } = require('../utils/file');
|
|
38
38
|
|
|
39
39
|
const fs = require('fs');
|
|
@@ -504,6 +504,8 @@ function compileDoXSync( model ) {
|
|
|
504
504
|
// TODO: think about making this work
|
|
505
505
|
|
|
506
506
|
resolve( model );
|
|
507
|
+
if (options.$cdsReplSupport)
|
|
508
|
+
return model;
|
|
507
509
|
tweakAssocs( model );
|
|
508
510
|
assertConsistency( model );
|
|
509
511
|
check( model );
|
|
@@ -554,9 +556,15 @@ async function compileDoX( model ) {
|
|
|
554
556
|
|
|
555
557
|
model.definitions = model.$functions.shuffleDict( model.definitions );
|
|
556
558
|
// Shuffling extensions is more difficult due to intra-file extensions of same artifact
|
|
559
|
+
// TODO: shuffle _before_ populate()
|
|
557
560
|
// TODO: think about making this work
|
|
558
561
|
|
|
559
|
-
|
|
562
|
+
resolve( model );
|
|
563
|
+
if (options.$cdsReplSupport)
|
|
564
|
+
return model;
|
|
565
|
+
await checkAsyncAbortFlag( options.abortSignal );
|
|
566
|
+
|
|
567
|
+
for (const phase of [ tweakAssocs, assertConsistency, check ]) {
|
|
560
568
|
phase( model );
|
|
561
569
|
// eslint-disable-next-line no-await-in-loop
|
|
562
570
|
await checkAsyncAbortFlag( options.abortSignal );
|
package/lib/compiler/populate.js
CHANGED
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const { isDeprecatedEnabled } = require('../base/
|
|
20
|
+
const { isDeprecatedEnabled } = require('../base/specialOptions');
|
|
21
21
|
const {
|
|
22
22
|
dictAdd, dictAddArray, dictFirst, dictForEach,
|
|
23
|
-
} = require('
|
|
23
|
+
} = require('./dictionaries');
|
|
24
24
|
const { weakLocation, weakRefLocation } = require('../base/location');
|
|
25
25
|
const { CompilerAssertion } = require('../base/error');
|
|
26
26
|
|
package/lib/compiler/resolve.js
CHANGED
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
|
|
39
39
|
'use strict';
|
|
40
40
|
|
|
41
|
-
const { isDeprecatedEnabled } = require('../base/
|
|
42
|
-
const { dictAdd } = require('
|
|
41
|
+
const { isDeprecatedEnabled } = require('../base/specialOptions');
|
|
42
|
+
const { dictAdd } = require('./dictionaries');
|
|
43
43
|
const { weakLocation } = require('../base/location');
|
|
44
44
|
const { combinedLocation } = require('../base/location');
|
|
45
45
|
const { typeParameters } = require('./builtins');
|
|
@@ -1566,6 +1566,8 @@ function resolve( model ) {
|
|
|
1566
1566
|
// No traversal into query, art.$queries set in define.js
|
|
1567
1567
|
// No subqueries for type projections, nor in annotation expressions.
|
|
1568
1568
|
const { query } = expr;
|
|
1569
|
+
if (!query.from && !query.args) // parser error
|
|
1570
|
+
return type; // ...see also TODO in initQueryExpression()
|
|
1569
1571
|
if (query._main?.kind === 'type' ||
|
|
1570
1572
|
(!query.kind && !query._leadingQuery)) { // UNION has _leadingQuery
|
|
1571
1573
|
error( 'expr-no-subquery', [ expr.location, user ], {
|
package/lib/compiler/shared.js
CHANGED
|
@@ -121,7 +121,7 @@ function fns( model ) {
|
|
|
121
121
|
lexical: userBlock,
|
|
122
122
|
dynamic: modelBuiltinsOrDefinitions,
|
|
123
123
|
navigation: environment,
|
|
124
|
-
notFound:
|
|
124
|
+
notFound: undefinedFromReference,
|
|
125
125
|
accept: acceptQuerySource,
|
|
126
126
|
noDep: '', // dependency special for from
|
|
127
127
|
args: () => 'from-args',
|
|
@@ -131,7 +131,7 @@ function fns( model ) {
|
|
|
131
131
|
lexical: userBlock,
|
|
132
132
|
dynamic: modelBuiltinsOrDefinitions,
|
|
133
133
|
navigation: staticTarget,
|
|
134
|
-
notFound:
|
|
134
|
+
notFound: undefinedTypeReference,
|
|
135
135
|
accept: acceptTypeOrElement,
|
|
136
136
|
// special `scope`s for CDL parser - TYPE OF (TODO generated?), cds.Association:
|
|
137
137
|
typeOf: typeOfSemantics,
|
|
@@ -629,9 +629,11 @@ function fns( model ) {
|
|
|
629
629
|
|
|
630
630
|
if (Array.isArray( art ))
|
|
631
631
|
art = art[0];
|
|
632
|
-
if (!art)
|
|
633
|
-
return (semantics.dynamic !== modelDefinitions
|
|
634
|
-
|
|
632
|
+
if (!art) {
|
|
633
|
+
return (semantics.dynamic !== modelDefinitions && !options.$cdsReplSupport)
|
|
634
|
+
? art
|
|
635
|
+
: pathName( path );
|
|
636
|
+
}
|
|
635
637
|
const first = (art.kind === 'using' ? art.extern : art.name).id;
|
|
636
638
|
return (path.length === 1) ? first : `${ first }.${ pathName( ref.path.slice(1) ) }`;
|
|
637
639
|
}
|
|
@@ -1186,7 +1188,11 @@ function fns( model ) {
|
|
|
1186
1188
|
return model.definitions;
|
|
1187
1189
|
}
|
|
1188
1190
|
function modelBuiltinsOrDefinitions( user ) {
|
|
1189
|
-
|
|
1191
|
+
if (!definedViaCdl( user ))
|
|
1192
|
+
return model.definitions;
|
|
1193
|
+
if (!options.$cdsReplSupport)
|
|
1194
|
+
return model.$builtins;
|
|
1195
|
+
return Object.assign( { __proto__: null }, model.definitions, model.$builtins );
|
|
1190
1196
|
}
|
|
1191
1197
|
|
|
1192
1198
|
function artifactParams( user ) {
|
|
@@ -1355,6 +1361,21 @@ function fns( model ) {
|
|
|
1355
1361
|
// TODO: improve text, use text variant for: "or builtin" or "definitions" or none
|
|
1356
1362
|
}
|
|
1357
1363
|
|
|
1364
|
+
function undefinedFromReference( user, item, valid, dict, prev, path, semantics ) {
|
|
1365
|
+
const base = Functions.effectiveType?.( prev );
|
|
1366
|
+
if (Functions.effectiveType?.( base?.elements?.[item.id] )?.target)
|
|
1367
|
+
signalElementHint( user, item, valid, prev, semantics, path );
|
|
1368
|
+
else
|
|
1369
|
+
undefinedDefinition( user, item, valid, dict, prev, path, semantics );
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
function undefinedTypeReference( user, item, valid, dict, prev, path, semantics ) {
|
|
1373
|
+
if (prev?.elements?.[item.id])
|
|
1374
|
+
signalElementHint( user, item, valid, prev, semantics, path );
|
|
1375
|
+
else
|
|
1376
|
+
undefinedDefinition( user, item, valid, dict, prev, path, semantics );
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1358
1379
|
function undefinedForAnnotate( user, item, valid, _dict, prev, path ) {
|
|
1359
1380
|
// in a CSN source, only one env was tested (valid.length 1):
|
|
1360
1381
|
const name = (prev) ? `${ prev.name.id }.${ item.id }` : item.id;
|
|
@@ -1382,6 +1403,14 @@ function fns( model ) {
|
|
|
1382
1403
|
}
|
|
1383
1404
|
}
|
|
1384
1405
|
|
|
1406
|
+
function signalElementHint( user, item, valid, prev, semantics, path ) {
|
|
1407
|
+
const art = searchName( prev, item.id, 'absolute' );
|
|
1408
|
+
const addSeparators = p => ( p === item ? ':' : '.' ) + p.id;
|
|
1409
|
+
const code = path[0].id + path.slice( 1 ).map( addSeparators ).join( '' );
|
|
1410
|
+
signalNotFound( 'ref-undefined-def', [ item.location, user ], valid,
|
|
1411
|
+
{ '#': 'hint', art, code }, semantics );
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1385
1414
|
function endsWithSuffix( name, suffix, cond ) {
|
|
1386
1415
|
if (!name.endsWith( suffix ))
|
|
1387
1416
|
return false;
|
package/lib/compiler/utils.js
CHANGED
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
// Please do not add functions “for completeness”, this is not an API file for
|
|
7
7
|
// others but only by the core compiler.
|
|
8
8
|
|
|
9
|
-
// TODO: split this file into utils/….js, add some functions from lib/base/model.js
|
|
10
|
-
|
|
11
9
|
'use strict';
|
|
12
10
|
|
|
13
|
-
const { dictAdd, dictFirst } = require('
|
|
11
|
+
const { dictAdd, dictFirst } = require('./dictionaries');
|
|
14
12
|
const { Location, weakLocation } = require('../base/location');
|
|
15
13
|
const { XsnName, XsnArtifact } = require('./xsn-model');
|
|
16
14
|
|
|
@@ -419,7 +417,7 @@ function targetMaxNotOne( assoc, item ) {
|
|
|
419
417
|
* two entities named `E`, the callback function is called on both.
|
|
420
418
|
* It is also called on columns with `inline`.
|
|
421
419
|
*
|
|
422
|
-
* See also function forEachDefinition()
|
|
420
|
+
* See also function forEachDefinition() below.
|
|
423
421
|
*/
|
|
424
422
|
function forEachUserArtifact( model, prop, callback ) { // not enums
|
|
425
423
|
forEachUserDict( model, prop, function main( art ) {
|
|
@@ -151,7 +151,7 @@ const {
|
|
|
151
151
|
setExpandStatusAnnotate,
|
|
152
152
|
} = require('./utils');
|
|
153
153
|
const { CompilerAssertion } = require('../base/error');
|
|
154
|
-
const { isBetaEnabled } = require('../base/
|
|
154
|
+
const { isBetaEnabled } = require('../base/specialOptions');
|
|
155
155
|
const { isSimpleCdlIdentifier } = require('../parsers/identifiers');
|
|
156
156
|
|
|
157
157
|
// Config object passed around all "rewrite" functions.
|
|
@@ -8,7 +8,7 @@ const {
|
|
|
8
8
|
} = require('../EdmPrimitiveTypeDefinitions.js');
|
|
9
9
|
const { isBuiltinType, isAnnotationExpression } = require('../../base/builtins');
|
|
10
10
|
const { transformExpression } = require('../../transform/db/applyTransformations.js');
|
|
11
|
-
const { conditionAsTree, expressionAsTree } = require('../../
|
|
11
|
+
const { conditionAsTree, expressionAsTree } = require('../../base/xprAsTree');
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Translate a given token stream expression into an edmJson representation
|
|
@@ -390,9 +390,7 @@ function xpr2edmJson( carrier, anno, location, options, messageFunctions, generi
|
|
|
390
390
|
|
|
391
391
|
|
|
392
392
|
transform.ref = (parent, prop, xpr, csnPath, parentParent, parentProp) => {
|
|
393
|
-
|
|
394
|
-
// we ignore the filters in order to generate EDMX
|
|
395
|
-
if (xpr.some(ps => ps.args/* || ps.where */)) {
|
|
393
|
+
if (xpr.some(ps => ps.args /* || (ps.where && ps.where.length)) until PR#13752 filters were also forbidden */)) {
|
|
396
394
|
error('odata-anno-xpr-ref', location, {
|
|
397
395
|
anno, elemref: parent, '#': 'args',
|
|
398
396
|
});
|
|
@@ -6,7 +6,8 @@ const edmUtils = require('../edmUtils.js');
|
|
|
6
6
|
const oDataDictionary = require('../../gen/Dictionary.json');
|
|
7
7
|
const preprocessAnnotations = require('./preprocessAnnotations.js');
|
|
8
8
|
const { forEachDefinition } = require('../../model/csnUtils');
|
|
9
|
-
const { isBetaEnabled
|
|
9
|
+
const { isBetaEnabled } = require('../../base/specialOptions.js');
|
|
10
|
+
const { setProp } = require('../../utils/objectUtils.js');
|
|
10
11
|
const { xpr2edmJson, getEdmJsonHandler } = require('./edmJson.js');
|
|
11
12
|
const { vocabularyDefinitions } = require('./vocabularyDefinitions.js');
|
|
12
13
|
const { EdmPathTypeMap } = require('../EdmPrimitiveTypeDefinitions.js');
|
package/lib/edm/csn2edm.js
CHANGED
|
@@ -9,7 +9,8 @@ const VALUELIST_NAVPROP_PREFIX = '';
|
|
|
9
9
|
const edmUtils = require('./edmUtils.js');
|
|
10
10
|
const { initializeModel } = require('./edmPreprocessor.js');
|
|
11
11
|
const translate = require('./annotations/genericTranslation.js');
|
|
12
|
-
const { setProp
|
|
12
|
+
const { setProp } = require('../utils/objectUtils');
|
|
13
|
+
const { isBetaEnabled } = require('../base/specialOptions');
|
|
13
14
|
const {
|
|
14
15
|
isEdmPropertyRendered, getUtils, findAnnotationExpression,
|
|
15
16
|
} = require('../model/csnUtils');
|
|
@@ -21,7 +22,7 @@ const {
|
|
|
21
22
|
EdmPrimitiveTypeMap,
|
|
22
23
|
} = require('./EdmPrimitiveTypeDefinitions.js');
|
|
23
24
|
const { getEdm } = require('./edm.js');
|
|
24
|
-
const { cloneFullCsn } = require('../
|
|
25
|
+
const { cloneFullCsn } = require('../base/cloneCsn');
|
|
25
26
|
const { forEach, forEachValue } = require('../utils/objectUtils.js');
|
|
26
27
|
/*
|
|
27
28
|
OData V2 spec 06/01/2017 PDF version is available here:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { setProp
|
|
3
|
+
const { setProp } = require('../utils/objectUtils');
|
|
4
|
+
const { isBetaEnabled } = require('../base/specialOptions');
|
|
4
5
|
const {
|
|
5
6
|
forEachDefinition, forEachMemberRecursively, getUtils,
|
|
6
7
|
transformAnnotationExpression,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
/* eslint max-statements-per-line:off */
|
|
4
|
-
const {
|
|
4
|
+
const { isBetaEnabled } = require('../base/specialOptions');
|
|
5
5
|
const {
|
|
6
6
|
forEachDefinition, forEachGeneric, forEachMemberRecursively,
|
|
7
7
|
isEdmPropertyRendered, getUtils,
|
|
@@ -15,8 +15,8 @@ const edmAnnoPreproc = require('./edmAnnoPreprocessor.js');
|
|
|
15
15
|
const { inboundQualificationChecks } = require('./edmInboundChecks.js');
|
|
16
16
|
const typesExposure = require('../transform/odata/typesExposure');
|
|
17
17
|
const expandCSNToFinalBaseType = require('../transform/odata/toFinalBaseType');
|
|
18
|
-
const { cloneCsnNonDict, cloneAnnotationValue } = require('../
|
|
19
|
-
const { forEach, forEachKey } = require('../utils/objectUtils.js');
|
|
18
|
+
const { cloneCsnNonDict, cloneAnnotationValue } = require('../base/cloneCsn');
|
|
19
|
+
const { setProp, forEach, forEachKey } = require('../utils/objectUtils.js');
|
|
20
20
|
|
|
21
21
|
const NavResAnno = '@Capabilities.NavigationRestrictions.RestrictedProperties';
|
|
22
22
|
|
package/lib/edm/edmUtils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { setProp } = require('../
|
|
3
|
+
const { setProp } = require('../utils/objectUtils');
|
|
4
4
|
const {
|
|
5
5
|
isEdmPropertyRendered, applyTransformations,
|
|
6
6
|
} = require('../model/csnUtils');
|
|
7
7
|
const { isBuiltinType } = require('../base/builtins');
|
|
8
8
|
const { escapeString, hasControlCharacters, hasUnpairedUnicodeSurrogate } = require('../render/utils/stringEscapes');
|
|
9
9
|
const { CompilerAssertion } = require('../base/error');
|
|
10
|
-
const { cloneAnnotationValue } = require('../
|
|
10
|
+
const { cloneAnnotationValue } = require('../base/cloneCsn');
|
|
11
11
|
|
|
12
12
|
/* eslint max-statements-per-line:off */
|
|
13
13
|
function validateOptions( _options ) {
|
package/lib/gen/BaseParser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//Base class for generated parser, for redepage v0.3.
|
|
1
|
+
// Base class for generated parser, for redepage v0.3.4
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -370,18 +370,7 @@ throw Error( `this.s === ${ this.s }; illegally set by action, or runtime/genera
|
|
|
370
370
|
this.dynamic_ = Object.getPrototypeOf( this.dynamic_ );
|
|
371
371
|
const caller = this.stack.pop();
|
|
372
372
|
const immediately = this.tokenIdx === caller.tokenIdx && this.tokenIdx >= this.errorTokenIdx;
|
|
373
|
-
if (this.constructor.tracingParser) {
|
|
374
|
-
const post = this.s == null &&
|
|
375
|
-
(immediately
|
|
376
|
-
? ' immediately'
|
|
377
|
-
: caller.followState == null
|
|
378
|
-
? ' unsuccessfully'
|
|
379
|
-
: ' prematurely');
|
|
380
|
-
const text = immediately ? '⚠ exit rule' : '⏎ exit rule';
|
|
381
|
-
this.s = caller.followState;
|
|
382
|
-
|
|
383
373
|
|
|
384
|
-
}
|
|
385
374
|
this.prec_ = caller.prec;
|
|
386
375
|
this.s = caller.followState;
|
|
387
376
|
if (immediately)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1802b89cdce8e878cb15384d6731099a
|