From: jaydeepjd.8914@gmail.com Date: Tue, 08 Mar 2022 16:54:47 GMT Subject: Re: [PATCH v5] userdiff: add builtin diff driver for kotlin language. Message-ID: In-Reply-To: <8799cd42-bb05-a827-187d-33fb03565f21@kdbg.org> > I guess that the suffix u is intended to mark unsigned integers. So, I > would say that the alternatives [fFlL] and [fFlLuU] should be swapped. Okay. > Furthermore, is it intentional that you do not recognize the '_' digit > separator in floating point numbers that begin with a decimal point? No. I will fix it. > > + /* unary and binary operators */ > > + "|[-+*/<>%&^|=!]?==?|--|\\+\\+|<>?=?|&&|\\|[|]?|->|\\.\\*|!!|::|[?:.][.:]"), > > What is the justification that there is still "|&&|\\|[|]?|" instead of > "|&&|\\|\\||" that I suggested (and I think I stressed that the point is > that single-character operators are matched elsewhere) and to which you > said "yes, right"? Yes. Must have slipped my mind. Sorry. > Also, the part "|<>?=?|" can match <, >, <=, and >=, all of which > are matched by other expressions, so you could reduce it to "|<<=|>>=|", > because that are the only tokens that they must match. Alright. So, the final regexes are these, right?: "[a-zA-Z_][a-zA-Z0-9_]*" /* hexadecimal and binary numbers */ "|0[xXbB][0-9a-fA-F_]+[lLuU]*" /* integers and floats */ "|[0-9][.]?[0-9_]+([Ee][-+]?[0-9]+)?[fFlLuU]*" /* floating point numbers beginning with decimal point */ "|[.][0-9][0-9_]*([Ee][-+]?[0-9]+)?[fFlL]?" /* unary and binary operators */ "|[-+*/<>%&^|=!]?==?|--|\\+\\+|<<=|>>=|&&|[||]|->|\\.\\*|!!|::|[?:.][.:]"), Thanks, Jaydeep.