utah-parser icon indicating copy to clipboard operation
utah-parser copied to clipboard

Exposing a proper iterator in "com.sonalake.utah.Parser"

Open sgoeschl opened this issue 4 years ago • 3 comments

In order to integrate with Apache FreeMarker I implemented an iterator (see https://github.com/apache/freemarker-generator/blob/master/freemarker-generator-tools/src/main/java/org/apache/freemarker/generator/tools/utahparser/impl/ParserWrapper.java)

Does it make sense to expose a Parser#iterator method out-of-the-box?

sgoeschl avatar Nov 08 '21 17:11 sgoeschl

Looks nice; if you wanted to issue a PR with this and some tests we can include it in the next release.

daniel-bray-sonalake avatar Nov 09 '21 18:11 daniel-bray-sonalake

Please have a look at https://github.com/sgoeschl/utah-parser/tree/UTAHPARSER-29

  • Deprecating "Parser#next"? Mixing that with an iterator will cause problems ...
  • Enforcing a single iterator only for a given Parser instance?

sgoeschl avatar Nov 09 '21 20:11 sgoeschl

We'll ponder this a little

daniel-bray-sonalake avatar Nov 10 '21 08:11 daniel-bray-sonalake