Skip to content

Commit

Permalink
feat: ?<JavaScript_Method> ( Fixes #230 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Sep 22, 2024
1 parent dcb9f4f commit ed939b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions RegEx/JavaScript/Method.regex.source.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt'
$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path

New-Regex -Description "JavaScript Method" |
New-RegEx -After '[\r\n\;]' -Comment 'After a newline or semicolon' |
New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' |
New-RegEx -Name MethodName -Pattern '[^/\(\)\{\}]' -Repeat -Comment 'Method Name' |
New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' |
New-RegEx -Name MemberParameters -Pattern '?<BalancedParenthesis>' -Comment 'Method Parameters' |
New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' |
New-RegEx -Name MemberBody -Pattern '?<BalancedCurlyBracket>' -Comment 'Method Body' |
Set-Content -Path (Join-Path $myRoot $myName)

0 comments on commit ed939b5

Please sign in to comment.