added nkError to the AST (#17567)
* added nkError to the AST * Update lib/core/macros.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update compiler/ast.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
parent
1a407402a4
commit
cfff27529e
6 changed files with 90 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ proc parseURL(url: string): TURL =
|
|||
var pattern: string = r"([a-zA-Z]+://)?(\w+?\.)?(\w+)(\.\w+)(:[0-9]+)?(/.+)?"
|
||||
var m: array[0..6, string] #Array with the matches
|
||||
newSeq(m, 7) #ERROR
|
||||
discard regexprs.match(url, re(pattern), m)
|
||||
discard re.match(url, re(pattern), m)
|
||||
|
||||
result = (protocol: m[1], subdomain: m[2], domain: m[3] & m[4],
|
||||
port: m[5], path: m[6].split('/'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue