From blerner @ending from mtholyoke@edu  Tue Oct  2 19:00:40 2018
From: blerner @ending from mtholyoke@edu (Barbara Lerner)
Date: Tue, 2 Oct 2018 13:00:40 -0400
Subject: [Rd] Problem with parseData
In-Reply-To: <ea2e79ec-b812-c75a-2587-af13c1d6f048@gmail.com>
References: <fda485ef-3ca1-6507-f227-51a5cb8af4a3@mtholyoke.edu>
 <d4cdfe7e-10c1-eceb-b0c4-88c2ebfb000f@gmail.com>
 <ea2e79ec-b812-c75a-2587-af13c1d6f048@gmail.com>
Message-ID: <ca5d0944-e9e1-7f99-d1d7-9e9ed87b44c0@mtholyoke.edu>

Thanks!? Please let us know when it is in the released version of R.

Barbara

Tomas Kalibera wrote on 10/2/18 6:37 AM:
> The fix is now in R-devel, 75386. I have not ported to R-patched, 
> because the fix breaks two packages which are working around this bug 
> (and to my knowledge without having reported it before). So thanks 
> again for the report!
>
> Best
> Tomas
>
> On 08/16/2018 10:06 AM, Tomas Kalibera wrote:
>> Dear Barbara,
>>
>> thank you for the report. This is something to be fixed in R - I am 
>> now testing a patch that adds the extra node for the equality 
>> assignment expression.
>>
>> Best,
>> Tomas
>>
>> On 07/30/2018 05:35 PM, Barbara Lerner wrote:
>>> Hi,
>>>
>>> I have run into a problem with parseData from the utils package. When
>>> an assignment is done with = instead of <-, the information provided by
>>> parseData does not include an entry for the assignment.
>>>
>>> For this input, stored in file "BadPosition.R":
>>>
>>> y <- 5
>>> foo = 7
>>>
>>> And running this code:
>>>
>>> parsed <- parse("BadPosition.R", keep.source=TRUE)
>>> parsedData <- utils::getParseData (parsed, includeText=TRUE)
>>> print(paste("parseData =", parsedData))
>>>
>>> I get the following output:
>>>
>>> [1] "parseData = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2)"
>>> [2] "parseData = c(1, 1, 1, 3, 6, 6, 1, 1, 5, 7, 7)"
>>> [3] "parseData = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2)"
>>> [4] "parseData = c(6, 1, 1, 4, 6, 6, 3, 3, 5, 7, 7)"
>>> [5] "parseData = c(7, 1, 3, 2, 4, 5, 10, 12, 11, 13, 14)"
>>> [6] "parseData = c(0, 3, 7, 7, 5, 7, 12, 0, 0, 14, 0)"
>>> [7] "parseData = c(\"expr\", \"SYMBOL\", \"expr\", \"LEFT_ASSIGN\",
>>> \"NUM_CONST\", \"expr\", \"SYMBOL\", \"expr\", \"EQ_ASSIGN\",
>>> \"NUM_CONST\", \"expr\")"
>>> [8] "parseData = c(FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE,
>>> TRUE, TRUE, FALSE)"
>>> [9] "parseData = c(\"y <- 5\", \"y\", \"y\", \"<-\", \"5\", \"5\",
>>> \"foo\", \"foo\", \"=\", \"7\", \"7\")"
>>>
>>> Notice how there is an entry for "y <- 5" beginning on line 1, 
>>> column 1,
>>> ending at line 1, column 6, but there is no analogous entry for "foo 
>>> = 7".
>>>
>>> I am running R 3.5.0 on a Mac running 10.12.6.
>>>
>>> Thanks for your help and please let me know if you need any further
>>> information.
>>>
>>> Barbara
>>>
>>
>

-- 
<http://www.getpostbox.com>Barbara Lerner
Associate Professor
Computer Science Department
Mount Holyoke College

<http://www.getpostbox.com>

	[[alternative HTML version deleted]]



[Rd] Problem with parseData
Barbara Lerner