From b7440c1e4c182ad977996d91bfb8125091ffae92 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Thu, 12 Nov 2026 23:28:58 -0800 Subject: ch31 early push needs review --- chapter31/docs/31-grammar.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'chapter31/docs/31-grammar.md') diff --git a/chapter31/docs/31-grammar.md b/chapter31/docs/31-grammar.md index 19f834af..3083fcc2 100644 --- a/chapter31/docs/31-grammar.md +++ b/chapter31/docs/31-grammar.md @@ -195,10 +195,13 @@ FLOAT_LITERAL : DIGIT+ ('.' DIGIT* ('e' DIGIT+)? | 'e' '-'? DIGIT+) 'f'? // Interpolation re-enters the ordinary expression grammar, recursively. stringExpression : '"' (STRING_TEXT | ESCAPE | '%%' | interpolation)* '"' ; interpolation : '%' format? '(' assignment ')' ; -format : FORMAT_FLAG* FORMAT_WIDTH? ('.' FORMAT_WIDTH?)? FORMAT_KIND ; +format : FORMAT_FLAG* FORMAT_WIDTH? ('.' FORMAT_WIDTH?)? FORMAT_KIND TIME_STYLE? ; // Flags: - + space # 0. Width/precision: decimal digits, no expressions. -// Kinds: d i u o x X f F e E g G a A c s b. -// Duplicate/inapplicable flags and precision on c/b are rejected. +// Kinds: d i u o x X f F e E g G a A c s b t. +// TIME_STYLE: F r R M D T, allowed only after t; default F (ISO UTC). +// Time styles: ISO, 12-hour, 24-hour, elapsed MM:SS.mmm, DD/MM/YY, HH:MM:SS. +// Duplicate/inapplicable flags and precision on c/b/t are rejected. +// Time accepts width and left alignment only; see time.md. // STRING_TEXT excludes double quote, backslash, and percent. CHARACTER_LITERAL : '\'' (ESCAPE | ~['\\]) '\'' ; fragment ESCAPE : '\\' [0ntr\\'"%] ; -- cgit v1.2.3