Soilihi BEN SOILIHI BOINA pushed to branch add-proj at Stefan / Typer
Commits: cb44bcd4 by Soilih BEN SOILIH at 2021-03-10T18:43:05-07:00 connexion du serveur lsp et typer
- - - - - 62dad551 by Soilih BEN SOILIH at 2021-03-11T18:50:46-07:00 Licence specifications
- - - - - 91c0bb50 by Soilih BEN SOILIH at 2021-03-13T22:36:05-07:00 commit
- - - - - 74b6b623 by Soilih BEN SOILIH at 2021-03-22T09:15:37-06:00 first commit
- - - - - a4a9cf9e by Soilih BEN SOILIH at 2021-03-26T21:48:38-06:00 fonction readstring
- - - - - cc0bd4d8 by Soilih BEN SOILIH at 2021-03-30T20:58:46-06:00 diagnostics
- - - - - bde2d9b9 by Soilih BEN SOILIH at 2021-03-30T21:05:26-06:00 Merge branch 'master' of https://gitlab.com/monnier/typer
- - - - - 1b7204e3 by Soilih BEN SOILIH at 2021-03-31T10:23:12-06:00 Errors handling
- - - - - 7abb48c5 by Soilih BEN SOILIH at 2021-04-03T08:12:45-06:00 little bug resolution
- - - - - be768c34 by Soilih BEN SOILIH at 2021-04-08T16:52:39-06:00 h
- - - - - c0f859bc by Soilih BEN SOILIH at 2021-04-08T17:03:41-06:00 update
- - - - - 94ab822b by Soilih BEN SOILIH at 2021-04-08T17:14:00-06:00 Merge branch 'extract-args-from-repl' of https://gitlab.com/monnier/typer into extract
- - - - - f847a4c1 by Soilih BEN SOILIH at 2021-04-08T17:17:15-06:00 extract
- - - - - f9f40536 by Soilih BEN SOILIH at 2021-04-08T18:18:36-06:00 commit
- - - - - e58ae4ad by Soilih BEN SOILIH at 2021-04-08T18:28:48-06:00 bugs
- - - - - 2941d939 by Soilih BEN SOILIH at 2021-04-09T13:38:10-06:00 fix merge conflict
- - - - - 9836b205 by Soilih BEN SOILIH at 2021-04-09T13:40:42-06:00 merge conflict
- - - - - 7ad32eb9 by Soilih BEN SOILIH at 2021-04-09T13:44:17-06:00 lsp args
- - - - - 6add7c68 by Soilih BEN SOILIH at 2021-04-09T13:48:40-06:00 lsp
- - - - - b2fe2a90 by Soilih BEN SOILIH at 2021-04-09T13:50:10-06:00 readstring
- - - - - 64522966 by Soilih BEN SOILIH at 2021-04-09T14:17:59-06:00 emacs file
- - - - - a1b864fd by Soilih BEN SOILIH at 2021-04-09T19:45:28-06:00 fix declaration order
- - - - - fad7704f by Soilih BEN SOILIH at 2021-04-11T21:01:01-06:00 linol update
- - - - - 4bd05656 by Soilih BEN SOILIH at 2021-04-14T21:19:06-06:00 return the AST with the logs
- - - - - 620fabd9 by Soilih BEN SOILIH at 2021-04-15T14:09:36-06:00 resolving the exception
- - - - - d076d86b by Soilih BEN SOILIH at 2021-04-17T09:09:25-06:00 empty
- - - - - 98f2b0c6 by Soilih BEN SOILIH at 2021-04-20T14:16:53-06:00 hover and definition
- - - - - 5ee099ae by Soilih BEN SOILIH at 2021-04-21T09:39:33-06:00 m
- - - - - 79fc9315 by Soilih BEN SOILIH at 2021-04-21T09:50:16-06:00 -*
- - - - - 8ad9bedf by Soilih BEN SOILIH at 2021-04-23T03:21:14-06:00 -
- - - - - 3eb5e83e by Soilih BEN SOILIH at 2021-04-23T04:07:32-06:00 hover and definition update
- - - - - 7783aed8 by Soilih BEN SOILIH at 2021-04-26T14:08:17-06:00 kind of completion and command(still to fix)
- - - - - 69a3e9ff by Simon Génier at 2021-04-26T16:46:56-04:00 Add tests for the lexer.
In addition to the tests themselves, added a few functions that were necessary. In particular there is now Pretoken.equal in Prelexer and Location.equal in Source that are equality predicates on pretokens and locations.
I also added in Sexp.sexp_string support for printing the location along with its associated sexp. This is useful in tests, when we check that the locations are correct, otherwise we would print two identical sexps!
- - - - - edbb3f90 by Simon Génier at 2021-04-26T16:47:10-04:00 Introduce swappable backends for Typer.
The backends themselves are objects which must implement the new backend abstract class. I also shuffled some code, mostly in the module REPL, so that is it more focused on evaluating interactive code. Finally, I moved code that was more concerned with loading regular Typer code in typer.ml and elab.ml.
- - - - - f578df6d by Simon Génier at 2021-04-26T20:46:21-04:00 Consolidate location related code in Source.
The purpose of this changeset is to take all the Location related code and to move it into the Source module. There are many changed lines, but most of them are simple renaming. I rewrote a few places to use printf instead of a series of prints, which I think are clearer. The only externally visible change is that I merged two functions that printed location in a different way. Some debug code used to print something like "Ln 32, cl 1", but now prints "foo.typer:32:1" like everywhere else.
- - - - - 0e18db2e by Simon Génier at 2021-04-26T21:33:57-04:00 Have the source tell its own location.
Move the code that keeps track of the current line and column inside of the source object. Not only does this make sense conceptually since the source is a kind of cursor, but it will allow us to simplify the lexer code.
- - - - - 396bafa3 by Simon Génier at 2021-04-26T21:39:40-04:00 Rename Pretoken -> Presymbol.
- - - - - bdfe5646 by Simon Génier at 2021-04-27T13:09:13-04:00 Rewrite the Lexer module in terms of source objects.
This might not look useful, but it will simplify a great deal our next change of add and end point to location records since all the location related code will be in there source objects.
I ended up rewriting most of the Lexer. I tried to avoid doing that, but the offset handling code was so mixed up with the rest than that turned out to give worse code and a diff as unreadable. I'm pretty confident that that the changes are OK since we are still able to load pervasives.typer and I wrote a few tests for the trickier inner operators.
- - - - - eab63fcc by Simon Génier at 2021-04-27T13:19:17-04:00 Shorten the names of a few methods on Source.t.
- - - - - ee0b598c by Simon Génier at 2021-04-27T13:29:38-04:00 Replace raw offsets with points which also track line and column.
- - - - - 46e3a82a by Simon Génier at 2021-04-27T13:48:29-04:00 Compute location inside the source from the given point.
- - - - - 1ed0a82a by Simon Génier at 2021-04-27T14:00:42-04:00 Documentation comments are now an optional.
- - - - - 3818bc2a by Simon Génier at 2021-04-27T15:25:04-04:00 Locations track their end point.
- - - - - d15507ff by Soilih BEN SOILIH at 2021-04-27T21:17:21-06:00 -
- - - - - 63f44e8e by Soilih BEN SOILIH at 2021-04-27T21:23:44-06:00 -
- - - - - 84e4416b by Soilih BEN SOILIH at 2021-04-27T22:58:33-06:00 +
- - - - - b22e1c28 by Soilih BEN SOILIH at 2021-04-28T08:48:54-06:00 -
- - - - - 1e9c5748 by Soilih BEN SOILIH at 2021-04-28T09:16:21-06:00 -
- - - - - cdfecb61 by Soilih BEN SOILIH at 2021-04-30T18:56:48-06:00 -
- - - - - 502b6879 by Soilih BEN SOILIH at 2021-05-01T12:59:04-06:00 -
- - - - - b613f361 by Soilih BEN SOILIH at 2021-05-01T13:49:37-06:00 -
- - - - - 981d60fe by Soilih BEN SOILIH at 2021-05-07T04:45:37-06:00 update location and hover
- - - - - bad1664f by Soilih BEN SOILIH at 2021-05-07T04:50:32-06:00 resolve merge conflict
- - - - - cfc76735 by Soilih BEN SOILIH at 2021-05-08T16:55:49-06:00 update the hover
- - - - - ee628865 by Soilih BEN SOILIH at 2021-05-08T16:56:09-06:00 Merge branch 'soilih-alpha' into soilih
- - - - - 16b2a6b5 by Soilih BEN SOILIH at 2021-05-08T17:50:59-06:00 -
- - - - - 9d8bd5d9 by Soilih BEN SOILIH at 2021-05-10T10:31:41-06:00 update the function browse_lexp
- - - - - 395d075f by Soilih BEN SOILIH at 2021-05-12T10:24:19-06:00 update hover
- - - - - 85a05e35 by Soilih BEN SOILIH at 2021-05-12T10:27:02-06:00 -
- - - - - 10ccddf1 by Soilih BEN SOILIH at 2021-05-14T09:33:40-06:00 -
- - - - - c3aa818e by Soilih BEN SOILIH at 2021-05-15T18:49:23-06:00 browse_lexp update
- - - - - fde849c9 by Soilih BEN SOILIH at 2021-05-17T14:24:34-06:00 update completion, diagnostics
- - - - - a3ccd6b2 by Soilih BEN SOILIH at 2021-05-20T19:39:18-06:00 resolve completion, diagnostics problems...case still not working*
- - - - - a1a11af5 by Soilih BEN SOILIH at 2021-05-26T02:37:49-06:00 browse lexp update
- - - - - 8cc99a68 by Soilih BEN SOILIH at 2021-05-31T23:30:38-06:00 improve print and log error
- - - - - 9abad61f by Soilih BEN SOILIH at 2021-06-12T13:16:16-06:00 completion, readstring, check, log
- - - - - 8e4c5775 by Soilih BEN SOILIH at 2021-06-15T07:07:01-06:00 a better way to complete
- - - - - 0a79b565 by Soilih BEN SOILIH at 2021-06-16T20:53:17-06:00 elab_check
- - - - - 170bef61 by Soilih BEN SOILIH at 2021-06-17T09:50:42-06:00 -
- - - - - 859393dd by Soilih BEN SOILIH at 2021-06-21T23:54:06-06:00 -
- - - - - 79ab4063 by Soilih BEN SOILIH at 2021-06-22T20:09:28-06:00 -
- - - - - bb0904ae by Soilih BEN SOILIH at 2021-06-29T15:58:45-06:00 fixing context
- - - - - d83e49da by Soilih BEN SOILIH at 2021-07-02T23:07:13-06:00 fixing let, adding got to definition
- - - - - 8e377da2 by Soilih BEN SOILIH at 2021-07-02T23:22:44-06:00 remove unecessary try with
- - - - - ba970f5c by Soilih BEN SOILIH at 2021-07-03T00:29:12-06:00 fixing the case Case
- - - - - 5025a06d by Soilih BEN SOILIH at 2021-07-13T10:53:05-06:00 test hover
- - - - - 29b5783a by Soilih BEN SOILIH at 2021-07-13T10:55:44-06:00 test hover.
- - - - - 06a6ffa3 by Soilih BEN SOILIH at 2021-07-16T21:57:52-06:00 -
- - - - - 3ed77305 by Soilih BEN SOILIH at 2021-07-21T00:49:17-06:00 definition with the identification and update the Inductive
- - - - - 1d141dbd by Soilih BEN SOILIH at 2021-08-13T10:57:54-06:00 fixing context
- - - - - 31c030ee by Soilih BEN SOILIH at 2021-08-15T23:03:03-06:00 fixing context errors
- - - - - 98548aee by Soilih BEN SOILIH at 2021-08-17T23:00:07-06:00 completion from buffer
- - - - - 8190e3c3 by Soilih BEN SOILIH at 2021-08-28T23:44:36-06:00 complete_oth
- - - - - 6a99c654 by Soilih BEN SOILIH at 2021-09-02T09:32:47-06:00 list myers and completions
- - - - - d0cf7df3 by Soilih BEN SOILIH at 2021-09-02T11:13:18-06:00 fix completion
- - - - - da59e1c2 by Soilih BEN SOILIH at 2021-09-03T11:16:21-06:00 -
- - - - - 1339b2e0 by Soilih BEN SOILIH at 2021-09-03T12:55:17-06:00 fixing completion
- - - - - b178ecb3 by Soilih BEN SOILIH at 2021-09-03T12:56:45-06:00 fixing Myers.list
- - - - - 6c5dfc8b by Soilih BEN SOILIH at 2021-09-03T15:25:55-06:00 considering the order in the completion suggestions
- - - - - 7e546235 by Soilih BEN SOILIH at 2021-09-12T23:52:44-06:00 fixing some order issues in completions
- - - - - 9d9ea020 by Soilih BEN SOILIH at 2021-09-27T15:05:21-06:00 considerate vname loc and ltype
- - - - - 83744967 by Soilih BEN SOILIH at 2021-10-04T14:47:34-06:00 fix the case Case
- - - - - 1403fe8b by Soilih BEN SOILIH at 2021-10-13T17:33:39-06:00 fix warnings
- - - - - 645d3261 by Soilih BEN SOILIH at 2021-10-14T00:39:33-06:00 -
- - - - - 09aacbad by Soilih BEN SOILIH at 2021-10-14T22:37:00-06:00 fix the completion problem at the end of the file
- - - - - 53c2f370 by Soilih BEN SOILIH at 2021-10-16T20:13:25-04:00 -
- - - - - acf01ebf by Soilih BEN SOILIH at 2021-10-17T03:06:02-04:00 adding symbols
- - - - - 2910ba93 by Soilih BEN SOILIH at 2021-10-18T21:54:10-04:00 my symbol
- - - - - 00d0160e by Soilih BEN SOILIH at 2021-10-18T23:57:07-04:00 fixing on_req_symbol method
- - - - - 4e3f9651 by Soilih BEN SOILIH at 2021-10-19T00:02:06-04:00 -
- - - - - 9a56ef06 by Soilih BEN SOILIH at 2021-11-04T09:51:17-04:00 -
- - - - - c136a43a by Soilih BEN SOILIH at 2021-11-05T17:13:24-04:00 -
- - - - - 16eab611 by Soilih BEN SOILIH at 2021-11-05T19:17:24-04:00 merge
- - - - -
2 changed files:
- + .vscode/launch.json - src/lexp.ml
Changes:
===================================== .vscode/launch.json ===================================== @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file
===================================== src/lexp.ml ===================================== @@ -66,6 +66,7 @@ type ltype = lexp | Sort of U.location * sort | Builtin of symbol * ltype | Var of vref + | Proj of U.location * string * lexp | Susp of lexp * subst (* Lazy explicit substitution: e[σ]. *) (* This "Let" allows recursion. *) | Let of U.location * (vname * lexp * ltype) list * lexp @@ -524,6 +525,7 @@ let rec lexp_location e = | Susp (e, _) -> lexp_location e (* | Susp (_, e) -> lexp_location e *) | Metavar (_,_,(l,_)) -> l + | Proj (l,_,_) -> l
(********* Normalizing a term *********)
View it on GitLab: https://gitlab.com/monnier/typer/-/compare/edf888bcde814fd010f53b4cf94501c01...