[libcroco-list] make parsing location available



Hi all,

A couple of users have expressed the need to access the parsing location
(line/column/byte offset) of virtually all the CSS language constructions
parsed from a given sheet.

e.g: considering the ruleset x[attr=val] {border: 3px solid green}
one should be able to get the parsing location of either the "attr"
construction, or "x", or green ... whatever.

This feature is important for people using libcroco either in CSS editing
environments or in CSS validation environments.

To support this feature, virtually all the types of the abstract
syntax tree must have a field of type :
struct CRParsingLocation {gint line; gint column ; gint byte_offset } ;
This also implies that we cannot use GString anymore, but rather
a CRString defined as:

struct CRString {GString stryng ; CRParsingLocation location} ;

The other composite types used in the abstract syntax tree of libcroco
Will also have a new field of type CRParsingLocation.

The change from GString to CRString implies an API compatibility breakage with
libcroco 0.5, unfortunately.
This is one of the reasons why I don't want to commit myself on API/ABI
compatibility
*before* libcroco 1.0
Maybe we can imagine to ensure API/ABI compatibility for a given minor version
number serie.
e.g: the serie the 0.6.xx versions would ensure API/ABI compatibility.
I am not sure this would be very useful as nobody requested it yet.

I have started to work on a first parsing location patch, and I hope I will be
able to commit something to my public archive soon.

Regards,

           Dodji.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]