diff options
author | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-12 21:06:25 -0500 |
---|---|---|
committer | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-12 21:06:25 -0500 |
commit | efb4f7d89caaabfb845c77fd6301e7dba7467faa (patch) | |
tree | a313b3d02ca95ba4819aa278275445cf2a267b3b /src/nre.nim | |
parent | e0cdad635bb7ae15259d8a7b365f441918f09fb3 (diff) | |
download | Nim-efb4f7d89caaabfb845c77fd6301e7dba7467faa.tar.gz |
Added some documentation
Diffstat (limited to 'src/nre.nim')
-rw-r--r-- | src/nre.nim | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nre.nim b/src/nre.nim index 72a5aa760..d2ee0f13b 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -11,13 +11,15 @@ from unicode import runeLenAt # Type definitions {{{ type Regex* = ref object - pattern*: string # not nil - pcreObj: ptr pcre.Pcre # not nil + ## Represents a compiled pattern + pattern*: string ## not nil + pcreObj: ptr pcre.Pcre ## not nil pcreExtra: ptr pcre.ExtraData ## nil captureNameToId: Table[string, int] RegexMatch* = ref object + ## Is returned upon a match. pattern*: Regex ## The regex doing the matching. ## Not nil. str*: string ## The string that was matched against. @@ -31,10 +33,15 @@ type CaptureBounds* = distinct RegexMatch SyntaxError* = ref object of Exception + ## Thrown when there is a syntax error in the + ## regular expression string passed in pos*: int ## the location of the syntax error in bytes pattern*: string ## the pattern that caused the problem StudyError* = ref object of Exception + ## Thrown when studying the regular expression failes + ## for whatever reason. The message contains the error + ## code. # }}} proc getinfo[T](pattern: Regex, opt: cint): T = |