aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/pyolian
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-02-18 09:33:22 +0100
committerDave Andreoli <dave@gurumeditation.it>2018-02-18 09:35:53 +0100
commit0af53f4bc6a42d0cd9b08647f8f40ea10140f14b (patch)
treecd4c001ddccf7dc815d0ad95e03dfc54b91bdfc5 /src/scripts/pyolian
parentelm_web: this testcase now also works (diff)
downloadefl-0af53f4bc6a42d0cd9b08647f8f40ea10140f14b.tar.gz
Pyolian: improve a bit the namespace generation
I still think that namespaces should be directly exposed by eolian. Currently pyolian provide a namespace implementation but it's hard to get it right, and it should be really shared between all eolian users.
Diffstat (limited to 'src/scripts/pyolian')
-rw-r--r--src/scripts/pyolian/eolian.py48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 6e3b52b3ec..d62e74bec2 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -510,48 +510,56 @@ class Namespace(object):
return self._name.split('.')
@property
+ def sub_namespaces(self):
+ base = self._name + '.'
+ deep = self._name.count('.') + 1
+ return [ ns for ns in self._unit.all_namespaces
+ if ns.name.startswith(base) and ns.name.count('.') == deep ]
+
+
+ @property
def classes(self):
- return [ c for c in self._unit.all_classes
- if c.namespace == self._name ]
+ return sorted([ c for c in self._unit.all_classes
+ if c.namespace == self._name ])
@property
def regulars(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.REGULAR and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.all_classes
+ if c.type == Eolian_Class_Type.REGULAR and
+ c.namespace == self._name])
@property
def abstracts(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.ABSTRACT and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.all_classes
+ if c.type == Eolian_Class_Type.ABSTRACT and
+ c.namespace == self._name])
@property
def mixins(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.MIXIN and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.all_classes
+ if c.type == Eolian_Class_Type.MIXIN and
+ c.namespace == self._name])
@property
def interfaces(self):
- return [ c for c in self._unit.all_classes
- if c.type == Eolian_Class_Type.INTERFACE and
- c.namespace == self._name]
+ return sorted([ c for c in self._unit.all_classes
+ if c.type == Eolian_Class_Type.INTERFACE and
+ c.namespace == self._name])
@property
def aliases(self):
- return [ td for td in self._unit.typedecl_all_aliases
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.typedecl_all_aliases
+ if td.namespace == self._name])
@property
def structs(self):
- return [ td for td in self._unit.typedecl_all_structs
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.typedecl_all_structs
+ if td.namespace == self._name])
@property
def enums(self):
- return [ td for td in self._unit.typedecl_all_enums
- if td.namespace == self._name]
+ return sorted([ td for td in self._unit.typedecl_all_enums
+ if td.namespace == self._name])
### Eolian Classes ##########################################################