44 Commits (v0.4.0)

Author SHA1 Message Date
Aadhavan Srinivasan 595b86df60 Added comment to function
Aadhavan Srinivasan 9f9af36be8 Fixed bug where escaped parentheses in lookarounds were counted as regular parentheses instead of literals
Aadhavan Srinivasan 1f06dcef64 Just declare the variable instead of initializing it as well
Aadhavan Srinivasan 3a2916baae Set 'isLazy' to true in the NFA, if the postfixNode has the flag set
Aadhavan Srinivasan 277cbc0fc5 Started working on lazy quantifier support
Aadhavan Srinivasan 1a890a1e75 Refactoring - remove duplicate code
Aadhavan Srinivasan fde3784e5a Added unicode charclass support within character classes; Fixed bugs with hex classes and unicode classes
Aadhavan Srinivasan 9cd330e521 More work on unicode character class support - fix bug where all characters aren't being matched
Aadhavan Srinivasan 44d6a2005c Started working on unicode character classes
Aadhavan Srinivasan 8327450dd2 Started implementing backreferences (octal values should now be prefaced with \0)
Aadhavan Srinivasan 668df8b70a Wrote MarshalText() and UnmarshalText() to implement TextMarshaler and TextUnmarshaler
Aadhavan Srinivasan 15ee49f42e Rename method receivers from 'regex' to 're' (it's shorter)
Aadhavan Srinivasan 9e12f9dcb3 Added field to Reg, denoting if we prefer longest match (POSIX style) or not (perl style)
Aadhavan Srinivasan 47f88c817f Fixed typo
Aadhavan Srinivasan c577064977 Added string field to Reg, that contains the expression string; wrote method to return the string
Aadhavan Srinivasan 99230b49de Use new function signature for zeroLengthMatchState()
Aadhavan Srinivasan 052de55826 question() now returns 2 values
Aadhavan Srinivasan 8534174ea1 Use pointers instead of values
Aadhavan Srinivasan cca8c7cda2 Got rid of transitions parameter, changed how kleene state is processed
I replaced the transition parameter for nfaState, replacing it with a
single nfaState pointer. This is because any non-alternation state will
only have one next state, so the map was just added complexity.

I changed alternation processing - instead of having their own dedicated
fields, they just use the new 'next' parameter, and another one called
'splitState'.

I also changed the kleene state processing to remove the unecessary
empty state in the right-side alternation (it actually messed up my
matching).
Aadhavan Srinivasan 5563a70568 Reverse the order in which I pop states for alternation, because this messes with the left branch-right branch thing
Aadhavan Srinivasan f94e3f2e71 Added comments
Aadhavan Srinivasan 6a96c98d04 Fixed bug where the regex '(()|.)(b)' wouldn't compile
Aadhavan Srinivasan 206fea34cd Added function to return the number of subexpressions in the group
Aadhavan Srinivasan f629a0f08f Added 'mustCompile' which panicks if there is an error compiling
Aadhavan Srinivasan 7431b1a7b2 Changed \Z to \z to fit with Go's naming
Aadhavan Srinivasan ee51e39d59 Added support for start-of-input (\A) and end-of-input (\Z) assertions
Aadhavan Srinivasan c3059fe899 Return a new error instead of rethrowing a non-existent error
Aadhavan Srinivasan 00c39857eb Rethrow errors instead of rewriting them
Aadhavan Srinivasan 57eb935bd1 Updated comment
Aadhavan Srinivasan cbd679949f Updated more referencs to constants
Aadhavan Srinivasan a63426d965 Updated references to constants
Aadhavan Srinivasan 2e3450285c Renamed one more variable to avoid exporting
Aadhavan Srinivasan 7e792f1248 Renamed more constants to avoid exporting
Aadhavan Srinivasan be60f2fb51 Updated references to 'epsilon'
Aadhavan Srinivasan e01ef48cbc Updated CONCAT to be a metacharacter instead of just a tilde, and renamed it to avoid exporting
Aadhavan Srinivasan 93474c5159 Renamed 'state' to 'nfaState' because 'state' by itself means nothing
Aadhavan Srinivasan 198a2c12a7 Renamed variable to avoid conflicting with type name
Aadhavan Srinivasan 7e88b8a4b0 Renamed variable to avoid conflicting with type name
Aadhavan Srinivasan 289bba35e2 Updated assertion constants so that they aren't exported
Aadhavan Srinivasan 7e6377a4c4 Updated more constants, so that they aren't exported
Aadhavan Srinivasan 73c6a442ce Updated nodeType constants so that they aren't exported
Aadhavan Srinivasan ca8f8e1030 Renamed function
Aadhavan Srinivasan 24a5045ebe Updated map and reduce function names so that they aren't exported
Aadhavan Srinivasan aef8152fc1 Renamed package 'greg' to 'regex'