I did some more work for on the unit tests for other modes.
I have some problems though:
- when I debug I get an error in an IELM buffer:
ELISP> (semantic-fetch-tags)
*** Eval error *** Wrong type argument: number-or-marker-p, nil
if I change the buffer to be parsed. (I do this 1st: (set-buffer
(get-file-buffer "/tmp/javascripttest.js")))
- I need to improve the validator function to handle trees, or I cant
handle java classes. This would extend to other cases like javascript:
function fun1(a, b){
return a;
}
function fun2(a, b){ //1
return b;
}
would yield this tree:
(("fun1" function
(:arguments
(("a" variable nil
(reparse-symbol FormalParameterList)
#<overlay from 16 to 17 in javascripttest.js>)
("b" variable nil
(reparse-symbol FormalParameterList)
#<overlay from 19 to 20 in javascripttest.js>)))
nil #<overlay from 2 to 40 in javascripttest.js>)
("fun2" function
(:arguments
(("a" variable nil
(reparse-symbol FormalParameterList)
#<overlay from 56 to 57 in javascripttest.js>)
("b" variable nil
(reparse-symbol FormalParameterList)
#<overlay from 59 to 60 in javascripttest.js>)))
nil #<overlay from 42 to 84 in javascripttest.js>))
My question, then, is if, I make a validator tree like this:
(("fun1" function
(:arguments
(("a" variable nil
(reparse-symbol FormalParameterList)
(overlay 16 17 "javascripttest.js"))
("b" variable nil
(reparse-symbol FormalParameterList)
(overlay 19 20 "javascripttest.js"))))
nil (overlay 2 40 "javascripttest.js"))
("fun2" function
(:arguments
(("a" variable nil
(reparse-symbol FormalParameterList)
(overlay 56 57 "javascripttest.js"))
("b" variable nil
(reparse-symbol FormalParameterList)
(overlay 59 60 "javascripttest.js")))
nil (overlay 42 84 "javascripttest.js"))
if this tree will always be generated the same way by
(semantic-fetch-tags) ?
(overlay ...) is of course a special symbol I need to implement for
the validator, and the next question is:
- can this be done more cleverly?
joakim@... writes:
> Eric,
>
> I refactored your unit test code a bit and added a python test.
>
> I just want to run it by you first to see that I'm on the right track,
> then I can add tests for java and javascript, at least. They would be
> very similar to the Python test.
>
> /Joakim
>
>
>
>
>
> --
> Joakim Verona
> http://www.verona.se
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
--
Joakim Verona
http://www.verona.se
|