you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 3 months ago (3 children)

as someone who would also reach for a state machine when doing simple parsing... what's the better alternative in python?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 3 months ago (2 children)

    A loop and a data structure to hold the result of parsing. The data structure will have a state you can interrogate. No need to build a state machine to explicitly name each way the parsing can develop.

  • source
  • parent
  • hideshow 2 child comments