[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #64903] Command window may not accept mutliple
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments |
Date: |
Thu, 16 Nov 2023 16:31:20 -0500 (EST) |
Update of bug #64903 (project octave):
Item Group: Matlab Compatibility => Regression
Release: 8.2.0 => stable
Operating System: Microsoft Windows => Any
_______________________________________________________
Follow-up Comment #3:
Looking through hg log for lex.ll, the most relevant changeset is this:
https://hg.savannah.gnu.org/hgweb/octave/rev/d938c4d22200
Related: bug #58198, which was marked as a regression blocker for Octave 6.
Marking this current bug as a regression since it worked before Octave 6.
This attempt at a patch is on the right path but not fully correct. I tried to
adapt the single-line comment parsing code a little below this part of lex.ll,
as seen in the above changeset. With the patch, it doesn't end immediately
after the block comment ends, but it doesn't end after the for loop ends
either! Needs more work...
diff -r b5e433b52bc3 libinterp/parse-tree/lex.ll
--- a/libinterp/parse-tree/lex.ll Mon Nov 13 16:58:52 2023 +0100
+++ b/libinterp/parse-tree/lex.ll Thu Nov 16 16:18:37 2023 -0500
@@ -762,16 +762,21 @@ ANY_INCLUDING_NL (.|{NL})
curr_lexer->m_block_comment_nesting_level--;
- int status = -1;
-
- if (curr_lexer->m_block_comment_nesting_level == 0)
+ if (curr_lexer->pending_token_count () > 0)
+ {
+ HANDLE_EOB_OR_EOF (-1);
+ }
+ else if (curr_lexer->m_block_comment_nesting_level == 0)
{
- status = -2;
-
curr_lexer->pop_start_state ();
+ HANDLE_EOB_OR_EOF (-2);
}
-
- HANDLE_EOB_OR_EOF (status);
+ else
+ {
+ curr_lexer->pop_start_state ();
+ curr_lexer->xunput (yytext[0]);
+ }
+
}
%{
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64903>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments, Liang Tang, 2023/11/16
- [Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments, Markus Mützel, 2023/11/16
- [Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments, Liang Tang, 2023/11/16
- [Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments,
Arun Giridhar <=
- [Octave-bug-tracker] [bug #64903] Command window may not accept mutliple line comments, Arun Giridhar, 2023/11/17
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Arun Giridhar, 2023/11/17
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Liang Tang, 2023/11/17
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Arun Giridhar, 2023/11/17
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Liang Tang, 2023/11/18
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Liang Tang, 2023/11/19
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Arun Giridhar, 2023/11/19
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Liang Tang, 2023/11/19
- [Octave-bug-tracker] [bug #64903] Command window may not accept multiple line comments, Arun Giridhar, 2023/11/24