How do you handle the scoping of parsers? #283
-
Just wondering how others handle the scoping of parser names. I only have one parser for the time being but as I add new devices I will have to add new parsers to handle their output. Right now the high-level parsers are global scope and for organization split across multiple source files, the lower level parsers used by the top-level parser are all private so not a problem. I can't use a struct to organize them as computed properties are not allowed in extensions so just wondering what the experts do in production code to control the scope of parser names and keep them isolated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I tried some ideas and I was able to use simple structures for organizing the parser code, once I found that static computed properties are permissible in extensions. So I get to control my variable scopes and organize the parser source files. |
Beta Was this translation helpful? Give feedback.
I tried some ideas and I was able to use simple structures for organizing the parser code, once I found that static computed properties are permissible in extensions. So I get to control my variable scopes and organize the parser source files.