Skip to content

Merge syntax repo #5347

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

Closed
wants to merge 321 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
2107584
Implement diffing algorithm for snapshot tests of outcome printer. (#67)
IwanKaramazow Jul 26, 2020
cc7d295
Implemente outcome printing of poly variants (#73)
IwanKaramazow Jul 26, 2020
06a0760
Stylistic tweaks
chenglou Jul 28, 2020
d79ca8d
Stylistic tweaks (#77)
chenglou Jul 28, 2020
559ca8c
Bump lodash from 4.17.15 to 4.17.19 (#63)
dependabot[bot] Jul 28, 2020
afa9388
Update reanalyze to 2.9.0, with support for `exit` as throwing an exc…
cristianoc Jul 28, 2020
c94e169
Upgrade reanalyze; check exit (#80)
chenglou Jul 28, 2020
900e485
Rename napkin_main to napkin_cli
chenglou Jul 29, 2020
658c30c
Default to printing ns (human-readable) (#82)
chenglou Jul 29, 2020
b9508d4
Fix makefile reanalysze dependencies
chenglou Jul 29, 2020
021f7a8
Group all the driver files together
chenglou Jul 29, 2020
821decd
Update package.json and readme (#84)
chenglou Jul 31, 2020
fa55e3b
add a task for vscode
bobzhang Jul 31, 2020
0ec18d1
Merge pull request #85 from BuckleScript/add_tasks_for_vscode
bobzhang Jul 31, 2020
4155d2a
Proper deps for make lib/test.exe (#86)
chenglou Jul 31, 2020
f21c23d
Fix test (#88)
chenglou Jul 31, 2020
02095f0
First pass at using a similar logic & display for terminal error repo…
chenglou Jul 31, 2020
a80e5d5
Try GitHub action CI
chenglou Jul 31, 2020
919d94e
Fix ci.yml ocaml version
chenglou Jul 31, 2020
adc7041
Update ci.yml
chenglou Jul 31, 2020
adf5238
Test CI again
chenglou Jul 31, 2020
0b798c4
Try caching CI (#91)
chenglou Jul 31, 2020
bc95f87
2 newlines at the end of terminal report for now (#93)
chenglou Jul 31, 2020
506003c
Update reanalyze to version 2.10.0.
cristianoc Aug 2, 2020
938123b
Fix Makefile: make benchmark and roundtrip-tests compile/run again
Aug 4, 2020
deda443
Add ci badge next to repo title
Aug 4, 2020
684dcc4
Enable roundtrip-tests on ci (#95)
IwanKaramazow Aug 4, 2020
4d199e7
Refactor parsing of string template literals. (#94)
IwanKaramazow Aug 4, 2020
1eb02c3
Expose interface to get comments out of the parser state.
Aug 6, 2020
3bc0b30
Light weight exotic poly variant syntax (#96)
IwanKaramazow Aug 9, 2020
3b8af06
Rename to Rescript (#98)
IwanKaramazow Aug 10, 2020
c67c672
Remove reference to "new syntax" in readme, this is rescript's syntax
Aug 10, 2020
07b54cc
Update BuckleScript -> ReScript
chenglou Aug 12, 2020
d1647e3
Report when error is missing in comma delimited regions. (#101)
IwanKaramazow Aug 12, 2020
da127e8
Revert "Light weight exotic poly variant syntax (#96)"
Aug 13, 2020
dc701a6
Unexpose Res_diagnostics.toString (#103)
chenglou Aug 13, 2020
6f032b3
Add extra test case for destructive substitution in sub modules
Aug 14, 2020
74754b0
Add support for printing and parsing of structures and signatures in …
Aug 17, 2020
d4d7ba1
Preserve user written leading white space in single line comments (#112)
IwanKaramazow Aug 17, 2020
1a18070
Scan `<=` in jsx mode as Token.LessEqual
Aug 18, 2020
02b4dcb
Cleanup dead code and fix exception reports.
Aug 18, 2020
12b1c2e
Give good error when a type declaration has an inline record type whe…
IwanKaramazow Aug 19, 2020
45d9542
escape LineTerminator in escape sequences template literal characters…
IwanKaramazow Aug 26, 2020
5e063b1
Annotate jsx regions with the correct breadcrumbs.
Aug 27, 2020
ff4f5fd
Update reporting style
chenglou Sep 4, 2020
3f354c8
No `:` when file doesn't have location
chenglou Sep 4, 2020
473d0fc
Update snapshots with new error location format
Sep 4, 2020
2e3db86
Add test case for ppx conversion from reason
Sep 4, 2020
b7c5786
Fix tests broken by ff4f5fd6f64c2cc86f5f9cfebe5acb7d11b32d99 (#131)
chenglou Sep 5, 2020
1a56e6a
Parse <Foo.bar /> elements (#125)
jchavarri Sep 7, 2020
549e90b
Update jsx test snapshots
Sep 7, 2020
0d726ef
Print empty Pmod_structure and Pmty_signature smoother
Sep 17, 2020
60602e2
Remove a trailing space
chenglou Sep 17, 2020
2525992
Update snapshots from last commit
chenglou Sep 17, 2020
11c5157
Update blog post url
chenglou Sep 17, 2020
fc617ba
Clean up end-of-file/printing newline logic (#142)
chenglou Sep 17, 2020
805f322
Fix printing of comments with ghost unit at the end of Pexp_let
Sep 18, 2020
ef0a7fc
update parser + test runner to fail when in non-recover mode (#146)
jchavarri Sep 21, 2020
eca7ef9
Move React ppx from compiler repo, add tests (#124)
jchavarri Sep 26, 2020
87af9ca
Parse error when a non-standalone attribute is used standalone in str…
IwanKaramazow Sep 26, 2020
b0f843f
Add error message when type definition name contains a module access …
IwanKaramazow Sep 26, 2020
5f103cb
Parse correct location on punned props (jsx)
Oct 1, 2020
1dd3fba
Convert nonrec types from Reason as nonrec in ReScript
Oct 1, 2020
73b9eee
Print comments in nested if-then-else expressions.
Oct 6, 2020
7077583
Implement intelligent breaking for chained or-patterns. (#155)
IwanKaramazow Oct 12, 2020
d9de8fc
Fix printing of Ptyp_arrow on type constraint arrow expressions
Oct 15, 2020
d3fad5d
change test.js to test.re in readme (#157)
a-c-sreedhar-reddy Oct 21, 2020
5e4b8de
rename react ppx module to have v3 suffix (#159)
jchavarri Oct 23, 2020
7a71bc7
Syntax error on tuple with one elements.
Nov 4, 2020
92f8d3a
Callback improvements (#167)
IwanKaramazow Nov 8, 2020
c781b0b
Add extra tests for printing and parsing of constrained patterns
Nov 10, 2020
fc264ad
Close breadcrumbs correct in `parseBracketAccess`.
Nov 11, 2020
fcc1ff9
Add Nook Exchange to test suite (#169)
IwanKaramazow Nov 11, 2020
efe64ca
Improve printing of chained pipes.
Nov 18, 2020
8e30b5b
Add https://github.com/ewert-online/warp to roundtrip tests (#176)
IwanKaramazow Nov 18, 2020
2826ce5
Parse unit as functor parameter (generative functors).
Nov 18, 2020
e2ee197
Fix jsx fragment in braced expression not printing as jsx fragment
Nov 18, 2020
855a42c
Fix printing of comments inside pexp_newtype/poly let-binding sugar
Nov 19, 2020
702ebb0
Fix printing of Ptyp_arrow with type alias as only parameter
Nov 24, 2020
d593438
Interpet strings correct in braced and primary expressions
Nov 24, 2020
ecf59fc
Improve printing multiline strings and template literals (#191)
IwanKaramazow Nov 26, 2020
82241f5
Remove personal settings in Makefile
Nov 30, 2020
64603a8
Print parens in Ppat_constraint as part of a record pattern.
Dec 1, 2020
0701285
Fix printing of comments in callbacks.
Dec 2, 2020
84d4ddb
Parse gadts in type extensions correct.
Dec 3, 2020
fb0a437
Add extra tests for printing of exception definitions
Dec 3, 2020
1a55142
Tweak printing of callbacks to break correctly in case of annotated l…
IwanKaramazow Dec 5, 2020
9e6641c
Fix printing of comments on Ptyp_arrow with labels.
Dec 5, 2020
57881f5
Improve formatting of poly variant typexprs with attributes
Dec 17, 2020
5ce820e
Remove support for nativeint (#208)
IwanKaramazow Dec 18, 2020
67e5fb8
Implement pretty outcome printing for uncurried outcometree types (#214)
IwanKaramazow Dec 28, 2020
f20e499
Fix printing of uncurried application with a huggable expression
Dec 29, 2020
127b011
Improve diagnostics for missing tilde in labeled parameters.
Dec 30, 2020
d73a4c3
Improve generated AST in the case of a missing tilde in an arrow expr…
Dec 30, 2020
0efc7f8
Convert Reason fast pipe with uncurried functions in the lhs to ReScr…
IwanKaramazow Dec 31, 2020
be3890f
Light weight exotic poly variant syntax (#228)
IwanKaramazow Jan 12, 2021
0b20304
Cleanup gentype attribute.printing.
Jan 12, 2021
184bf9a
Keep a changelog
Jan 12, 2021
17e532b
Print attributes without the @bs prefix (#230)
IwanKaramazow Jan 14, 2021
4b97d08
Add wilcards-world ui to roundtrip test (#233)
IwanKaramazow Jan 14, 2021
80a5df1
Improve conversion of quoted strings from Reason. (#238)
IwanKaramazow Jan 17, 2021
da3dd0f
Improve printing of jsx children and props with leading line comment …
IwanKaramazow Jan 17, 2021
e3f7ff0
Fix printing of trailing comments under lhs of "pipe" expression. (#239)
IwanKaramazow Jan 19, 2021
002ec09
Fix printing of constrained expr rhs js object. (#240)
IwanKaramazow Jan 19, 2021
5f2c9e0
Improve printing of non-callback arguments in Pexp_apply with callbac…
IwanKaramazow Jan 19, 2021
3ca3df5
improve indentation of fast pipe chain in let binding (#244)
IwanKaramazow Jan 22, 2021
09f9970
Implement intelligent breaking for poly-var type expressions (#246)
IwanKaramazow Jan 22, 2021
d80bf73
Add extra test case for braced jsx conversion from Reason.
Jan 23, 2021
436c728
Move towards "if" keyword for guards on pattern match cases.
Jan 24, 2021
9ffd88c
Add CHANGELOG.md entry
Jan 24, 2021
480fc01
Merge pull request #248 from rescript-lang/case-if
bobzhang Jan 26, 2021
f14f42b
Fix parsing of poly-var typexpr consisting of one tag-spec-first (#254)
IwanKaramazow Feb 2, 2021
d97fb74
update changes to reflect the version cut
bobzhang Feb 4, 2021
fd8b4cd
Merge pull request #255 from rescript-lang/bobzhang-patch-1
bobzhang Feb 4, 2021
91f2758
Fix parsing of first class module exprs as part of binary/ternary exp…
IwanKaramazow Feb 4, 2021
1ed664d
Try pattern matching on character in the scanner instead of using if-…
chenglou Feb 22, 2021
740db9b
Make scanner use char directly instead of converting back and forth b…
chenglou Feb 22, 2021
c5fef71
Hide the hacky eof char implementation
chenglou Feb 22, 2021
9de578c
Remove unsupported line and paragraph separator
chenglou Feb 22, 2021
121564a
Clean up gitignore
chenglou Feb 23, 2021
52ef4c5
Remove some usages of bytes
chenglou Feb 22, 2021
eeb6852
Add multiline exotic identifier test
chenglou Feb 23, 2021
20c2ba0
Small scanner optimization
chenglou Feb 23, 2021
e8a7212
Better error msg for multi-line exotic ident
chenglou Feb 23, 2021
0bbe689
Fix the ^ syntax error message
chenglou Feb 24, 2021
62bcd62
Fix outcome printer for locally abstract types (#267)
amiralies Feb 24, 2021
dd80274
Tweak unknown character message, add test
chenglou Feb 24, 2021
29418f0
CLEAN UP Scanner.scan EVEN MORE
chenglou Feb 24, 2021
e82052e
Remove scanner rdOffset
chenglou Feb 24, 2021
5acbbdc
Convert most scanner logic into pattern matching
chenglou Feb 24, 2021
95fbbef
Remove parser's line seeding api
chenglou Feb 24, 2021
65febb3
Fix atomic expressions parsing (#279)
amiralies Feb 25, 2021
dc44a28
Update parse inline record type name (#280)
chenglou Feb 25, 2021
0eace9c
Scanner: clean up newline logic
chenglou Feb 25, 2021
5d96cf7
Further code cleanup
chenglou Feb 26, 2021
cd1a7c9
No need for res_character_codes anymore
chenglou Feb 26, 2021
e133aa3
Tiny fix to token printing
chenglou Feb 26, 2021
ad4b771
Add back 2 items ignored by 121564a0db80f2d2a6206099cfd2674b2b9a2253
chenglou Feb 26, 2021
8e2c654
Bump reanalyze to version 2.14.0.
cristianoc Feb 26, 2021
2bc05e6
Clean up makefile, gitignore, package.json, etc.
chenglou Feb 26, 2021
0e0080b
Make Printer.classifyIdentContent much more readable
chenglou Feb 26, 2021
68698be
Make CLI flags more rigorous
chenglou Feb 26, 2021
03ff5b2
Clean up Js.t object parsing, printing and converting
chenglou Feb 27, 2021
5fcf4df
Clean up name, Remove another specialized Js.t printer logic
chenglou Feb 27, 2021
fc68029
Add conversion test for Js.t
chenglou Feb 27, 2021
d351f13
Clean up the conversion of @bs.* and %bs.*
chenglou Feb 28, 2021
f83a234
Fix printing of nested Pmty_with module types. (#295)
IwanKaramazow Feb 28, 2021
ee2b27e
Small parser cleanup
chenglou Feb 27, 2021
5da05aa
Update package.json info
chenglou Feb 26, 2021
6fcad29
Fix parsing and printing of externals inside ext/attr payload (#297)
IwanKaramazow Feb 28, 2021
750f319
Remove file accidentally introduced in ee2b27e26067f8888a684c831c8cea…
chenglou Feb 28, 2021
46fbc05
Fix eof unclosed multiline comment location report
chenglou Feb 28, 2021
ede048a
Enable stack trace for binary; remove an `exit 1`
chenglou Mar 3, 2021
af9cc1d
Update reanalyze to version 2.15.0.
cristianoc Mar 4, 2021
a34a147
Printer nits
chenglou Mar 4, 2021
857881a
Update tiny scanner debug util
chenglou Mar 5, 2021
2db1d08
Printer test: optimize concat.
cristianoc Mar 5, 2021
fa3e023
Small comment on the recent optimization
chenglou Mar 5, 2021
6fa25d8
remove readStdin
namenu Mar 6, 2021
b7060e8
fix tests
namenu Mar 6, 2021
3009d8a
Remove all old mentions of napkin
chenglou Mar 6, 2021
2e2c0a0
Printer experiment: version of `fits` that does not allocate.
cristianoc Mar 5, 2021
d8cd101
small cleanup
cristianoc Mar 5, 2021
1568660
Better outcome printer testing error message
chenglou Mar 8, 2021
7617478
Clean up `res_doc.fits`
chenglou Mar 8, 2021
5f36f71
Add outcome printer test for erasure of Js.t
chenglou Mar 8, 2021
9e3594b
Oprint tests: add non-parametrized object type printing
chenglou Mar 8, 2021
adb722a
CLI: we only support parsing one file
chenglou Mar 12, 2021
fb6ba66
Sort tokens alphabetically
chenglou Mar 13, 2021
200261b
Remove "to" and "downto" as keywords. (#327)
IwanKaramazow Mar 15, 2021
7086ed9
Add support for parsing template literals in patterns. (#326)
IwanKaramazow Mar 15, 2021
b75667f
Printer: make propagateForcedBreaks allocation-free (#325)
cristianoc Mar 16, 2021
eed3287
Remove "with" as internal token.
Mar 16, 2021
3d00a9b
Fix & improve string error when quote is followed by eof
chenglou Mar 16, 2021
bf9bf7b
Parse poly variant pattern with one unit arg correct. (#332)
IwanKaramazow Mar 18, 2021
986115c
Remove internal printing experiment.
Mar 19, 2021
984f34e
Sync over error report changes from compiler repo
chenglou Mar 20, 2021
49aca4d
Document error reporting logic
chenglou Mar 20, 2021
4e3db16
Rename all relevant .js/.jsi test files to .res/.resi
chenglou Mar 22, 2021
05720dc
Update snapshots
chenglou Mar 22, 2021
bb855eb
test
chenglou Mar 21, 2021
6aa360f
Add printer tests
chenglou Mar 21, 2021
aa72042
Add forgotten parsing/other tests
chenglou Mar 23, 2021
dc416a1
Add tests/conversion/
chenglou Mar 23, 2021
1ca8972
Ppx test
chenglou Mar 23, 2021
f16ad2a
Refactor test.sh
chenglou Mar 23, 2021
f1f5e6c
Add roundtrip testing
chenglou Mar 24, 2021
e8b715c
Refactor
chenglou Mar 24, 2021
07c8914
Refactor
chenglou Mar 24, 2021
2859ab4
Update makefile
chenglou Mar 25, 2021
e64207c
Make the CLI detect origin from extension
chenglou Mar 25, 2021
24095c2
Add support for object type spreading (#290)
IwanKaramazow Mar 25, 2021
80c10bd
Update for jest snapshots for spread
Mar 25, 2021
42a146d
Update object method parsing and printer for ReScript 9 (#348)
IwanKaramazow Mar 25, 2021
5f93495
Clean up test script a bit more
chenglou Mar 25, 2021
53ae270
Expose Res_outcome_printer.printOutTypeDoc / printOutSigItemDoc (#350)
ryyppy Mar 26, 2021
df46cc4
Fix test shell script
chenglou Mar 26, 2021
6a78893
Chunk up test parallelization
chenglou Mar 26, 2021
a6e733e
Tweak outcome printer for object type. (#355)
IwanKaramazow Mar 28, 2021
a1992db
Fix parsing of arrow expressions in ternaries. (#367)
IwanKaramazow Apr 3, 2021
21fec88
add Rescript syntax highlighting
ShalokShalom Apr 4, 2021
4a45231
add syntax highlighting
ShalokShalom Apr 4, 2021
202663c
Merge pull request #370 from ShalokShalom/patch-1
bobzhang Apr 5, 2021
dd73957
Fix printing of trailing comments on variant constructor without bar.
Apr 5, 2021
3d7b7af
Add back roundtrip tests for tests/printer
chenglou Apr 2, 2021
42cb6b8
Remove random empty file
chenglou Apr 5, 2021
8748fa0
Remove jest
chenglou Apr 5, 2021
df8f3b8
Remove nonexistent phony targets in makefile
chenglou Apr 8, 2021
febfcdc
Implement jsx spread printing (#368)
IwanKaramazow Apr 10, 2021
b9a8e76
Fix printing of JSX in binary expressions. (#377)
IwanKaramazow Apr 10, 2021
e8ba587
Fix printing of trailing comments on constructor part of Ppat_constru…
IwanKaramazow Apr 10, 2021
1b5d46a
Numeric poly variant support (#349)
IwanKaramazow Apr 10, 2021
5e0970f
Update .merlin flags
chenglou Apr 9, 2021
189d512
fix #381
bobzhang Apr 12, 2021
967ad43
Merge pull request #382 from rescript-lang/fix_windows_issue
bobzhang Apr 12, 2021
6f59dba
Upgrade CI deps
chenglou Apr 14, 2021
fab2d7d
not display external garbage
bobzhang Apr 14, 2021
529e206
Merge pull request #387 from rescript-lang/not_display_external_garbage
bobzhang Apr 14, 2021
54eb85f
exception analysis
cristianoc Apr 14, 2021
0e77d77
no loop
cristianoc Apr 14, 2021
f653274
Regenerate package-lock.json
chenglou Apr 17, 2021
2b2dda7
No need to cache npm installs anymore + use npm ci
chenglou Apr 17, 2021
6155500
Explicit type annotation for unit (#389)
a-c-sreedhar-reddy Apr 23, 2021
cbb4df8
Fix regression in template literal string scanning. (#394)
IwanKaramazow Apr 24, 2021
5d09cf6
Clean up outcome printer test infra (#400)
chenglou May 1, 2021
b7e0177
Add extra test case for conversion of bs.send.pipe from Reason (#401)
IwanKaramazow May 1, 2021
1ed8132
Implement printing of `Otyp_module` in outcome printer. (#402)
IwanKaramazow May 1, 2021
fb73597
Fix printing of Osig_module in outcome printer. (#404)
IwanKaramazow May 5, 2021
6e22913
Tiny cleanup
chenglou May 5, 2021
6375a55
Fix parsing of arrow type with objects in constructor declaration arg…
IwanKaramazow May 13, 2021
8001a62
Don't parse Int token with suffices as hash ident for poly variants (…
IwanKaramazow May 13, 2021
09c3c81
Fix printing of underscore Pexp_fun sugar in context of Array.get (#414)
IwanKaramazow May 14, 2021
ef395f6
Remove `{path as p}` record pattern sugar for `{path: p}` (#416)
IwanKaramazow May 15, 2021
4e7d3c7
Tweak grammar of primitive list in externals (#415)
IwanKaramazow May 25, 2021
f6e596d
implement syntax for arity zero vs arity one in uncurried application…
IwanKaramazow May 25, 2021
cb5267c
Handle windows CRLF correct. (#425)
IwanKaramazow May 27, 2021
fb2b7dd
reanalyze 2.17
cristianoc Jun 3, 2021
30a978d
Refactor string escape sequence parsing (#431)
IwanKaramazow Jun 4, 2021
d7211d6
Handle nested unclosed template literal strings
bobzhang Jun 13, 2021
4e269dc
Fix outcome printing for empty objects (#444)
amiralies Jun 27, 2021
9e39774
Fix printing of optional labeled args in outcome arrow types. (#446)
IwanKaramazow Jun 30, 2021
b50be68
Fix "depext unmet availability conditions" GH actions CI (#454)
IwanKaramazow Aug 23, 2021
aefb65b
Fix error reporting when parsing an lident (#448)
amiralies Aug 24, 2021
cfcea33
Unicode support (#433)
IwanKaramazow Aug 24, 2021
3f1a6a9
Fix redundant space in outcome printing of constructors. (#455)
IwanKaramazow Aug 24, 2021
13189d2
Remove references to reasonreact in react ppx diagnostics (#458)
amiralies Aug 30, 2021
181e8f6
Add extra test case for outcome printing of function parameter types …
IwanKaramazow Sep 6, 2021
88e644b
remove syntax submodule
kevinbarabash Dec 24, 2021
317559e
Merge remote-tracking branch 'syntax/master' into merge-syntax-repo
kevinbarabash Dec 24, 2021
1c8c0ff
move github workflow from syntax/.github to .github
kevinbarabash Dec 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test-syntax:
runs-on: macos-latest

steps:
- uses: actions/[email protected]

- name: Cache OCaml's opam
uses: actions/[email protected]
with:
path: ~/.opam
key: macos-latest-ocaml-4.06.1

- name: Use OCaml
uses: ocaml/setup-ocaml@v1
with:
ocaml-version: 4.06.1

- name: Use Node.js
uses: actions/[email protected]
with:
node-version: 14.4.0

- name: Install depedencies
working-directory: ./syntax
run: npm ci

- name: Run tests
working-directory: ./syntax
run: eval $(opam env) && make roundtrip-test
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = ocaml
url = https://github.com/rescript-lang/ocaml
ignore = untracked
[submodule "syntax"]
path = syntax
url = https://github.com/rescript-lang/syntax
branch = master
[submodule "ninja"]
path = ninja
url = https://github.com/rescript-lang/ninja
Expand Down
1 change: 0 additions & 1 deletion syntax
Submodule syntax deleted from d9c44b
79 changes: 79 additions & 0 deletions syntax/.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
src/reactjs_jsx_ppx_v3.cmx : src/reactjs_jsx_ppx_v3.cmi
src/reactjs_jsx_ppx_v3.cmi :
src/res_ast_conversion.cmx : src/res_printer.cmx src/res_ast_conversion.cmi
src/res_ast_conversion.cmi :
src/res_ast_debugger.cmx : src/res_driver.cmx src/res_doc.cmx \
src/res_ast_debugger.cmi
src/res_ast_debugger.cmi : src/res_driver.cmi
src/res_cli.cmx : src/res_driver_reason_binary.cmx \
src/res_driver_ml_parser.cmx src/res_driver_binary.cmx src/res_driver.cmx \
src/res_ast_debugger.cmx src/reactjs_jsx_ppx_v3.cmx
src/res_comment.cmx : src/res_comment.cmi
src/res_comment.cmi :
src/res_comments_table.cmx : src/res_parsetree_viewer.cmx src/res_doc.cmx \
src/res_comment.cmx
src/res_core.cmx : src/res_utf8.cmx src/res_token.cmx src/res_scanner.cmx \
src/res_printer.cmx src/res_parser.cmx src/res_js_ffi.cmx \
src/res_grammar.cmx src/res_doc.cmx src/res_diagnostics.cmx \
src/res_comments_table.cmx src/res_core.cmi
src/res_core.cmi : src/res_parser.cmi
src/res_diagnostics.cmx : src/res_token.cmx src/res_grammar.cmx \
src/res_diagnostics_printing_utils.cmx src/res_diagnostics.cmi
src/res_diagnostics.cmi : src/res_token.cmx src/res_grammar.cmx
src/res_diagnostics_printing_utils.cmx :
src/res_doc.cmx : src/res_minibuffer.cmx src/res_doc.cmi
src/res_doc.cmi :
src/res_driver.cmx : src/res_printer.cmx src/res_parser.cmx src/res_io.cmx \
src/res_diagnostics.cmx src/res_core.cmx src/res_comment.cmx \
src/res_driver.cmi
src/res_driver.cmi : src/res_diagnostics.cmi src/res_comment.cmi
src/res_driver_binary.cmx : src/res_driver.cmx src/res_driver_binary.cmi
src/res_driver_binary.cmi : src/res_driver.cmi
src/res_driver_ml_parser.cmx : src/res_io.cmx src/res_driver.cmx \
src/res_comment.cmx src/res_ast_conversion.cmx \
src/res_driver_ml_parser.cmi
src/res_driver_ml_parser.cmi : src/res_driver.cmi src/res_comment.cmi
src/res_driver_reason_binary.cmx : src/res_scanner.cmx src/res_io.cmx \
src/res_driver.cmx src/res_comment.cmx src/res_ast_conversion.cmx \
src/res_driver_reason_binary.cmi
src/res_driver_reason_binary.cmi : src/res_token.cmx src/res_driver.cmi
src/res_grammar.cmx : src/res_token.cmx
src/res_io.cmx : src/res_io.cmi
src/res_io.cmi :
src/res_js_ffi.cmx :
src/res_minibuffer.cmx : src/res_minibuffer.cmi
src/res_minibuffer.cmi :
src/res_multi_printer.cmx : src/res_printer.cmx src/res_io.cmx \
src/res_driver_reason_binary.cmx src/res_driver_ml_parser.cmx \
src/res_driver.cmx src/res_diagnostics.cmx src/res_ast_conversion.cmx \
src/res_multi_printer.cmi
src/res_multi_printer.cmi :
src/res_outcome_printer.cmx : src/res_token.cmx src/res_doc.cmx \
src/res_outcome_printer.cmi
src/res_outcome_printer.cmi : src/res_doc.cmi
src/res_parens.cmx : src/res_parsetree_viewer.cmx src/res_parens.cmi
src/res_parens.cmi :
src/res_parser.cmx : src/res_token.cmx src/res_scanner.cmx \
src/res_reporting.cmx src/res_grammar.cmx src/res_diagnostics.cmx \
src/res_comment.cmx src/res_parser.cmi
src/res_parser.cmi : src/res_token.cmx src/res_scanner.cmi \
src/res_reporting.cmx src/res_grammar.cmx src/res_diagnostics.cmi \
src/res_comment.cmi
src/res_parsetree_viewer.cmx : src/res_parsetree_viewer.cmi
src/res_parsetree_viewer.cmi :
src/res_printer.cmx : src/res_utf8.cmx src/res_token.cmx \
src/res_parsetree_viewer.cmx src/res_parens.cmx src/res_doc.cmx \
src/res_comments_table.cmx src/res_comment.cmx src/res_printer.cmi
src/res_printer.cmi : src/res_doc.cmi src/res_comments_table.cmx \
src/res_comment.cmi
src/res_reporting.cmx : src/res_token.cmx src/res_grammar.cmx
src/res_scanner.cmx : src/res_utf8.cmx src/res_token.cmx \
src/res_diagnostics.cmx src/res_comment.cmx src/res_scanner.cmi
src/res_scanner.cmi : src/res_token.cmx src/res_diagnostics.cmi
src/res_token.cmx : src/res_comment.cmx
src/res_utf8.cmx : src/res_utf8.cmi
src/res_utf8.cmi :
tests/res_test.cmx : tests/res_utf8_test.cmx src/res_token.cmx \
src/res_parser.cmx src/res_outcome_printer.cmx src/res_multi_printer.cmx \
src/res_io.cmx src/res_driver.cmx src/res_core.cmx
tests/res_utf8_test.cmx : src/res_utf8.cmx
10 changes: 10 additions & 0 deletions syntax/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_STORE
node_modules
*.cm*
*.o
*.s
lib/*
!lib/README.md
.vscode/settings.json
# each person has its own preferences
_build
6 changes: 6 additions & 0 deletions syntax/.merlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
S src
B src
S +compiler-libs
B +compiler-libs

FLG -w +a-4-42-40-9-48
24 changes: 24 additions & 0 deletions syntax/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: node_js

node_js:
- 10.15.1

sudo: required

env:
- OCAML_VERSION=4.06

install: test -e .travis.opam.sh || wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh

script:
- bash -ex .travis-opam.sh
- npm install
- opam switch create 4.06.1
- eval $(opam env)
- ocamlopt -v
- make world
- make test

os:
# - linux
- osx
52 changes: 52 additions & 0 deletions syntax/.vscode/ninja.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env node
var path = require("path");
var cp = require("child_process");
var jscompDir = path.join(__dirname, "..");
var vendorNinjaPath = "make";
function main() {
var subcommand = process.argv[2];
switch (subcommand) {
case "build":
cp.execSync(vendorNinjaPath, {
encoding: "utf8",
cwd: jscompDir,
stdio: [0, 1, 2],
});
// cp.execSync(`make depend`, {
// cwd: jscompDir,
// stdio: [0, 1, 2],
// });
break;
case "clean":
cp.execSync(`make clean`, {
cwd: jscompDir,
stdio: [0, 1, 2],
});
break;
case "config":
cp.execSync(`make depend`, {
cwd: jscompDir,
stdio: [0, 1, 2],
});
break;
case "cleanbuild":
cp.execSync(`make clean && make depend && make -j9`, {
cwd: jscompDir,
stdio: [0, 1, 2],
});
break;
case "help":
console.log(`supported subcommands:
[exe] config
[exe] build
[exe] cleanbuild
[exe] help
[exe] clean
`);
break;
default:
break;
}
}

main();
123 changes: 123 additions & 0 deletions syntax/.vscode/task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/usr/bin/env node
//@ts-check
var fs = require("fs");
var path = require("path");
var cp = require("child_process");
var sourceDirs = ["src"];

var buildAppending = false;
var isBuilding = false;

var jscompDir = path.join(__dirname, "..");
/**
*
* @param {Date} d
*/
function showDate(d) {
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`;
}
function rebuild() {
if (isBuilding) {
buildAppending = true;
} else {
console.log(">>>> Start compiling");
isBuilding = true;

cp.fork(path.join(__dirname, "ninja.js"), ["build"]).on(
"exit",
buildFinished
);
}
}
/**
*
* @param {number} code
* @param {string} signal
*/
function buildFinished(code, signal) {
isBuilding = false;
if (buildAppending) {
buildAppending = false;
rebuild();
} else {
if (code !== 0) {
// console.log(`File "package.json", line 1, characters 1-1:`);
// console.log(`Error: Failed to build ${showDate(new Date())}`);
}
console.log(">>>> Finish compiling (options: R|clean|config)");
// TODO: check ninja exit error code
if (code === 0) {
// This is not always correct
// ninjaFile.updateDev();
// This file is cached
cp.fork(path.join(__dirname, "ninja.js"), ["-dev"]);
}
}
}
/**
*
* @param {string} eventType
* @param {string} filename
*/
function onSourceChange(eventType, filename) {
// console.log('event ', eventType,filename)
if (
filename.endsWith(".ml") ||
filename.endsWith(".mli") ||
filename.endsWith(".json") ||
filename.endsWith(".re") ||
filename.endsWith(".rei")
) {
rebuild();
}
}

sourceDirs.forEach((x) => {
fs.watch(path.join(jscompDir, x), "utf8", onSourceChange);
});

// fs.watch(path.join("..", "package.json"), "utf8", onSourceChange);

rebuild();

var readline = require("readline");
readline
.createInterface({
input: process.stdin,
output: process.stdout,
})
.on("line", (input) => {
switch (input.toLowerCase()) {
case "r":
rebuild();
break;
case "config":
if (isBuilding) {
console.log(`it's building`);
} else {
isBuilding = true;
cp.fork(path.join(__dirname, "ninja.js"), ["config"]).on(
"close",
() => {
isBuilding = false;
rebuild();
}
);
}
break;
case "clean":
if (isBuilding) {
console.log(`it's building`);
} else {
isBuilding = true;
cp.fork(path.join(__dirname, "ninja.js"), ["cleanbuild"]).on(
"close",
() => {
isBuilding = false;
}
);
}

break;
}
});
Loading