mksyntaxhtml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. cp syntax.txt syntax.html
  3. sam -d syntax.html <<'!'
  4. ,s/\&/\&amp;/g
  5. ,s/</\&lt;/g
  6. ,s/>/\&gt;/g
  7. ,s!== (([^()]|\([^()]*\))*)!≡ <code>\1</code>!g
  8. ,s!«!<code>!g
  9. ,s!»!</code>!g
  10. ,s! vim$! <font size=-2>VIM</font>!g
  11. ,s! pcre$! <font size=-2>PCRE</font>!g
  12. ,s! perl$! <font size=-2>PERL</font>!g
  13. ,x g/NOT SUPPORTED/ s!^[^ ]+!<font color=#808080>&</font>!
  14. ,s!NOT SUPPORTED!!g
  15. ,s!(^[^ ]+) (.*)\n!<tr><td><code>\1</code></td><td>\2</td></tr>\n!g
  16. ,s!.*:$!<b>&</b>!g
  17. ,s!^$!<tr><td></td></tr>!g
  18. ,x v/<tr>/ s!.*!<tr><td colspan=2>&</td></tr>!
  19. 1,2c
  20. <html>
  21. <!-- AUTOMATICALLY GENERATED by mksyntaxhtml -->
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  24. <title>RE2 regular expression syntax reference</title>
  25. </head>
  26. <body>
  27. <h1>RE2 regular expression syntax reference</h1>
  28. <table border=0 cellpadding=2 cellspacing=2>
  29. <tr><td colspan=2>This page lists the regular expression syntax accepted by RE2.</td></tr>
  30. <tr><td colspan=2>It also lists syntax accepted by PCRE, PERL, and VIM.</td></tr>
  31. <tr><td colspan=2>Grayed out expressions are not supported by RE2.</td></tr>
  32. .
  33. $a
  34. </table>
  35. </body>
  36. </html>
  37. .
  38. w
  39. q
  40. !