[llvm-commits] CVS: llvm-www/demo/syntax.css index.cgi

Misha Brukman brukman at cs.uiuc.edu
Tue Dec 9 15:02:03 PST 2003


Changes in directory llvm-www/demo:

syntax.css added (r1.1)
index.cgi updated: 1.18 -> 1.19

---
Log message:

Syntax-highlight LLVM code with color. Now we're stylish, too.


---
Diffs of the changes:  (+14 -9)

Index: llvm-www/demo/syntax.css
diff -c /dev/null llvm-www/demo/syntax.css:1.1
*** /dev/null	Tue Dec  9 15:01:24 2003
--- llvm-www/demo/syntax.css	Tue Dec  9 15:01:14 2003
***************
*** 0 ****
--- 1,4 ----
+ /* LLVM syntax highlighting for the Web */
+ 
+ .llvm_type    { font-style: oblique; color: green }
+ .llvm_keyword { font-weight: bold; color: blue }


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.18 llvm-www/demo/index.cgi:1.19
--- llvm-www/demo/index.cgi:1.18	Sat Nov 22 12:58:14 2003
+++ llvm-www/demo/index.cgi	Tue Dec  9 15:01:14 2003
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2003/11/22 18:58:14 $
+# Last modified $Date: 2003/12/09 21:01:14 $
 #
 
 use CGI;
@@ -17,7 +17,7 @@
 if ( !-d "/tmp/webcompile" ) { mkdir( "/tmp/webcompile", 0777 ); }
 
 $LOGFILE         = '/tmp/webcompile/log.txt';
-$FORM_URL        = 'http://llvm.cs.uiuc.edu/demo/index.cgi';
+$FORM_URL        = 'index.cgi';
 $CONTACT_ADDRESS = 'gaeke -at- uiuc.edu';
 $LOGO_IMAGE_URL  = 'cathead.png';
 @PREPENDPATHDIRS =
@@ -82,12 +82,10 @@
 }
 
 sub syntaxHighlightLLVM {
-    my ($input) = @_;
-    $input =~
-s@\b(void|bool|sbyte|ubyte|short|ushort|int|uint|long|ulong|float|double|type|label|opaque)\b@<i>$1</i>@g;
-    $input =~
-s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|to|except|not|target|endian|pointersize|big|little|volatile)\b@<b>$1</b>@g;
-    return $input;
+  my ($input) = @_;
+  $input =~ s@\b(void|bool|sbyte|ubyte|short|ushort|int|uint|long|ulong|float|double|type|label|opaque)\b@<span class="llvm_type">$1</span>@g;
+  $input =~ s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|to|except|not|target|endian|pointersize|big|little|volatile)\b@<span class="llvm_keyword">$1</span>@g;
+  return $input;
 }
 
 sub mailto {
@@ -108,7 +106,10 @@
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>Try out LLVM in your browser!</title>
-  <link rel="stylesheet" href="../llvm.css" type="text/css">
+  <style>
+    \@import url("syntax.css");
+    \@import url("../llvm.css");
+  </style>
 </head>
 <body leftmargin="10" marginwidth="10">
 





More information about the llvm-commits mailing list