@sap/cds-compiler 5.7.0 → 5.7.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/CHANGELOG.md +15 -0
- package/lib/base/location.js +1 -1
- package/lib/base/model.js +4 -5
- package/lib/compiler/define.js +3 -0
- package/lib/compiler/resolve.js +1 -1
- package/lib/gen/CdlParser.js +2367 -2361
- package/lib/main.d.ts +0 -1
- package/lib/parsers/AstBuildingParser.js +35 -18
- package/lib/parsers/CdlGrammar.g4 +15 -10
- package/lib/parsers/index.js +1 -1
- package/lib/render/utils/delta.js +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@
|
|
|
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 5.7.4 - 2025-02-05
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- New CDL Parser (option `newParser: true`)
|
|
15
|
+
+ Improve code completion
|
|
16
|
+
+ Fix further edge cases in error recovery
|
|
17
|
+
|
|
18
|
+
## Version 5.7.2 - 2025-01-30
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Fix edge case in error recovery of the new CDL parser (option `newParser: true`)
|
|
23
|
+
|
|
24
|
+
|
|
10
25
|
## Version 5.7.0 - 2025-01-24
|
|
11
26
|
|
|
12
27
|
### Added
|
package/lib/base/location.js
CHANGED
package/lib/base/model.js
CHANGED
|
@@ -168,8 +168,6 @@ function forEachMember( construct, callback, target ) {
|
|
|
168
168
|
function forEachMemberRecursively( construct, callback, target ) {
|
|
169
169
|
forEachMember( construct, ( member, memberName, prop ) => {
|
|
170
170
|
callback( member, memberName, prop );
|
|
171
|
-
if (Array.isArray(member.$duplicates)) // redefinitions
|
|
172
|
-
member.$duplicates.forEach( o => callback( o, memberName, prop ) );
|
|
173
171
|
// Descend into nested members, too
|
|
174
172
|
forEachMemberRecursively( member, callback );
|
|
175
173
|
}, target);
|
|
@@ -177,15 +175,16 @@ function forEachMemberRecursively( construct, callback, target ) {
|
|
|
177
175
|
|
|
178
176
|
// Apply function `callback` to all objects in dictionary `dict`, including all
|
|
179
177
|
// duplicates (found under the same name). Function `callback` is called with
|
|
180
|
-
// the following arguments: the object, the name, and -if it is a duplicate-
|
|
178
|
+
// the following arguments: the object, the name, and - if it is a duplicate -
|
|
181
179
|
// the array index and the array containing all duplicates.
|
|
182
180
|
function forEachGeneric( obj, prop, callback ) {
|
|
183
181
|
const dict = obj[prop];
|
|
184
182
|
for (const name in dict) {
|
|
185
183
|
obj = dict[name];
|
|
184
|
+
const { $duplicates } = obj;
|
|
186
185
|
callback( obj, name, prop );
|
|
187
|
-
if (Array.isArray(
|
|
188
|
-
|
|
186
|
+
if (Array.isArray($duplicates)) // redefinitions
|
|
187
|
+
$duplicates.forEach( o => callback( o, name, prop ) );
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
190
|
|
package/lib/compiler/define.js
CHANGED
|
@@ -1155,6 +1155,9 @@ function define( model ) {
|
|
|
1155
1155
|
setLink( elem, '_block', bl );
|
|
1156
1156
|
const existing = parent[prop]?.[name];
|
|
1157
1157
|
const add = construct !== parent && (!existing || elem.$inferred !== 'include');
|
|
1158
|
+
// don't dump with `entity T {}; extend T with { extend e {}; e {}; e {} };`:
|
|
1159
|
+
if (elem.$duplicates === true && add)
|
|
1160
|
+
elem.$duplicates = null;
|
|
1158
1161
|
setMemberParent( elem, name, parent, add && prop );
|
|
1159
1162
|
// console.log(message( null, elem.location, elem, {}, 'Info', 'INIT').toString())
|
|
1160
1163
|
checkRedefinition( elem );
|
package/lib/compiler/resolve.js
CHANGED
|
@@ -1459,7 +1459,7 @@ function resolve( model ) {
|
|
|
1459
1459
|
type = getOrigin( type );
|
|
1460
1460
|
const err = message( 'ref-undefined-enum', [ sym.location, assignment ],
|
|
1461
1461
|
{ id: sym.id, type } );
|
|
1462
|
-
if (options.newParser)
|
|
1462
|
+
if (options.newParser || options.newparser)
|
|
1463
1463
|
attachAndEmitValidNames( err, symbols );
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|