Menu

Original line string. How to get?

2008-10-06
2013-05-23
  • Denis Golovan

    Denis Golovan - 2008-10-06

    Hi.

    One more problem, connected to abstraction from file source - it seems there is no way to get original line content as it was before parsing.

    For correct ctags/etags format, I must contruct regexp expression based on original line in source (for relative navigation, AFAIU).

    Thanks.

     
    • Anthony Steele

      Anthony Steele - 2008-10-06

      Nope, not designed for the current line content.
      This (and the file name) could be done, it just needs to be passed down to each process that works on the source.

       
      • Denis Golovan

        Denis Golovan - 2008-10-07

        Is it possible to patch?
        It's a definite blocker for me (together with filename)

        Thanks.

         
        • Anthony Steele

          Anthony Steele - 2008-10-07

          I'll work on file name on the token first, since it's the easier job.
          At least the file name information is around, the full text of the line has never been important before.

          A tokens can even sometimes span multiple lines, if it's a long comment.

           
          • Denis Golovan

            Denis Golovan - 2008-10-08

            >I'll work on file name on the token first, since it's the easier job.

            Ok, thanks.

            >A tokens can even sometimes span multiple lines, if it's a long comment.

            Hm, right idea. Then I'll need all of that lines.

            Best regards,
            Denis

             
    • Anthony Steele

      Anthony Steele - 2008-10-12

      I have checked in the function TSourceToken.SourceLine
      Should give the text of the line that the token is on. It may be slow if you call it a lot.

      I haven't tested it, but I think that the idea will work.

       
      • Denis Golovan

        Denis Golovan - 2008-10-13

        Ok, Anthony. I'll test it and report back.

        Best regards,
        Denis

         
      • Denis Golovan

        Denis Golovan - 2008-10-13

        Well, it works pretty good. Just one little patch needed (AV otherwise).
        Speed is not super, but it works. I thought I would give option to get line by token YPosition :)

        Thanks Anthony. I think we can discuss now proper integration of my patches. See https://sourceforge.net/forum/forum.php?thread_id=2365798&forum_id=136082

        Best regards,
        Denis

         
        • Anthony Steele

          Anthony Steele - 2008-10-14

          ok, I have tested the method, checked in and made it stable and hopefully correct.

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.