Skip to content

Commit 83af937

Browse files
committed
Add grammar comments related to block scalar productions
1 parent b3f5f5b commit 83af937

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/node_modules/
22
/package-lock.json
3+
/yaml-spec-1.2-patch.yaml.orig

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ comments: $(SPEC12_COMMENTS)
3030

3131
clean:
3232
rm -fr node_modules
33+
rm -f package-lock.json yaml-spec-1.2-patch.yaml.orig
3334

3435
$(SPEC12_TXT):
3536
lynx --dump $(SPEC12_URL) > $@

yaml-spec-1.2-comments.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,38 @@
333333
'154': |
334334
The (max) function tells the parser that it can consider only the given
335335
number of characters to match the next rule.
336+
'162': |
337+
This production is misleading. It claims to be called with 2 arguments, m and
338+
t, but it is not called with any arguments. In reality it is supposed to
339+
*create* 2 state variables m and t.
340+
341+
It should actually be:
342+
343+
c-b-block-header ::=
344+
( ( c-indentation-indicator
345+
c-chomping-indicator )
346+
| ( c-chomping-indicator
347+
c-indentation-indicator ) )
348+
s-b-comment
349+
'163': |
350+
This production should not receive any arguments. It creates a variable that
351+
indicates the amount of indentation for a literal scalar.
352+
353+
It should actually be:
354+
355+
c-indentation-indicator ::=
356+
( ns-dec-digit => m = ns-dec-digit - x:30 )
357+
( <empty> => m = auto-detect() )
358+
'164': |
359+
This production should not receive any arguments. It creates a variable that
360+
indicates how trailing whitespace should be interpreted.
361+
362+
It should actually be:
363+
364+
c-chomping-indicator ::=
365+
( '-' => t = strip )
366+
( '+' => t = keep )
367+
( <empty> => t = clip )
336368
'183': |
337369
The <auto-detect-indent> rule is a "special" rule that finds the new level of
338370
indentation and returns the number of columns. The level must be greater than

yaml-spec-1.2-patch.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,21 @@ ns-flow-node:
25192519
##### 8.1.1. Block Scalar Headers
25202520

25212521

2522+
#===============================================================================
2523+
# This production is misleading. It claims to be called with 2 arguments, m and
2524+
# t, but it is not called with any arguments. In reality it is supposed to
2525+
# *create* 2 state variables m and t.
2526+
#
2527+
# It should actually be:
2528+
#
2529+
# c-b-block-header ::=
2530+
# ( ( c-indentation-indicator
2531+
# c-chomping-indicator )
2532+
# | ( c-chomping-indicator
2533+
# c-indentation-indicator ) )
2534+
# s-b-comment
2535+
#===============================================================================
2536+
25222537
:162: c-b-block-header
25232538
# c-b-block-header(m,t) ::=
25242539
# ( ( c-indentation-indicator(m)
@@ -2541,6 +2556,17 @@ c-b-block-header:
25412556

25422557

25432558

2559+
#===============================================================================
2560+
# This production should not receive any arguments. It creates a variable that
2561+
# indicates the amount of indentation for a literal scalar.
2562+
#
2563+
# It should actually be:
2564+
#
2565+
# c-indentation-indicator ::=
2566+
# ( ns-dec-digit => m = ns-dec-digit - x:30 )
2567+
# ( <empty> => m = auto-detect() )
2568+
#===============================================================================
2569+
25442570
:163: c-indentation-indicator
25452571
# c-indentation-indicator(m) ::=
25462572
# ( ns-dec-digit => m = ns-dec-digit - x:30 )
@@ -2556,6 +2582,18 @@ c-indentation-indicator:
25562582

25572583

25582584

2585+
#===============================================================================
2586+
# This production should not receive any arguments. It creates a variable that
2587+
# indicates how trailing whitespace should be interpreted.
2588+
#
2589+
# It should actually be:
2590+
#
2591+
# c-chomping-indicator ::=
2592+
# ( '-' => t = strip )
2593+
# ( '+' => t = keep )
2594+
# ( <empty> => t = clip )
2595+
#===============================================================================
2596+
25592597
:164: c-chomping-indicator
25602598
# c-chomping-indicator(t) ::=
25612599
# ( '-' => t = strip )

yaml-spec-1.2.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,21 @@ ns-flow-node:
25192519
##### 8.1.1. Block Scalar Headers
25202520

25212521

2522+
#===============================================================================
2523+
# This production is misleading. It claims to be called with 2 arguments, m and
2524+
# t, but it is not called with any arguments. In reality it is supposed to
2525+
# *create* 2 state variables m and t.
2526+
#
2527+
# It should actually be:
2528+
#
2529+
# c-b-block-header ::=
2530+
# ( ( c-indentation-indicator
2531+
# c-chomping-indicator )
2532+
# | ( c-chomping-indicator
2533+
# c-indentation-indicator ) )
2534+
# s-b-comment
2535+
#===============================================================================
2536+
25222537
:162: c-b-block-header
25232538
# c-b-block-header(m,t) ::=
25242539
# ( ( c-indentation-indicator(m)
@@ -2541,6 +2556,17 @@ c-b-block-header:
25412556

25422557

25432558

2559+
#===============================================================================
2560+
# This production should not receive any arguments. It creates a variable that
2561+
# indicates the amount of indentation for a literal scalar.
2562+
#
2563+
# It should actually be:
2564+
#
2565+
# c-indentation-indicator ::=
2566+
# ( ns-dec-digit => m = ns-dec-digit - x:30 )
2567+
# ( <empty> => m = auto-detect() )
2568+
#===============================================================================
2569+
25442570
:163: c-indentation-indicator
25452571
# c-indentation-indicator(m) ::=
25462572
# ( ns-dec-digit => m = ns-dec-digit - x:30 )
@@ -2556,6 +2582,18 @@ c-indentation-indicator:
25562582

25572583

25582584

2585+
#===============================================================================
2586+
# This production should not receive any arguments. It creates a variable that
2587+
# indicates how trailing whitespace should be interpreted.
2588+
#
2589+
# It should actually be:
2590+
#
2591+
# c-chomping-indicator ::=
2592+
# ( '-' => t = strip )
2593+
# ( '+' => t = keep )
2594+
# ( <empty> => t = clip )
2595+
#===============================================================================
2596+
25592597
:164: c-chomping-indicator
25602598
# c-chomping-indicator(t) ::=
25612599
# ( '-' => t = strip )

0 commit comments

Comments
 (0)