feat: enable custom bitwise operators | and & in wren compiler and add test

Add INFIX_OPERATOR entries for TOKEN_PIPE and TOKEN_AMP with PREC_BITWISE precedence in the compiler's grammar rules, replacing the previous UNUSED entries. This allows user-defined classes to implement custom `|` and `&` operator methods.

Include a new test file `test/custom_operators/bitwise.wren` that defines Amp and Pipe classes with their respective operator methods to validate the feature works correctly.
This commit is contained in:
Kyle Marek-Spartz
2014-02-16 18:01:40 +00:00
parent d2a5f3c79e
commit 4f4251882d
2 changed files with 13 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
class Amp {
& that {
return
}
}
class Pipe {
| that {
return
}
}