Core: Resolved skipspaces issue in CParser::Set

git-svn-id: svn://ultimatepp.org/upp/trunk@7681 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-09-13 17:15:01 +00:00
parent 82ee6afcc8
commit b1e2aeaeb5
3 changed files with 20 additions and 19 deletions

View file

@ -480,7 +480,8 @@ void CParser::SetPos(const CParser::Pos& p)
term = p.ptr;
wspc = p.wspc;
lineptr = p.lineptr;
DoSpaces();
if(skipspaces)
DoSpaces();
}
CParser::CParser(const char *ptr)
@ -513,8 +514,8 @@ void CParser::Set(const char *_ptr, const char *_fn, int _line)
term = lineptr = wspc = _ptr;
fn = _fn;
line = _line;
skipspaces = true;
Spaces();
if(skipspaces)
Spaces();
LLOG("Set " << fn << ":" << line);
}
@ -523,7 +524,6 @@ void CParser::Set(const char *_ptr)
Set(_ptr, "", 1);
}
inline void NextCStringLine(String& t, const char *linepfx, int& pl)
{
t << "\"\r\n" << (linepfx ? linepfx : "") << "\"";

View file

@ -418,8 +418,7 @@ onst]_[@(0.0.255) char]_`*[*@3 ptr], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3
[s5;:CParser`:`:Set`(const char`*`): [@(0.0.255) void]_[* Set]([@(0.0.255) const]_[@(0.0.255) c
har]_`*[*@3 ptr])&]
[s2;%% Sets the new input string.&]
[s0;%% &]
[s0;%% &]
[s3;%% &]
[s0;%% &]
[ {{10000@(113.42.0) [s0;%% [*@7;4 CParser`::Error]]}}&]
[s3; &]

View file

@ -12,6 +12,7 @@ topic "Rules for references to Value internal maps elements";
[a83;*R6 $$10,12#31310162474203024125188417583966:caption]
[b83;*2 $$11,12#07864147445237544204411237157677:title]
[b42;a42;2 $$12,12#45413000475342174754091244180557:text]
[l321;t246;C@5;1 $$13,13#20902679421464641399138805415013:code]
[{_}%EN-US
[s10; Rules for references to Value internal maps elements&]
[s0; Value is originally designed as nonmutable concrete Value of
@ -29,17 +30,18 @@ including just reading it.]&]
[s0; &]
[s0; Examples of invalid code:&]
[s0; &]
[s0; [*C@5 Value m;]&]
[s0; [*C@5 Value`& x `= m(`"key`");]&]
[s0; [*C@5 x `= m; // using m as source invalidates x]&]
[s0;*C@5 &]
[s0; [*C@5 Value m;]&]
[s0; [*C@5 Value`& x `= m(`"key`");]&]
[s0; [*C@5 Value`& y `= m(`"key2`"); // Invalidates x]&]
[s0; [*C@5 x `= 123; // undefined]&]
[s0;*C@5 &]
[s0; [*C@5 Value m;]&]
[s0; [*C@5 Value`& x `= m.At(1);]&]
[s0; [*C@5 Value m2 `= m; // Invalidates x]&]
[s0; [*C@5 x `= `"fail`"; // undefined]&]
[s13; &]
[s13; Value m;&]
[s13; Value`& x `= m(`"key`");&]
[s13; x `= m; // using m as source invalidates x&]
[s13; ....&]
[s13; Value m;&]
[s13; Value`& x `= m(`"key`");&]
[s13; Value`& y `= m(`"key2`"); // Invalidates x&]
[s13; x `= 123; // undefined&]
[s13; ....&]
[s13; Value m;&]
[s13; Value`& x `= m.At(1);&]
[s13; Value m2 `= m; // Invalidates x&]
[s13; x `= `"fail`"; // undefined&]
[s0; ]]