OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_TableFunctionsFactory_init.RangeAnnotationTransformer Class Reference
+ Inheritance diagram for generate_TableFunctionsFactory_init.RangeAnnotationTransformer:
+ Collaboration diagram for generate_TableFunctionsFactory_init.RangeAnnotationTransformer:

Public Member Functions

def visit_arg_node
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstTransformer
def visit_udtf_node
def visit_composed_node
def visit_arg_node
def visit_primitive_node
def visit_template_node
def visit_annotation_node
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstVisitor
def visit_udtf_node
def visit_composed_node
def visit_arg_node
def visit_primitive_node
def visit_annotation_node
def visit_template_node

Detailed Description

* Append require annotation if range is used

Definition at line 912 of file

Member Function Documentation

def generate_TableFunctionsFactory_init.RangeAnnotationTransformer.visit_arg_node (   self,

Definition at line 916 of file

917  def visit_arg_node(self, arg_node):
918  for ann in arg_node.annotations:
919  if ann.key == 'range':
920  name = arg_node.get_annotation('name')
921  if name is None:
922  raise TransformerException('"range" requires a named argument')
924  l = ann.value
925  if len(l) == 2:
926  lo, hi = ann.value
927  value = '"{lo} <= {name} && {name} <= {hi}"'.format(lo=lo, hi=hi, name=name)
928  else:
929  raise TransformerException('"range" requires an interval. Got {l}'.format(l=l))
930  arg_node.set_annotation('require', value)
931  return arg_node

The documentation for this class was generated from the following file: