Closed egorsmkv closed 9 years ago
Hmm. I'll have to figure out a good way to handle that. After the regex line-end symbol '$', bish expects there to be a variable name. That's because interpolations in strings are currently handled by prefixing '$' as well. I will need to think on this one a bit.
Yes, I also realized that there must be a variable.
Ok, I'll wait.
@tdenniston Why not use these quotes `?
@eg0r This should work now, for example:
text = "335";
@([[ $text =~ ^[0-9]+\$ ]]);
assert(success());
Seems to work as expected.
Wonderful commit. Now you can make functions for type checking:
def is_integer(v) {
@([[ $v =~ ^[0-9]+\$ ]]);
return success();
}
if (is_integer("100")) {
println("Yes!");
} else {
println("No!");
}
# => "Yes!"
For example, the following code will not be translated:
Will be displayed parse error:
Parsing error: Expected variable to be a symbol near character ')', line 5
How best to do these teams? Maybe they wrap in quotes `?