[gtksourceview] Added support for Nowdoc strings to PHP language spec



commit 43a545f0bea4626df29c6becb76177a003a41353
Author: Chris Blay <chris b blay gmail com>
Date:   Mon Feb 13 17:23:39 2012 -0700

    Added support for Nowdoc strings to PHP language spec
    
    https://bugzilla.gnome.org/show_bug.cgi?id=670025

 data/language-specs/php.lang |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/data/language-specs/php.lang b/data/language-specs/php.lang
index 516a93a..66e84c7 100644
--- a/data/language-specs/php.lang
+++ b/data/language-specs/php.lang
@@ -10,6 +10,7 @@
  Copyright (C) 2006 Steve FrÃcinaux <steve istique net>
  Copyright (C) 2007 Patryk Zawadzki <patrys pld-linux org>
  Copyright (C) 2007 Eric Norige <thelema swbell net>
+ Copyright (C) 2012 Christopher Blay <chris b blay gmail com>
 
  This library is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
@@ -158,6 +159,19 @@
       </include>
     </context>
 
+    <context id="now-doc-string" style-ref="here-doc" extend-parent="true">
+      <start>(&lt;&lt;&lt;)\s?'([a-zA-Z_][a-zA-Z0-9_]*)'</start>
+      <end>^(\%{2 start});?$</end>
+      <include>
+        <context sub-pattern="0" where="start" style-ref="here-doc-bound"/>
+        <context sub-pattern="1" where="end" style-ref="here-doc-bound"/>
+        <context style-ref="def:special-char">
+          <match>\\['\\]</match>
+        </context>
+        <context ref="def:line-continue"/>
+      </include>
+    </context>
+
     <context id="identifier" style-ref="identifier">
       <match>[a-zA-Z_][a-zA-Z0-9_]*</match>
     </context>
@@ -316,6 +330,7 @@
         <context ref="single-quoted-string"/>
         <context ref="backtick-string"/>
         <context ref="here-doc-string"/>
+        <context ref="now-doc-string"/>
         <context ref="variable"/>
         <context ref="array-operators"/>
         <context ref="keywords"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]