Skip to content

[gram.key] Replace 'context-dependent keywords' with 'names' #6837

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/grammar.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

\pnum
\indextext{keyword}%
New context-dependent keywords are introduced into a program by
New names are introduced into a program by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And function and variable declaration are different? In what respect?

I think this entire paragraph should just be removed.

@zygoloid , do you have an idea what this does here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is trying to describe the so-called lexer hack, whereby the grammatical interpretation of the program depends on the result of name lookup. I don't think this really gets there for me, though, and it'd be more useful to say that an identifier is only a foo-name if name lookup finds a foo, analogous to this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eisenwave Do you want to try that out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better left to someone who understands this lexer hack better. I'm not confident that I can get the wording right.

Copy link
Member

@jensmaurer jensmaurer Aug 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zygoloid , we already say that the identifier in a class-head introduces a class-name. We might lack a bit of wording for template-name, but that's a core issue.

\tcode{typedef}\iref{dcl.typedef},
\tcode{namespace}\iref{namespace.def},
class\iref{class}, enumeration\iref{dcl.enum}, and
Expand Down