# Path: jasy/js/MetaData.py
# class MetaData:
#     """ 
#     Data structure to hold all meta information. 
#     
#     A instance of this class is typically created by processing all 
#     meta data relevant tags of all doc comments in the given node structure.
# 
#     Hint: Must be a clean data class without links to other 
#     systems for optiomal cachability using Pickle
#     """
#     
#     __slots__ = ["name", "requires", "optionals", "breaks", "assets"]
#     
#     def __init__(self, tree):
#         self.name = None
#         
#         self.requires = set()
#         self.optionals = set()
#         self.breaks = set()
#         self.assets = set()
#         
#         self.__inspect(tree)
#         
#         
#     def __inspect(self, node):
#         """ The internal inspection routine """
#     
#         # Parse comments
#         comments = getattr(node, "comments", None)
#         if comments:
#             for comment in comments:
#                 commentTags = comment.getTags()
#                 if commentTags:
# 
#                     if "name" in commentTags:
#                         self.name = list(commentTags["name"])[0]
#                     if "require" in commentTags:
#                         self.requires.update(commentTags["require"])
#                     if "load" in commentTags:
#                         # load is a special combination shorthand for requires + breaks
#                         # This means load it but don't require it being loaded first
#                         self.requires.update(commentTags["load"])
#                         self.breaks.update(commentTags["load"])
#                     if "optional" in commentTags:
#                         self.optionals.update(commentTags["optional"])
#                     if "break" in commentTags:
#                         self.breaks.update(commentTags["break"])
#                     if "asset" in commentTags:
#                         self.assets.update(commentTags["asset"])
# 
#         # Process children
#         for child in node:
#             if child is not None:
#                 self.__inspect(child)


import sys, os, unittest, logging
import jasy.js.parse.Parser as Parser
from jasy.js.MetaData import MetaData
#!/usr/bin/env python3


# Extend PYTHONPATH with local 'lib' folder
if __name__ == "__main__":
    jasyroot = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir, os.pardir, os.pardir))
    sys.path.insert(0, jasyroot)
    print("Running from %s..." % jasyroot)


        
class Tests(unittest.TestCase):

    def process(self, code):
        tree = Parser.parse(code)

# Path: jasy/js/MetaData.py
# class MetaData:
#     """ 
#     Data structure to hold all meta information. 
#     
#     A instance of this class is typically created by processing all 
#     meta data relevant tags of all doc comments in the given node structure.
# 
#     Hint: Must be a clean data class without links to other 
#     systems for optiomal cachability using Pickle
#     """
#     
#     __slots__ = ["name", "requires", "optionals", "breaks", "assets"]
#     
#     def __init__(self, tree):
#         self.name = None
#         
#         self.requires = set()
#         self.optionals = set()
#         self.breaks = set()
#         self.assets = set()
#         
#         self.__inspect(tree)
#         
#         
#     def __inspect(self, node):
#         """ The internal inspection routine """
#     
#         # Parse comments
#         comments = getattr(node, "comments", None)
#         if comments:
#             for comment in comments:
#                 commentTags = comment.getTags()
#                 if commentTags:
# 
#                     if "name" in commentTags:
#                         self.name = list(commentTags["name"])[0]
#                     if "require" in commentTags:
#                         self.requires.update(commentTags["require"])
#                     if "load" in commentTags:
#                         # load is a special combination shorthand for requires + breaks
#                         # This means load it but don't require it being loaded first
#                         self.requires.update(commentTags["load"])
#                         self.breaks.update(commentTags["load"])
#                     if "optional" in commentTags:
#                         self.optionals.update(commentTags["optional"])
#                     if "break" in commentTags:
#                         self.breaks.update(commentTags["break"])
#                     if "asset" in commentTags:
#                         self.assets.update(commentTags["asset"])
# 
#         # Process children
#         for child in node:
#             if child is not None:
#                 self.__inspect(child)


# Path: jasy/test/js/meta.py
import sys, os, unittest, logging
import jasy.js.parse.Parser as Parser
from jasy.js.MetaData import MetaData

#!/usr/bin/env python3


# Extend PYTHONPATH with local 'lib' folder
if __name__ == "__main__":
    jasyroot = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir, os.pardir, os.pardir))
    sys.path.insert(0, jasyroot)
    print("Running from %s..." % jasyroot)


        
class Tests(unittest.TestCase):

    def process(self, code):
        tree = Parser.parse(code)

        meta = MetaData(tree)