aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/odin/parser/parser.odin3
-rw-r--r--core/odin/tokenizer/token.odin10
-rw-r--r--core/odin/tokenizer/tokenizer.odin10
3 files changed, 21 insertions, 2 deletions
diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin
index 63c7e388f..a2472ea2d 100644
--- a/core/odin/parser/parser.odin
+++ b/core/odin/parser/parser.odin
@@ -1627,7 +1627,8 @@ token_precedence :: proc(p: ^Parser, kind: tokenizer.Token_Kind) -> int {
case .Mul, .Quo,
.Mod, .Mod_Mod,
.And, .And_Not,
- .Shl, .Shr:
+ .Shl, .Shr,
+ .Concat:
return 7
}
return 0
diff --git a/core/odin/tokenizer/token.odin b/core/odin/tokenizer/token.odin
index 48d08f127..74e60f2b8 100644
--- a/core/odin/tokenizer/token.odin
+++ b/core/odin/tokenizer/token.odin
@@ -64,6 +64,8 @@ Token_Kind :: enum u32 {
Shl, // <<
Shr, // >>
+ Concat, // ##
+
Cmp_And, // &&
Cmp_Or, // ||
@@ -80,6 +82,9 @@ Token_Kind :: enum u32 {
And_Not_Eq, // &~=
Shl_Eq, // <<=
Shr_Eq, // >>=
+
+ Concat_Eq, // ##=
+
Cmp_And_Eq, // &&=
Cmp_Or_Eq, // ||=
B_Assign_Op_End,
@@ -199,6 +204,8 @@ tokens := [Token_Kind.COUNT]string {
"<<",
">>",
+ "##",
+
"&&",
"||",
@@ -215,6 +222,9 @@ tokens := [Token_Kind.COUNT]string {
"&~=",
"<<=",
">>=",
+
+ "##=",
+
"&&=",
"||=",
"",
diff --git a/core/odin/tokenizer/tokenizer.odin b/core/odin/tokenizer/tokenizer.odin
index d4da82c56..6fa16fece 100644
--- a/core/odin/tokenizer/tokenizer.odin
+++ b/core/odin/tokenizer/tokenizer.odin
@@ -650,7 +650,15 @@ scan :: proc(t: ^Tokenizer) -> Token {
}
case '#':
kind = .Hash
- if t.ch == '!' {
+
+ if t.ch == '#' {
+ advance_rune(t)
+ kind = .Concat
+ if t.ch == '=' {
+ advance_rune(t)
+ kind = .Concat_Eq
+ }
+ } else if t.ch == '!' {
kind = .Comment
lit = scan_comment(t)
} else if t.ch == '+' {