|
|
@ -8,12 +8,12 @@ import (
|
|
|
|
var whitespaceChars = []rune{' ', '\t', '\n'}
|
|
|
|
var whitespaceChars = []rune{' ', '\t', '\n'}
|
|
|
|
var digitChars = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
|
|
|
|
var digitChars = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
|
|
|
|
var wordChars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")
|
|
|
|
var wordChars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")
|
|
|
|
var LBRACKET rune = 0xF0000
|
|
|
|
var LBRACKET rune = 0xF0001
|
|
|
|
var RBRACKET rune = 0xF0001
|
|
|
|
var RBRACKET rune = 0xF0002
|
|
|
|
var ANY_CHAR rune = 0xF0002 // Represents any character - used for states where the allChars flag is on.
|
|
|
|
var ANY_CHAR rune = 0xF0003 // Represents any character - used for states where the allChars flag is on.
|
|
|
|
var LPAREN_CHAR rune = 0xF0003 // Parentheses in regex are concatenated with this - it acts as a pseudio-parentheses
|
|
|
|
var LPAREN_CHAR rune = 0xF0004 // Parentheses in regex are concatenated with this - it acts as a pseudio-parentheses
|
|
|
|
var RPAREN_CHAR rune = 0xF0004
|
|
|
|
var RPAREN_CHAR rune = 0xF0005
|
|
|
|
var NONCAPLPAREN_CHAR rune = 0xF0005 // Represents a non-capturing group's LPAREN
|
|
|
|
var NONCAPLPAREN_CHAR rune = 0xF0006 // Represents a non-capturing group's LPAREN
|
|
|
|
|
|
|
|
|
|
|
|
// Returns true if str[idx] and str[idx-1] are separated by a word boundary.
|
|
|
|
// Returns true if str[idx] and str[idx-1] are separated by a word boundary.
|
|
|
|
func isWordBoundary(str []rune, idx int) bool {
|
|
|
|
func isWordBoundary(str []rune, idx int) bool {
|
|
|
|