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

Semantic rust #551

Merged
merged 6 commits into from May 19, 2020
Merged

Semantic rust #551

merged 6 commits into from May 19, 2020

Conversation

p-alik
Copy link
Contributor

@p-alik p-alik commented May 14, 2020

This PR aims to solve #130

Temporary Installation Step

semantic-rust depends on package tree-sitter-rust, which isn't available at https://hackage.haskell.org/ yet.

To build the content of this PR you've to execute following steps, because source-repository-package entry for haskell-tree-sitter (see a4410b6) doesn't solve .gitsubmodules dependency.

  • cabal v2-update (or ./script/bootstrap)
  • cd /tmp
  • git clone --recurse-submodules git@github.com:tree-sitter/haskell-tree-sitter.git
  • cd semantic
  • find dist-newstyle/ -maxdepth 3 -type d -name "tree-sitter-rust" -exec cp -a ../haskell-tree-sitter/tree-sitter-rust/vendor {} \;
  • cabal v2-buiild
  • cd semantic-rust
  • cabal v2-test (to get testing passed two corpus files were excluded e899938)

@jtl385

This comment has been minimized.

4 similar comments
@jtl385

This comment has been minimized.

@jtl385

This comment has been minimized.

@jtl385

This comment has been minimized.

@jtl385

This comment has been minimized.

Copy link
Contributor

@joshvera joshvera left a comment

Choose a reason for hiding this comment

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

Thanks @p-alik! I've uploaded tree-sitter-rust-0.1.0.0 to hackage so I think we can remove the source-repository-package entry.

Mind cherry-picking or doing something similar to this commit e18b6c3?

@p-alik
Copy link
Contributor Author

p-alik commented May 19, 2020

Thank you for uploading of tree-sitter-rust-0.1.0.0 to hackage, @joshvera.
e18b6c3 was cherr-picked.
It seems there is no building/testing issue anymore, but since two corpus files are excluded a399bdd there remains some uncertainty because tree-sitter/tree-sitter#619 runs run corpus test properly.

Copy link
Contributor

@joshvera joshvera left a comment

Choose a reason for hiding this comment

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

It seems there is no building/testing issue anymore, but since two corpus files are excluded a399bdd there remains some uncertainty because tree-sitter/tree-sitter#619 runs run corpus test properly.

That's alright we'll investigate later. I took a look briefly and it looks like an error parsing the macros.txt resulting in Error: "endOfInput". Might be an issue with our parsing or the file itself. https://github.com/github/semantic/blob/master/semantic-ast/src/AST/Test.hs#L77

@joshvera joshvera merged commit 25afb3f into github:master May 19, 2020
@p-alik p-alik deleted the semantic-rust branch May 19, 2020 15:40
@p-alik
Copy link
Contributor Author

p-alik commented May 19, 2020

@joshvera, beside macros.txt a399bdd excludes expressions.txt for sake of this example, which fails with

    Match expressions:                                       FAIL
      src/AST/Test.hs:36:
      type 'MatchPattern' expected one or more nodes in field 'extraChildren' but got zero
      ```
      match x {
          1 => { "one" }
          2 => "two",
          -1 => 1,
          -3.14 => 3,

          #[attr1]
          3 => "three",
          macro!(4) => "four",
          _ => "something else",
      }   

      let msg = match x {
          0 | 1 | 10 => "one of zero, one, or ten",
          y if y < 20 => "less than 20, but not zero, one, or ten",
          y if y == 200 =>
            if a {
              "200 (but this is not very stylish)"
            } 
          _ => "something else",
      };  
      ```

@patrickt patrickt mentioned this pull request May 21, 2020
@joshvera
Copy link
Contributor

@p-alik thanks! I'll try to take a look soon.

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.

None yet

3 participants