Ticket #251: comments.patch
File comments.patch, 1.6 KB (added by , 15 years ago) |
---|
-
source/ps/tests/test_Parser.h
109 109 TS_ASSERT(! Line.ParseString(Parser, "a a x")); 110 110 TS_ASSERT(Line.ParseString(Parser, "a x a b x a x b x b x b x b x a x a x a b x a b x b x a x")); 111 111 } 112 113 void test5() 114 { 115 CParser Parser; 116 Parser.InputTaskType("assignment", "_$ident_=_$value[[;]$rest]"); 117 std::string str; 118 119 CParserLine Line; 120 121 TS_ASSERT(Line.ParseString(Parser, "12 = 34 ; comment")); 122 TS_ASSERT_EQUALS((int)Line.GetArgCount(), 2); 123 TS_ASSERT(Line.GetArgString(0, str) && str == "12"); 124 TS_ASSERT(Line.GetArgString(1, str) && str == "34"); 125 } 112 126 }; -
source/ps/Parser.cpp
710 710 ++Progress; 711 711 break; 712 712 case typeRest: 713 // Extract the whole of the std::string 714 715 // Reset, probably is but still 716 value.m_String = std::string(); 717 718 for (i=Progress; i<Segments.size(); ++i) 719 { 720 value.m_String += Segments[i]; 721 722 // If argument starts with => " <=, add one to the end of it too 723 if (Segments[i][0] == '"') 724 value.m_String += "\""; 725 } 726 727 m_Arguments.push_back(value); 728 713 // This is a comment, don't store it. 729 714 // Now BREAK EVERYTHING ! 730 715 // We're done, we found our match and let's get out 731 716 LookNoFurther = true;