Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit a8a36ad

Browse files
committed
Merge remote-tracking branch 'origin/master' into typescript-mapped-types
2 parents 33e2671 + e9e9c0e commit a8a36ad

29 files changed

+176
-503
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

.gitmodules

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
[submodule "vendor/hspec-expectations-pretty-diff"]
2-
path = vendor/hspec-expectations-pretty-diff
3-
url = https://github.com/rewinfrey/hspec-expectations-pretty-diff
41
[submodule "vendor/haskell-tree-sitter"]
52
path = vendor/haskell-tree-sitter
63
url = https://github.com/tree-sitter/haskell-tree-sitter.git
7-
[submodule "vendor/proto3-suite"]
8-
path = vendor/proto3-suite
9-
url = https://github.com/joshvera/proto3-suite.git
10-
[submodule "vendor/proto3-wire"]
11-
path = vendor/proto3-wire
12-
url = https://github.com/joshvera/proto3-wire.git

.hlint.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
name: Eta reduce
4040
within:
4141
- Language.Go.Assignment
42-
- Language.MiniPython.Assignment
43-
- Language.MiniRuby.Assignment
4442
- Language.PHP.Assignment
4543
- Language.Python.Assignment
4644
- Language.Ruby.Assignment

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ install:
3535
script:
3636
- cabal new-build -j semantic-core semantic:exe:semantic
3737
- cabal new-test semantic:test semantic-core:spec
38+
- cabal new-run semantic:parse-examples
39+
40+
# Any branch linked with a pull request will be built, as well as the non-PR
41+
# branches listed below:
42+
branches:
43+
only:
44+
- master

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM haskell:8.6 as build
2+
WORKDIR /build
3+
RUN cabal new-update
4+
5+
# Build our upstream dependencies after copying in only enough to tell cabal
6+
# what they are. This will make these layers cache better even as we change the
7+
# code of semantic itself.
8+
COPY semantic.cabal .
9+
COPY cabal.project .
10+
COPY semantic-core/semantic-core.cabal ./semantic-core/
11+
COPY vendor ./vendor
12+
RUN cabal new-build --only-dependencies
13+
14+
# Once the dependencies are built, copy in the rest of the code and compile
15+
# semantic itself.
16+
COPY . /build
17+
RUN cabal new-build semantic:exe:semantic
18+
19+
# A fake `install` target until we can get `cabal new-install` to work
20+
RUN cp $(find dist-newstyle -name semantic -type f -perm -u=x) /usr/local/bin/semantic
21+
22+
# Create a fresh image containing only the compiled CLI program, so that the
23+
# image isn't bulked up by all of the extra build state.
24+
FROM debian:stretch-slim
25+
26+
RUN apt-get update && \
27+
apt-get install -y \
28+
libgmp10 \
29+
&& \
30+
apt-get autoremove -y && \
31+
apt-get clean -y && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
COPY --from=build /usr/local/bin/semantic /usr/local/bin/semantic
35+
36+
ENTRYPOINT ["/usr/local/bin/semantic"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cabal new-run semantic -- --help
118118

119119
Architecturally, `semantic`:
120120
1. Reads blobs.
121-
2. Generates parse trees for those blobs with [tree-sitter][tree-sitter] (an incremental parsing system for programmings tools).
121+
2. Generates parse trees for those blobs with [tree-sitter][tree-sitter] (an incremental parsing system for programming tools).
122122
3. Assigns those trees into a generalized representation of syntax.
123123
4. Performs analysis, computes diffs, or just returns parse trees.
124124
5. Renders output in one of many supported formats.

cabal.project

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
packages: vendor/* vendor/proto3-suite vendor/haskell-tree-sitter/languages/* semantic.cabal semantic-core/semantic-core.cabal
1+
packages: vendor/* vendor/haskell-tree-sitter/languages/* . semantic-core
22

3-
package proto3-suite
3+
source-repository-package
4+
type: git
5+
location: https://github.com/joshvera/proto3-suite.git
6+
tag: 83f3352f0c7c94ea091e6087f60692eda9991fae
7+
8+
source-repository-package
9+
type: git
10+
location: https://github.com/joshvera/proto3-wire.git
11+
tag: 84664e22f01beb67870368f1f88ada5d0ad01f56
12+
13+
source-repository-package
14+
type: git
15+
location: https://github.com/rewinfrey/hspec-expectations-pretty-diff
16+
tag: 94af5871c24ba319f7f72fefa53c1a4d074c9a29

script/clone-example-repos

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ clone_repo "$python_examples/certbot" certbot/certbot bb8222200a8cbd39a3ce9584ce
4848
ts_examples="$dir/typescript/vendor/tree-sitter-typescript/examples"
4949
clone_repo "$ts_examples/desktop" desktop/desktop d1324f56d02dd9afca5d2e9da545905a7d41d671
5050

51+
# Java examples are disabled because the assignment code is not yet
52+
# robust and for reasons of CI celerity.
53+
5154
java_examples="$dir/java/vendor/tree-sitter-java/examples"
52-
clone_repo "$java_examples/elasticsearch" elastic/elasticsearch 4d62640bf116af7e825d89c7319a39c3f2f325b4
53-
clone_repo "$java_examples/guava" google/guava e24fddc5fff7fd36d33ea38737b6606a7e476845
54-
clone_repo "$java_examples/RxJava" ReactiveX/RxJava 8a6bf14fc9a61f7c1c0016ca217be02ca86211d2
55+
# clone_repo "$java_examples/elasticsearch" elastic/elasticsearch 4d62640bf116af7e825d89c7319a39c3f2f325b4
56+
# clone_repo "$java_examples/guava" google/guava e24fddc5fff7fd36d33ea38737b6606a7e476845
57+
# clone_repo "$java_examples/RxJava" ReactiveX/RxJava 8a6bf14fc9a61f7c1c0016ca217be02ca86211d2
5558

5659
clone_repo "$ts_examples/npm" npm/npm ee147fbbca6f2707d3b16f4fa78f4c4606b2d9b1
5760

semantic-core/semantic-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ library
3535
-- other-modules:
3636
-- other-extensions:
3737
build-depends: algebraic-graphs ^>= 0.3
38-
, base >= 4.11 && < 5
38+
, base >= 4.12 && < 5
3939
, containers ^>= 0.6
4040
, directory ^>= 1.3
4141
, filepath ^>= 1.4

semantic.cabal

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ common haskell
4141
-- as caret-operator bounds relative to a version in Stackage.
4242
-- These are currently pinned to lts-13.13.
4343
common dependencies
44-
build-depends: base >= 4.8 && < 5
44+
build-depends: base >= 4.12 && < 5
4545
, aeson ^>= 1.4.2.0
4646
, algebraic-graphs ^>= 0.3
4747
, async ^>= 2.2.1
@@ -199,8 +199,6 @@ library
199199
, Language.Haskell.Syntax.Type
200200
, Language.JSON.Assignment
201201
, Language.JSON.PrettyPrint
202-
, Language.MiniRuby.Assignment
203-
, Language.MiniPython.Assignment
204202
, Language.Ruby.Assignment
205203
, Language.Ruby.PrettyPrint
206204
, Language.Ruby.Syntax
@@ -273,7 +271,7 @@ library
273271
-- Custom Prelude
274272
, Prologue
275273

276-
build-depends: base >= 4.8 && < 5
274+
build-depends: base >= 4.12 && < 5
277275
, ansi-terminal ^>= 0.8.2
278276
, array ^>= 0.5.3.0
279277
, attoparsec ^>= 0.13.2.2

0 commit comments

Comments
 (0)