summaryrefslogtreecommitdiff
path: root/buildscripts/idl
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2019-02-08 18:18:58 +0000
committerSara Golemon <sara.golemon@mongodb.com>2019-02-16 20:29:38 +0000
commit406d3c7586126f7315ebca37f646a4c93f5f2a65 (patch)
treecc0fa698dfc42ea9b76e837268123b4032bae46b /buildscripts/idl
parentdafbadabf9ba80a3a125945e20d11d4da5008bf2 (diff)
downloadmongo-406d3c7586126f7315ebca37f646a4c93f5f2a65.tar.gz
SERVER-39499 Migrate base server options to IDL
Diffstat (limited to 'buildscripts/idl')
-rw-r--r--buildscripts/idl/idl/ast.py2
-rw-r--r--buildscripts/idl/idl/binder.py2
-rw-r--r--buildscripts/idl/idl/generator.py14
-rw-r--r--buildscripts/idl/idl/parser.py2
-rw-r--r--buildscripts/idl/idl/syntax.py2
5 files changed, 13 insertions, 9 deletions
diff --git a/buildscripts/idl/idl/ast.py b/buildscripts/idl/idl/ast.py
index 529a762654d..628056533ea 100644
--- a/buildscripts/idl/idl/ast.py
+++ b/buildscripts/idl/idl/ast.py
@@ -345,7 +345,7 @@ class ConfigOption(common.SourceLocation):
self.deprecated_name = [] # type: List[unicode]
self.deprecated_short_name = [] # type: List[unicode]
- self.description = None # type: unicode
+ self.description = None # type: Expression
self.section = None # type: unicode
self.arg_vartype = None # type: unicode
self.cpp_vartype = None # type: unicode
diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py
index 021e7279218..0227e31ec76 100644
--- a/buildscripts/idl/idl/binder.py
+++ b/buildscripts/idl/idl/binder.py
@@ -1075,7 +1075,7 @@ def _bind_config_option(ctxt, globals_spec, option):
node.short_name = node.short_name + ',' + option.single_name
- node.description = option.description
+ node.description = _bind_expression(option.description)
node.arg_vartype = option.arg_vartype
node.cpp_vartype = option.cpp_vartype
node.cpp_varname = option.cpp_varname
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index 44769d7ee51..c3fefabd00d 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -2026,12 +2026,16 @@ class _CppSourceFileWriter(_CppFileWriterBase):
with self._condition(opt.condition):
with self._block(section, ';'):
self._writer.write_line(
- common.template_args(
+ common.template_format(
'.addOptionChaining(${name}, ${short}, moe::${argtype}, ${desc}, ${deprname}, ${deprshortname})',
- name=_encaps(opt.name), short=_encaps(
- opt.short_name), argtype=opt.arg_vartype, desc=_encaps(opt.description),
- deprname=_encaps_list(opt.deprecated_name), deprshortname=_encaps_list(
- opt.deprecated_short_name)))
+ {
+ 'name': _encaps(opt.name),
+ 'short': _encaps(opt.short_name),
+ 'argtype': opt.arg_vartype,
+ 'desc': _get_expression(opt.description),
+ 'deprname': _encaps_list(opt.deprecated_name),
+ 'deprshortname': _encaps_list(opt.deprecated_short_name),
+ }))
self._writer.write_line('.setSources(moe::%s)' % (opt.source))
if opt.hidden:
self._writer.write_line('.hidden()')
diff --git a/buildscripts/idl/idl/parser.py b/buildscripts/idl/idl/parser.py
index 143d8b59be4..826fc2da3ee 100644
--- a/buildscripts/idl/idl/parser.py
+++ b/buildscripts/idl/idl/parser.py
@@ -624,7 +624,7 @@ def _parse_config_option(ctxt, spec, name, node):
"single_name": _RuleDesc('scalar'),
"deprecated_name": _RuleDesc('scalar_or_sequence'),
"deprecated_short_name": _RuleDesc('scalar_or_sequence'),
- "description": _RuleDesc('scalar', _RuleDesc.REQUIRED),
+ "description": _RuleDesc('scalar_or_mapping', _RuleDesc.REQUIRED, _parse_expression),
"section": _RuleDesc('scalar'),
"arg_vartype": _RuleDesc('scalar', _RuleDesc.REQUIRED),
"cpp_vartype": _RuleDesc('scalar'),
diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py
index 1eb614e1e8a..3e9c0a9fa09 100644
--- a/buildscripts/idl/idl/syntax.py
+++ b/buildscripts/idl/idl/syntax.py
@@ -570,7 +570,7 @@ class ConfigOption(common.SourceLocation):
self.single_name = None # type: unicode
self.deprecated_short_name = [] # type: List[unicode]
- self.description = None # type: unicode
+ self.description = None # type: Expression
self.section = None # type: unicode
self.arg_vartype = None # type: unicode
self.cpp_vartype = None # type: unicode