Created a function to return a state that will always have a zero-length state
This commit is contained in:
		
							
								
								
									
										9
									
								
								nfa.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								nfa.go
									
									
									
									
									
								
							@@ -333,3 +333,12 @@ func newState() State {
 | 
			
		||||
	ret.output = append(ret.output, &ret)
 | 
			
		||||
	return ret
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Creates and returns a state that _always_ has a zero-length match.
 | 
			
		||||
func zeroLengthMatchState() State {
 | 
			
		||||
	start := newState()
 | 
			
		||||
	start.content = newContents(EPSILON)
 | 
			
		||||
	start.isEmpty = true
 | 
			
		||||
	start.assert = ALWAYS_TRUE
 | 
			
		||||
	return start
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user