summaryrefslogtreecommitdiff
path: root/buildscripts/idl/idl/syntax.py
diff options
context:
space:
mode:
authorHuayu Ouyang <huayu.ouyang@mongodb.com>2021-01-22 23:30:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-27 01:38:50 +0000
commit3b3e3f2bafca78b1acd80102f069fd4a28c2617c (patch)
treef6cb3f073ae47f57454f3382cddb378ed402106e /buildscripts/idl/idl/syntax.py
parentacf4722f7c235c5f740151b43c0de5875be67b91 (diff)
downloadmongo-3b3e3f2bafca78b1acd80102f069fd4a28c2617c.tar.gz
SERVER-53205 Check for a removed field from reply type in IDL compatibility checker script
Diffstat (limited to 'buildscripts/idl/idl/syntax.py')
-rw-r--r--buildscripts/idl/idl/syntax.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py
index 83b2a46edd1..966fd492d16 100644
--- a/buildscripts/idl/idl/syntax.py
+++ b/buildscripts/idl/idl/syntax.py
@@ -199,6 +199,14 @@ class SymbolTable(object):
for idltype in imported_symbols.types:
self.add_type(ctxt, idltype)
+ def get_struct(self, name):
+ # type: (str) -> Struct
+ """Get the struct from the SymbolTable's struct list based on the struct name."""
+ for struct in self.structs:
+ if struct.name == name:
+ return struct
+ return None
+
def resolve_type_from_name(self, ctxt, location, field_name, field_type_name):
# type: (errors.ParserContext, common.SourceLocation, str, str) -> Optional[Union[Enum, Struct, Type]]
"""Find the type or struct a field refers to or log an error."""