On Fri, Aug 30, 2013 at 10:21 PM, Edward K. Ream <[email protected]>wrote:
> On Wed, Aug 28, 2013 at 8:36 PM, HaveF <[email protected]> wrote: > > https://gist.github.com/HaveF/6373152 >> > > Thanks for this. The erroneous message about inserting an @ignore > directive was easy to fix. > > The real bug is that code such as:: > > app.listen(port, function() { > console.log("Listening on " + port); > }); > > will generate a complaint about function "function" not ending in a > newline. > > Indeed, the '}' on the last line is followed by a ')', because the > definition of function is embedded in the call to app.listen(!) > > It's not at all clear what to do about this and related cases. Indeed, > it's hard to know whether we would actually want to put such a lightweight > definition in a node of its own. Otoh, such embedded functions are common, > and we often *would* rather put them in separate nodes. > > At present, the javascript import code is very simple: it just sets some > switches in the base scanner class and overrides the base class's notion of > what a string is. Clearly, at least some special-purpose hacking will be > required. My first thought is just to suppress the warning. This *might* > work, provided that the scanning can resume properly at the ')' and ';' > that follows the '}'. We shall see. > Still not works, it seems the importer remove } and add a '\n' instead. See line 6.(BTW, I use version "Leo 4.11a3, build 5947, 2013-09-07 02:53:50 -0500") reading: @auto web.js Warning: function function does not end with a newline; one will be added }); Warning: function function does not end with a newline; one will be added }); Error: @auto did not import @auto web.js perfectly The clean-all-lines command may help fix whitespace problems first mismatched line: 6 (original) = 6 (imported) Original file... 4 u"app.get('/', function(request, response) {\n" 5 u" response.send('Hello World!');\n" 6 u'});\n' 7 u' \n' 8 u'var port = process.env.PORT || 5000;\n' Imported file... 4 u"app.get('/', function(request, response) {\n" 5 u" response.send('Hello World!');\n" 6 u'\n' 7 u');\n' 8 u' \n' errors inhibited read @auto R:\web.js reading entire file into @auto node. reading: @edit web.js finished > > Edward > -- -- Sincerely, HaveF -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.
