rse data can be retrieved using ` [ getParseData
](/link/getParseData?package=base&version=3.6.2) ` applied to the ` srcfile `
object. Because parsing was incomplete, it will typically include references
to ` "parent" ` entries that are not present.

##  Details

` parse(....) ` :

    

If ` text ` has length greater than zero (after coercion) it is used in
preference to ` file ` .

All versions of  R  accept input from a connection with end of line marked by
LF (as used on Unix), CRLF (as used on DOS/Windows) or CR (as used on classic
Mac OS). The final line can be incomplete, that is missing the final EOL
marker.

When input is taken from the console, ` n = NULL ` is equivalent to ` n = 1 `
, and ` n < 0 ` will read until an EOF character is read. (The EOF character
is Ctrl-Z for the Windows front-ends.) The line-length limit is 4095 bytes
when reading from the console (which may impose a lower limit: see ‘An
Introduction to R’).

The default for ` srcfile ` is set as follows. If ` keep.source ` is not `
TRUE ` , ` srcfile ` defaults to a character string, either ` "<text>" ` or
one derived from ` file ` . When ` keep.source ` is ` TRUE ` , if ` text ` is
used, ` srcfile ` will be set to a ` [ srcfilecopy
](/link/srcfilecopy?package=base&version=3.6.2) ` containing the text. If a
character string is used for ` file ` , a ` [ srcfile
](/link/srcfile?package=base&version=3.6.2) ` object referring to that file
will be used.

When ` srcfile ` is a character string, error messages will include the name,
but source reference information will not be added to the result. When `
srcfile ` is a ` [ srcfile ](/link/srcfile?package=base&version=3.6.2) `
object, source reference information will be retained.

` str2expression(s) ` :

    

for a ` [ character ](/link/character?package=base&version=3.6.2) ` vector ` s
` , ` str2expression(s) ` corresponds to ` [ parse
](/link/parse?package=base&version=3.6.2) (text = s, keep.source=FALSE) ` ,
which is always of type ( ` [ typeof
](/link/typeof?package=base&version=3.6.2) ` ) and ` [ class
](/link/class?package=base&version=3.6.2) ` ` expression ` .

` str2lang(s) ` :

    

for a ` [ character ](/link/character?package=base&version=3.6.2) ` string ` s
` , ` str2lang(s) ` corresponds to ` [ parse
](/link/parse?package=base&version=3.6.2) (text = s, keep.source=FALSE)[[1]] `
(plus a check that both ` s ` and the ` parse(*) ` result are of length one)
which is typically a ` call ` but may also be a ` symbol ` aka ` [ name
](/link/name?package=base&version=3.6.2) ` , ` [ NULL
](/link/NULL?package=base&version=3.6.2) ` or an atomic constant such as ` 2 `
, ` 1L ` , or ` TRUE ` . Put differently, the value of ` str2lang(.) ` is a
call or one of its parts, in short “a call or simpler”.

Currently, encoding is not handled in ` str2lang() ` and ` str2expression() `
.

##  References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_ .
Wadsworth & Brooks/Cole.

Murdoch, D. (2010). [ Source References
](https://journal.r-project.org/archive/2010-2/RJournal_2010-2_Murdoch.pdf) .
_The R Journal_ 2/2, 16-19.

##  See Also

` [ scan ](/link/scan?package=base&version=3.6.2) ` , ` [ source
](/link/source?package=base&version=3.6.2) ` , ` [ eval
](/link/eval?package=base&version=3.6.2) ` , ` [ deparse
](/link/deparse?package=base&version=3.6.2) ` .

The source reference information can be used for debugging (see e.g. ` [
setBreakpoint ](/link/setBreakpoint?package=base&version=3.6.2) ` ) and
profiling (see ` [ Rprof ](/link/Rprof?package=base&version=3.6.2) ` ). It can
be examined by ` [ getSrcref ](/link/getSrcref?package=base&version=3.6.2) `
and related functions. More detailed information is available through ` [
getParseData ](/link/getParseData?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fparse&utm_source=r-docs&utm_medium=docs&utm_term=parse&utm