bash-language-server
bash-language-server copied to clipboard
Failed to parse expression: "$((16#ffff))" decimal conversion
#!/usr/bin/env bash
function to_decimal () {
echo "$(("$1"#"$2"))"
}
to_decimal 16 ff
The function to_decimal converts the number "$2" in base "$1" to decimal. The parser fails to recognize this instruction.
Thanks for reporting this issue. It seems to be a grammar issue.
I create an issue: tree-sitter/tree-sitter-bash#62
In my version of bash I actually get an error here:
"line 3: "16"#"ff": syntax error: operand expected (error token is ""16"#"ff"")"
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
This seems to have been fixed in the newer version of the grammar