Powershell 5 parser
-
I was working on a project that utilised Powershell 5 classes. I made this modification to my functionList.xml. I jumbly submit it here for those it may help (and for anyone that has improvements)
<!-- ================================================== [ PowerShell 5 ] --> <parser displayName="PowerShell" id ="powershell_syntax" commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`) (?s:\x3C\x23(?:[^\x23]|\x23[^\x3E])*\x23\x3E) # Multi Line Comment | (?m-s:\x23.*$) # Single Line Comment " > <classRange mainExpr ="(?ms)class\s+[A-Za-z_0-9\-]+[^{]*({(((?>[^{}]+)|(?1))*)})" > <className> <nameExpr expr="(?:class\s+)([^{]*)" /> </className> <function mainExpr="(?xmi)(?:\[[A-Za-z:\.\[\]]*\]) \s* [A-Za-z_\-]+ [^{]+" > <functionName> <funcNameExpr expr=".*" /> </functionName> </function> </classRange> <function mainExpr="(?xmi)(?:function|filter) \s* [A-Za-z_\-]+ [^{]+ " > <functionName> <nameExpr expr="(?i)[A-Za-z_\-]*\s*[^{]+" /> </functionName> </function> </parser>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login