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.

BIG SI unit absorbs abstract also api as<br />

asif at atomic bool case catch coerces<br />

coercion component comprises default dim do elif<br />

else end ensures except excludes exit export<br />

extends finally fn for forbid from getter<br />

hidden ident idiom if import in int<br />

invariant io juxtaposition label largest nat object<br />

of or opr private property provided requires<br />

self settable setter smallest spawn syntax test<br />

then throw throws trait transient try tryatomic<br />

type typecase unit value var where while<br />

widening widens with wrapped<br />

<strong>The</strong> operators on units, namely cubed, cubic, inverse, per, square, and squared, are also special reserved words.<br />

To avoid confusion, <strong>Fortress</strong> reserves the following tokens:<br />

goto idiom public pure reciprocal static<br />

<strong>The</strong>y do not have any special meanings but they cannot be used as identifiers.<br />

5.9 Character Literals<br />

A character literal consists of a sequence of characters enclosed in single quotation marks. <strong>The</strong> character that begins<br />

a character literal is called the literal’s opening mark; the character that ends it is its closing mark. For convenience,<br />

the marks may be true typographical “curly” single quotation marks (U+2018 and U+2019), a pair of apostrophe<br />

characters (U+0027), or a “backquote” character (U+0060) and an apostrophe character. As discussed in Section 13.1,<br />

a character literal evaluates to a value of type Character (see Section 8.7), which represents an abstract Unicode<br />

character.<br />

A left single quotation mark (U+2018) or a backquote begins a character literal unless it is within a comment, another<br />

character literal, or a string literal. An apostrophe (U+2018) begins a character literal unless it is within a comment,<br />

another character literal, or a string literal, or it is immediately preceded by a word character (i.e.., a letter, digit,<br />

connecting punctuation, prime, or apostrophe). In either case, the character literal ends with the nearest apostrophe or<br />

right single quotation mark after the first character following the opening mark. In particular, an apostrophe or right<br />

single quotation mark immediately following the opening mark of a character literal is not a closing mark. Thus, for<br />

example, the sequence ’’’ is a single character literal with one enclosed character ’.<br />

It is a static error if any of the enclosed characters of a character literal is a line feed, form feed, carriage return, or<br />

any character forbidden outside comments in a <strong>Fortress</strong> program (see Section 5.1), or if there is exactly one enclosed<br />

character and it is a backslash (U+005C). It is also a static error if any of the enclosed characters is a string literal delimiter<br />

that is not immediately preceded by a backslash (i.e., an unescaped string literal delimiter). This last restriction<br />

is necessary to prevent ASCII conversion from changing the boundaries of string literals (see Appendix E).<br />

<strong>The</strong> sequence of enclosed characters may be a single character (e.g., ‘a’, ’$’, ‘α’, ‘⊕’), a sequence of four or more<br />

hexadecimal digits identifying the code point of a Unicode character (e.g., ‘001C’, ‘FBAB’, ‘1D11E’), the official Unicode<br />

5.0 name or an alternative name of a Unicode character with spaces and hyphens intact (e.g., ‘PLUS-MINUS SIGN’),<br />

or a character-literal escape sequence. <strong>The</strong> character-literal escape sequences, and the characters such character literals<br />

evaluate to, are:<br />

47

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

Saved successfully!

Ooh no, something went wrong!