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

fix: init.f90 file generates ast and asr with cc flag #5783

Merged
merged 3 commits into from
Dec 22, 2024

Conversation

parth121101
Copy link
Contributor

@parth121101 parth121101 commented Dec 21, 2024

Towards: #5463 , #5781

@parth121101 parth121101 added the error resiliency Issues or PR towards creating error resilient frontend label Dec 21, 2024
@parth121101
Copy link
Contributor Author

Following is init.f90 fortran file

cat tests/errors/init1.f90
program init1
integer x = 1
end

Current main branch is unable to generate ast and asr with cc flag

lfortran tests/errors/init1.f90 --continue-compilation --show-asr
syntax error: Invalid syntax for variable initialization (try inserting '::' after the type)
 --> tests/errors/init1.f90:2:1
  |
2 | integer x = 1
  | ^^^^^^^^^^^^^ 


Note: Please report unclear, confusing or incorrect messages as bugs at
https://github.com/lfortran/lfortran/issues.

While with this PR we are able to generate ast as well as ast.

lfortran tests/errors/init1.f90 --continue-compilation --show-asr
syntax error: Invalid syntax for variable initialization (try inserting '::' after the type)
 --> tests/errors/init1.f90:2:1
  |
2 | integer x = 1
  | ^^^^^^^^^^^^^ 


Note: Please report unclear, confusing or incorrect messages as bugs at
https://github.com/lfortran/lfortran/issues.
(TranslationUnit
    (SymbolTable
        1
        {
            init1:
                (Program
                    (SymbolTable
                        2
                        {
                            x:
                                (Variable
                                    2
                                    x
                                    []
                                    Local
                                    (IntegerConstant 1 (Integer 4) Decimal)
                                    (IntegerConstant 1 (Integer 4) Decimal)
                                    Save
                                    (Integer 4)
                                    ()
                                    Source
                                    Public
                                    Required
                                    .false.
                                    .false.
                                )
                        })
                    init1
                    []
                    []
                )
        })
    []
)

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

Otherwise I think this looks good!

tests/errors/continue_compilation_2.f90 Outdated Show resolved Hide resolved
Copy link
Contributor

@certik certik 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!

@certik certik merged commit a65da3c into lfortran:main Dec 22, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error resiliency Issues or PR towards creating error resilient frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants