8 |
8 |
9 It uses the JavaScript parser contained in the jasy web framework. |
9 It uses the JavaScript parser contained in the jasy web framework. |
10 """ |
10 """ |
11 |
11 |
12 import ThirdParty.Jasy.jasy.js.parse.Parser as jsParser |
12 import ThirdParty.Jasy.jasy.js.parse.Parser as jsParser |
|
13 import ThirdParty.Jasy.jasy.js.tokenize.Tokenizer as jsTokenizer |
13 |
14 |
14 import Utilities |
15 import Utilities |
15 import Utilities.ClassBrowsers as ClassBrowsers |
16 import Utilities.ClassBrowsers as ClassBrowsers |
16 from . import ClbrBaseClasses |
17 from . import ClbrBaseClasses |
17 |
18 |
103 """ |
104 """ |
104 try: |
105 try: |
105 self.__root = jsParser.parse(self.__source) |
106 self.__root = jsParser.parse(self.__source) |
106 self.__visit(self.__root) |
107 self.__visit(self.__root) |
107 except jsParser.SyntaxError: |
108 except jsParser.SyntaxError: |
108 # ignore syntax errors |
109 # ignore syntax errors of the parser |
|
110 pass |
|
111 except jsTokenizer.ParseError: |
|
112 # ignore syntax errors of the tokenizer |
109 pass |
113 pass |
110 |
114 |
111 return self.__dict |
115 return self.__dict |
112 |
116 |
113 def __visit(self, root): |
117 def __visit(self, root): |