Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 4214 Bytes
1 | <?xml version="1.0" encoding="iso-8859-1"?> |
2 | <!DOCTYPE html |
3 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
5 | <html> |
6 | <head> |
7 | <title>File: README</title> |
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
9 | <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> |
10 | |
11 | <script language="JavaScript" type="text/javascript"> |
12 | // <![CDATA[ |
13 | |
14 | function toggleSource( id ) |
15 | { |
16 | var elem |
17 | var link |
18 | |
19 | if( document.getElementById ) |
20 | { |
21 | elem = document.getElementById( id ) |
22 | link = document.getElementById( "l_" + id ) |
23 | } |
24 | else if ( document.all ) |
25 | { |
26 | elem = eval( "document.all." + id ) |
27 | link = eval( "document.all.l_" + id ) |
28 | } |
29 | else |
30 | return false; |
31 | |
32 | if( elem.style.display == "block" ) |
33 | { |
34 | elem.style.display = "none" |
35 | link.innerHTML = "show source" |
36 | } |
37 | else |
38 | { |
39 | elem.style.display = "block" |
40 | link.innerHTML = "hide source" |
41 | } |
42 | } |
43 | |
44 | function openCode( url ) |
45 | { |
46 | window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" ) |
47 | } |
48 | // ]]> |
49 | </script> |
50 | </head> |
51 | |
52 | <body> |
53 | <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'> |
54 | <tr><td> |
55 | <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr> |
56 | <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />README</td> |
57 | <td align="right"> |
58 | <table border='0' cellspacing="0" cellpadding="2"> |
59 | <tr> |
60 | <td>Path:</td> |
61 | <td>README |
62 | </td> |
63 | </tr> |
64 | <tr> |
65 | <td>Modified:</td> |
66 | <td>Sat Jun 18 13:36:02 MDT 2005</td> |
67 | </tr> |
68 | </table> |
69 | </td></tr> |
70 | </table> |
71 | </td></tr> |
72 | </table><br> |
73 | <!-- banner header --> |
74 | |
75 | <div id="bodyContent"> |
76 | <div id="content"> |
77 | |
78 | <div class="description"><h1><a href="../classes/Syntax.html">Syntax</a></h1> |
79 | <p> |
80 | A syntax highlighting a library for Ruby. |
81 | </p> |
82 | <h2>About</h2> |
83 | <p> |
84 | This is a simple syntax highlighting library for Ruby. It is a naive syntax |
85 | analysis tool, meaning that it does not "understand" the syntaxes |
86 | of the languages it processes, but merely does some semi-intelligent |
87 | pattern matching. |
88 | </p> |
89 | <h2>Usage</h2> |
90 | <p> |
91 | There are primarily two uses for the <a |
92 | href="../classes/Syntax.html">Syntax</a> library: |
93 | </p> |
94 | <p> |
95 | # Convert text from a supported syntax to a supported highlight format |
96 | (like HTML). # Tokenize text in a supported syntax and process the tokens |
97 | directly. |
98 | </p> |
99 | <h3>Highlighting a supported syntax</h3> |
100 | <pre> |
101 | require 'syntax/convertors/html' |
102 | |
103 | convertor = Syntax::Convertors::HTML.for_syntax "ruby" |
104 | puts convertor.convert( File.read( "file.rb" ) ) |
105 | </pre> |
106 | <p> |
107 | The above snippet will emit HTML, using spans and CSS to indicate the |
108 | different highlight "groups". (Sample CSS files are included in |
109 | the "data" directory.) |
110 | </p> |
111 | <h3>Tokenize text</h3> |
112 | <pre> |
113 | require 'syntax' |
114 | |
115 | tokenizer = Syntax.load "ruby" |
116 | tokenizer.tokenize( File.read( "file.rb" ) ) do |token| |
117 | puts "group(#{token.group}, #{token.instruction}) lexeme(#{token})" |
118 | end |
119 | </pre> |
120 | <p> |
121 | Tokenizing is straightforward process. Each time a new token is discovered |
122 | by the tokenizer, it is yielded to the given block. |
123 | </p> |
124 | <ul> |
125 | <li><tt>token.group</tt> is the lexical group to which the token belongs. Each |
126 | supported syntax may have it’s own set of lexical groups. |
127 | |
128 | </li> |
129 | <li><tt>token.instruction</tt> is an instruction used to determine how this |
130 | token should be treated. It will be <tt>:none</tt> for normal tokens, |
131 | <tt>:region_open</tt> if the token starts a nested region, and |
132 | <tt>:region_close</tt> if it closes the last opened region. |
133 | |
134 | </li> |
135 | <li><tt>token</tt> is itself a subclass of String, so you can use it just as |
136 | you would a string. It represents the lexeme that was actually parsed. |
137 | |
138 | </li> |
139 | </ul> |
140 | </div> |
141 | |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | |
149 | |
150 | </div> |
151 | |
152 | </div> |
153 | |
154 | </body> |
155 | </html> |