From 7f5d4f37d8d3240b8c3a91be79c0585e6ca8a9d4 Mon Sep 17 00:00:00 2001 From: Arne Georg Gleditsch Date: Mon, 17 Aug 2009 08:52:04 +0200 Subject: Handle embedded escaped string-terminators. --- lib/LXRng/Lang/GnuAsm.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/LXRng/Lang/GnuAsm.pm') 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, -- cgit v1.2.3