sayotte / iscdhcp

Go goyacc-based config file parser/generator for ISC-DHCP
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Parse example configuration #1

Open idefixcert opened 4 years ago

idefixcert commented 4 years ago

I tried to parse the example configuration from https://github.com/42wim/isc-dhcp/blob/master/server/dhcpd.conf.example even If I delete the comments it does not work.

sayotte commented 4 years ago

Can you elaborate on “does not work”?

What did you expect, and what did you see instead?

idefixcert commented 4 years ago

I get the error: 2019/09/26 17:27:33 iscdhcp.Decode(): error at (or just before) token "domain-name": syntax error I expect, that I can use a isc-dhcp.conf file an parse it with the parser.

sayotte commented 4 years ago

Fair enough-- the parser is incomplete in its coverage, actually it only covers the ones that I needed when I created it, and I haven't needed it much since.

The domain-name statement is super common. Would you consider adding that support and sending me a PR? You'd need to:

All told, that is probably ~25 lines of change, and I've just updated the project to current standards (made it a Go module, migrated to golangci-lint).

Or, I could add this myself. But my concern is that it'll actually be an onion-- after adding domain-name we'll see that it lacks support for another statement, then another, and so on. And, putting a fine point on it, I can't take time away from other things to dig that deep. But I could probably support you with code reviews if you have the time to do the discovery/fix iterations.