-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ?<JavaScript_Method> ( Fixes #230 )
- Loading branch information
James Brundage
committed
Sep 22, 2024
1 parent
dcb9f4f
commit ed939b5
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |