Thread (44 messages) 44 messages, 4 authors, 2022-03-13

Re: [PATCH v5] userdiff: add builtin diff driver for kotlin language.

From: Jaydeep Das <hidden>
Date: 2022-03-10 16:29:40


On 3/9/22 00:02, Johannes Sixt wrote:
Am 08.03.22 um 17:54 schrieb jaydeepjd.8914@gmail.com:
quoted
So, the final regexes are these, right?:
Not quite.
quoted
      "[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]*"
This would not match 12.5 because you allow only a single digit before
the decimal point. Perhaps

	"|[0-9][.0-9_]*([Ee][-+]?[0-9]+)?[fFlLuU]*"
The problem with this approach is that it matches `2..5` as a single token.
However in Kotlin, `..` is used to specify a range so 2..5 should be broken into
2 .. and 5.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help