Instead, use the following logic to deduce the name inside the lobster file:
for the first occurrence per file, just take the name as is
for the second and all consecutive occurrences of functions with the same name in the same file, append a counter value (which just indicates how many times the function has been declared previously).
Example:
Python file 1:
First func becomes func
Second func becomes func-2
Third func becomes func-3
and so on
Python file 2:
First func becomes func
Second func becomes func-2
Third func becomes func-3
and so on
The new feature here are the lines "tag": "python file.hello_world" and "tag": "python file.hello_world-2".
No line number shall be appended, but instead a counter (starting from 2).
If hello_world or hello_universe are defined again in different files, then the generation of the tags shall not be influenced by those other files. That is, the tag generator shall only look at one single file at a time.
See comment https://github.com/bmw-software-engineering/lobster/pull/39#discussion_r1655077765
lobster-python
shall not use line numbers as unique identifiers.Instead, use the following logic to deduce the name inside the lobster file:
Example: Python file 1: First
func
becomesfunc
Secondfunc
becomesfunc-2
Thirdfunc
becomesfunc-3
and so onPython file 2: First
func
becomesfunc
Secondfunc
becomesfunc-2
Thirdfunc
becomesfunc-3
and so onConsider the following Python code
file.py
:The expected
lobster-python
output file shall look like this:The new feature here are the lines
"tag": "python file.hello_world"
and"tag": "python file.hello_world-2"
. No line number shall be appended, but instead a counter (starting from 2).If
hello_world
orhello_universe
are defined again in different files, then the generation of the tags shall not be influenced by those other files. That is, the tag generator shall only look at one single file at a time.