Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_syntactic_literal() returns TRUE in the presence of attributes. #1684

Open
moodymudskipper opened this issue Jan 23, 2024 · 0 comments
Open

Comments

@moodymudskipper
Copy link

x <- 1
attr(x, "foo") <- 42
rlang::is_syntactic_literal(x)
#> [1] TRUE

Created on 2024-01-23 with reprex v2.0.2

I believe this contradicts the given definition, though the definition is a bit ambiguous :

is_syntactic_literal() is a predicate that returns TRUE for the subset of literals that are created by R when parsing text (see parse_expr()): numbers, strings and NULL. Along with symbols, these literals are the terminating nodes in an AST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant