delorie.com/archives/browse.cgi | search |
> On 8 Feb 2015, at 15:30, John Doty <jpd AT noqsi DOT com> wrote: > > Shudder. Here anybody who’s processing this in a textutilish way needs to write a whole bunch of extra stuff to remove all of the unneeded punctuation. “5” is a perfectly good number, but “5,” isn’t. Ok, make it "5 ," then. Lua doesn't care about the white space and neither do I. > This also demonstrates the sort of misconception that can creep in with this approach. “device=‘resistor’” is wrong: to the parser, text is text. Whether the “=“ is to be interpreted depends on what you are doing. In text sometimes there’s no “=“, sometimes more than one. Often, “=" punctuates an attribute, but sometimes it’s just part of a note to the reader. Not the parser’s call. I just showed one way of representing it. 'device=resistor' is just as acceptable as device='resistor'. > The file format should be language-neutral. We have that now. No we don't. We have a format that's clearly biased towards your toolset. > If it ain’t broke, don’t fix it. If Lua is as good as you claim, you could have written a parser for the existing format in the time we’ve wasted here. What problem does changing the file format solve? It brings consistency and structure. It means we have one single format and language that can be used across the entire gEDA suite, for data, configuration and scripting; and it becomes trivial to manipulate that data in a well ordered manner - gnetlist becomes a rather trivial wrapper that simply loads the data file and chooses the correct backend. The backend has immediate, unfettered access to the entire object tree without any information hiding or abstraction. That's what you wanted, wasn't it? Frankly, if we're reduced to quibbling about comma and quote placement then I'm inclined to believe that you're just arguing for the sake of it; that you're happy to stand against any form of progress if it has any impact at all on the way you currently work. That being the case I'm happy simply to modify your initial command to: convert_to_johns_friendly_format.lua Interface.*.sch | awk '/^C /{print $7}' | sort | uniq and just jog on. Chris
webmaster | delorie software privacy |
Copyright 2019 by DJ Delorie | Updated Jul 2019 |