Recent

Author Topic: Latest trunk and issues with unit filenames with dots in them?  (Read 3411 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Latest trunk and issues with unit filenames with dots in them?
« on: October 06, 2017, 11:19:35 pm »
I'm updating my Lazarus from the trunk once or twice a week.

The main projects I work with have dots in their filenames, like "ProjectName.UI.Forms.Main.pas".

About two weeks ago (I might try to pick the exact release if necessary later), the IDE changed it's behaviour. In many files, when I press Ctrl+Shift+Up and +Down to navigate, or try to auto-complete a variable, it jumps to the "unit" line at the top and complains that it would expect "end." instead of the word following the first dot.

This is not always happening, otherwise I would have created a simple test file (tried a few times, but could not reproduce in test projects so far, but in all working projects). Adding another blank line after the final "end." of the unit often helps, unless there's an initialization part with $IFDEF inside, for example, and similar strange patterns.

Has, in the trunk, anything changed regarding future support of namespaces for example, that would now disallow dots in unitnames?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Latest trunk and issues with unit filenames with dots in them?
« Reply #1 on: October 07, 2017, 12:36:23 am »
Mattias made such changes at least in r55944, r55946, r55948 and 55951.
You could test which one broke the parsing of your code.
The bug should be reproducible before it can be fixed. I hope you find steps to do it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Latest trunk and issues with unit filenames with dots in them?
« Reply #2 on: October 07, 2017, 08:09:21 pm »
Thanks a lot for identifying interesting commits! I find the problem even in 55944. Here are exact details:

Message: "Project5.UI.Frame.VPN.pas(1,18) Error: expected end., but Frame found"
Marked code line: "unit Project5.UI.Frame.VPN;"

I stripped down the unit to a minimum. It's also attached in a zip file in case it's a byte-specific thing (e.g. the last line break seems to play a role).

Code: Pascal  [Select][+][-]
  1. unit Project5.UI.Frame.VPN;
  2.  
  3. interface
  4.  
  5. type
  6.    TFrameProject5VPN = class(TProject5Frame)
  7.    public
  8.       class function ShowsWheel: boolean; override;
  9.    end;
  10.  
  11. implementation
  12.  
  13. class function TFrameProject5VPN.ShowsWheel: boolean;
  14. begin
  15.    Result := True;
  16. end;
  17.  
  18. initialization
  19.    AddProject5FrameClass(TFrameProject5VPN);
  20. end.

Here are my steps to reproduce the issue:

  • Start Lazarus
  • Open Test Project LazFNWithDots.lpr
  • Open Project5.UI.Frame.VPN.pas via Project Inspector
  • The Messages pane will show an error.
  • Click the class function line, then press Ctrl+Shift+Down to try to go down to the implementation. Instead, the editor will jump to the unit line, showing the error again.

I can write a Mantis ticket as well, but maybe someone can confirm this isn't something odd on my system only?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Latest trunk and issues with unit filenames with dots in them?
« Reply #3 on: October 08, 2017, 12:51:45 am »
I tested with your project. I cannot reproduce the problem. Jumping in the code and parsing works well here.
Try building Lazarus clean. It usually solves problems.
If not, then you could try to bisect the guilty revision:
 http://wiki.freepascal.org/How_do_I_create_a_bug_report#Regression_caused_by_a_certain_revision

Could OS have an effect? I am testing on Linux.
« Last Edit: October 08, 2017, 12:55:43 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Latest trunk and issues with unit filenames with dots in them?
« Reply #4 on: October 10, 2017, 12:04:08 pm »
Just using "Clean all" when building Lazarus didn't help, I tried that along with checking for any svn conflicts.
But I made another attempt at fpcupdeluxe into a fresh folder yesterday, and it seems to no longer appear in that completely fresh installation.
Sorry for reporting without having tried that first :) And thanks for pointing me into the right direction!

 

TinyPortal © 2005-2018