The recommended file extension is .langur.
Langur source code is pure UTF-8. Anything else would be uncivilized (see UTF-8 Everywhere). Surrogate codes (from UTF-16) are not allowed and a BOM (code point FEFF) is not allowed. The shell may miss a shebang line if a BOM were present.
Token whitespace is the horizontal tab (9), space (32), and line feed (10).
Windows line endings (CR/LF combination) cannot be used in langur source code, in favor of Linux line endings (LF only), which most operating systems use, anyway. Any decent plain text editor will allow you to specify the type of line endings to use. On Windows, Notepad++ seems to be useful, and there are surely plenty of others. Notepad, which comes with Windows, is not useful in this regard, and will not break at a line feed.
Identifiers are ASCII letters, numbers, and underscore, starting with a letter. Internal identifiers start with an underscore.
Use a shebang line at the very start of the file to specify the interpreter to use, such as...
#! /usr/bin/langur
Langur has 2 types of comments, single-line comments and multi-line (or inline) comments.
# single-line comment started with hash mark /* multi-line (or inline) comment enclosed in C-style markers */
Comments allow characters designated as "Graphic" by Unicode, Spaces, and Private Use Area code points. Also, the following list of invisible "spaces," to make it easier to paste in international text. There may be more code points that need to be allowed.
Linux | Windows |
---|---|
-c | /c |
compile only (do not execute) | |
-e "script" | /e "script" |
execute command-line script instead of a file | |
--help | /? |
help: print command line options | |
-W0123 | /W0123 |
warn on number literals starting with 0 so they're not confused for base 8 literals as used in many languages In langur, a base 8 literal is prefixed with 8x, such as 8x123 (NOT 0123). |
|
-w0123 | /w0123 |
disable this warning | |
-Wsurrogate | /Wsurrogate |
warn on surrogate codes used in escape sequences in source code | |
-wsurrogate | /wsurrogate |
disable this warning |