summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2017-05-25 20:05:05 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2017-05-26 16:50:57 +0200
commit22145e286ce62305b405f4ddaef4196912c088be (patch)
treea6f584506c21e76fe7f896b37cfdf4d197a95390
parentb41ddd960ae7301815174b1a0193a9f6465bf787 (diff)
downloadelixir-22145e286ce62305b405f4ddaef4196912c088be.tar.gz
Update syntax reference
-rw-r--r--lib/elixir/pages/Syntax Reference.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/elixir/pages/Syntax Reference.md b/lib/elixir/pages/Syntax Reference.md
index fc56c77a7..3f2cd271f 100644
--- a/lib/elixir/pages/Syntax Reference.md
+++ b/lib/elixir/pages/Syntax Reference.md
@@ -65,7 +65,9 @@ end
### Atoms
-Atoms in Elixir start with a colon (`:`) which must be followed by any ASCII letter and an optional sequence of ASCII letters, numbers or underscores. Valid examples are `:foo`, `:FOO` and `:foo_42`. Atoms may also have a single `@` on them, such as: `:foo@bar42`.
+Atoms in Elixir start with a colon (`:`) which must be followed by non-combining Unicode characters and underscore. The atom may continue using a sequence of Unicode characters, including numbers, underscore and `@`. Atoms may end in `!` or `?`. See [Unicode Syntax](unicode-syntax.html) for a formal specification.
+
+All operators in Elixir are also valid atoms. Valid examples are `:foo`, `:FOO`, `:foo_42`, `:foo@bar` and `:++`. Invalid examples are `:@foo` (`@` is not allowed at start), `:123` (numbers are not allowed at start) and `:(*)` (not a valid operator).
If the colon is followed by a double- or single-quote, the atom can be made of any latin character up to OTP 19 or of any unicode character from OTP 20 onwards, such as `:"++olá++"`.
@@ -92,7 +94,9 @@ Charlists are always represented as themselves in the AST.
### Variables
-Variables must start with lowercase ASCII character which may be followed by any ASCII letter, number or underscore. Variables may end in `?` or `!`. [Elixir's naming conventions](naming-conventions.html) proposes variables to be in `snake_case` format.
+Variables in Elixir must start with underscore or a non-combining Unicode character that is not in uppercase or titlecase. The variable may continue using a sequence of Unicode characters, including numbers and underscore. Variables may end in `?` or `!`. See [Unicode Syntax](unicode-syntax.html) for a formal specification.
+
+[Elixir's naming conventions](naming-conventions.html) proposes variables to be in `snake_case` format.
Variables are represented by three-element tuples: