-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add maps and lists to directed codegen
This adds lists and maps to directed codegen. This is needed because when generating Python code there needs to be some data generated for lists and maps that must be placed in topological ordering as much as is possible.
- Loading branch information
1 parent
a6f1d1c
commit 0eaafee
Showing
6 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ore/src/main/java/software/amazon/smithy/codegen/core/directed/GenerateListDirective.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.codegen.core.directed; | ||
|
||
import software.amazon.smithy.codegen.core.CodegenContext; | ||
import software.amazon.smithy.model.shapes.ListShape; | ||
import software.amazon.smithy.model.shapes.ServiceShape; | ||
|
||
/** | ||
* Directive used to generate a list. | ||
* | ||
* @param <C> CodegenContext type. | ||
* @param <S> Codegen settings type. | ||
* @see DirectedCodegen#generateList | ||
*/ | ||
public class GenerateListDirective<C extends CodegenContext<S, ?, ?>, S> | ||
extends ShapeDirective<ListShape, C, S> { | ||
GenerateListDirective(C context, ServiceShape service, ListShape shape) { | ||
super(context, service, shape); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...core/src/main/java/software/amazon/smithy/codegen/core/directed/GenerateMapDirective.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.codegen.core.directed; | ||
|
||
import software.amazon.smithy.codegen.core.CodegenContext; | ||
import software.amazon.smithy.model.shapes.MapShape; | ||
import software.amazon.smithy.model.shapes.ServiceShape; | ||
|
||
/** | ||
* Directive used to generate a map. | ||
* | ||
* @param <C> CodegenContext type. | ||
* @param <S> Codegen settings type. | ||
* @see DirectedCodegen#generateMap | ||
*/ | ||
public class GenerateMapDirective<C extends CodegenContext<S, ?, ?>, S> | ||
extends ShapeDirective<MapShape, C, S> { | ||
GenerateMapDirective(C context, ServiceShape service, MapShape shape) { | ||
super(context, service, shape); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters