Skip to content

Location ranges for output #428

@sim642

Description

@sim642

Currently we only have start locations (file, line, column) for statements from CIL, but it's increasingly useful to also have end locations, i.e. the ability to describe location ranges.

For example, GobPie needs them to specify where a warning's squiggly underline should end. Right now it uses a heuristic to search for the next ; from the start location.

Similarly SARIF (#376) needs end locations. Right now it very stupidly just uses endLine = startLine + 4.

Since there are at least two downstream uses for location ranges, it might be more sensible for Goblint to be able to provide them itself. The options are:

  1. Move the ; finding heuristic into Goblint. This can internally be replaced with something better later without altering any of its uses.
  2. Change CIL to provide end locations for at least statements if nothing else. This is probably a bigger undertaking and requires hacking its lexer/parser to return more information, which it technically does know.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions