Is it possible to write a Ini parser? #646
-
In examples, it usually has a tree-like object. Is it possible to write an Ini parser? The main concern is about the array syntax and section-merge, like: [section1]
foo[]=1
[section2]
bar=2
[section1]
foo[]=3
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
For now, I use chumksy to write a lexer to parse each line as one token and then collect all info to build the ini. It works well, still wonder is there any preferred way? |
Beta Was this translation helpful? Give feedback.
-
Sure! Parsing this should be possible. Note that things like section merging probably shouldn't be done in the parser anyway (one can imagine a parser that does this, but it's a bit unclear to throw it all in the same place). |
Beta Was this translation helpful? Give feedback.
Sure! Parsing this should be possible. Note that things like section merging probably shouldn't be done in the parser anyway (one can imagine a parser that does this, but it's a bit unclear to throw it all in the same place).