Bugs item #2038921, was opened at 2008-08-05 16:00
Message generated for change (Comment added) made by lebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2038921&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: syntax error when macro-file is not terminated by newline

Initial Comment:
Hi,

I found a small bug of the macro-language interpreter.

The macro file with content like

$test = $empty_array
$test["test"] = "test"

gives syntax error when the file is not terminated by '\n'.

All is OK when other construction like

define test {
        return
}

stands at the file end (also not terminated by '\n').
 
All is OK in both cases if files are saved via File menu
since NEdit automatically terminates them by '\n'.
But the problem occurs when a macro-file is created via the write_file() macro.

The bug is observed for both NEdit-5.5 and NEdit-5.6.
But NEdit-5.5 detects parse error and NEdit-5.6 detects syntax error.

Alexey Kuznetsov

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-08-20 16:58

Message:
Logged In: YES 
user_id=122956
Originator: NO

Commited, but I can't close this bug anyway.

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-08-19 19:49

Message:
Logged In: YES 
user_id=122956
Originator: NO

I posted a patch to the mail list.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-08-05 17:04

Message:
Logged In: NO 

You are completely right if interpreter detects syntax error for ANY
macro-file
not terminated by newline. I wrote that some files are considered 
as correct, but for some files syntax error is detected.

I think, the interpreter must detect (or fix) an error in ANY file
containing this error.

Alexey

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-08-05 16:19

Message:
Logged In: YES 
user_id=122956
Originator: NO

You can't call this thing a "file" if you are in the POSIX environment,
because POSIX defines a text file as lines ending with a newline. So
actually its your fault if you try to load a macro file without a final
newline. Beside this, the newline is the command separator in the NEdit
macro language, so second fault on your side.

So I wouldn't call this a bug from NEdit, but from the user.

I mean, if you have a syntax error in a C file (e.g. a missing ';'), you
don't blame the compiler, didn't you?

Sure, we can be so smart and add a newline on file load. And I think we
should, for the sake of the dumb users outside.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2038921&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to