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

Determine upper or lowercase for SynExpr.DotIndexedGet #802

Merged
merged 2 commits into from
May 3, 2020

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented May 1, 2020

Fixes #798

@nojaf nojaf requested review from jindraivanek and Smaug123 May 1, 2020 14:30
Copy link
Contributor

@Smaug123 Smaug123 left a comment

Choose a reason for hiding this comment

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

It's not clear to me what this pattern is actually matching (due to me not having much experience with Fantomas). Is the point that we were previously unable to tell that the a in a.A.[0] was a lowercase expression?

@nojaf
Copy link
Contributor Author

nojaf commented May 2, 2020

The pattern match tries to determine if the SynExpr is upper- or lowercase.

In this case, the problem was that SynExpr.DotIndexedGet was passed to the function and was not yet supported.
Looking at the structure of the DotIndexedGet, its first value in the tuple is a SynExpr so we can the function recursively in this case.

DotIndexedGet
                       (LongIdent
                          (false,
                           LongIdentWithDots
                             ([a; A],[tmp.fsx (1,16--1,17) IsSynthetic=false]),
                           None,tmp.fsx (1,15--1,18) IsSynthetic=false),
                        [One
                           (Const
                              (Int32 0,tmp.fsx (1,20--1,21) IsSynthetic=false),
                            false,tmp.fsx (1,20--1,21) IsSynthetic=false)],
                        tmp.fsx (1,18--1,19) IsSynthetic=false,
                        tmp.fsx (1,15--1,22) IsSynthetic=false)

=> determine value of DotIndexedGet by checking SynExpr.LongIdent.

@nojaf nojaf merged commit 5da49d5 into fsprojects:master May 3, 2020
@nojaf nojaf deleted the fix-798 branch May 3, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fantomas crash with evaluation of array member
3 participants