{"thread":{"id":"51104","subject":"[PATCH] RFC: userdiff: add built-in pattern for rust","startedAt":"2019-05-15T18:34:18Z","lastAt":"2019-05-16T22:36:54Z","messageCount":5,"participants":["marcandre.lureau@redhat.com","Johannes Sixt","Marc-André Lureau"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"375638","messageId":"20190515183415.31383-1-marcandre.lureau@redhat.com","threadId":"51104","inReplyTo":null,"subject":"[PATCH] RFC: userdiff: add built-in pattern for rust","fromName":"","fromEmail":"marcandre.lureau@redhat.com","sentAt":"2019-05-15T18:34:15Z","receivedAt":"2019-05-15T18:34:18Z","isPatch":true,"sender":{"key":"marcandre.lureau@redhat.com","avatar":null},"body":"From: Marc-André Lureau <mlureau@redhat.com>\n\nThis adds xfuncname and word_regex patterns for Rust, a quite\npopular programming language. It also includes test cases for the\nxfuncname regex (t4018) and updated documentation.\n\nThe word_regex pattern finds identifiers, integers, floats and\noperators, according to the Rust Reference Book.\n\nRFC: since I don't understand why when there are extra lines such as the\none with FIXME, the funcname is not correctly reported. Help welcome!\n\nSigned-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n---\n Documentation/gitattributes.txt | 2 ++\n t/t4018-diff-funcname.sh        | 1 +\n t/t4018/rust-fn                 | 5 +++++\n t/t4018/rust-struct             | 5 +++++\n t/t4018/rust-trait              | 5 +++++\n userdiff.c                      | 9 +++++++++\n 6 files changed, 27 insertions(+)\n create mode 100644 t/t4018/rust-fn\n create mode 100644 t/t4018/rust-struct\n create mode 100644 t/t4018/rust-trait\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 4fb20cd0e9..07da08fb27 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -833,6 +833,8 @@ patterns are available:\n \n - `ruby` suitable for source code in the Ruby language.\n \n+- `rust` suitable for source code in the Rust language.\n+\n - `tex` suitable for source code for LaTeX documents.\n \n \ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 22f9f88f0a..9261d6d3a0 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -43,6 +43,7 @@ diffpatterns=\"\n \tphp\n \tpython\n \truby\n+\trust\n \ttex\n \tcustom1\n \tcustom2\ndiff --git a/t/t4018/rust-fn b/t/t4018/rust-fn\nnew file mode 100644\nindex 0000000000..f450590d6c\n--- /dev/null\n+++ b/t/t4018/rust-fn\n@@ -0,0 +1,5 @@\n+pub(self) fn RIGHT<T>(x: &[T]) where T: Debug {\n+    let _ = x;\n+    // FIXME: extra lines break match?\n+    let a = ChangeMe;\n+}\ndiff --git a/t/t4018/rust-struct b/t/t4018/rust-struct\nnew file mode 100644\nindex 0000000000..76aff1c0d8\n--- /dev/null\n+++ b/t/t4018/rust-struct\n@@ -0,0 +1,5 @@\n+#[derive(Debug)]\n+pub(super) struct RIGHT<'a> {\n+    name: &'a str,\n+    age: ChangeMe,\n+}\ndiff --git a/t/t4018/rust-trait b/t/t4018/rust-trait\nnew file mode 100644\nindex 0000000000..ea397f09ed\n--- /dev/null\n+++ b/t/t4018/rust-trait\n@@ -0,0 +1,5 @@\n+unsafe trait RIGHT<T> {\n+    fn len(&self) -> u32;\n+    fn ChangeMe(&self, n: u32) -> T;\n+    fn iter<F>(&self, f: F) where F: Fn(T);\n+}\ndiff --git a/userdiff.c b/userdiff.c\nindex 3a78fbf504..9e1e2fa03f 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -130,6 +130,15 @@ PATTERNS(\"ruby\", \"^[ \\t]*((class|module|def)[ \\t].*)$\",\n \t \"(@|@@|\\\\$)?[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\\\?(\\\\\\\\C-)?(\\\\\\\\M-)?.\"\n \t \"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\\\.{1,3}|::|[!=]~\"),\n+PATTERNS(\"rust\",\n+\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(struct|enum|union|mod)[ \\t].*)$\\n\"\n+\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(unsafe[\\t ]+)?trait[ \\t].*)$\\n\"\n+\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?((const|unsafe|extern(([\\t ]+)*\\\"[^)]+\\\")?)[\\t ]+)*fn[ \\t].*)$\\n\",\n+\t /* -- */\n+\t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n+\t \"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n+\t \"|0[box]?[0-9a-fA-F_]+(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n+\t \"|[-+*\\\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\\\|\\\\||->|=>|\\\\.{2}=|\\\\.{3}|::\"),\n PATTERNS(\"bibtex\", \"(@[a-zA-Z]{1,}[ \\t]*\\\\{{0,1}[ \\t]*[^ \\t\\\"@',\\\\#}{~%]*).*$\",\n \t \"[={}\\\"]|[^={}\\\" \\t]+\"),\n PATTERNS(\"tex\", \"^(\\\\\\\\((sub)*section|chapter|part)\\\\*{0,1}\\\\{.*)$\",\n\nbase-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2\n-- \n2.22.0.rc0.1.g4f1097ba08\n\n"},{"id":"375739","messageId":"c8b6e9c6-12a4-c6dd-bea9-7f07c8af7d15@kdbg.org","threadId":"51104","inReplyTo":"20190515183415.31383-1-marcandre.lureau@redhat.com","subject":"Re: [PATCH] RFC: userdiff: add built-in pattern for rust","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-05-16T20:29:04Z","receivedAt":"2019-05-16T20:29:09Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 15.05.19 um 20:34 schrieb marcandre.lureau@redhat.com:\n> From: Marc-André Lureau <mlureau@redhat.com>\n> \n> This adds xfuncname and word_regex patterns for Rust, a quite\n> popular programming language. It also includes test cases for the\n> xfuncname regex (t4018) and updated documentation.\n> \n> The word_regex pattern finds identifiers, integers, floats and\n> operators, according to the Rust Reference Book.\n> \n> RFC: since I don't understand why when there are extra lines such as the\n> one with FIXME, the funcname is not correctly reported. Help welcome!\n> \n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  Documentation/gitattributes.txt | 2 ++\n>  t/t4018-diff-funcname.sh        | 1 +\n>  t/t4018/rust-fn                 | 5 +++++\n>  t/t4018/rust-struct             | 5 +++++\n>  t/t4018/rust-trait              | 5 +++++\n\nNice to see tests!\n\n> diff --git a/userdiff.c b/userdiff.c\n> index 3a78fbf504..9e1e2fa03f 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -130,6 +130,15 @@ PATTERNS(\"ruby\", \"^[ \\t]*((class|module|def)[ \\t].*)$\",\n>  \t \"(@|@@|\\\\$)?[a-zA-Z_][a-zA-Z0-9_]*\"\n>  \t \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\\\?(\\\\\\\\C-)?(\\\\\\\\M-)?.\"\n>  \t \"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\\\.{1,3}|::|[!=]~\"),\n> +PATTERNS(\"rust\",\n> +\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(struct|enum|union|mod)[ \\t].*)$\\n\"\n> +\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(unsafe[\\t ]+)?trait[ \\t].*)$\\n\"\n> +\t \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?((const|unsafe|extern(([\\t ]+)*\\\"[^)]+\\\")?)[\\t ]+)*fn[ \\t].*)$\\n\",\n\nThe last \\n there is the reason for the test failures: it adds an empty\npattern that matches everywhere and does not capture any text.\n\nCan we simplify these patterns as in\n\n   ^\n   space*\n   ( pub ( \"(\" stuff \")\" )? space* )?\n   ( struct|enum|union|mod|unsafe|trait|const|extern|fn )\n   stuff\n   $\n\nYou don't have to check for a correct syntax rigorously because you can\nassume that only correct Rust code will be passed to the patterns.\n\n> +\t /* -- */\n> +\t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n> +\t \"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n\nI assume that\n\n       +e_1.ei8-e_2.eu128\n\nis correct syntax, but not a single token. Yet, your number pattern\nwould take it as a single word.\n\n> +\t \"|0[box]?[0-9a-fA-F_]+(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n\nYou should really subsume your number patterns under a single pattern\nthat requires an initial digit, because you can again assume that only\ncorrect syntax will be shown to the patterns:\n\n\t\"|[0-9][0-9_a-fA-Fuisxz]*([.][0-9]*([eE][+-]?[0-9]+)?)?\"\n\n(very likely, I have mistaken the meaning of f32 and f64 here).\n\n> +\t \"|[-+*\\\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\\\|\\\\||->|=>|\\\\.{2}=|\\\\.{3}|::\"),\n>  PATTERNS(\"bibtex\", \"(@[a-zA-Z]{1,}[ \\t]*\\\\{{0,1}[ \\t]*[^ \\t\\\"@',\\\\#}{~%]*).*$\",\n>  \t \"[={}\\\"]|[^={}\\\" \\t]+\"),\n>  PATTERNS(\"tex\", \"^(\\\\\\\\((sub)*section|chapter|part)\\\\*{0,1}\\\\{.*)$\",\n> \n> base-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2\n> \n\n-- Hannes\n"},{"id":"375740","messageId":"aa6913d2-229e-096f-abdb-881f22821629@kdbg.org","threadId":"51104","inReplyTo":"c8b6e9c6-12a4-c6dd-bea9-7f07c8af7d15@kdbg.org","subject":"Re: [PATCH] RFC: userdiff: add built-in pattern for rust","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-05-16T20:46:28Z","receivedAt":"2019-05-16T20:46:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 16.05.19 um 22:29 schrieb Johannes Sixt:\n> Am 15.05.19 um 20:34 schrieb marcandre.lureau@redhat.com:\n>> +\t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n>> +\t \"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n> \n> I assume that\n> \n>        +e_1.ei8-e_2.eu128\n\nMake that\n\t+e_1.e_8-e_2.eu128\n\n> is correct syntax, but not a single token. Yet, your number pattern\n> would take it as a single word.\n\n-- Hannes\n"},{"id":"375753","messageId":"CAMxuvayAS=UbM6JF1WHkb5XsoVwQa2i4HQJM=0A4wo-t+T2cAw@mail.gmail.com","threadId":"51104","inReplyTo":"c8b6e9c6-12a4-c6dd-bea9-7f07c8af7d15@kdbg.org","subject":"Re: [PATCH] RFC: userdiff: add built-in pattern for rust","fromName":"Marc-André Lureau","fromEmail":"marcandre.lureau@redhat.com","sentAt":"2019-05-16T22:17:12Z","receivedAt":"2019-05-16T22:23:35Z","isPatch":true,"sender":{"key":"marcandre.lureau@redhat.com","avatar":null},"body":"Hi\n\nOn Thu, May 16, 2019 at 10:29 PM Johannes Sixt <j6t@kdbg.org> wrote:\n>\n> Am 15.05.19 um 20:34 schrieb marcandre.lureau@redhat.com:\n> > From: Marc-André Lureau <mlureau@redhat.com>\n> >\n> > This adds xfuncname and word_regex patterns for Rust, a quite\n> > popular programming language. It also includes test cases for the\n> > xfuncname regex (t4018) and updated documentation.\n> >\n> > The word_regex pattern finds identifiers, integers, floats and\n> > operators, according to the Rust Reference Book.\n> >\n> > RFC: since I don't understand why when there are extra lines such as the\n> > one with FIXME, the funcname is not correctly reported. Help welcome!\n> >\n> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> > ---\n> >  Documentation/gitattributes.txt | 2 ++\n> >  t/t4018-diff-funcname.sh        | 1 +\n> >  t/t4018/rust-fn                 | 5 +++++\n> >  t/t4018/rust-struct             | 5 +++++\n> >  t/t4018/rust-trait              | 5 +++++\n>\n> Nice to see tests!\n>\n> > diff --git a/userdiff.c b/userdiff.c\n> > index 3a78fbf504..9e1e2fa03f 100644\n> > --- a/userdiff.c\n> > +++ b/userdiff.c\n> > @@ -130,6 +130,15 @@ PATTERNS(\"ruby\", \"^[ \\t]*((class|module|def)[ \\t].*)$\",\n> >        \"(@|@@|\\\\$)?[a-zA-Z_][a-zA-Z0-9_]*\"\n> >        \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\\\?(\\\\\\\\C-)?(\\\\\\\\M-)?.\"\n> >        \"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\\\.{1,3}|::|[!=]~\"),\n> > +PATTERNS(\"rust\",\n> > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(struct|enum|union|mod)[ \\t].*)$\\n\"\n> > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(unsafe[\\t ]+)?trait[ \\t].*)$\\n\"\n> > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?((const|unsafe|extern(([\\t ]+)*\\\"[^)]+\\\")?)[\\t ]+)*fn[ \\t].*)$\\n\",\n>\n> The last \\n there is the reason for the test failures: it adds an empty\n> pattern that matches everywhere and does not capture any text.\n\nOops, thanks!\n\n>\n> Can we simplify these patterns as in\n>\n>    ^\n>    space*\n>    ( pub ( \"(\" stuff \")\" )? space* )?\n>    ( struct|enum|union|mod|unsafe|trait|const|extern|fn )\n>    stuff\n>    $\n>\n> You don't have to check for a correct syntax rigorously because you can\n> assume that only correct Rust code will be passed to the patterns.\n\nyes, but with\n\nextern ( space* '\"' stuff '\"' )?\n\nI'll try that\n\n>\n> > +      /* -- */\n> > +      \"[a-zA-Z_][a-zA-Z0-9_]*\"\n> > +      \"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n>\n> I assume that\n>\n>        +e_1.ei8-e_2.eu128\n>\n> is correct syntax, but not a single token. Yet, your number pattern\n> would take it as a single word.\n>\n> > +      \"|0[box]?[0-9a-fA-F_]+(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n>\n> You should really subsume your number patterns under a single pattern\n> that requires an initial digit, because you can again assume that only\n> correct syntax will be shown to the patterns:\n>\n>         \"|[0-9][0-9_a-fA-Fuisxz]*([.][0-9]*([eE][+-]?[0-9]+)?)?\"\n>\n> (very likely, I have mistaken the meaning of f32 and f64 here).\n\nThat doesn't capture 0o70, easy to fix.\n\nThen it doesn't capture the examples from the reference manual:\n123.0f64;\n0.1f64;\n0.1f32;\n12E+99_f64;\n\nThanks for your help!\n\n>\n> > +      \"|[-+*\\\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\\\|\\\\||->|=>|\\\\.{2}=|\\\\.{3}|::\"),\n> >  PATTERNS(\"bibtex\", \"(@[a-zA-Z]{1,}[ \\t]*\\\\{{0,1}[ \\t]*[^ \\t\\\"@',\\\\#}{~%]*).*$\",\n> >        \"[={}\\\"]|[^={}\\\" \\t]+\"),\n> >  PATTERNS(\"tex\", \"^(\\\\\\\\((sub)*section|chapter|part)\\\\*{0,1}\\\\{.*)$\",\n> >\n> > base-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2\n> >\n>\n> -- Hannes\n"},{"id":"375755","messageId":"CAMxuvayShHs4=ykFaVgmvr0NkO=nb7n7Lht1-5MdafDavNF6MQ@mail.gmail.com","threadId":"51104","inReplyTo":"CAMxuvayAS=UbM6JF1WHkb5XsoVwQa2i4HQJM=0A4wo-t+T2cAw@mail.gmail.com","subject":"Re: [PATCH] RFC: userdiff: add built-in pattern for rust","fromName":"Marc-André Lureau","fromEmail":"marcandre.lureau@redhat.com","sentAt":"2019-05-16T22:36:40Z","receivedAt":"2019-05-16T22:36:54Z","isPatch":true,"sender":{"key":"marcandre.lureau@redhat.com","avatar":null},"body":"Hi\n\nOn Fri, May 17, 2019 at 12:17 AM Marc-André Lureau\n<marcandre.lureau@redhat.com> wrote:\n>\n> Hi\n>\n> On Thu, May 16, 2019 at 10:29 PM Johannes Sixt <j6t@kdbg.org> wrote:\n> >\n> > Am 15.05.19 um 20:34 schrieb marcandre.lureau@redhat.com:\n> > > From: Marc-André Lureau <mlureau@redhat.com>\n> > >\n> > > This adds xfuncname and word_regex patterns for Rust, a quite\n> > > popular programming language. It also includes test cases for the\n> > > xfuncname regex (t4018) and updated documentation.\n> > >\n> > > The word_regex pattern finds identifiers, integers, floats and\n> > > operators, according to the Rust Reference Book.\n> > >\n> > > RFC: since I don't understand why when there are extra lines such as the\n> > > one with FIXME, the funcname is not correctly reported. Help welcome!\n> > >\n> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> > > ---\n> > >  Documentation/gitattributes.txt | 2 ++\n> > >  t/t4018-diff-funcname.sh        | 1 +\n> > >  t/t4018/rust-fn                 | 5 +++++\n> > >  t/t4018/rust-struct             | 5 +++++\n> > >  t/t4018/rust-trait              | 5 +++++\n> >\n> > Nice to see tests!\n> >\n> > > diff --git a/userdiff.c b/userdiff.c\n> > > index 3a78fbf504..9e1e2fa03f 100644\n> > > --- a/userdiff.c\n> > > +++ b/userdiff.c\n> > > @@ -130,6 +130,15 @@ PATTERNS(\"ruby\", \"^[ \\t]*((class|module|def)[ \\t].*)$\",\n> > >        \"(@|@@|\\\\$)?[a-zA-Z_][a-zA-Z0-9_]*\"\n> > >        \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\\\?(\\\\\\\\C-)?(\\\\\\\\M-)?.\"\n> > >        \"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\\\.{1,3}|::|[!=]~\"),\n> > > +PATTERNS(\"rust\",\n> > > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(struct|enum|union|mod)[ \\t].*)$\\n\"\n> > > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?(unsafe[\\t ]+)?trait[ \\t].*)$\\n\"\n> > > +      \"^[\\t ]*(((pub|pub\\\\([^)]+\\\\))[\\t ]+)?((const|unsafe|extern(([\\t ]+)*\\\"[^)]+\\\")?)[\\t ]+)*fn[ \\t].*)$\\n\",\n> >\n> > The last \\n there is the reason for the test failures: it adds an empty\n> > pattern that matches everywhere and does not capture any text.\n>\n> Oops, thanks!\n>\n> >\n> > Can we simplify these patterns as in\n> >\n> >    ^\n> >    space*\n> >    ( pub ( \"(\" stuff \")\" )? space* )?\n> >    ( struct|enum|union|mod|unsafe|trait|const|extern|fn )\n> >    stuff\n> >    $\n> >\n> > You don't have to check for a correct syntax rigorously because you can\n> > assume that only correct Rust code will be passed to the patterns.\n>\n> yes, but with\n>\n> extern ( space* '\"' stuff '\"' )?\n>\n> I'll try that\n>\n\nOr do you want to capture any line with \"extern...\" or \"unsafe...\" ?\n\nThat's a bit too much I think, in particular, with unsafe, which is\ncommonly used with a simple block.\n\nSo perhaps this instead?:\n\n[\\t ]*((pub(\\([^)]+\\))[\\t ]+)?((const|unsafe|extern([\\t\n]+\\\"[^\\\"]+\\\"))[\\t ]+)?(struct|enum|union|mod|trait|fn)[ \\t].*)$\n\n\n> >\n> > > +      /* -- */\n> > > +      \"[a-zA-Z_][a-zA-Z0-9_]*\"\n> > > +      \"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n> >\n> > I assume that\n> >\n> >        +e_1.ei8-e_2.eu128\n> >\n> > is correct syntax, but not a single token. Yet, your number pattern\n> > would take it as a single word.\n> >\n> > > +      \"|0[box]?[0-9a-fA-F_]+(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?\"\n> >\n> > You should really subsume your number patterns under a single pattern\n> > that requires an initial digit, because you can again assume that only\n> > correct syntax will be shown to the patterns:\n> >\n> >         \"|[0-9][0-9_a-fA-Fuisxz]*([.][0-9]*([eE][+-]?[0-9]+)?)?\"\n> >\n> > (very likely, I have mistaken the meaning of f32 and f64 here).\n>\n> That doesn't capture 0o70, easy to fix.\n>\n> Then it doesn't capture the examples from the reference manual:\n> 123.0f64;\n> 0.1f64;\n> 0.1f32;\n> 12E+99_f64;\n>\n> Thanks for your help!\n>\n> >\n> > > +      \"|[-+*\\\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\\\|\\\\||->|=>|\\\\.{2}=|\\\\.{3}|::\"),\n> > >  PATTERNS(\"bibtex\", \"(@[a-zA-Z]{1,}[ \\t]*\\\\{{0,1}[ \\t]*[^ \\t\\\"@',\\\\#}{~%]*).*$\",\n> > >        \"[={}\\\"]|[^={}\\\" \\t]+\"),\n> > >  PATTERNS(\"tex\", \"^(\\\\\\\\((sub)*section|chapter|part)\\\\*{0,1}\\\\{.*)$\",\n> > >\n> > > base-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2\n> > >\n> >\n> > -- Hannes\n"}]}