mastering_nim icon indicating copy to clipboard operation
mastering_nim copied to clipboard

syntax

Open random-bites opened this issue 1 year ago • 0 comments

Chapter 13, Syntax. Observations.

From p. 57:

This chapter describes in detail the second phase of the translation process called parsing.

Does it cover (Nim) parsing in detail? I think that more could be said about what parsing is so that the reader can better understand how this chapter addresses it. Otherwise, this chapter is very terse, and it may not be clear to the reader why discussing associativity and precedence rules and dot-like operators, ending with a reference to the grammar appendix, is a detailed explanation of (Nim) parsing. But, perhaps this is all that can be said on this subject.

Also, Chapter 13 is titled Syntax. Does this chapter discuss syntax parsing or grammar? I guess I'm somewhat confused by the title.

How the parser handles the indentation is described in Chapter 12, Lexical analysis.

Reference Section 12.2, Indentation, explicitly, instead?

Nim allows user-definable operators.

Reference Section 12.13, Operators, explicitly?

Also, it's not exactly clear to me why this sentence is where it is.

The next sentence

Binary operators have 11 different levels of precedence.

So, Nim's binary built-in and user-definable operators may have up to 11 different levels of precedence?

From p. 59:

Other syntax rules are described in the following sections along the semantics of described construct like an if statement.

Should this be written like the following instead?

Other syntax rules are described in the following sections along with the semantics of a described construct like an if statement.

random-bites avatar Jul 29 '22 15:07 random-bites