]> granicus.if.org Git - apache/commitdiff
Identify Apache specific functions and constants in C.
authorDaniel Gruno <humbedooh@apache.org>
Wed, 25 Apr 2012 08:33:31 +0000 (08:33 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Wed, 25 Apr 2012 08:33:31 +0000 (08:33 +0000)
Treat true and false as boolean types (not keywords) in Lua.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1330154 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/scripts/prettify.js

index 3c58917721be368279c249e879d5125703b0f713..4ef51ca76bf457275fccc3f4a2fcaca0943a573e 100644 (file)
@@ -887,7 +887,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
     fallthroughStylePatterns.push(
         // TODO(mikesamuel): recognize non-latin letters and numerals in idents
         [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*|NULL/i, null],
+        
         [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_(t|req)\b)/, null],
+        [PR_TAG,     /^apr_[a-z_0-9]+|ap_[a-z_0-9]+/i, null],
         [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
         [PR_LITERAL,
          new RegExp(
@@ -1263,7 +1265,8 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
           'keywords': CPP_KEYWORDS,
           'hashComments': true,
           'cStyleComments': true,
-          'types': C_TYPES
+          'types': C_TYPES,
+          'functions': "apr_[a-z_]+,ap_rputs"
         }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
   registerLangHandler(sourceDecorator({
           'keywords': 'null,true,false'
@@ -1537,10 +1540,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
          // A comment is either a line comment that starts with two dashes, or
          // two dashes preceding a long bracketed block.
          [PR['PR_COMMENT'], /^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],
-         [PR['PR_TYPE'], /^nil/],
+         [PR['PR_TYPE'], /^nil|false|true/],
          // A long bracketed block not preceded by -- is a string.
          [PR['PR_STRING'],  /^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],
-         [PR['PR_KEYWORD'], /^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|not|or|repeat|return|then|true|until|while)\b/, null],
+         [PR['PR_KEYWORD'], /^(?:and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/, null],
          // A number is a hex integer literal, a decimal real literal, or in
          // scientific notation.
          [PR['PR_LITERAL'],