From 886d8c585fbd3efe6fd298f8d5b5f980c752deae Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 11 Jun 2018 12:47:36 +0900 Subject: gtad.yaml: More concise list joining --- lib/csapi/gtad.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/csapi/gtad.yaml') diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml index 55932378..48e04477 100644 --- a/lib/csapi/gtad.yaml +++ b/lib/csapi/gtad.yaml @@ -113,6 +113,7 @@ mustache: _literalQuote: '"' omittedValue: '{}' # default value to initialize omitted parameters with initializer: '{{defaultValue}}' + join,: '{{#@join}}, {{/@join}}' openOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}Omittable<{{/defaultValue}}{{/useOmittable}}{{/required?}}" closeOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}>{{/defaultValue}}{{/useOmittable}}{{/required?}}" maybeOmittableType: "{{>openOmittable}}{{dataType.name}}{{>closeOmittable}}" @@ -121,9 +122,9 @@ mustache: qualifiedMaybeCrefType: "{{#avoidCopy}}const {{/avoidCopy}}{{>qualifiedMaybeOmittableType}}{{#avoidCopy}}&{{/avoidCopy}}{{#moveOnly}}&&{{/moveOnly}}" initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{{>omittedValue}}{{/defaultValue}}" - joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{#@join}}, {{/@join}}' - joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{#@join}}, {{/@join}}' - passQueryParams: '{{#queryParams}}{{paramName}}{{#@join}}, {{/@join}}{{/queryParams}}' + joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{>join,}}' + joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{>join,}}' + passQueryParams: '{{#queryParams}}{{paramName}}{{>join,}}{{/queryParams}}' # preamble: preamble.mustache copyrightName: Kitsune Ral copyrightEmail: -- cgit v1.2.3