Thanks for you answer sir, I was thinking its regular expressions(automata) not BNF grammer. Aint I right ?
And I thought even if it is for human reading, if we write literal grammer ( regular expression, in my view) using documentation, we would end up with python not allowing strings like"python's rule" and ' python"the master" ' Here I changed the defination of string literal for explaining my thinking, inserted short-singlequoted-stringitem, short-sq-tstringchar, short-doublequoted-stringitem and short-dq-stringchar . I think we should use this in documentation stringliteral ::= [stringprefix](shortstring | longstring) stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR" | "b" | "B" | "br" | "Br" | "bR" | "BR" shortstring ::= "'" short-singlequoted-stringitem* "'" | '"' short-doublequoted-stringitem* '"' longstring ::= "'''" longstringitem* "'''" | '"""' longstringitem* '"""' short-singlequoted-stringitem ::= short-sq-stringchar | escapeseq short-doublequoted-stringitem ::= short-dq-stringchar | escapeseq longstringitem ::= longstringchar | escapeseq short-sq-tstringchar ::= <any source character except "\" or newline or single-quote> short-dq-stringchar ::= <any source character except "\" or newline or double-quote> longstringchar ::= <any source character except "\"> escapeseq ::= "\" <any ASCII character>
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com