1. 15 Eki, 2016 1 kayıt (commit)
    • Jiří Techet's avatar
      Move ctags "API" from Geany to ctags · 3390e2ac
      Jiří Techet yazdı
      This commit basically just moves stuff from tm_ctags_wrappers.c/h to
      ctags. The "api.h" file has been renamed to "ctags-api.h" to make it
      clearer it belongs to ctags when included.
      
      The code also tries to completely isolate ctags from the caller;
      previously we were using tagEntryInfo to pass information to Geany. This
      however required including entry.h which added lots of other stuff we
      don't want in the API. Instead create an auxiliary struct that holds
      all the needed information from tagEntryInfo (currently only the stuff
      used by Geany) and copy all the info from tagEntryInfo before invoking
      the callback.
      3390e2ac
  2. 14 Eki, 2016 8 kayıt (commit)
    • Jiří Techet's avatar
      Some initial work on ctags as a library · 32dfa287
      Jiří Techet yazdı
      Protect library-specific stuff by CTAGS_LIB macro which also makes it
      better visible what changes had to be made to convert ctags into library.
      Changes which need further Geany sync and aren't library-related aren't
      protected by the macro.
      
      Move things from geany.c/h to the locations where they belong and rename
      geany.c/h to api.c/h into which API-like functions will be moved in the
      next commits (mostly things from tm_ctags_wrappers.c/h).
      
      Add complete main.c from uctags and just remove main() using the CTAGS_LIB
      macro.
      32dfa287
    • Jiří Techet's avatar
      tmp · 29d801aa
      Jiří Techet yazdı
      29d801aa
    • Jiří Techet's avatar
      Sync error.c completely and create a custom error printer · f82218ab
      Jiří Techet yazdı
      Make sure the custom error printer never ends with fatal errors terminating
      the application.
      f82218ab
    • Jiří Techet's avatar
      Some minor syncs · c56047be
      Jiří Techet yazdı
      c56047be
    • Jiří Techet's avatar
      read: backport patch from uctags · de214944
      Jiří Techet yazdı
      See
      
      cd460f4c19bf940fc4290b5ceca1dba873baf7cb
      eb347f8fe08ac0d5467b4020aceb1a5ecbdd12aa
      
      That said the readLineRaw() is completely mad and wrong. In the first
      iteration pLastChar is set to position -2 where it's assigned '\0' so
      there's invalid memory access.
      
      Since iFileGetLine() uses mio_gets() too, we should unify the two.
      de214944
    • Jiří Techet's avatar
      Add typeRef to sTagEntryInfo · bbdd3a1e
      Jiří Techet yazdı
      Even though we don't use it, we can keep it there and get rid of some
      diffs against uctags.
      bbdd3a1e
    • Jiří Techet's avatar
      grab uctags debug.c/h · 97bf03c8
      Jiří Techet yazdı
      If we don't define the DEBUG macro (which we don't), all the assert
      operations will be NOOPs. The asserts aren't that terribly useful
      (usually the crash happens just the following line) and uctags should
      be reasonably well tested by the uctags project so we can drop them.
      97bf03c8
    • Jiří Techet's avatar
      Grab uctags version of parse.c/h and nestlevel.c/h plus additional fallout · 829ea7d3
      Jiří Techet yazdı
      At this point the only remaining files with big changes are parser.c/h
      and nestlevel.c/h. However, the amount of changes is big and these
      changes cannot be easily separated into individual small patches. Fortunately
      by looking at parse.c there doesn't seem to be anything really valuable
      in Geany's version and we can just simply take over the ctags one and
      only apply the necessary changes on top of that. nestlevel.c/h has to
      be synced at the same time as the changes are related to cork introduction
      which was done in both of them.
      
      A few points:
      
      createTagsWithFallback1() and createTagsWithFallback() have been modified
      so they don't do anything with the output tags file which we don't use.
      Because they contain all the reparsing logic we originally had in
      tm_ctags_parse(), this function got simplified and just calls
      createTagsWithFallback().
      
      In Options EX_PATTERN has been changed to EX_LINENUM (there's some strange
      thing with EX_PATTERN in uctags as it always checks the previous line
      in the output tags file - and we don't have output tags file so it
      crashes).
      
      Lots of previously commented-out lines (because we didn't have all the
      functions from uctags at that point) could be uncommented.
      
      lxpath.c has been added.
      
      Parsers had to be adjusted to work with the updated nestlevel and cork.
      Changes in asciidoc and rest were based on the "rst.c" parser from uctags.
      txt2tags has been modified manually. The ruby changes wer taken directly
      from the uctags ruby parser and the python ones were based on the last
      commit before the introduction of the token-based parser.
      
      The parser now respects if kinds are enabled/disabled so prototypes
      and externvars had to be enabled in the c.c parser to get the same output.
      
      The parse2() function now returns rescanReason union instead of simple
      bool to indicate reparsing should happen - c.c and fortran have been
      changed accordingly.
      
      tm_ctags_init() has been changed to call all the initialization that
      happens in uctags except of output tag file initialization which we don't
      use. In addition it calls
      
      initializeParser (LANG_AUTO)
      
      This forces all parsers to get initialized. Without it parsers get
      initialized lazily as they are used but the problem is code like
      
      isInputLanguage (Lang_java)
      
      in c.c which just does ((lang) == getInputLanguage ()) works incorrectly
      because getInputLanguage () returns 0 for C and when uninitialized,
      Lang_java is also 0 and we have a problem. This problem isn't present in
      uctags because there the 0th parser is always CTagsSelfTestParser
      so this cannot happen.
      829ea7d3
  3. 12 Eki, 2016 12 kayıt (commit)
  4. 11 Eki, 2016 8 kayıt (commit)
  5. 10 Eki, 2016 5 kayıt (commit)
    • Jiří Techet's avatar
      read: Some function renaming · 2f4d43ac
      Jiří Techet yazdı
      2f4d43ac
    • Jiří Techet's avatar
      read: use makeFileTag() · dac3afbb
      Jiří Techet yazdı
      dac3afbb
    • Jiří Techet's avatar
      read: Add some extra data structures · eecfff0d
      Jiří Techet yazdı
      eecfff0d
    • Jiří Techet's avatar
    • Jiří Techet's avatar
      c.c, lcpp.c: Avoid using File.mio · 63fbe2f6
      Jiří Techet yazdı
      In uctags File is made private and mio gets inaccessible. At the moment
      it's used by c.c and lcpp.c to get the parameter list. The C parser
      "marks" the position where the argument list starts and once the right
      ")" is reached, string corresponding to this range is read from MIO,
      filtered and used for parameter list.
      
      For macro parameters the end of parameter list is handled in a slightly
      obfuscated way - since the code from read.c reads the code by lines,
      getInputFilePosition() returns the position of EOL so the parameter list
      is read between '(' and EOL.
      
      The code had to be modified to collect the potential parameter string
      on the way - vString *signature has been added to lcpp.c and every
      getcFromInputFile() and ungetcToInputFile() has been converted to
      getcAndCollect() and ungetcAndCollect(), respectively, which in addition
      perform the parameter collection when needed. Unfortunately this involves
      many places in lcpp.c and we must be careful to always use these instead
      of the standard ones from read.c.
      
      We cannot rely on the implicit reading of whole lines and must add such
      a code ourselves: just plain reading and collecting is enough. In addition
      I added handling of multi-line signatures which was missing before.
      
      In tests "bug1585745.cpp" and "cpp_destructor.cpp" the new code fixes
      missing () in destructors when there's a space between tilde and name.
      In "simple.d" test it fixes wrong function prototype.
      
      The output of test "bug507864.c" seems to be worse than before but it was
      already broken before and apparently the compiler is confused by it.
      63fbe2f6
  6. 09 Eki, 2016 6 kayıt (commit)