diff options
| author | Baitinq <[email protected]> | 2025-07-11 20:03:35 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-07-11 20:03:35 +0200 |
| commit | 9ebcf96cf342b7e432070893f1f0606ab4a72f1c (patch) | |
| tree | 28b29ec86d5eaef69a4e4a67b8587392b1417c7e /src | |
| parent | Bootstrap: Support addition (diff) | |
| download | pry-lang-9ebcf96cf342b7e432070893f1f0606ab4a72f1c.tar.gz pry-lang-9ebcf96cf342b7e432070893f1f0606ab4a72f1c.tar.bz2 pry-lang-9ebcf96cf342b7e432070893f1f0606ab4a72f1c.zip | |
Boostrap: Parse ( expr )
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/parser.pry | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bootstrap/parser.pry b/src/bootstrap/parser.pry index 95e654e..b24ec33 100644 --- a/src/bootstrap/parser.pry +++ b/src/bootstrap/parser.pry @@ -583,6 +583,17 @@ let parser_parse_primary_expression = (p: *parser) => *Node { return stmt; }; + if parser_accept_token(p, TOKEN_LPAREN) != cast(*token, null) { + let expr = parser_parse_expression(p); + if expr == cast(*Node, null) { + return cast(*Node, null); + }; + if parser_accept_token(p, TOKEN_RPAREN) == cast(*token, null) { + return cast(*Node, null); + }; + return expr; + }; + let tok = parser_consume_token(p); if tok == cast(*token, null) { printf("NO TOK\n"); |