diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-03 13:20:34 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-03 13:20:34 +0900 |
commit | 48c7d2de6fda86a5115147bc7d9825c3627a17d9 (patch) | |
tree | 2b3a45451870ee7e7f7f1121a107cdfb25226405 /lib | |
parent | f96e349baa30a8a5b263a98a12158614a82fdd27 (diff) | |
download | libquotient-48c7d2de6fda86a5115147bc7d9825c3627a17d9.tar.gz libquotient-48c7d2de6fda86a5115147bc7d9825c3627a17d9.zip |
gtad.yaml: Fixes around defaultValue
1. defaultValue now preempts Omittable<>
2. Fixed the problem when defaultValue was provided but initializer was empty
(a case for int's, bool's etc.)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/csapi/gtad.yaml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml index d8243f4f..e3afd473 100644 --- a/lib/csapi/gtad.yaml +++ b/lib/csapi/gtad.yaml @@ -25,7 +25,7 @@ analyzer: - +set: &UseOmittable useOmittable: imports: [ '"converters.h"' ] - omittedValue: none # See `none` in converters.h + omittedValue: 'none' # See `none` in converters.h +on: - integer: - int64: qint64 @@ -109,14 +109,15 @@ mustache: _scopeRenderer: "{{scopeCamelCase}}Job::" _literalQuote: '"' omittedValue: '{}' # default value to initialize omitted parameters with - openOmittable: "{{^required?}}{{#useOmittable}}Omittable<{{/useOmittable}}{{/required?}}" - closeOmittable: "{{^required?}}{{#useOmittable}}>{{/useOmittable}}{{/required?}}" + initializer: '{{defaultValue}}' + openOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}Omittable<{{/defaultValue}}{{/useOmittable}}{{/required?}}" + closeOmittable: "{{^required?}}{{#useOmittable}}{{^defaultValue}}>{{/defaultValue}}{{/useOmittable}}{{/required?}}" maybeOmittableType: "{{>openOmittable}}{{dataType.name}}{{>closeOmittable}}" qualifiedMaybeOmittableType: "{{>openOmittable}}{{dataType.qualifiedName}}{{>closeOmittable}}" maybeCrefType: "{{#avoidCopy}}const {{/avoidCopy}}{{>maybeOmittableType}}{{#avoidCopy}}&{{/avoidCopy}}{{#moveOnly}}&&{{/moveOnly}}" qualifiedMaybeCrefType: "{{#avoidCopy}}const {{/avoidCopy}}{{>qualifiedMaybeOmittableType}}{{#avoidCopy}}&{{/avoidCopy}}{{#moveOnly}}&&{{/moveOnly}}" - initializeDefaultValue: "{{#defaultValue}}{{#initializer}}{{>initializer}}{{/initializer}}{{/defaultValue}}{{^defaultValue}}{{>omittedValue}}{{/defaultValue}}" + 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}}' |