@sap/cds-compiler 3.4.2 → 3.5.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 +80 -0
- package/README.md +1 -0
- package/bin/cds_update_identifiers.js +5 -5
- package/bin/cdsc.js +15 -16
- package/bin/cdshi.js +19 -6
- package/doc/CHANGELOG_ARCHIVE.md +2 -2
- package/doc/CHANGELOG_BETA.md +9 -1
- package/doc/CHANGELOG_DEPRECATED.md +2 -0
- package/lib/api/main.js +61 -59
- package/lib/api/options.js +4 -2
- package/lib/api/validate.js +2 -2
- package/lib/base/cleanSymbols.js +2 -3
- package/lib/base/dictionaries.js +6 -6
- package/lib/base/error.js +2 -2
- package/lib/base/keywords.js +6 -6
- package/lib/base/location.js +11 -12
- package/lib/base/message-registry.js +177 -58
- package/lib/base/messages.js +252 -180
- package/lib/base/model.js +14 -11
- package/lib/base/node-helpers.js +9 -10
- package/lib/base/optionProcessorHelper.js +138 -129
- package/lib/checks/.eslintrc.json +2 -0
- package/lib/checks/actionsFunctions.js +5 -5
- package/lib/checks/annotationsOData.js +4 -4
- package/lib/checks/arrayOfs.js +1 -1
- package/lib/checks/cdsPersistence.js +1 -1
- package/lib/checks/checkForTypes.js +3 -3
- package/lib/checks/defaultValues.js +3 -3
- package/lib/checks/elements.js +7 -7
- package/lib/checks/emptyOrOnlyVirtual.js +2 -2
- package/lib/checks/foreignKeys.js +1 -1
- package/lib/checks/invalidTarget.js +4 -4
- package/lib/checks/managedInType.js +1 -1
- package/lib/checks/managedWithoutKeys.js +1 -1
- package/lib/checks/nonexpandableStructured.js +5 -3
- package/lib/checks/nullableKeys.js +1 -1
- package/lib/checks/onConditions.js +5 -6
- package/lib/checks/parameters.js +1 -1
- package/lib/checks/queryNoDbArtifacts.js +2 -2
- package/lib/checks/selectItems.js +4 -4
- package/lib/checks/sql-snippets.js +4 -4
- package/lib/checks/types.js +7 -7
- package/lib/checks/utils.js +4 -4
- package/lib/checks/validator.js +16 -13
- package/lib/compiler/.eslintrc.json +4 -1
- package/lib/compiler/assert-consistency.js +8 -7
- package/lib/compiler/builtins.js +14 -14
- package/lib/compiler/checks.js +123 -48
- package/lib/compiler/define.js +12 -13
- package/lib/compiler/extend.js +266 -60
- package/lib/compiler/finalize-parse-cdl.js +10 -5
- package/lib/compiler/index.js +17 -14
- package/lib/compiler/populate.js +14 -6
- package/lib/compiler/propagator.js +2 -0
- package/lib/compiler/resolve.js +2 -15
- package/lib/compiler/shared.js +27 -16
- package/lib/compiler/tweak-assocs.js +5 -6
- package/lib/compiler/utils.js +20 -0
- package/lib/edm/annotations/genericTranslation.js +604 -358
- package/lib/edm/annotations/preprocessAnnotations.js +39 -35
- package/lib/edm/csn2edm.js +275 -222
- package/lib/edm/edm.js +17 -3
- package/lib/edm/edmAnnoPreprocessor.js +6 -6
- package/lib/edm/edmInboundChecks.js +2 -2
- package/lib/edm/edmPreprocessor.js +107 -77
- package/lib/edm/edmUtils.js +44 -5
- package/lib/gen/Dictionary.json +210 -8
- package/lib/gen/language.checksum +1 -1
- package/lib/gen/language.interp +67 -63
- package/lib/gen/language.tokens +81 -81
- package/lib/gen/languageLexer.interp +4 -10
- package/lib/gen/languageLexer.js +854 -869
- package/lib/gen/languageLexer.tokens +79 -81
- package/lib/gen/languageParser.js +14309 -13832
- package/lib/inspect/inspectModelStatistics.js +2 -2
- package/lib/inspect/inspectPropagation.js +6 -6
- package/lib/inspect/inspectUtils.js +2 -2
- package/lib/json/from-csn.js +102 -55
- package/lib/json/to-csn.js +119 -198
- package/lib/language/antlrParser.js +5 -2
- package/lib/language/docCommentParser.js +6 -6
- package/lib/language/errorStrategy.js +43 -23
- package/lib/language/genericAntlrParser.js +113 -133
- package/lib/language/language.g4 +1550 -1506
- package/lib/language/multiLineStringParser.js +3 -3
- package/lib/language/textUtils.js +2 -2
- package/lib/main.js +3 -3
- package/lib/model/csnRefs.js +5 -0
- package/lib/model/csnUtils.js +130 -122
- package/lib/model/revealInternalProperties.js +1 -1
- package/lib/model/sortViews.js +4 -6
- package/lib/modelCompare/compare.js +2 -2
- package/lib/modelCompare/utils/.eslintrc.json +22 -0
- package/lib/modelCompare/utils/filter.js +100 -0
- package/lib/optionProcessor.js +5 -0
- package/lib/render/.eslintrc.json +1 -0
- package/lib/render/DuplicateChecker.js +1 -1
- package/lib/render/manageConstraints.js +12 -12
- package/lib/render/toCdl.js +311 -276
- package/lib/render/toHdbcds.js +97 -94
- package/lib/render/toRename.js +5 -5
- package/lib/render/toSql.js +127 -223
- package/lib/render/utils/common.js +141 -108
- package/lib/render/utils/delta.js +227 -0
- package/lib/render/utils/sql.js +22 -6
- package/lib/render/utils/stringEscapes.js +3 -3
- package/lib/transform/db/.eslintrc.json +2 -0
- package/lib/transform/db/applyTransformations.js +3 -3
- package/lib/transform/db/assertUnique.js +13 -12
- package/lib/transform/db/associations.js +5 -5
- package/lib/transform/db/cdsPersistence.js +10 -8
- package/lib/transform/db/constraints.js +14 -14
- package/lib/transform/db/expansion.js +20 -22
- package/lib/transform/db/flattening.js +24 -42
- package/lib/transform/db/groupByOrderBy.js +3 -3
- package/lib/transform/db/temporal.js +6 -6
- package/lib/transform/db/transformExists.js +23 -23
- package/lib/transform/db/views.js +16 -16
- package/lib/transform/draft/.eslintrc.json +1 -35
- package/lib/transform/draft/db.js +10 -10
- package/lib/transform/draft/odata.js +2 -2
- package/lib/transform/forOdataNew.js +8 -29
- package/lib/transform/forRelationalDB.js +16 -6
- package/lib/transform/localized.js +11 -10
- package/lib/transform/odata/toFinalBaseType.js +41 -27
- package/lib/transform/odata/typesExposure.js +113 -47
- package/lib/transform/parseExpr.js +209 -106
- package/lib/transform/transformUtilsNew.js +17 -10
- package/lib/transform/translateAssocsToJoins.js +24 -19
- package/lib/transform/universalCsn/coreComputed.js +10 -10
- package/lib/transform/universalCsn/universalCsnEnricher.js +26 -26
- package/lib/transform/universalCsn/utils.js +3 -3
- package/lib/utils/file.js +5 -5
- package/lib/utils/moduleResolve.js +13 -13
- package/lib/utils/objectUtils.js +6 -6
- package/lib/utils/term.js +5 -2
- package/lib/utils/timetrace.js +51 -24
- package/package.json +5 -8
- package/share/messages/check-proper-type-of.md +1 -1
- package/share/messages/message-explanations.json +1 -1
- package/share/messages/redirected-to-complex.md +4 -4
- package/share/messages/{syntax-expecting-integer.md → syntax-expecting-unsigned-int.md} +7 -4
- package/lib/modelCompare/filter.js +0 -83
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,86 @@
|
|
|
7
7
|
Note: `beta` fixes, changes and features are usually not listed in this ChangeLog but [here](doc/CHANGELOG_BETA.md).
|
|
8
8
|
The compiler behavior concerning `beta` features can change at any time without notice.
|
|
9
9
|
|
|
10
|
+
## Version 3.5.0 - 2022-12-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- grammar: `localized` is now allowed in select items as well, to force the creation of convenience views.
|
|
15
|
+
- to.edm(x):
|
|
16
|
+
+ Validate annotation values of OASIS/SAP vocabulary term definitions against `@Validation.AllowedValues`.
|
|
17
|
+
+ Reveal dangling type references in produced EDM.
|
|
18
|
+
+ `@Capabilities` 'pull up' introduced with [3.3.0](#version-330---2022-09-29) must now be switched
|
|
19
|
+
on with option `odataCapabilitiesPullup`.
|
|
20
|
+
- If option `addTextsLanguageAssoc` is set but ignored by the compiler, an info message is emitted.
|
|
21
|
+
This can happen if, e.g., the `sap.common.Languages` entity is missing.
|
|
22
|
+
- Add OData vocabularies 'Offline' and 'PDF'.
|
|
23
|
+
- Two new aspects in the `sap.common` context get special meaning:
|
|
24
|
+
`sap.common.TextsAspect` and `sap.common.FioriTextsAspect`.
|
|
25
|
+
If these aspects exist, the former will be included in all `.texts`
|
|
26
|
+
entities without `@fiori.draft.enabled` annotation. The latter will be
|
|
27
|
+
included in all `.texts` aspects that are `@fiori.draft.enabled`.
|
|
28
|
+
They allow to extend `.texts` entities by simply extending these aspects.
|
|
29
|
+
Example:
|
|
30
|
+
```
|
|
31
|
+
entity E {
|
|
32
|
+
key id : Integer;
|
|
33
|
+
content: localized String;
|
|
34
|
+
}
|
|
35
|
+
extend sap.common.TextsAspect with {
|
|
36
|
+
elem: String;
|
|
37
|
+
};
|
|
38
|
+
// from @sap/cds common.cds
|
|
39
|
+
aspect sap.common.TextsAspect {
|
|
40
|
+
key locale: String;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- to.edm(x):
|
|
47
|
+
+ Vocabulary references to `Common` and `Core` are added to the generated EDM by default to allow
|
|
48
|
+
usage of these vocabularies in http messages even if the terms are not being used in the EDM itself.
|
|
49
|
+
+ API representation of enum types as `@Validation.AllowedValues` has been shifted from `for.odata` to
|
|
50
|
+
`to.edm(x)`. This allows to reuse imported enum types in new APIs.
|
|
51
|
+
+ Messages raised from the EDM annotation renderer have been reworked with message id and enhanced message
|
|
52
|
+
position including the annotation under investigation.
|
|
53
|
+
+ `@Validation.AllowedValues` annotation as introduced for enum elements with
|
|
54
|
+
[1.44.2](./doc/CHANGELOG_ARCHIVE.md#version-1442---2020-10-09)
|
|
55
|
+
are now always rendered into the API regardless of `@assert.range`.
|
|
56
|
+
- to.cdl: The input CSN is no longer cloned for client-CSN and parseCdl-CSN,
|
|
57
|
+
as the renderer does not modify it.
|
|
58
|
+
- A new warning is emitted if compositions of anonymous aspects are used with the `Association`
|
|
59
|
+
keyword instead of `Composition`. Replace the former with the latter to fix the warning.
|
|
60
|
+
|
|
61
|
+
### Removed
|
|
62
|
+
|
|
63
|
+
- to.edm(x): 'Empty Schema' warning has been removed.
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- Enums with a structured base type were accidentally not warned about if used in annotation definitions.
|
|
68
|
+
- for.odata/for.hana: Instead of parenthesising tuple expansion with `()`, put
|
|
69
|
+
newly created expression in a `xpr` expression, if the term has more than one expansion.
|
|
70
|
+
- Annotation on indirect or inferred enum values were sometimes lost
|
|
71
|
+
- to.cdl:
|
|
72
|
+
+ Certain keywords of special functions no longer add superfluous parentheses.
|
|
73
|
+
+ Extension rendering now supports type extensions as well as `key` for elements.
|
|
74
|
+
+ Builtins that clashed names with implicit contexts were not rendered with `cds.` prefix.
|
|
75
|
+
+ Unknown artifacts (as can happen in parseCdl-style CSN) are now rendered as `USING` statements.
|
|
76
|
+
+ Type extensions in `csn.extensions` (e.g. for `length`) are now rendered.
|
|
77
|
+
- to.edm(x):
|
|
78
|
+
+ Fix a bug in type exposure when using `@cds.external` complex types.
|
|
79
|
+
+ Don't remove empty `Edm.EntityContainer`.
|
|
80
|
+
+ Aspects with actions outside of services are no longer warned about.
|
|
81
|
+
- for.hana: Fix a foreign key replacement bug during association to join translation.
|
|
82
|
+
|
|
83
|
+
## Version 3.4.4 - 2022-11-25
|
|
84
|
+
|
|
85
|
+
### Fixed
|
|
86
|
+
|
|
87
|
+
- compiler: CSN flavor `gensrc` (known as `xtended` in `@sap/cds`) lost annotations
|
|
88
|
+
on enum values and projection columns.
|
|
89
|
+
|
|
10
90
|
## Version 3.4.2 - 2022-11-11
|
|
11
91
|
|
|
12
92
|
### Fixed
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ process.exit(0); // success
|
|
|
50
50
|
|
|
51
51
|
// --------------------------------------------------------
|
|
52
52
|
|
|
53
|
-
function modernizeIdentifierStyle(source, filename) {
|
|
53
|
+
function modernizeIdentifierStyle( source, filename ) {
|
|
54
54
|
const options = { messages: [], attachTokens: true };
|
|
55
55
|
const messageFunctions = createMessageFunctions( options, 'parse', null );
|
|
56
56
|
|
|
@@ -82,7 +82,7 @@ function modernizeIdentifierStyle(source, filename) {
|
|
|
82
82
|
|
|
83
83
|
// -----------------------------------------------
|
|
84
84
|
|
|
85
|
-
function updateIdent(identToken) {
|
|
85
|
+
function updateIdent( identToken ) {
|
|
86
86
|
const newIdentText = toNewIdentStyle(identToken.text);
|
|
87
87
|
|
|
88
88
|
if (!identToken.stop)
|
|
@@ -96,7 +96,7 @@ function modernizeIdentifierStyle(source, filename) {
|
|
|
96
96
|
currentOffset += (newIdentText.length - identToken.text.length);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
function toNewIdentStyle(oldIdentText) {
|
|
99
|
+
function toNewIdentStyle( oldIdentText ) {
|
|
100
100
|
let ident = oldIdentText.slice(1, oldIdentText.length - 1);
|
|
101
101
|
|
|
102
102
|
// There are only two replacement rules we need to check for:
|
|
@@ -116,7 +116,7 @@ function modernizeIdentifierStyle(source, filename) {
|
|
|
116
116
|
* @param {string} replaceWith
|
|
117
117
|
* @return {string}
|
|
118
118
|
*/
|
|
119
|
-
function replaceSliceInSource(source, startIndex, endIndex, replaceWith) {
|
|
119
|
+
function replaceSliceInSource( source, startIndex, endIndex, replaceWith ) {
|
|
120
120
|
return source.substring(0, startIndex) +
|
|
121
121
|
replaceWith +
|
|
122
122
|
source.substring(endIndex);
|
|
@@ -125,7 +125,7 @@ function replaceSliceInSource(source, startIndex, endIndex, replaceWith) {
|
|
|
125
125
|
/**
|
|
126
126
|
* @param {string} msg
|
|
127
127
|
*/
|
|
128
|
-
function exitError(msg) {
|
|
128
|
+
function exitError( msg ) {
|
|
129
129
|
console.error(msg);
|
|
130
130
|
usage();
|
|
131
131
|
process.exit(1);
|
package/bin/cdsc.js
CHANGED
|
@@ -57,7 +57,7 @@ catch (err) {
|
|
|
57
57
|
throw err;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function remapCmdOptions(options, command) {
|
|
60
|
+
function remapCmdOptions( options, command ) {
|
|
61
61
|
if (!command || !options[command])
|
|
62
62
|
return;
|
|
63
63
|
|
|
@@ -208,7 +208,7 @@ function cdsc_main() {
|
|
|
208
208
|
* @param {CSN.Options} options
|
|
209
209
|
* @param {object} args
|
|
210
210
|
*/
|
|
211
|
-
function validateDirectBackendOption(command, options, args) {
|
|
211
|
+
function validateDirectBackendOption( command, options, args ) {
|
|
212
212
|
if (![ 'toCdl', 'toOdata', 'toHana', 'toCsn', 'toSql' ].includes(command)) {
|
|
213
213
|
displayUsage(`Option '--direct-backend' can't be used with command '${command}'`,
|
|
214
214
|
optionProcessor.helpText, 2);
|
|
@@ -225,7 +225,7 @@ function validateDirectBackendOption(command, options, args) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// Display help text 'helpText' and 'error' (if any), then exit with exit code <code>
|
|
228
|
-
function displayUsage(error, helpText, code) {
|
|
228
|
+
function displayUsage( error, helpText, code ) {
|
|
229
229
|
// Display non-error output (like help) to stdout
|
|
230
230
|
const out = (code === 0 && !error) ? process.stdout : process.stderr;
|
|
231
231
|
// Display help text first, error at the end (more readable, no scrolling)
|
|
@@ -240,7 +240,7 @@ function displayUsage(error, helpText, code) {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
// Executes a command line that has been translated to 'command' (what to do), 'options' (how) and 'args' (which files)
|
|
243
|
-
function executeCommandLine(command, options, args) {
|
|
243
|
+
function executeCommandLine( command, options, args ) {
|
|
244
244
|
const normalizeFilename = options.testMode && process.platform === 'win32';
|
|
245
245
|
const messageLevels = {
|
|
246
246
|
Error: 0, Warning: 1, Info: 2, Debug: 3,
|
|
@@ -428,7 +428,7 @@ function executeCommandLine(command, options, args) {
|
|
|
428
428
|
console.log(explainMessage(args.messageId));
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
function inspect(model) {
|
|
431
|
+
function inspect( model ) {
|
|
432
432
|
const inspectModel = require('../lib/inspect');
|
|
433
433
|
|
|
434
434
|
if (options.statistics) {
|
|
@@ -449,7 +449,7 @@ function executeCommandLine(command, options, args) {
|
|
|
449
449
|
// Display error messages in `err` resulting from a compilation. Also set
|
|
450
450
|
// process.exitCode - process.exit() will force the process to exit as quickly
|
|
451
451
|
// as possible = is problematic, since console.error() might be asynchronous
|
|
452
|
-
function displayErrors(err) {
|
|
452
|
+
function displayErrors( err ) {
|
|
453
453
|
if (err instanceof main.CompilationError) {
|
|
454
454
|
if (options.rawOutput)
|
|
455
455
|
console.error( util.inspect( reveal( err.model, options.rawOutput ), false, null ));
|
|
@@ -505,7 +505,7 @@ function executeCommandLine(command, options, args) {
|
|
|
505
505
|
let hasAtLeastOneExplanation = false;
|
|
506
506
|
messages.filter(msg => messageLevels[msg.severity] <= options.warning).forEach((msg) => {
|
|
507
507
|
hasAtLeastOneExplanation = hasAtLeastOneExplanation || main.hasMessageExplanation(msg.messageId);
|
|
508
|
-
const name = msg
|
|
508
|
+
const name = msg.$location && msg.$location.file;
|
|
509
509
|
const fullFilePath = name ? path.resolve('', name) : undefined;
|
|
510
510
|
log(main.messageStringMultiline(msg, {
|
|
511
511
|
normalizeFilename,
|
|
@@ -514,9 +514,8 @@ function executeCommandLine(command, options, args) {
|
|
|
514
514
|
hintExplanation: true,
|
|
515
515
|
color: options.color,
|
|
516
516
|
}));
|
|
517
|
-
if (fullFilePath && msg
|
|
518
|
-
// A message context only makes sense, if we have at least
|
|
519
|
-
// i.e. line and column for start position.
|
|
517
|
+
if (fullFilePath && msg.$location.line) {
|
|
518
|
+
// A message context only makes sense, if we have at least start line
|
|
520
519
|
const context = sourceLines(fullFilePath);
|
|
521
520
|
log(main.messageContext(context, msg, { color: options.color }));
|
|
522
521
|
}
|
|
@@ -532,7 +531,7 @@ function executeCommandLine(command, options, args) {
|
|
|
532
531
|
// or display it to stdout if 'options.out' is '-'.
|
|
533
532
|
// Depending on 'options.rawOutput', the model is either compacted to 'name.json' or
|
|
534
533
|
// written in raw form to '<name>_raw.txt'.
|
|
535
|
-
function displayNamedXsn(xsn, name) {
|
|
534
|
+
function displayNamedXsn( xsn, name ) {
|
|
536
535
|
if (options.rawOutput) {
|
|
537
536
|
writeToFileOrDisplay(options.out, `${name}_raw.txt`, util.inspect(reveal(xsn, options.rawOutput), false, null), true);
|
|
538
537
|
}
|
|
@@ -553,7 +552,7 @@ function executeCommandLine(command, options, args) {
|
|
|
553
552
|
* @param {CSN.Model} csn
|
|
554
553
|
* @param {string} name
|
|
555
554
|
*/
|
|
556
|
-
function displayNamedCsn(csn, name) {
|
|
555
|
+
function displayNamedCsn( csn, name ) {
|
|
557
556
|
if (!csn) // only print CSN if it is set.
|
|
558
557
|
return;
|
|
559
558
|
if (options.internalMsg) {
|
|
@@ -571,7 +570,7 @@ function executeCommandLine(command, options, args) {
|
|
|
571
570
|
// If 'content' is not a string, JSON-stringify it
|
|
572
571
|
// If displaying to stdout, prepend a headline containing 'filename', unless 'omitHeadline' is set.
|
|
573
572
|
// For filenames, illegal characters (slash, backslash, colon) are replaced by '_'.
|
|
574
|
-
function writeToFileOrDisplay(dir, fileName, content, omitHeadline = false) {
|
|
573
|
+
function writeToFileOrDisplay( dir, fileName, content, omitHeadline = false ) {
|
|
575
574
|
if (options.internalMsg)
|
|
576
575
|
return;
|
|
577
576
|
fileName = fileName.replace(/[:/\\]/g, '_');
|
|
@@ -605,7 +604,7 @@ function executeCommandLine(command, options, args) {
|
|
|
605
604
|
}
|
|
606
605
|
}
|
|
607
606
|
|
|
608
|
-
function loadOptionsFromJson(cmdLine) {
|
|
607
|
+
function loadOptionsFromJson( cmdLine ) {
|
|
609
608
|
try {
|
|
610
609
|
let opt = JSON.parse(fs.readFileSync(cmdLine.options.options, 'utf-8'));
|
|
611
610
|
if (opt.cds)
|
|
@@ -621,7 +620,7 @@ function loadOptionsFromJson(cmdLine) {
|
|
|
621
620
|
}
|
|
622
621
|
}
|
|
623
622
|
|
|
624
|
-
function catchErrors(err) {
|
|
623
|
+
function catchErrors( err ) {
|
|
625
624
|
// @ts-ignore
|
|
626
625
|
if (err instanceof Error && err.hasBeenReported)
|
|
627
626
|
return;
|
|
@@ -664,7 +663,7 @@ function parseSeverityOptions({ options }) {
|
|
|
664
663
|
}
|
|
665
664
|
}
|
|
666
665
|
|
|
667
|
-
function parseSeverityOption(list, severity) {
|
|
666
|
+
function parseSeverityOption( list, severity ) {
|
|
668
667
|
const ids = list.split(',');
|
|
669
668
|
for (let id of ids) {
|
|
670
669
|
id = id.trim();
|
package/bin/cdshi.js
CHANGED
|
@@ -37,12 +37,25 @@ function highlight( err, buf ) {
|
|
|
37
37
|
return;
|
|
38
38
|
const chars = [ ...buf ];
|
|
39
39
|
for (const tok of ts.tokens) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
chars[tok.
|
|
40
|
+
if (tok.start < 0)
|
|
41
|
+
continue;
|
|
42
|
+
if (tok.$isSkipped) {
|
|
43
|
+
if (tok.stop > tok.start) {
|
|
44
|
+
chars[tok.start] = (tok.$isSkipped === true ? '\x0f' : '\x16');
|
|
45
|
+
chars[tok.stop] = '\x17';
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
chars[tok.start] = (tok.$isSkipped === true ? '\x0e' : '\x15');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const cat = tok.isIdentifier;
|
|
53
|
+
if (cat) {
|
|
54
|
+
if (cat !== 'ref' || chars[tok.start] !== '$')
|
|
55
|
+
chars[tok.start] = categoryChars[cat] || cat.charAt(0);
|
|
56
|
+
if (tok.stop > tok.start) // stop in ANTLR at last char, not behind
|
|
57
|
+
chars[tok.start + 1] = '_';
|
|
58
|
+
}
|
|
46
59
|
}
|
|
47
60
|
}
|
|
48
61
|
for (const c of chars)
|
package/doc/CHANGELOG_ARCHIVE.md
CHANGED
|
@@ -154,7 +154,7 @@ The compiler behaviour concerning `beta` features can change at any time without
|
|
|
154
154
|
- When the option `addTextsLanguageAssoc` is set to true and
|
|
155
155
|
the model contains an entity `sap.common.Languages` with an element `code`,
|
|
156
156
|
all generated texts entities additionally contain an element `language`
|
|
157
|
-
which is an association to `sap.common.Languages` using element `
|
|
157
|
+
which is an association to `sap.common.Languages` using element `locale`.
|
|
158
158
|
- for.odata:
|
|
159
159
|
+ In `--odata-format=flat`, structured view parameters are flattened like elements.
|
|
160
160
|
- to.hdbcds
|
|
@@ -2870,7 +2870,7 @@ Features
|
|
|
2870
2870
|
|
|
2871
2871
|
Fixes
|
|
2872
2872
|
* Issue an error, if an association element that is defined in a mixin of the
|
|
2873
|
-
same view is explicitly redirected. Up to now this
|
|
2873
|
+
same view is explicitly redirected. Up to now this modeling error was not
|
|
2874
2874
|
recognized and led to the generation of incorrect HANA CDS models.
|
|
2875
2875
|
* We now also allow query entities and their elements to use as type, relaxing
|
|
2876
2876
|
a check introduces with v1.0.26.
|
package/doc/CHANGELOG_BETA.md
CHANGED
|
@@ -8,7 +8,15 @@ Note: `beta` fixes, changes and features are listed in this ChangeLog just for i
|
|
|
8
8
|
The compiler behavior concerning `beta` features can change at any time without notice.
|
|
9
9
|
**Don't use `beta` fixes, changes and features in productive mode.**
|
|
10
10
|
|
|
11
|
-
## Version 3.
|
|
11
|
+
## Version 3.5.0 - 2022-12-07
|
|
12
|
+
|
|
13
|
+
### Added `odataTerms`
|
|
14
|
+
|
|
15
|
+
Allows to introduce and use new `Edm.Term`s in an OData API
|
|
16
|
+
based on CDS annotations. Annotations must be service members,
|
|
17
|
+
they can't be autoexposed.
|
|
18
|
+
|
|
19
|
+
## Version 3.4.0 - 2022-10-26
|
|
12
20
|
|
|
13
21
|
### Added `aspectWithoutElements`
|
|
14
22
|
|