Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 buggy behaviour

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Dusan Posted - May 14 2013 : 09:01:20 AM
In VS2005 paste following code into CPP file:
// cppConsole.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"

#define TEST_MACRO

#if defined(TEST_MACRO)
#include <iostream>
#include <locale>
#endif
#if defined(TEST_MACRO)
static int haha_hoho()
{
  return 0;
}

template< typename T > 
struct is_int{ 
  static const bool value = false; 
};

template<> 
struct is_int< int >{ 
  static const bool value = true; 
};

template<> 
struct is_int< int* >{ 
  static const bool value = true; 
};

template <typename IVal>
IVal max_signed()
{
  IVal new_val;
  memset(&new_val, -1, sizeof(IVal));
  return new_val / 2;
}

static int zz(const char *aa, const char *bb, int cc = 1, int dd = 1, const std::locale & loc = std::locale())
{
  char pc, sc;
  while (true) 
  {
    pc = cc ? std::tolower(*bb, loc) : *bb;

    if (
      (pc == '\\0' && *aa   != '\\0') || 
      (*aa   == '\\0' && pc != '%' )) 
      return 0;
    
    if (pc == '%') 
    {
      while (*bb == '%')
        ++bb;
      
      pc = cc ? std::tolower(*bb, loc) : *bb;
      if (pc == '\\0')
        break;
      while (true) 
      {
        if (pc != '_' && pc != '\\\\') 
        {
          while (*aa) 
          {
            sc = cc ? std::tolower(*aa, loc) : *aa;
            if (sc == pc)
              break;
            ++aa;
          }
        }
        if (zz(aa, bb, dd))
          return 1;
        if (*aa == '\\0')
          return 0;
        sc = cc ? std::tolower(*aa, loc) : *aa;
        ++aa;
      }
    }
    if (pc == '_') 
    {
      bb++;
      aa++;
      continue;
    }
    // osetrenie escape
    if (
      dd && pc == '\\\\' &&
      (bb[1] == '\\\\' || bb[1] == '%' || bb[1] == '_')) 
    {
      ++bb;
      pc = cc ? std::tolower(*bb, loc) : *bb;
    }
    sc = cc ? std::tolower(*aa++, loc) : *aa++;
    ++bb;
    if (sc != pc)
      return 0;
  }
  return -1;
}

int _tmain(int argc, _TCHAR* argv[])
{
  // here must not be any statement!!!
  std::string str; // try to add include for str

 

 

  return 0;
}
#endif


Focus on function _tmain
1.) when cursor is in it, bracket highlighting ends on # in line with #endif ( I mean, does not end on closing bracket )
2.) try to add include for std::string str; VAX adds it into _tmain body.

Seems like parsing error, code compiles...

8   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jun 03 2013 : 2:12:27 PM
The issue with Add Include being offered for std::string when #include <string> is already present is case=74343, and is fixed in build 1940
support Posted - Jun 03 2013 : 2:10:59 PM
case=74288 is fixed in build 1940
feline Posted - May 16 2013 : 12:45:15 PM
Normally blank lines won't have any effect on how our parser behaves, but clearly this is an exception to that normal rule. Hopefully when this bug is fixed all of these issues will be resolved, since they do seem to be connected.
Dusan Posted - May 16 2013 : 12:57:07 AM
I have used the same code for bracket highlighting issue, but as I wrote, it is not as easy to reproduce it each time...

Regarding std::string include issue, it really depends on std::string statement position in code. For example if you remove one or more empty rows from _tmain method (or remove first comment in it), it causes that add include feature is working well.
But how could empty row affect parsing?
Perhaps highlighting issue and add include issue relates to the same parsing problem - hopefully.

feline Posted - May 15 2013 : 9:02:59 PM
I am not sure what is going on with the bracket highlighting, normally this behaves in a consistent manor. If you can make this happen in a consistent manor I would be interested to see the code you used to do so.

I am seeing the same problem with Add Include working several times in a row, that is unexpected. I have added a note about this to the bug report, since this may well be related to the same problem that is causing the #include line to be placed into the function.
Dusan Posted - May 15 2013 : 02:13:34 AM
One more issue... I have been playing with that code to regenerate bracket highlighting issue (successfully but can not reproduce it each time)..

..but I have found, that include for std::string can be added again and again (still into _tmain) even it is there already.
Dusan Posted - May 15 2013 : 01:53:28 AM
Hmm... I have reopened the same project and now bracket highlighting works correctly... :( ...or... :)

OS: Windows Vista 64bit
IDE: Visual Studio 2005
VAX: 10.7.1936.0 build 2013.04.22
feline Posted - May 14 2013 : 1:38:23 PM
Thank you for the clear description, I am seeing the Add Include problem:

case=74288

So far no sign of the bracket highlighting problem though, the () and {} brackets on the _tmain function are being highlighted correctly for me. Which version of VA are you using? Which OS are you using?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000