Closed ffunenga closed 8 years ago
You see, the problem of making a code generator consists of 2 parts:
In our case the problem (2) is easy—just some string manipulation, and the problem (1) is hard—we need to implement a big subset of docopt functionality in C (the part of functionality that occurs at run-time and, thus, we cannot reuse Python implementation for that).
That is why we need test_docopt.c
—tests for the hard problem. We also use docopt.c
, because we cannot test template, we need to test some C code that could be compiled. log.h
is just handy during development, it will be removed eventually.
I noticed that you're mostly targeting the (2) problem and almost dismissing the (1). You should take a closer look at it. Right now docopt.c supports only options and no pattern-matching. The pattern-matching needs to be implemented in C, since it happens during the run-time of the end-user program, and it's a hard task.
Let's get back to this after we have implemented other features like positional arguments, commands and pattern matching?
@halst ok, after the str.replace I'll be looking at the C code
@kblomqvist ok
I dont understand why the following files are in the repository:
IMO, all the files in the upstream repo should have a justification why they are where they are.
I know @halst and @kblomqvist have shown their preference for
all files go to level 0
but I don't see any reason why NOT to: