Per Bothner
2011-04-27 02:54:17 UTC
Hi all,
I'm attempting to implement eval-last-sexp. What I have so far pretty
much works,
but there must be some code somewhere in kawa that does the parsing I've
attempted
in the method evalLastSexp.
Well, I'm not sure where in Kawa you'd find a parser that does whatI'm attempting to implement eval-last-sexp. What I have so far pretty
much works,
but there must be some code somewhere in kawa that does the parsing I've
attempted
in the method evalLastSexp.
we need. One problem is that it needs to parse *backwards*. And of course
to be correct, you should check if a paren is inside string quotes or
is part of character literal.
Also note that an sexpr isn't necessary a parenthesis form - it can be
a constant or a symbol. In that case you probably have to scan
backwards for
a delimiter.
So I'm willing to check in your patch as-is (though there are some
indentation
issues), it might be a good idea if you could take a look at Emacs's
implementation - see how they do it. We don't need to be 100% correct, but
having a better idea of what Emacs does seems like a good idea.
Also, since jemacs supports both kawa and
elisp,
should the user be given a way to switch between the two? I've attached
a diff file
of my code, any suggestions would be appreciated.
Yes, perhaps there should be a way to switch languages, but usingelisp,
should the user be given a way to switch between the two? I've attached
a diff file
of my code, any suggestions would be appreciated.
the "current language" is probably good enough for now. Regardless,
this may be difficult enough for just one language!
--
--Per Bothner
***@bothner.com http://per.bothner.com/
--Per Bothner
***@bothner.com http://per.bothner.com/