Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parsing if statement without else block preceded by a newline #412

Merged
merged 1 commit into from
May 25, 2020

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented May 22, 2020

It changes the following:

  • Fixes parsing error caused by if statement without else block preceded by a newline

This example on master will give a parsing error:

if (x) {} // <--- newline here

It produces this error:

Parsing Error: unexpected token '}' at line 1, col 11

@HalidOdat HalidOdat added bug Something isn't working parser Issues surrounding the parser labels May 22, 2020
@HalidOdat HalidOdat added this to the v0.9.0 milestone May 22, 2020
@github-actions
Copy link

Benchmark for 3c03b12

Click to view benchmark
Test PR Benchmark Master Benchmark %
Create Realm 398.5±28.33µs 391.2±13.09µs 102%
Expression (Lexer) 1951.3±72.97ns 1959.3±51.05ns 100%
Expression (Parser) 5.1±0.17µs 5.1±0.20µs 99%
Fibonacci (Execution) 2.6±0.07ms 2.6±0.10ms 100%
For loop (Execution) 422.7±14.27µs 425.5±13.60µs 99%
For loop (Lexer) 5.3±0.25µs 5.4±0.43µs 99%
For loop (Parser) 14.4±0.87µs 14.5±0.65µs 99%
Hello World (Lexer) 947.9±40.57ns 939.0±39.10ns 101%
Hello World (Parser) 2.4±0.10µs 2.4±0.09µs 100%
Symbols (Execution) 425.7±17.06µs 427.3±11.59µs 100%
undefined undefined 100%

@HalidOdat HalidOdat changed the title Fixed parsing if statement preceded by a newline Fixed parsing if statement without else block preceded by a newline May 25, 2020
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! :) Thanks!

@HalidOdat HalidOdat merged commit e7a9c80 into master May 25, 2020
@HalidOdat HalidOdat deleted the fix/if branch May 25, 2020 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants