File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ void Token::update_property_info()
6565 if (!_str.empty ()) {
6666 if (_str == " true" || _str == " false" )
6767 _tokType = eBoolean;
68- else if (_str[0 ] == ' _' || std::isalpha (( unsigned char ) _str[0 ]) ) { // Name
68+ else if (std::isalpha (( unsigned char ) _str[0 ]) || _str[ 0 ] == ' _' || _str[0 ] == ' $ ' ) { // Name
6969 if (_varId)
7070 _tokType = eVariable;
7171 else if (_tokType != eVariable && _tokType != eFunction && _tokType != eType && _tokType != eKeyword)
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ class TestToken : public TestFixture {
8585 TEST_CASE (isNameGuarantees3)
8686 TEST_CASE (isNameGuarantees4)
8787 TEST_CASE (isNameGuarantees5)
88+ TEST_CASE (isNameGuarantees6)
8889
8990 TEST_CASE (canFindMatchingBracketsNeedsOpen);
9091 TEST_CASE (canFindMatchingBracketsInnerPair);
@@ -888,6 +889,11 @@ class TestToken : public TestFixture {
888889 ASSERT_EQUALS (false , tok.isNumber ());
889890 }
890891
892+ void isNameGuarantees6 () const {
893+ Token tok (nullptr );
894+ tok.str (" $f" );
895+ ASSERT_EQUALS (true , tok.isName ());
896+ }
891897
892898 void canFindMatchingBracketsNeedsOpen () const {
893899 givenACodeSampleToTokenize var (" std::deque<std::set<int> > intsets;" );
You can’t perform that action at this time.
0 commit comments