Lichen

Changeset

91:068688ccb818
2016-10-11 Paul Boddie raw files shortlog changelog graph Modified and made use of the get_attrname_from_location function, also tidying the deducer and adding documentation.
common.py (file) deducer.py (file)
     1.1 --- a/common.py	Sat Oct 08 00:43:13 2016 +0200
     1.2 +++ b/common.py	Tue Oct 11 16:27:24 2016 +0200
     1.3 @@ -800,6 +800,8 @@
     1.4      """
     1.5  
     1.6      path, name, attrnames, access = location
     1.7 +    if not attrnames:
     1.8 +        return attrnames
     1.9      return get_attrnames(attrnames)[0]
    1.10  
    1.11  def get_name_path(path, name):
     2.1 --- a/deducer.py	Sat Oct 08 00:43:13 2016 +0200
     2.2 +++ b/deducer.py	Tue Oct 11 16:27:24 2016 +0200
     2.3 @@ -384,7 +384,13 @@
     2.4  
     2.5      def write_access_plans(self):
     2.6  
     2.7 -        "Each attribute access is written out as a plan."
     2.8 +        """
     2.9 +        Each attribute access is written out as a plan of the following form:
    2.10 +
    2.11 +        location " " name " " test " " test type " " base " " traversed attributes
    2.12 +                 " " attributes to traverse " " context " " access method
    2.13 +                 " " static attribute
    2.14 +        """
    2.15  
    2.16          f_attrs = open(join(self.output, "attribute_plans"), "w")
    2.17  
    2.18 @@ -1339,12 +1345,10 @@
    2.19          'accessor_locations'.
    2.20          """
    2.21  
    2.22 -        path, name, attrnames, version = access_location
    2.23 -        if not attrnames:
    2.24 +        attrname = get_attrname_from_location(access_location)
    2.25 +        if not attrname:
    2.26              return
    2.27  
    2.28 -        attrname = get_attrnames(attrnames)[0]
    2.29 -
    2.30          # Collect all suggested types for the accessors. Accesses may
    2.31          # require accessors from of a subset of the complete set of types.
    2.32