Ross, I am delighted that someone wants to improve noweb's support for Python, and I took a quick look at your patches. I'm sorry to report that I am not very happy with the decisions that you have made. Perhaps we can work together to identify a way that noweb can support Python which will be more in keeping with the original design, and which I feel that I can incorporate into upstream sources and maintain.
> I could not simply add pipeline stages since the tangled file needs to > refer to itself and to the .nw file I'm not sure why you would ever want the tangled file to refer to itself, since the purpose of a #line directive is to refer to the original noweb sources. > the filenames are not available in standard processing. Have you overlooked the @file tag in noweb's filter representation? File names are available there. > I also wanted to add column information to the -L directive... > I found the out of the box behavior of -L not to work with > python--it screwed up the indentation of subsequent lines. Notangle in general, when used with the -L directive, has been carefully crafted to ensure that each character of code in the tangled output resides in the *same* column as it did in the original sources. However, this technique will clearly not work in languages like Python or Haskell, where indentation is significant, and the source code *must* be moved from its original position. Because the -L option *does* preserve the information about the original columns, I believe it may be best for you to shift the code using either a noweb filter or perhaps a postprocessing step. (I wrote noweb 23 years ago, and I don't remember exactly where the #line directives are introduced.) I'm handicapped by not knowing anything about what Python uses in place of #line or how you intend to exploit it. I inspected your patches but was not able to figure out the big picture, other than that you plan further postprocessing at run time with your 'detangle' script. > I'm also contemplating using the python ast module to parse the code > for index purposes in noweave. Currently, only notangle has changed. I've had good luck using several different compilers to parse code and index it. I've always done this without touching noweb. Norman -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org