Commit Graph

55 Commits

Author SHA1 Message Date
Maurice Makaay 63cbe18d03 Backup work, before switching from module development setup to standard GOPATH workspace setup (some tooling simply is not yet working with it, and I mainly miss refactoring a lot) 2019-06-27 07:36:24 +00:00
Maurice Makaay b95f255ae7 Moved all parser code into subpackage 'parse'. 2019-06-26 21:51:42 +00:00
Maurice Makaay 54cb75955d Went over the full TOML AST implementation to give stuff good names.
Also pushed all tests to ast_test to make sure that the public interface
is sufficient for using the package
2019-06-26 15:38:32 +00:00
Maurice Makaay 688894dbf2 Extracted the toml AST to its own subpackage. Preparation for having encoder and decoder as well, not all inside the main toml dir. 2019-06-26 13:57:22 +00:00
Maurice Makaay da62fc078e Removed .vscode folder from repo. 2019-06-26 12:55:30 +00:00
Maurice Makaay fd9365b842 Implemented inline tables + tests. 2019-06-26 12:54:04 +00:00
Maurice Makaay 97153fc806 Brought test coverage too 100%. 2019-06-26 07:18:42 +00:00
Maurice Makaay 608e68c207 Cleaning up test code. 2019-06-26 06:39:41 +00:00
Maurice Makaay c536dd1243 Huge overhaul in AST handling. The AST is now fully integrated with the parser, which has been simplified quite a bit because of this. 2019-06-25 21:29:05 +00:00
Maurice Makaay 15560b29b0 Added a good string formatter for the AST, to making testing more straight forward. 2019-06-24 07:05:38 +00:00
Maurice Makaay 8838dc9c44 Backup work. 2019-06-23 12:05:52 +00:00
Maurice Makaay 726b5a377b A bit of code cleanup, to let the date/time code better represent the ideas behind the followed methodology. 2019-06-19 11:28:03 +00:00
Maurice Makaay 45245e05b6 Some small cleanup, committing before I continue with inline lists. 2019-06-19 11:09:26 +00:00
Maurice Makaay c405260ea6 All base value types for TOML implemented (added date/time types and implemented correct detection of the possible value types). All examples from the TOML specification key/value assignments have been added to the unit tests. All are gree :-) 2019-06-19 10:42:51 +00:00
Maurice Makaay fd66f63588 And stil... it can be cleaner and simpler. 2019-06-18 23:26:15 +00:00
Maurice Makaay 1c8f5ffe7e Added booleans ...that was boring. 2019-06-18 23:24:23 +00:00
Maurice Makaay c29afaeacc Nope, NOW I'm done with the number types. On reading the docs, I noticed
that I missed an implementation for floats 'nan' and 'inf'. All taken care
of now!
2019-06-18 23:13:59 +00:00
Maurice Makaay 278efd7dbe Implemented all number formats for TOML. 2019-06-18 22:52:45 +00:00
Maurice Makaay e8739d38ea Implemented the TOML number formats (integer, binary, octal, hexadecimal. 2019-06-18 15:45:33 +00:00
Maurice Makaay 51a093efc5 Added some docs from the TOML specs to the code for easy reference. 2019-06-17 23:44:32 +00:00
Maurice Makaay e1ef9df7ca Implemented all string types and key types 2019-06-17 23:25:39 +00:00
Maurice Makaay b49715652e Brought the TOML code up-to-speed with the latest version of parsekit. 2019-06-17 13:59:59 +00:00
Maurice Makaay 269bd9ed36 Compatbility with parsekit v0.0.2 2019-05-26 09:26:17 +00:00
Maurice Makaay 9ab468a3ba Compatiblity with the latest parsekit version. 2019-05-25 22:53:37 +00:00
Maurice Makaay 0ac419fb9e Compatibility with latest parsekit. 2019-05-24 20:50:51 +00:00
Maurice Makaay 3cc6fed3df Commit to get compatibility with the latest parsekit. 2019-05-24 16:01:35 +00:00
Maurice Makaay 3e0c9136c3 Moved EOF handling into parsekit and updates for code-compatiblity with latest parsekit version. 2019-05-24 13:58:00 +00:00
Maurice Makaay 6a4a314fee Backup work. 2019-05-24 12:41:53 +00:00
Maurice Makaay 6af770a918 Compatibility with the latest parsekit module. 2019-05-23 00:02:53 +00:00
Maurice Makaay 234bbdf30f Compatibility with new atoms in parsekit. 2019-05-22 12:44:52 +00:00
Maurice Makaay 9a13e0dd7a Split off the parsekit code into a separate repository and Go module. 2019-05-21 15:25:06 +00:00
Maurice Makaay a3947feea7 Some changes to see how they reflect in godoc. 2019-05-21 13:23:30 +00:00
Maurice Makaay 9c0b889499 Adding a go file to the module root to make 'go get' happy. 2019-05-21 13:03:20 +00:00
Maurice Makaay 478efe3e25 Backup work. 2019-05-21 12:49:42 +00:00
Maurice Makaay d9d837fe6e Added a load of parser/combinator implementation, the system seems feasible! 2019-05-20 22:40:59 +00:00
Maurice Makaay 3677ab18cb Backup work on code cleanup now the parser/combinator code is stable. 2019-05-20 12:24:36 +00:00
Maurice Makaay 84ae34fb5f Just a bit of code formatting. 2019-05-19 23:44:11 +00:00
Maurice Makaay e3e408dfdb Phew, that was quite the update. I've now got a working implementation of a parser/combinator-like matching API, which prevents us from having to specify everything in state functions. That is way too low level for a lot of things. I'd rather have parser/combinator-style definitions for chunks of the input and keeping the state functions for higher level document structure parsing. 2019-05-19 23:35:03 +00:00
Maurice Makaay 55e23874f7 Hmm... even beter wording! Fully from the parser writer's perspective, hiding internals. 2019-05-18 13:21:56 +00:00
Maurice Makaay a569c430d5 More sensible state naming. No need to prefix every state function with state_. 2019-05-18 01:49:30 +00:00
Maurice Makaay e2e4fbd901 Slightly improved routing handling to prevent repeition in code for string parsing. 2019-05-18 01:28:27 +00:00
Maurice Makaay 4556520582 Added some more straightforwardness to the pattern magic coding. I can now write stuff like p.After(upper, upper, 4hex).Store() to store runes in the string buffer when the match is complete. Other options instead of Store() are for now Backup() (making it more of a peek) or Ignore() (skipping over the scanned text). I think this methodology forms a nice mental representation for the coder that uses the library. It's close to how we think about parsing (or at least I do) 2019-05-18 01:19:25 +00:00
Maurice Makaay 666cff3af3 Ahhhh found a name that clicked for the more general layer of the parser code: parsekit. That is short and tells me what it is. It's not a parser, but something to build parsers with. Now I could also name the actual parsing code as I would like to, namely 'toml/parser'. So it feels like the structure is settling down. 2019-05-17 22:03:10 +00:00
Maurice Makaay 3f638c59cd Some huge refactorings before I start moving forward again. Learned a lot about Go in the meanwhile, and more ideas keep popping up to improve what I've got so far even further. 2019-05-17 19:56:55 +00:00
Maurice Makaay 9f19add210 Now the parser code is out of the way, we can split up the state functions describing the syntax of TOML into separate files, while still keeping it maintainable. 2019-05-17 14:13:25 +00:00
Maurice Makaay db4a8f7942 Removed some source files that are not used anymore, after the refactoring steps. 2019-05-17 12:46:09 +00:00
Maurice Makaay f86ef2b918 Splitting off a more generic parser (it's fun getting to know a language, but you keep refactoring with all new stuff that you learn :-) 2019-05-17 12:44:24 +00:00
Maurice Makaay aeb48edc44 A little round of code cleanup. 2019-05-17 00:34:00 +00:00
Maurice Makaay 453a625a38 Fixed cursor position tracking (to report row + column on error). All tests are green again :-) 2019-05-17 00:11:12 +00:00
Maurice Makaay 29a13834dd Simplify, simplify, simplify, and make handling of invalid UTF8 or unexpected en of file more robust. 2019-05-16 23:26:43 +00:00