19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix E<br />

Support for Unicode Input in ASCII<br />

As mentioned in Chapter 5, to facilitate the writing of <strong>Fortress</strong> programs using legacy, ASCII-based tools, <strong>Fortress</strong><br />

programs are subjected to two preprocessing steps. <strong>The</strong>se steps are described in detail in this appendix.<br />

E.1 Word Pasting across Line Breaks<br />

Consider every line terminator in the program (processing them from left to right) such that the following conditions<br />

are all true:<br />

• the last non-whitespace character before the line terminator is an ampersand (&);<br />

• the first non-whitespace character after the line terminator is an ampersand (&);<br />

• a word character immediately precedes the first ampersand; and<br />

• a word character immediately follows the second ampersand.<br />

<strong>The</strong>n all the characters from the first ampersand to the second ampersand are removed from the program, including the<br />

two ampersands. (Note that all the removed characters other than the two ampersands must be whitespace characters.)<br />

(<strong>The</strong> purpose of this is to allow very long identifier names and numeric tokens to be split across line boundaries.) For<br />

example:<br />

supercalifragilisticexpiali&<br />

&docious = 0.142857142857142857&<br />

&142857 TIMES &<br />

GREEK_SMALL_LETTER_&<br />

&UPSILON_WITH_DIALYTICA_AND_TONOS<br />

becomes<br />

supercalifragilisticexpialidocious = 0.142857142857142857&<br />

&142857 TIMES &<br />

GREEK_SMALL_LETTER_&<br />

&UPSILON_WITH_DIALYTICA_AND_TONOS<br />

becomes<br />

346

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!