Support for regex and `=~` operator
未关闭
compiler
- 主要语言
- Rust
- 星标
- 5.2k
- 派生
- 145
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 7
描述
Bash example:
```bash
line=" aaaaaab"
pattern="[[:space:]]*(a)?b"
if [[ $line =~ $pattern ]]; then
echo "Matches"
fi
```
Source: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Conditional-Constructs
Is there a way or plan to implement this with Amber?
The following code:
```amber
main (args) {
let line = " aaaaaab"
let pattern = "[[:space:]]*(a)?b"
if line =~ pattern {
echo "Matches"
}
}
```
Does not compile:
```stdout
ERROR
Identifier 'if' is a reserved keyword
at example.ab:6:3
5|
6| if text =~ pattern {
7| echo "Matches"
```
Using Amber 0.3.3-alpha
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。