diff options
Diffstat (limited to 'lib/LXRng/Lang')
-rw-r--r-- | lib/LXRng/Lang/C.pm | 9 | ||||
-rw-r--r-- | lib/LXRng/Lang/GnuAsm.pm | 8 | ||||
-rw-r--r-- | lib/LXRng/Lang/Kconfig.pm | 8 |
3 files changed, 13 insertions, 12 deletions
diff --git a/lib/LXRng/Lang/C.pm b/lib/LXRng/Lang/C.pm index db3a204..892e104 100644 --- a/lib/LXRng/Lang/C.pm +++ b/lib/LXRng/Lang/C.pm @@ -67,8 +67,9 @@ sub parsespec { return ['atom', '\\\\.', undef, 'comment', '/\*', '\*/', 'comment', '//', "\$", - 'string', '"', '"', - 'string', "'", "'", + 'string', '"(?:[^\\\\]*\\\\.)*[^\\\\]*"', undef, + 'string', "'(?:[^\\\\]*\\\\.)*[^\\\\]*'", undef, + 'atom', '#\s*(?:ifn?def|define|else|endif|undef)', undef, 'include', '#\s*include\s+"', '"', 'include', '#\s*include\s+<', '>']; } @@ -85,8 +86,8 @@ sub markuphandlers { qr/[^\n]+/ => sub { $markup->format_comment(@_) }; $subst{'string'} = new Subst::Complex - qr/\n/ => $format_newline, - qr/[^\n\"\']+/ => sub { $markup->format_string(@_) }; + qr/\n/ => $format_newline, + qr/[^\n]+/ => sub { $markup->format_string(@_) }; $subst{'include'} = new Subst::Complex qr/\n/ => $format_newline, diff --git a/lib/LXRng/Lang/GnuAsm.pm b/lib/LXRng/Lang/GnuAsm.pm index acdcdef..4ad83d8 100644 --- a/lib/LXRng/Lang/GnuAsm.pm +++ b/lib/LXRng/Lang/GnuAsm.pm @@ -95,8 +95,8 @@ sub parsespec { 'atom', '[.][a-z0-9]+', undef, # Directives 'comment', '/\*', '\*/', 'comment', '//', "\$", - 'string', '"', '"', - 'string', "'", "'", + 'string', '"(?:[^\\\\]*\\\\.)*[^\\\\]*"', undef, + 'string', "'(?:[^\\\\]*\\\\.)*[^\\\\]*'", undef, 'atom', '#\s*(?:ifn?def|define|else|endif|undef)', undef, 'include', '#\s*include\s+"', '"', 'include', '#\s*include\s+<', '>', @@ -115,8 +115,8 @@ sub markuphandlers { qr/[^\n]+/ => sub { $markup->format_comment(@_) }; $subst{'string'} = new Subst::Complex - qr/\n/ => $format_newline, - qr/[^\n\"\']+/ => sub { $markup->format_string(@_) }; + qr/\n/ => $format_newline, + qr/[^\n]+/ => sub { $markup->format_string(@_) }; $subst{'include'} = new Subst::Complex qr/\n/ => $format_newline, diff --git a/lib/LXRng/Lang/Kconfig.pm b/lib/LXRng/Lang/Kconfig.pm index 2239a87..4c8df6c 100644 --- a/lib/LXRng/Lang/Kconfig.pm +++ b/lib/LXRng/Lang/Kconfig.pm @@ -58,8 +58,8 @@ sub reserved { sub parsespec { return ['atom', '\\\\.', undef, 'comment', '#', "\$", - 'string', '"', '"', - 'string', "'", "'", + 'string', '"(?:[^\\\\]*\\\\.)*[^\\\\]*"', undef, + 'string', "'(?:[^\\\\]*\\\\.)*[^\\\\]*'", undef, 'help', 'help', "^(?=[^ \t\n])", 'include', '^source\s+"', '"']; } @@ -85,8 +85,8 @@ sub markuphandlers { qr/[^\n\"\']+/ => sub { $markup->format_string(@_) }; $subst{'string'} = new Subst::Complex - qr/\n/ => $format_newline, - qr/[^\n\"\']+/ => sub { $markup->format_string(@_) }; + qr/\n/ => $format_newline, + qr/[^\n]+/ => sub { $markup->format_string(@_) }; $subst{'include'} = new Subst::Complex qr/\n/ => $format_newline, |