|
111 | 111 | * Unicode support (contributed mostly by Jean-Philippe Bernardy,
|
112 | 112 | with help from Alan Zimmerman).
|
113 | 113 |
|
114 |
| - * An Alex lexer now takes a UTF-8 encoded byte sequence as input |
115 |
| - (see Section 5.1, “Unicode and UTF-8”. If you are using the |
| 114 | + * An Alex lexer now takes a UTF-8 encoded byte sequence as input. |
| 115 | + If you are using the |
116 | 116 | "basic" wrapper or one of the other wrappers that takes a
|
117 | 117 | Haskell String as input, the string is automatically encoded
|
118 |
| - into UTF-8 by Alex. If your input is a ByteString, you are |
119 |
| - responsible for ensuring that the input is UTF-8 encoded. The |
120 |
| - old 8-bit behaviour is still available via the --latin1 |
121 |
| - option. |
| 118 | + into UTF-8 by Alex. If your input is a `ByteString`, you are |
| 119 | + responsible for ensuring that the input is UTF-8 encoded. |
122 | 120 |
|
123 | 121 | * Alex source files are assumed to be in UTF-8, like Haskell
|
124 | 122 | source files. The lexer specification can use Unicode
|
125 | 123 | characters and ranges.
|
126 | 124 |
|
127 | 125 | * `alexGetChar` is renamed to `alexGetByte` in the generated code.
|
128 | 126 |
|
129 |
| - * There is a new option, `--latin1`, that restores the old |
| 127 | + * There is a new option, `--latin1`, that restores the old 8-bit |
130 | 128 | behaviour.
|
131 | 129 |
|
132 | 130 | * Alex now does DFA minimization, which helps to reduce the size
|
133 | 131 | of the generated tables, especially for lexers that use Unicode.
|
| 132 | + |
| 133 | +## Release Notes for version 2.2 |
| 134 | + |
| 135 | +- `Cabal-1.2` is now required. |
| 136 | + |
| 137 | +- `ByteString` wrappers: use Alex to lex ByteStrings directly. |
| 138 | + |
| 139 | +## Release Notes for version 2.1.0 |
| 140 | + |
| 141 | +- Switch to a Cabal build system: you need a recent version of Cabal |
| 142 | + (1.1.6 or later). If you have GHC 6.4.2, then you need to upgrade |
| 143 | + Cabal before building Alex. GHC 6.6 is fine. |
| 144 | + |
| 145 | +- Slight change in the error semantics: the input returned on error is |
| 146 | + before the erroneous character was read, not after. This helps to |
| 147 | + give better error messages. |
| 148 | + |
| 149 | +## Release Notes for version 2.0 |
| 150 | + |
| 151 | +Alex has changed a *lot* between versions 1.x and 2.0. The following is |
| 152 | +supposed to be an exhaustive list of the changes: |
| 153 | + |
| 154 | +### Syntax changes |
| 155 | + |
| 156 | +- Code blocks are now surrounded by `{...}` rather than `%{...%}`. |
| 157 | + |
| 158 | +- Character-set macros now begin with ‘`$`’ instead of ‘`^`’ and have |
| 159 | + multi-character names. |
| 160 | + |
| 161 | +- Regular expression macros now begin with ‘`@`’ instead of ‘`%`’ and |
| 162 | + have multi-character names. |
| 163 | + |
| 164 | +- Macro definitions are no longer surrounded by `{ ... }`. |
| 165 | + |
| 166 | +- Rules are now of the form |
| 167 | + |
| 168 | + <c1,c2,...> regex { code } |
| 169 | + |
| 170 | + where `c1`, `c2` are startcodes, and `code` is an arbitrary Haskell |
| 171 | + expression. |
| 172 | + |
| 173 | +- Regular expression syntax changes: |
| 174 | + |
| 175 | + - `()` is the empty regular expression (used to be ‘`$`’) |
| 176 | + |
| 177 | + - set complement can now be expressed as `[^sets]` (for similarity |
| 178 | + with lex regular expressions). |
| 179 | + |
| 180 | + - The `'abc'` form is no longer available, use `[abc]` instead. |
| 181 | + |
| 182 | + - ‘`^`’ and ‘`$`’ have the usual meanings: ‘`^`’ matches just |
| 183 | + after a ‘`\n`’, and ‘`$`’ matches just before a ‘`\n`’. |
| 184 | + |
| 185 | + - ‘`\n`’ is now the escape character, not ‘`^`’. |
| 186 | + |
| 187 | + - The form `"..."` means the same as the sequence of characters |
| 188 | + inside the quotes, the difference being that special characters |
| 189 | + do not need to be escaped inside `"..."`. |
| 190 | + |
| 191 | +- Rules can have arbitrary predicates attached to them. This subsumes |
| 192 | + the previous left-context and right-context facilities (although |
| 193 | + these are still allowed as syntactic sugar). |
| 194 | + |
| 195 | +### Changes in the form of an Alex file |
| 196 | + |
| 197 | +- Each file can now only define a single grammar. This change was made |
| 198 | + to simplify code generation. Multiple grammars can be simulated |
| 199 | + using startcodes, or split into separate modules. |
| 200 | + |
| 201 | +- The API has been simplified, and at the same time made more |
| 202 | + flexible. |
| 203 | + |
| 204 | +- You no longer need to import the `Alex` module. |
| 205 | + |
| 206 | +### Usage changes |
| 207 | + |
| 208 | +The command-line syntax is quite different. |
| 209 | + |
| 210 | +### Implementation changes |
| 211 | + |
| 212 | +- A more efficient table representation, coupled with standard |
| 213 | + table-compression techniques, are used to keep the size of the |
| 214 | + generated code down. |
| 215 | + |
| 216 | +- When compiling a grammar with GHC, the `-g` switch causes an even |
| 217 | + faster and smaller grammar to be generated. |
| 218 | + |
| 219 | +- Startcodes are implemented in a different way: each state |
| 220 | + corresponds to a different initial state in the DFA, so the scanner |
| 221 | + doesn't have to check the startcode when it gets to an accept state. |
| 222 | + This results in a larger, but quicker, scanner. |
0 commit comments