markharwood edited a comment on pull request #1541:
URL: https://github.com/apache/lucene-solr/pull/1541#issuecomment-636710038


   On reflection, you're right - the single flag is trappy.
   I'd like to refactor this class to make this simpler. The root problem we 
have is propagating parser state (flags/options) down to the objects that 
represent clauses in the parse tree. This is made difficult by the fact that 
RegExp is a single class representing both the parser and the parsed nodes.
   I suggest refactoring so that :
   1) RegExp remains the user-facing class with the public constructor and has 
the parsing logic
   2) We use a new private class RegExpClause to hold clause state, but being 
an inner class it has access to the flags in the outer RegExp instance that 
contains it.
   
   This should solve the problem of propagating settings and give us a sounder 
footing to build on.
   Should I do this refactor as part of this PR or another @jpountz ?
   
   One issue is that this would technically be a breaking change as 
https://issues.apache.org/jira/projects/LUCENE/issues/LUCENE-9371 opened up the 
internal state of the parser and we will change the class of nodes.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to