After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696325 - libvala: Get a list of all used defines ("pp conditionals")
libvala: Get a list of all used defines ("pp conditionals")
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Parser
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-21 20:18 UTC by Dominique Lasserre
Modified: 2018-05-22 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proof of concept (10+) (1.62 KB, application/octet-stream)
2013-03-21 20:18 UTC, Dominique Lasserre
  Details
Proof of concept (fixed) (12+) (1.78 KB, patch)
2013-03-25 16:17 UTC, Dominique Lasserre
none Details | Review

Description Dominique Lasserre 2013-03-21 20:18:41 UTC
Created attachment 239496 [details]
Proof of concept (10+)

Currently it is not possible to get a list of all used defines, e.g. #if FOOBAR, ... #elif BAR, etc -> FOOBAR, BAR, ... which is necessary for an IDE to provide a comprehensive language feature support.

Currently I am working around this limitation with a slightly modified local version of valaparser.vala and valascanner.vala (see attached patch for a proof of concept). But would like to avoid those modified copies (cause of code duplication, overhead, maintenance).

As the proof of concept shows it would be enough to provide a list of all defines by source file (and not by complete CodeContext - which also would be ok).
Comment 1 Dominique Lasserre 2013-03-25 16:17:48 UTC
Created attachment 239783 [details] [review]
Proof of concept (fixed) (12+)

With the first patch removing of used defines was not supported. With a defines list by source file (currently hash keys are strings: SourceFile.filename) removal is now possible.
Comment 2 Luca Bruno 2013-03-25 16:24:12 UTC
used_defines in the parser is unused, right?
Comment 3 Dominique Lasserre 2013-03-25 16:30:28 UTC
Yes, but libraries/apps using the Parser to update a source file will profit.
Comment 4 Dominique Lasserre 2013-06-28 22:14:30 UTC
Another approach to avoid extending libvala with an unused list is to use lots of protected virtual members.
Comment 5 GNOME Infrastructure Team 2018-05-22 14:44:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/366.