Comparing version 3.1.0-next.c8e01a2 to 3.1.0-next.cbc5db3
@@ -187,3 +187,3 @@ /****************************************************************************** | ||
actionWithAssignment: value.actionWithAssignment, | ||
ruleCalls: [...value.ruleCalls], | ||
ruleCalls: value.ruleCalls.slice(), | ||
properties: value.properties.map(copyProperty), | ||
@@ -196,3 +196,3 @@ }; | ||
super: value.super, | ||
ruleCalls: value.ruleCalls, | ||
ruleCalls: value.ruleCalls.slice(), | ||
properties: value.properties.map(e => copyProperty(e)) | ||
@@ -199,0 +199,0 @@ }; |
@@ -37,4 +37,4 @@ /****************************************************************************** | ||
export declare function findAstTypes(type: PropertyType): string[]; | ||
export declare function findAstTypesInternal(type: PropertyType, visited: Set<PropertyType>): string[]; | ||
export declare function isAstType(type: PropertyType): boolean; | ||
export declare function isAstTypeInternal(type: PropertyType, visited: Set<PropertyType>): boolean; | ||
//# sourceMappingURL=types-util.d.ts.map |
@@ -193,3 +193,3 @@ /****************************************************************************** | ||
} | ||
export function findAstTypesInternal(type, visited) { | ||
function findAstTypesInternal(type, visited) { | ||
if (visited.has(type)) { | ||
@@ -219,4 +219,13 @@ return []; | ||
export function isAstType(type) { | ||
return isAstTypeInternal(type, new Set()); | ||
} | ||
export function isAstTypeInternal(type, visited) { | ||
if (visited.has(type)) { | ||
return false; | ||
} | ||
else { | ||
visited.add(type); | ||
} | ||
if (isPropertyUnion(type)) { | ||
return type.types.every(isAstType); | ||
return type.types.every(e => isAstTypeInternal(e, visited)); | ||
} | ||
@@ -226,3 +235,3 @@ else if (isValueType(type)) { | ||
if ('type' in value) { | ||
return isAstType(value.type); | ||
return isAstTypeInternal(value.type, visited); | ||
} | ||
@@ -229,0 +238,0 @@ else { |
{ | ||
"name": "langium", | ||
"version": "3.1.0-next.c8e01a2", | ||
"version": "3.1.0-next.cbc5db3", | ||
"description": "A language engineering tool for the Language Server Protocol", | ||
@@ -73,3 +73,3 @@ "homepage": "https://langium.org", | ||
"devDependencies": { | ||
"langium-cli": "3.1.0-next.c8e01a2" | ||
"langium-cli": "3.1.0-next.cbc5db3" | ||
}, | ||
@@ -76,0 +76,0 @@ "volta": { |
@@ -230,3 +230,3 @@ /****************************************************************************** | ||
actionWithAssignment: value.actionWithAssignment, | ||
ruleCalls: [...value.ruleCalls], | ||
ruleCalls: value.ruleCalls.slice(), | ||
properties: value.properties.map(copyProperty), | ||
@@ -240,3 +240,3 @@ }; | ||
super: value.super, | ||
ruleCalls: value.ruleCalls, | ||
ruleCalls: value.ruleCalls.slice(), | ||
properties: value.properties.map(e => copyProperty(e)) | ||
@@ -243,0 +243,0 @@ }; |
@@ -212,3 +212,3 @@ /****************************************************************************** | ||
export function findAstTypesInternal(type: PropertyType, visited: Set<PropertyType>): string[] { | ||
function findAstTypesInternal(type: PropertyType, visited: Set<PropertyType>): string[] { | ||
if (visited.has(type)) { | ||
@@ -235,8 +235,17 @@ return []; | ||
export function isAstType(type: PropertyType): boolean { | ||
return isAstTypeInternal(type, new Set()); | ||
} | ||
export function isAstTypeInternal(type: PropertyType, visited: Set<PropertyType>): boolean { | ||
if (visited.has(type)) { | ||
return false; | ||
} else { | ||
visited.add(type); | ||
} | ||
if (isPropertyUnion(type)) { | ||
return type.types.every(isAstType); | ||
return type.types.every(e => isAstTypeInternal(e, visited)); | ||
} else if (isValueType(type)) { | ||
const value = type.value; | ||
if ('type' in value) { | ||
return isAstType(value.type); | ||
return isAstTypeInternal(value.type, visited); | ||
} else { | ||
@@ -243,0 +252,0 @@ // Is definitely an interface type |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 7 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 7 instances in 1 package
3330553
57467