https://bugs.documentfoundation.org/show_bug.cgi?id=146608

--- Comment #6 from Mike Kaganski <[email protected]> ---
Code pointer:

SbiScanner::NextSym sets `bHash = true`, when it finds a starting hash, but not
ending; it is expected that such a hash represents a file number
(Open/Write/Seek and friends; it is checked in SbiParser::Channel); or as an
odd "feature" - a comment (see the code below `PrevLineCommentLbl`, which
assigns "REM" to aSym).

To fix this bug, we need to make sure in this method, that *either* the # is
really treated as comment (and then it masks the rest of the line; the code
like `CInt(#09/16/1989)` would become invalid in that case, and produce an
error); or # appears in a context that allows / expects such a character.

My idea would be to introduce a field in parser, which would allow (or disallow
by default) channel (and its #). It would be set in SbiParser::Write /
SbiParser::Open / whatever; and would be checked in SbiScanner::NextSym. When
channel was disallowed, and # appeared and wasn't handled as a different
entity, it would set an error.

A small issue is that we will need additionally to handle statements that allow
channel numbers, that we don't handle specially in parser: e.g., Seek. We would
need to introduce respective methods, or otherwise make sure, that when these
appear, we set the field / allow #.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to