I have write a little parser for html.
for an input like:
<span> text </span>
("span" end_tag nil nil nil 31 38)
("span" start_tag nil nil nil 19 25))
nil nil 19 38)
("br" tag nil nil nil 48 54))
("div" end_tag nil nil nil 55 61)
nil nil 6 15)))
nil nil 1 16))
nil #<overlay from 1 to 61 in test.html>))
You can notice that only the "div" tag as an overlay, "span"
and "br" (contained in :children of "div") have no overlay at 5th
position (semantic-tag-overlay tag) return nil.
I have override semantic-tag-components and
(define-mode-local-override semantic-tag-components-with-overlays html-mode
"Return a list of components for TAG."
(if (eq nil (semantic-tag-get-attribute tag :children))
(semantic-tag-get-attribute tag :children)
semantic-tag-components is used in semantic--tag-link-to-buffer
In this function i saw it need the semantic-tag-overlay return a
So my question is how to make the children tag have an overlay?
From: Eric M. Ludlam <ericludlam@gm...> - 2012-02-24 02:38:57
There are a few ways to deal with a child tag.
Parser tags start out in a "raw" form, using numbers to represent the
location. All raw tags need to be "cooked", which is the process of
converting the location information into an overlay, or into a vector
that can be saved to disk.
This happens automatically for top-level tags. When you create a child
tag, you have two choices. In the wisent manual, you will see a section
on grammar styles. The bison style uses the EXPANDTAG macro to say that
the created tag needss to be cooked. If you instead use the iterative
style, you would use EXPANDFULL on some region of the buffer to recurse
into the parser and expand all generated tags there. Iterative style
can be tricky if you are used to regular Bison parsing, but can make
life a lot easier.
On 02/20/2012 11:35 AM, antoine no wrote:
> I resolved this by adding (car (EXPANDTAG ...)) arroud the TAG
> generation in wisent grammar.
> I don't know if it is the right thing to do?
Get latest updates about Open Source Projects, Conferences and News.