From f801b30e70745ec16b7ec4734cf95c1e3e46fd69 Mon Sep 17 00:00:00 2001 From: Bram Stappers Date: Wed, 30 Nov 2016 10:20:56 +0100 Subject: [PATCH] Added template string token to EcmaScript 5 language definition. --- pmd-javascript/etc/grammar/es5.jj | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pmd-javascript/etc/grammar/es5.jj b/pmd-javascript/etc/grammar/es5.jj index a2e558c5d3..688692d61d 100644 --- a/pmd-javascript/etc/grammar/es5.jj +++ b/pmd-javascript/etc/grammar/es5.jj @@ -200,7 +200,16 @@ TOKEN : | "'" "'" + | "`" + + "`" > : NOREGEXP +| + < #BACKTICK_STRING_LITERAL_BODY:( + ("\\" ~[] ) + | (~["`", "\\"]) + )* + > | < #SINGLE_STRING_LITERAL_BODY:( ( "\\" ~[ "\r" , "\n" , "\u2028" , "\u2029"] )