View Issue Details

IDProjectCategoryView StatusLast Update
0006485JEDI VCL00 JVCL Componentspublic2020-05-19 10:16
ReportermatorAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0006485: jvInterpreter cannot handle repeated uses
DescriptionTestScript uses 'lib\Lib1' and 'lib\Lib2'
Lib1 uses 'lib\Lib2'

The jvInterpreter throws a duplicate identifier on whatever the first identifier is (constant, variable, or function) in Lib2.
Additional InformationThis can be fixed by adding a single line of code to jvInterpreter.pas -> procedure TJvInterpreterUnit.ReadUnit (starting at line 7964):

procedure TJvInterpreterUnit.ReadUnit(const UnitName: string);
var
  OldUnitName: string;
  OldSource: string;
  S: string;
begin
  if FAdapter.UnitExists(UnitName) then
    Exit;
  FAdapter.AddSrcUnit(FCurUnitName, '', '');
  FAdapter.AddSrcUnit(UnitName, '', ''); // the line of code added
...


Adding this line of code simply prevents the jvInterpreter from attempting to call InterpretUnit on the same unit twice.
TagsNo tags attached.

Activities

mator

2016-01-17 18:49

reporter   ~0021268

I need to correct something here. The example I gave is actually a trivial example which can be resolved by changing the uses line to just

uses 'lib\Lib1';

A better example:

Lib1 uses Lib3
Lib2 uses Lib3

putting:

uses 'lib\Lib1', 'lib\Lib2';

Will always lead to a redeclared identifier error.

obones

2018-07-18 15:36

administrator   ~0021478

Please provide the zipped sources of an application showing this.

mator

2018-07-18 19:29

reporter   ~0021558

Hi obones,

Sorry but I've moved on from using Delphi/Jedi for development for my applications and won't be able to provide an example.

Regards,
- Mator

mh

2019-04-26 20:24

reporter   ~0021750

Created a pull request for this:
https://github.com/project-jedi/jvcl/pull/95

obones

2020-05-19 10:16

administrator   ~0021916

As asked before, could you please provide the zipped sources of a sample application showing this?

Issue History

Date Modified Username Field Change
2016-01-06 04:35 mator New Issue
2016-01-17 18:49 mator Note Added: 0021268
2018-07-18 15:36 obones Note Added: 0021478
2018-07-18 15:36 obones Status new => feedback
2018-07-18 19:29 mator Note Added: 0021558
2019-04-26 20:24 mh Note Added: 0021750
2020-05-19 10:16 obones Note Added: 0021916