Commits

Anonymous committed ca8bbf3

[svn] Patch #160 by Tim Hatch: byref functions in PHP.

  • Participants
  • Parent commits 1864bff
  • Branches trunk

Comments (0)

Files changed (3)

 for 0.6
 -------
 
-- pygmentize presets?
-
-- short cmdline options for common ``-O`` options
-
-- improve guess_lexer heuristics (esp. for template langs)
-
-- help for ``-O`` and ``-a`` cmdline options
-
 - allow "overlay" token types (e.g. Diff + X) 
   - highlight specials: nth line, a word etc.
   - dhtml: overlays toggleable by javascript
     * objective c
     * mysql/postgresql/sqlite
     * tcl
-    * python help() ?
 
-- tell the PHP and DelphiLexer how to differ between Operators and
-  text.
+- tell the C(++) and PHP lexers how to differ between Operators and text.
 
 - add support for function name highlighting to c++ lexer
 
 - readd property support for C# lexer
 
 
-for 0.7 / later
----------------
+for 0.7
+-------
+
+- automatically get help for lexers/formatters/options from docstrings
 
 - moin parser
 
-- add folding? would require more language-aware parsers...
+- pygmentize presets?
+
+- more unit tests (pygmentize, all formatters comprehensively)
+
+- review perl lexer (numerous bugs, but so far no one had complaints ;)
+
+
+for 0.8 -- 1.0
+--------------
 
 - more setuptools entrypoints (html formatter etc.)
   see paste script's Commands
 
-- docstrings?
-
-- more unit tests (pygmentize, all formatters)
-
-- review perl lexer (numerous bugs, but so far no one had complaints ;)
-
-
+- add folding? would require more language-aware parsers...

pygments/lexers/web.py

              bygroups(Operator, Text, Name.Attribute)),
             (r'[~!%^&*()+=|\[\]:;,.<>/?{}@-]', Text),
             (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
-            (r'(function)(\s+)', bygroups(Keyword, Text), 'functionname'),
+            (r'(function)(\s+)(&?)(\s*)',
+              bygroups(Keyword, Text, Operator, Text), 'functionname'),
             (r'(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|'
              r'eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|'
              r'FALSE|print|for|require|continue|foreach|require_once|'

tests/examplefiles/test.php

     return true;
   }
 }
+
+function &byref() {
+    $x = array();
+    return $x;
+}
 ?>