-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.log
1867 lines (1863 loc) · 90 KB
/
master.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
* commit be385c5748d5ec3f7018dc7ec451e8bd251f3e3c
| Author: awsmith <[email protected]>
| Date: Mon Jul 4 13:48:49 2022 -0500
|
| [test] Add test for parenthesised type atoms
|
| src/syntax/lexgen.ml | 8 ++++----
| test/parser_data/type_parenthesised.ptest | 3 +++
| test/test_parser.ml | 5 +++--
| 3 files changed, 10 insertions(+), 6 deletions(-)
|
* commit ec68f64ce0352f552e140aef082b58f445e841c9
| Author: awsmith <[email protected]>
| Date: Tue Jun 28 01:07:22 2022 -0500
|
| [syntax] Implemented basic type expression parsing
|
| Implemented a wrapper of the common parsing facilities for type
| expressions. In general, the grammar of type expressions will be much
| simpler than that of patterns or expressions, as expression-level
| features such as labelled arguments and user-defined operators are not
| supported in the type grammar. This state of affairs may change at some
| point in the future, but I'm quite far off from having implemented the
| type-checking functionality required to support such constructs (...or
| any type-checker at all).
|
| src/syntax/cst.ml | 23 ++++++++++++
| src/syntax/parser.ml | 43 +++++++++++++++++++++-
| src/syntax/parser.mli | 8 +++-
| test/parser_data/type_constructor_multiple.ptest | 6 +++
| test/parser_data/type_constructor_single.ptest | 4 ++
| test/parser_data/type_module_multiple.ptest | 7 ++++
| test/parser_data/type_module_single.ptest | 3 ++
| test/parser_data/type_single_identifier.ptest | 3 ++
| test/test_parser.ml | 17 ++++++++-
| 9 files changed, 110 insertions(+), 4 deletions(-)
|
* commit fe52252b9c9d56f5513d5b0aacd274a3aded85e0
| Author: awsmith <[email protected]>
| Date: Mon Jun 27 23:50:29 2022 -0500
|
| [syntax] Move expression CST types into module Cst.Expr
|
| Moved type *Cst.expr into module Cst.Expr as type Cst.Expr.t, along with
| its associated types and functions. This refactor is in anticipation of
| the addition of type expression parsing to enable type ascriptions and
| pattern parsing.
|
| src/syntax/cst.ml | 226 ++++++++++----------
| src/syntax/parser.ml | 53 ++---
| src/syntax/parser.mli | 4 +-
| src/syntax/parser_base.ml | 2 +-
| test/parser_data/discard_missing_expr.ptest | 2 +-
| .../parser_data/funcall_label_missing_value.ptest | 2 +-
| .../funcall_label_missing_value_2.ptest | 4 +-
| test/parser_data/infix_missing_rhs.ptest | 2 +-
| test/parser_data/infix_missing_rhs_2.ptest | 2 +-
| .../infix_prefixed_missing_operator.ptest | 4 +-
| test/parser_data/infix_prefixed_missing_rhs.ptest | 2 +-
| test/parser_data/prefix_missing_rhs.ptest | 2 +-
| test/parser_data/prefix_missing_rhs_2.ptest | 2 +-
| test/parser_data/tuple_missing_rhs.ptest | 4 +-
| test/test_parser.ml | 2 +-
| 15 files changed, 159 insertions(+), 154 deletions(-)
|
* commit 08895f3eba87873322a922ed8d1034f9391cfa9c
| Author: awsmith <[email protected]>
| Date: Thu Jun 23 16:44:27 2022 -0500
|
| [syntax] Fix precedence of discard statements
|
| Discard statements should have a higher precedence than infix operators,
| as they are dispatched directly from Expr.parse_top.
|
| src/syntax/parser.ml | 14 ++++++--------
| test/parser_data/discard_dominates_infix.ptest | 5 +++++
| test/test_parser.ml | 1 +
| 3 files changed, 12 insertions(+), 8 deletions(-)
|
* commit 220b3e4adbae4aa9ae5aa0d0ef729d49de88ed7b
| Author: awsmith <[email protected]>
| Date: Tue Jun 21 14:15:07 2022 -0500
|
| [syntax] Restore parsing of discard expressions
|
| Reïmplemented the parsing of discard expressions using the new abstract
| parsing framework. Implementing the remainder of the language's syntax
| may necessitate the addition of a few more "overridable parser hierarchy
| control" functions, although their use should be similarly minimal to
| the implementation of Parser.Expr.parse_top.
|
| src/prelude/reporting.ml | 1 +
| src/prelude/reporting_intf.ml | 3 ++-
| src/syntax/cst.ml | 9 ++++++---
| src/syntax/parser.ml | 29 ++++++++++++++++++++++++++-
| src/syntax/parser_base.ml | 13 +++++++-----
| test/parser_data/discard_missing_expr.ptest | 2 +-
| test/test_parser.ml | 2 +-
| 7 files changed, 47 insertions(+), 12 deletions(-)
|
* commit 325913d70fdb8a2703b3fb6d877db57b48efaa37
| Author: awsmith <[email protected]>
| Date: Sun Jun 19 15:15:44 2022 -0500
|
| [syntax] Remove special-case precedence for operator ~in
|
| This operator was a holdover from the syntax design before arbitrary
| infix expressions were permitted. There is no reason for the operator
| ~in alone to be parsed as a Compare_op, as the boolean operators with
| which it will be used still have a higher precedence than that of all
| other tilde-prefixed infix expressions.
|
| This change technically forbids the presence of an infix operator ~in
| since "in" is lexed as a keyword rather than an identifier: allowing
| keywords to be used as identifiers in some contexts could loosen this
| restriction. Other alternatives include a sigil (backticks, e.g. `in`?)
| to allow a keyword to be used as an identifier, or reversing the
| argument order of such operators and using a different name, e.g.
| "collection ~has element", or the Haskell "collection ~elem element".
| The use of dot syntax could also obliviate the need for such an operator
| entirely: "collection.has element". There are many options, none of
| which necessitate special-case parsing for a single operator.
|
| src/syntax/lexer.ml | 10 +++-------
| src/syntax/parser_base.ml | 2 +-
| test/test_lexer.ml | 1 -
| 3 files changed, 4 insertions(+), 9 deletions(-)
|
* commit 4b910a98384746b96fa26f7e3554a495e68f80b4
| Author: awsmith <[email protected]>
| Date: Sat Jun 18 13:24:46 2022 -0500
|
| [syntax] Parse tilde-prefixed infix operators
|
| Hudson's syntax now includes a feature directly inspired by, of all
| sources, APL: the ability to use arbitrary expressions as infix
| operators by prefixing them with a tilde. In its simplest form, this
| construct allows for common functions to be transformed into infix
| operators without requiring separate definitions:
|
| min :: Int -> Int -> Int.
| x ~min y ~min z
|
| However, it may be used in more complex scenarios, allowing for
| compositions:
|
| x ~(g @ f) y
|
| And even anonymous functions to be used as infix operators:
|
| x ~{f _ + f _} y
|
| I don't expect that the latter form will see much use, although I can
| see some limited scenarios in which it could improve clarity somewhat.
|
| src/prelude/reporting.ml | 1 +
| src/prelude/reporting_intf.ml | 3 +-
| src/syntax/cst.ml | 22 +++++++++++++--
| src/syntax/parser.ml | 10 ++++---
| src/syntax/parser_base.ml | 31 +++++++++++++++++++--
| .../field_projection_complex_head.ptest | 2 +-
| test/parser_data/funcall_complex_head_2.ptest | 2 +-
| .../funcall_positional_precedence_2.ptest | 2 +-
| test/parser_data/infix_and_dominates_dollar.ptest | 4 +--
| test/parser_data/infix_caret.ptest | 2 +-
| .../parser_data/infix_caret_dominates_index.ptest | 6 ++--
| test/parser_data/infix_caret_override.ptest | 6 ++--
| test/parser_data/infix_caret_override_2.ptest | 6 ++--
| .../infix_caret_right_associative.ptest | 4 +--
| test/parser_data/infix_compare.ptest | 2 +-
| .../infix_compare_dominates_plus.ptest | 6 ++--
| test/parser_data/infix_compare_equal.ptest | 2 +-
| .../infix_compare_left_associative.ptest | 4 +--
| test/parser_data/infix_compose.ptest | 2 +-
| .../infix_compose_right_associative.ptest | 4 +--
| test/parser_data/infix_dollar.ptest | 2 +-
| .../infix_dollar_dominates_symbolic.ptest | 6 ++--
| .../infix_dollar_right_associative.ptest | 4 +--
| test/parser_data/infix_dominates_funcall.ptest | 2 +-
| test/parser_data/infix_index.ptest | 2 +-
| .../infix_index_left_associative.ptest | 4 +--
| test/parser_data/infix_missing_rhs.ptest | 2 +-
| test/parser_data/infix_missing_rhs_2.ptest | 4 +--
| test/parser_data/infix_plus.ptest | 2 +-
| test/parser_data/infix_plus_dominates_times.ptest | 10 +++----
| .../parser_data/infix_plus_left_associative.ptest | 4 +--
| test/parser_data/infix_prefixed.ptest | 3 ++
| test/parser_data/infix_prefixed_complex.ptest | 7 +++++
| .../infix_prefixed_dominates_compare.ptest | 9 ++++++
| .../infix_prefixed_equals_symbolic.ptest | 9 ++++++
| .../infix_prefixed_left_associative.ptest | 7 +++++
| .../infix_prefixed_missing_operator.ptest | 9 ++++++
| test/parser_data/infix_prefixed_missing_rhs.ptest | 7 +++++
| test/parser_data/infix_prefixed_projection.ptest | 5 ++++
| test/parser_data/infix_symbolic.ptest | 2 +-
| .../infix_symbolic_dominates_compare.ptest | 6 ++--
| .../infix_symbolic_left_associative.ptest | 6 ++--
| test/parser_data/infix_times.ptest | 2 +-
| .../parser_data/infix_times_dominates_caret.ptest | 6 ++--
| .../infix_times_dominates_prefix_minus.ptest | 2 +-
| .../infix_times_left_associative.ptest | 6 ++--
| .../prefix_minus_dominates_infix_caret.ptest | 2 +-
| .../prefix_minus_dominates_infix_index.ptest | 4 +--
| .../prefix_not_dominates_infix_compare.ptest | 2 +-
| test/test_parser.ml | 18 ++++++++++++
| 50 files changed, 197 insertions(+), 78 deletions(-)
|
* commit ec9770c53649fa2db66b6fe1cc0a833c07abe100
| Author: awsmith <[email protected]>
| Date: Sat Jun 18 12:14:12 2022 -0500
|
| [syntax] Parse infix operators as generic nodes
|
| Modified the definition of infix applications to allow them to be used
| by multiple node types, and changed the operator field therein to be a
| node rather than an identifier string. This change is necessary to
| support tilde-prefixed infix operator expressions.
|
| src/syntax/cst.ml | 30 ++++-----
| src/syntax/lexer.ml | 11 +---
| src/syntax/parser.ml | 73 ++++++++++-----------
| src/syntax/parser_base.ml | 56 ++++++++--------
| .../field_projection_complex_head.ptest | 2 +-
| test/parser_data/funcall_complex_head_2.ptest | 4 +-
| .../funcall_positional_precedence_2.ptest | 4 +-
| test/parser_data/infix_and_dominates_dollar.ptest | 4 +-
| test/parser_data/infix_caret.ptest | 2 +-
| .../parser_data/infix_caret_dominates_index.ptest | 10 ++-
| test/parser_data/infix_caret_override.ptest | 6 +-
| test/parser_data/infix_caret_override_2.ptest | 6 +-
| .../infix_caret_right_associative.ptest | 6 +-
| test/parser_data/infix_compare.ptest | 2 +-
| .../infix_compare_dominates_plus.ptest | 6 +-
| test/parser_data/infix_compare_equal.ptest | 2 +-
| .../infix_compare_left_associative.ptest | 4 +-
| test/parser_data/infix_compose.ptest | 2 +-
| .../infix_compose_right_associative.ptest | 6 +-
| test/parser_data/infix_dollar.ptest | 2 +-
| .../infix_dollar_dominates_symbolic.ptest | 6 +-
| .../infix_dollar_right_associative.ptest | 4 +-
| test/parser_data/infix_dominates_funcall.ptest | 2 +-
| test/parser_data/infix_index.ptest | 2 +-
| .../infix_index_left_associative.ptest | 6 +-
| test/parser_data/infix_missing_rhs.ptest | 2 +-
| test/parser_data/infix_missing_rhs_2.ptest | 4 +-
| test/parser_data/infix_plus.ptest | 2 +-
| test/parser_data/infix_plus_dominates_times.ptest | 10 +--
| .../parser_data/infix_plus_left_associative.ptest | 4 +-
| test/parser_data/infix_symbolic.ptest | 2 +-
| .../infix_symbolic_dominates_compare.ptest | 6 +-
| .../infix_symbolic_left_associative.ptest | 8 ++-
| test/parser_data/infix_times.ptest | 2 +-
| .../parser_data/infix_times_dominates_caret.ptest | 6 +-
| .../infix_times_dominates_prefix_minus.ptest | 2 +-
| .../infix_times_left_associative.ptest | 10 +--
| .../prefix_minus_dominates_infix_caret.ptest | 2 +-
| .../prefix_minus_dominates_infix_index.ptest | 4 +-
| .../prefix_not_dominates_infix_compare.ptest | 2 +-
| test/test_lexer.ml | 5 +-
| 41 files changed, 168 insertions(+), 161 deletions(-)
|
* commit 7427a53da96166451560520e8c80754d3ee63fc9
| Author: awsmith <[email protected]>
| Date: Thu Jun 16 11:35:43 2022 -0500
|
| [syntax] Make $ right-associative; change ** to ^
|
| Made the $ operator right-associative for isomorphism with Haskell.
| Also changed the ** operator to ^, allowing the caret to be used as a
| general tightly-binding right-associative operator, similarly to its use
| in OCaml. The relevant token definitions have been modified to reflect
| these changes.
|
| .gitignore | 1 +
| src/syntax/lexer.ml | 12 +++++-------
| src/syntax/parser.ml | 6 +++---
| src/syntax/token.ml | 6 ++----
| test/parser_data/infix_caret.ptest | 3 +++
| ...ndex.ptest => infix_caret_dominates_index.ptest} | 4 ++--
| ...nt_override.ptest => infix_caret_override.ptest} | 4 ++--
| ...verride_2.ptest => infix_caret_override_2.ptest} | 4 ++--
| .../parser_data/infix_caret_right_associative.ptest | 5 +++++
| .../parser_data/infix_dollar_left_associative.ptest | 5 -----
| .../infix_dollar_right_associative.ptest | 5 +++++
| test/parser_data/infix_exponent.ptest | 3 ---
| .../infix_exponent_right_associative.ptest | 5 -----
| test/parser_data/infix_plus_dominates_times.ptest | 4 ++--
| test/parser_data/infix_times_dominates_caret.ptest | 5 +++++
| .../infix_times_dominates_exponent.ptest | 5 -----
| ...est => prefix_minus_dominates_infix_caret.ptest} | 4 ++--
| test/test_lexer.ml | 19 ++++---------------
| test/test_parser.ml | 16 ++++++++--------
| 19 files changed, 51 insertions(+), 65 deletions(-)
|
* commit e782b5f4126078a972e5d6c7d8f0200e6c46459b
| Author: awsmith <[email protected]>
| Date: Mon Jun 13 04:36:59 2022 -0500
|
| [syntax] Add abstract parser generation (Parser_base)
|
| Added a new module to generate parsers for expression-like syntaxes
| given an abstract definition of the syntactic construct to parse. While
| this functionality is not useful in its own right at present, being used
| solely to generate the Cst.expr parser, it will be supremely helpful
| once I add pattern and type syntaxes, which are also expression-like in
| form and thus can be defined using Parser_base.
|
| A further consequence of this change is a reduction in the number of
| mutually recursive definitions in both Cst and Parser, making future
| refactoring somewhat easier.
|
| src/syntax/cst.ml | 155 ++--
| src/syntax/parser.ml | 796 ++++----------------
| src/syntax/parser.mli | 17 +
| src/syntax/parser_base.ml | 511 +++++++++++++
| .../parser_data/delimiter_mismatched_lparen.ptest | 2 +-
| test/parser_data/field_access_complex_head.ptest | 6 -
| test/parser_data/field_access_mixed.ptest | 9 -
| test/parser_data/field_access_record_deep.ptest | 15 -
| test/parser_data/field_access_record_double.ptest | 4 -
| test/parser_data/field_access_record_single.ptest | 3 -
| test/parser_data/field_access_tuple_single.ptest | 3 -
| .../field_projection_complex_head.ptest | 6 +
| ...cimal.ptest => field_projection_decimal.ptest} | 0
| ...st => field_projection_missing_accessor.ptest} | 0
| ... => field_projection_missing_accessor_2.ptest} | 0
| test/parser_data/field_projection_mixed.ptest | 9 +
| .../field_projection_record_deep.ptest | 15 +
| .../field_projection_record_double.ptest | 4 +
| .../field_projection_record_single.ptest | 3 +
| ....ptest => field_projection_tuple_double.ptest} | 4 +-
| .../field_projection_tuple_single.ptest | 3 +
| test/parser_data/funcall_complex_head.ptest | 2 +-
| test/parser_data/funcall_label_precedence.ptest | 2 +-
| .../funcall_positional_precedence.ptest | 2 +-
| test/test_parser.ml | 26 +-
| 25 files changed, 824 insertions(+), 773 deletions(-)
|
* commit 3ae8a13eeb486d52d467a2284861641db3f71065
| Author: awsmith <[email protected]>
| Date: Fri Jun 10 05:41:43 2022 -0500
|
| [syntax] Implemented discard expression
|
| Implemented the discard expression, which effectively consists of a
| prefix Discard operator and evaluates an expression solely for its side
| effects, returning a unit value.
|
| src/syntax/cst.ml | 2 +
| src/syntax/parser.ml | 65 +++++++++++++++------
| test/parser_data/discard.ptest | 4 ++
| test/parser_data/discard_missing_expr.ptest | 5 ++
| .../field_access_missing_accessor.ptest | 3 +-
| .../field_access_missing_accessor_2.ptest | 9 ++-
| test/test_parser.ml | 7 ++-
| 7 files changed, 70 insertions(+), 25 deletions(-)
|
* commit 98bb8f7defc954466617ce76ac6cde455bc0fe96
| Author: awsmith <[email protected]>
| Date: Thu Jun 9 01:55:35 2022 -0500
|
| [syntax] Parse tuple literals
|
| Implemented the parsing of tuple literals, which consist of a series of
| expressions delimited by commas. Unlike some other languages, Hudson
| tuples do not need to be surrounded by parentheses; accordingly,
| trailing commas are also not permitted to avoid syntactic ambiguities.
|
| src/syntax/cst.ml | 10 +++
| src/syntax/parser.ml | 78 ++++++++++++++---------
| test/parser_data/tuple_2.ptest | 3 +
| test/parser_data/tuple_3.ptest | 3 +
| test/parser_data/tuple_dominates_infix_or.ptest | 5 ++
| test/parser_data/tuple_missing_rhs.ptest | 7 ++
| test/parser_data/tuple_nested_left.ptest | 4 ++
| test/parser_data/tuple_nested_right.ptest | 4 ++
| test/test_parser.ml | 11 +++-
| 9 files changed, 94 insertions(+), 31 deletions(-)
|
* commit 3b4a47f13ff9708f8df5429b21e97503bd9c756e
| Author: awsmith <[email protected]>
| Date: Mon Jun 6 01:25:59 2022 -0500
|
| [syntax] Added boolean and (&&) and or (||) operators
|
| Added support for parsing the short-circuiting boolean AND and OR
| operators. These operators have the highest precedence yet, allowing
| for all comparisons and uses of NOT to be used as boolean clauses
| without requiring parentheses.
|
| src/syntax/cst.ml | 6 ++++
| src/syntax/parser.ml | 36 ++++++++++++++-------
| test/parser_data/infix_and.ptest | 3 ++
| test/parser_data/infix_and_dominates_dollar.ptest | 4 +++
| .../infix_and_dominates_prefix_not.ptest | 4 +++
| test/parser_data/infix_and_left_associative.ptest | 4 +++
| test/parser_data/infix_or.ptest | 3 ++
| test/parser_data/infix_or_dominates_and.ptest | 4 +++
| test/parser_data/infix_or_left_associative.ptest | 4 +++
| test/test_parser.ml | 7 ++++
| 10 files changed, 63 insertions(+), 12 deletions(-)
|
* commit a31ab50825e840d3085d498f939822524282d06c
| Author: awsmith <[email protected]>
| Date: Sun Jun 5 21:33:12 2022 -0500
|
| [syntax] Implemented prefix operator expressions
|
| Implemented the parsing of prefix operators in expressions. These are a
| relatively simple extension of infix operators, having only a right
| binding power. These binding powers are sequenced with the infix
| operators, maintaining a strict ordering to describe the precedences
| throughout the expression parser.
|
| src/prelude/reporting.ml | 7 +-
| src/prelude/reporting_intf.ml | 5 +-
| src/syntax/cst.ml | 49 ++++++----
| src/syntax/parser.ml | 101 +++++++++++++++-----
| .../parser_data/delimiter_mismatched_lparen.ptest | 2 +-
| .../parser_data/delimiter_unmatched_garbage.ptest | 2 +-
| test/parser_data/delimiter_unmatched_lparen.ptest | 2 +-
| .../delimiter_unmatched_lparen_2.ptest | 4 +-
| .../infix_dominates_prefix_minus.ptest | 4 +
| .../infix_times_dominates_prefix_minus.ptest | 5 +
| test/parser_data/prefix_minus.ptest | 3 +
| test/parser_data/prefix_minus_2.ptest | 3 +
| .../prefix_minus_dominates_funcall.ptest | 4 +
| .../prefix_minus_dominates_infix_exponent.ptest | 5 +
| .../prefix_minus_dominates_infix_index.ptest | 7 ++
| test/parser_data/prefix_missing_rhs.ptest | 5 +
| test/parser_data/prefix_missing_rhs_2.ptest | 6 ++
| test/parser_data/prefix_not.ptest | 3 +
| test/parser_data/prefix_not_2.ptest | 3 +
| .../prefix_not_dominates_infix_compare.ptest | 5 +
| test/parser_data/prefix_plus.ptest | 3 +
| test/test_parser.ml | 18 ++++
| 22 files changed, 197 insertions(+), 49 deletions(-)
|
* commit 0057cee0360c5b7eb3d66e5e4676a636290234d8
| Author: awsmith <[email protected]>
| Date: Thu Jun 2 13:50:22 2022 -0500
|
| [syntax] Implemented token schema error correction
|
| Added error correction back to the parser, with some modifications to
| increase the mechanism's flexibility: viz. tokens may now prompt entire
| delimiter schemata rather than only a single token, allowing for more
| complex structures such as if ... then ... end to be corrected more
| accurately by distinguishing them from other structures that use similar
| tokens (e.g. elif ... then, which does not prompt its own "end"). Error
| correction may also now delete other extraneous tokens, defining the
| effective boundary of each schema start token as the span until the next
| closing delimiter is encountered.
|
| I also increased the lookahead distance for error correction: error
| correction shouldn't be invoked too frequently, so this should have a
| minimal impact on performance while improving accuracy. Future
| profiling may reveal a more suitable token number, but for now a nice
| round power of 2 seems reasonable.
|
| src/prelude/reporting.ml | 9 +-
| src/prelude/reporting_intf.ml | 5 +-
| src/syntax/cst.ml | 14 +-
| src/syntax/parser.ml | 250 +++++++++++++++++++-
| test/parser_data/atom_nop_parentheses.ptest | 7 +-
| test/parser_data/delimiter_extra_lparen.ptest | 7 -
| test/parser_data/delimiter_extra_lparen_2.ptest | 9 -
| .../parser_data/delimiter_mismatched_lparen.ptest | 6 +-
| .../parser_data/delimiter_preceding_garbage.ptest | 5 +
| .../delimiter_preceding_garbage_2.ptest | 5 +
| .../parser_data/delimiter_unmatched_garbage.ptest | 5 +
| test/parser_data/delimiter_unmatched_lparen.ptest | 6 +-
| .../delimiter_unmatched_lparen_2.ptest | 10 +-
| test/parser_data/field_access_complex_head.ptest | 5 +-
| test/parser_data/funcall_complex_head.ptest | 2 +-
| test/parser_data/funcall_complex_head_2.ptest | 3 +-
| .../funcall_positional_precedence_2.ptest | 5 +-
| test/parser_data/infix_exponent_override.ptest | 10 +-
| test/parser_data/infix_exponent_override_2.ptest | 10 +-
| test/test_parser.ml | 29 +--
| 20 files changed, 329 insertions(+), 73 deletions(-)
|
* commit 3b09ca5d5c43adb195a665bdfcad181a4ec26a3a
| Author: awsmith <[email protected]>
| Date: Thu Jun 2 02:05:05 2022 -0500
|
| [test] Convert parser tests to new CST format
|
| Migrated and re-enabled all parser tests that do not rely on delimiter
| parsing to match the new internal and serialisation formats of the CST.
| I sincerely hope that I don't have to go through this process again in
| the future; if I do, I'll probably write some tooling to alleviate the
| burden of manually migrating each test.
|
| test/parser_data/funcall_flag_false.ptest | 2 +-
| test/parser_data/funcall_flag_true.ptest | 2 +-
| test/parser_data/funcall_label_missing_value.ptest | 5 ++---
| .../parser_data/funcall_label_missing_value_2.ptest | 9 ++++-----
| test/parser_data/funcall_label_multiple.ptest | 5 +++--
| test/parser_data/funcall_label_precedence.ptest | 2 +-
| test/parser_data/funcall_label_single.ptest | 2 +-
| test/parser_data/funcall_mixed.ptest | 13 +++++++------
| test/parser_data/funcall_positional_multi.ptest | 7 ++++---
| .../parser_data/funcall_positional_precedence.ptest | 2 +-
| test/parser_data/funcall_positional_single.ptest | 2 +-
| test/parser_data/funcall_punned.ptest | 2 +-
| test/parser_data/infix_compare.ptest | 2 +-
| test/parser_data/infix_compare_dominates_plus.ptest | 5 +++--
| test/parser_data/infix_compare_equal.ptest | 2 +-
| .../infix_compare_left_associative.ptest | 5 +++--
| test/parser_data/infix_compare_pipe.ptest | 4 ----
| test/parser_data/infix_compose.ptest | 2 +-
| .../infix_compose_right_associative.ptest | 5 +++--
| test/parser_data/infix_dollar.ptest | 2 +-
| .../infix_dollar_dominates_symbolic.ptest | 5 +++--
| .../parser_data/infix_dollar_left_associative.ptest | 5 +++--
| test/parser_data/infix_dominates_funcall.ptest | 5 +++--
| test/parser_data/infix_exponent.ptest | 2 +-
| .../infix_exponent_dominates_index.ptest | 5 +++--
| .../infix_exponent_right_associative.ptest | 5 +++--
| test/parser_data/infix_index.ptest | 2 +-
| test/parser_data/infix_index_left_associative.ptest | 5 +++--
| test/parser_data/infix_missing_rhs.ptest | 6 +++---
| test/parser_data/infix_missing_rhs_2.ptest | 11 +++++++----
| test/parser_data/infix_plus.ptest | 2 +-
| test/parser_data/infix_plus_dominates_times.ptest | 15 +++++++++++----
| test/parser_data/infix_plus_left_associative.ptest | 5 +++--
| test/parser_data/infix_symbolic.ptest | 2 +-
| .../infix_symbolic_dominates_compare.ptest | 7 ++++---
| .../infix_symbolic_left_associative.ptest | 8 +++++---
| test/parser_data/infix_times.ptest | 2 +-
| .../infix_times_dominates_exponent.ptest | 5 +++--
| test/parser_data/infix_times_left_associative.ptest | 8 +++++---
| test/test_parser.ml | 19 +++++++++----------
| 40 files changed, 113 insertions(+), 91 deletions(-)
|
* commit 64f48c9f7569ce3bd1e572434e09d0a3ba4cd31a
| Author: awsmith <[email protected]>
| Date: Thu Jun 2 00:27:52 2022 -0500
|
| [syntax] Remove separate terminal group types
|
| Removed the type field_access_terms and rolled its members into type
| field_access in order to reduce the amount of typing required to access
| these terminals. Additionally, the ergonomics of ignoring the field
| field_access_terms and the two separate terminal fields in field_access
| are the same, so there's no real advantage to using the separate type.
|
| src/syntax/cst.ml | 17 ++++++++++++++---
| src/syntax/parser.ml | 22 +++++++++++-----------
| 2 files changed, 25 insertions(+), 14 deletions(-)
|
* commit de9419b49104cb160132715d8977d0aa44cc6579
| Author: awsmith <[email protected]>
| Date: Mon May 30 02:52:03 2022 -0500
|
| [syntax] Reimplement parsing of function calls, infix operators
|
| Reimplemented the parsing of function calls and infix operators with the
| same behaviour as the previous parser, save for the aggressive delimiter
| correction. In general, I am starting to think that delimiter checking
| should largely be restricted to when we actually see a delimiter. This
| opinion is largely inspired by an examination of rustc's error
| correction, which is relatively conservative with regard to delimiters.
| It seems like any more "clever" solution could potentially result in
| malformed trees, while the fidelity of the syntax tree should generally
| be the highest priority.
|
| The tests for these reimplemented constructs have not yet been
| re-enabled, as the serialisation format and structure of the syntax tree
| have both changed. Furthermore, I still haven't implemented delimiter
| correction for the above reasons.
|
| src/prelude/reporting.ml | 9 +--
| src/prelude/reporting_intf.ml | 7 +-
| src/syntax/cst.ml | 81 +++++++++++++++++++--
| src/syntax/parser.ml | 151 ++++++++++++++++++++++++++++++++++++++--
| test/test_parser.ml | 6 +-
| 5 files changed, 229 insertions(+), 25 deletions(-)
|
* commit f002fa0d533f25318aef8f3c64982acc0ad3abe9
| Author: awsmith <[email protected]>
| Date: Sun May 29 20:18:09 2022 -0500
|
| [syntax] Begin parser refactor: atoms, dot accesses
|
| Started a refactor of the parser since the old implementation had a
| number of limitations that would present significant difficulties moving
| forward, viz. the immediate reporting of errors and lack of higher-order
| parsing primitives. The new implementation aims to fix all of these
| issues, in addition to being a general code cleanup now that I have a
| much better idea of how I want to structure the parser as a whole.
|
| This commit also includes a small change to the behaviour of the parser:
| the period of a dot access does not attempt to perform error correction
| if it is preceded by a closing delimiter, as that correction could
| introduce ambiguities in complex expressions. Any token other than a
| valid (or nearly valid) field will now return an error of type
| `Dot_missing_field.
|
| src/prelude/reporting.ml | 2 +-
| src/prelude/reporting_intf.ml | 2 +-
| src/syntax/cst.ml | 187 ++-----
| src/syntax/parser.ml | 530 ++++++--------------
| src/syntax/parser.mli | 8 -
| test/parser_data/field_access_decimal.ptest | 5 +
| .../field_access_missing_accessor.ptest | 4 +-
| .../field_access_missing_accessor_2.ptest | 8 +-
| test/parser_data/field_access_mixed.ptest | 4 +-
| test/parser_data/field_access_tuple_double.ptest | 8 +-
| test/parser_data/field_access_tuple_single.ptest | 2 +-
| .../malformed_invalid_byte_string.ptest | 2 +-
| .../malformed_invalid_caret_character.ptest | 2 +-
| .../parser_data/malformed_invalid_codepoint.ptest | 2 +-
| test/parser_data/malformed_invalid_digit.ptest | 2 +-
| test/parser_data/malformed_invalid_radix.ptest | 2 +-
| .../malformed_invalid_string_escape.ptest | 2 +-
| .../malformed_overlong_named_character.ptest | 2 +-
| .../malformed_unknown_character_name.ptest | 2 +-
| test/test_parser.ml | 30 +-
| 20 files changed, 237 insertions(+), 569 deletions(-)
|
* commit b6653af3a485ce7383670848914e799bd03845a4
| Author: awsmith <[email protected]>
| Date: Wed May 25 01:52:41 2022 -0500
|
| [test] Add additional parser tests; final newlines
|
| Added some additional parser tests to check edge cases and ensured that
| all test files end with trailing newlines. The shell command that I
| used to perform this modification was:
|
| $ for f in $(ls test/parser_data); do sed -i -e '$a\' $f; done
|
| test/parser_data/atom_nop_parentheses.ptest | 2 +-
| test/parser_data/funcall_complex_head_2.ptest | 2 +-
| test/parser_data/funcall_flag_false.ptest | 2 +-
| test/parser_data/funcall_flag_true.ptest | 2 +-
| test/parser_data/funcall_label_precedence.ptest | 2 +-
| test/parser_data/funcall_label_single.ptest | 2 +-
| test/parser_data/funcall_mixed.ptest | 8 ++++++++
| test/parser_data/funcall_positional_precedence.ptest | 2 +-
| test/parser_data/funcall_positional_single.ptest | 2 +-
| test/parser_data/funcall_punned.ptest | 2 +-
| test/parser_data/infix_compare.ptest | 2 +-
| test/parser_data/infix_compare_dominates_plus.ptest | 2 +-
| test/parser_data/infix_compare_equal.ptest | 4 ++++
| test/parser_data/infix_compare_pipe.ptest | 4 ++++
| test/parser_data/infix_compose.ptest | 2 +-
| test/parser_data/infix_dollar.ptest | 2 +-
| test/parser_data/infix_dollar_dominates_symbolic.ptest | 2 +-
| test/parser_data/infix_exponent.ptest | 2 +-
| test/parser_data/infix_index.ptest | 2 +-
| test/parser_data/infix_plus.ptest | 2 +-
| test/parser_data/infix_symbolic.ptest | 2 +-
| test/parser_data/infix_times.ptest | 2 +-
| test/parser_data/infix_times_dominates_exponent.ptest | 2 +-
| test/test_parser.ml | 3 +++
| 24 files changed, 39 insertions(+), 20 deletions(-)
|
* commit be65be99ef3b707bbb9fbce234dad53f58ad20eb
| Author: awsmith <[email protected]>
| Date: Mon May 23 04:10:33 2022 -0500
|
| [syntax] Implemented function call parsing
|
| Implemented the parsing of function calls, including all of their
| argument types with rudimentary error correction. Hudson's function
| call syntax is similar to other functional languages, not requiring any
| delimiters between arguments: f x y. As in OCaml, function calls bind
| more tightly than all infix operators.
|
| src/prelude/reporting.ml | 1 +
| src/prelude/reporting_intf.ml | 3 +-
| src/syntax/cst.ml | 62 +++++++++++++++++--
| src/syntax/parser.ml | 66 ++++++++++++++++++++-
| test/parser_data/funcall_complex_head.ptest | 3 +
| test/parser_data/funcall_complex_head_2.ptest | 3 +
| test/parser_data/funcall_flag_false.ptest | 3 +
| test/parser_data/funcall_flag_true.ptest | 3 +
| .../parser_data/funcall_label_missing_value.ptest | 5 ++
| .../funcall_label_missing_value_2.ptest | 7 +++
| test/parser_data/funcall_label_multiple.ptest | 4 ++
| test/parser_data/funcall_label_precedence.ptest | 3 +
| test/parser_data/funcall_label_single.ptest | 3 +
| test/parser_data/funcall_positional_multi.ptest | 5 ++
| .../funcall_positional_precedence.ptest | 3 +
| .../funcall_positional_precedence_2.ptest | 4 ++
| test/parser_data/funcall_positional_single.ptest | 3 +
| test/parser_data/funcall_punned.ptest | 3 +
| test/parser_data/infix_dominates_funcall.ptest | 4 ++
| test/test_parser.ml | 27 +++++++++
| 20 files changed, 206 insertions(+), 9 deletions(-)
|
* commit da572bfff2b12d498755704d75dd7a2d65d50d65
| Author: awsmith <[email protected]>
| Date: Sat May 21 23:46:48 2022 -0500
|
| [syntax] Implemented infix operator precedence parsing
|
| Implemented the parsing of infix operators according to a defined
| precedence table. In preparation for the addition of function call
| syntax, I also separated standard infix operators from field accesses:
| the former bind less tightly than function calls, while the latter binds
| more tightly.
|
| src/syntax/cst.ml | 15 ++
| src/syntax/lexer.ml | 9 +-
| src/syntax/parser.ml | 190 ++++++++++++--------
| src/syntax/token.ml | 4 +
| test/parser_data/atom_nop_parentheses.ptest | 3 +
| test/parser_data/delimiter_extra_lparen_3.ptest | 6 -
| test/parser_data/field_access_complex_head.ptest | 3 +
| .../field_access_missing_accessor.ptest | 5 +
| .../field_access_missing_accessor_2.ptest | 7 +
| test/parser_data/infix_compare.ptest | 3 +
| .../infix_compare_dominates_plus.ptest | 4 +
| .../infix_compare_left_associative.ptest | 4 +
| test/parser_data/infix_compose.ptest | 3 +
| .../infix_compose_right_associative.ptest | 4 +
| test/parser_data/infix_dollar.ptest | 3 +
| .../infix_dollar_dominates_symbolic.ptest | 4 +
| .../infix_dollar_left_associative.ptest | 4 +
| test/parser_data/infix_exponent.ptest | 3 +
| .../infix_exponent_dominates_index.ptest | 4 +
| test/parser_data/infix_exponent_override.ptest | 5 +
| test/parser_data/infix_exponent_override_2.ptest | 5 +
| .../infix_exponent_right_associative.ptest | 4 +
| test/parser_data/infix_index.ptest | 3 +
| .../infix_index_left_associative.ptest | 4 +
| test/parser_data/infix_missing_rhs.ptest | 5 +
| test/parser_data/infix_missing_rhs_2.ptest | 6 +
| test/parser_data/infix_plus.ptest | 3 +
| test/parser_data/infix_plus_dominates_times.ptest | 6 +
| .../parser_data/infix_plus_left_associative.ptest | 4 +
| test/parser_data/infix_symbolic.ptest | 3 +
| .../infix_symbolic_dominates_compare.ptest | 4 +
| .../infix_symbolic_left_associative.ptest | 5 +
| test/parser_data/infix_times.ptest | 3 +
| .../infix_times_dominates_exponent.ptest | 4 +
| .../infix_times_left_associative.ptest | 5 +
| test/test_lexer.ml | 5 +-
| test/test_parser.ml | 51 +++++-
| 37 files changed, 311 insertions(+), 92 deletions(-)
|
* commit 2c1a2f17deb5fa3c0744d2233e86c7026e226d09
| Author: awsmith <[email protected]>
| Date: Sun May 15 23:43:41 2022 -0500
|
| [syntax] Added closing delimiter error handling in head position
|
| Added handling of closing delimiters in head-initial position: they are
| always assumed to terminate their enclosing expressions in the immediate
| context and can be handled by higher-level parsers later on in the
| parsing process.
|
| src/syntax/parser.ml | 5 +++++
| test/parser_data/delimiter_extra_lparen_3.ptest | 6 ++++++
| test/test_parser.ml | 3 ++-
| 3 files changed, 13 insertions(+), 1 deletion(-)
|
* commit c697176dd44a55b48523d10c50430f8e2cc5a97d
| Author: awsmith <[email protected]>
| Date: Sun May 15 23:25:16 2022 -0500
|
| [syntax] Added delimiter error correction in infix position
|
| Added correction for delimiter errors preceding binary operators in
| expressions, allowing test delimiter_extra_lparen to pass. Delimiter
| errors in head-initial position, as in "x.)y", are still uncorrected
| since I have not yet determined how they should be handled.
|
| src/syntax/parser.ml | 155 +++++++++++++---------
| test/parser_data/delimiter_extra_lparen_2.ptest | 9 ++
| test/test_parser.ml | 3 +-
| 3 files changed, 106 insertions(+), 61 deletions(-)
|
* commit 393741994bc10307d9e194844a3b3463f95a7ea4
| Author: awsmith <[email protected]>
| Date: Sat May 7 08:13:24 2022 -0500
|
| [syntax] Implemented delimiter error correction in head position
|
| Implemented error correction for extra, missing, or mismatched
| delimiters at the head positions of expressions. With this commit, test
| delimiter_extra_lparen is expected to fail, since it requires token
| deletion in the position of an infix operator rather than an expression
| head.
|
| src/prelude/reporting.ml | 7 +-
| src/prelude/reporting_intf.ml | 3 +
| src/syntax/cst.ml | 10 +-
| src/syntax/lexer.ml | 9 +-
| src/syntax/parser.ml | 112 ++++++++++++++++++--
| test/parser_data/delimiter_extra_lparen.ptest | 7 ++
| .../parser_data/delimiter_mismatched_lparen.ptest | 7 ++
| test/parser_data/delimiter_unmatched_lparen.ptest | 5 +
| .../delimiter_unmatched_lparen_2.ptest | 7 ++
| test/parser_data/field_access_tuple_double.ptest | 1 +
| test/test_parser.ml | 12 ++-
| 11 files changed, 167 insertions(+), 13 deletions(-)
|
* commit b37230f27922359d0f7401da308b309399413f37
| Author: awsmith <[email protected]>
| Date: Thu May 5 16:21:48 2022 -0500
|
| [syntax] Encapsulate common parser state
|
| Encapsulated the common parser state, the current stack of pending
| closing delimiters and the list of tokens that are yet to be parsed,
| into a record to simplify the process of passing it around. I also
| implemented the most barebones form of parenthesis parsing possible: the
| next pending task in this regard is error correction, which will further
| benefit from the state encapsulation.
|
| src/syntax/parser.ml | 114 +++++++++++++--------
| test/parser_data/field_access_tuple_double.ptest | 5 +
| test/test_parser.ml | 1 +
| 3 files changed, 75 insertions(+), 45 deletions(-)
|
* commit c40abc3343108210925d63e53ad3af63e6859075
| Author: awsmith <[email protected]>
| Date: Fri Apr 29 11:52:18 2022 -0500
|
| [meta] Add ppx_blob dependency to build script; indentation
|
| .builds/archlinux.yml | 1 +
| test/parser_data/field_access_mixed.ptest | 12 ++++++------
| 2 files changed, 7 insertions(+), 6 deletions(-)
|
* commit 9feedb84469ea1ee4b7250db5de326e59e12767d
| Author: awsmith <[email protected]>
| Date: Fri Apr 29 11:37:35 2022 -0500
|
| [test] Use s-expression validation in parser tests
|
| The difficulty of writing complex nested structures in OCaml has been
| discouraging me from writing particularly complex parser tests. As more
| complex structures and programs will have to be parsed in the near
| future, I have migrated the parser testing infrastructure to compare the
| sexp form of parsed expressions to an expected form loaded from a
| string. Provided that the serialised sexps continue to preserve the CST
| structure with a reasonable degree of fidelity (as is currently the
| plan), this new test format should encourage me to write more detailed
| tests and allow for tests to be reused between languages in the future.
|
| dune-project | 1 +
| test/dune | 6 +-
| test/parser_data/atom_byte_string_literal.ptest | 3 +
| test/parser_data/atom_character_literal.ptest | 3 +
| test/parser_data/atom_identifier.ptest | 3 +
| test/parser_data/atom_integer_literal.ptest | 3 +
| test/parser_data/atom_string_literal.ptest | 3 +
| test/parser_data/field_access_mixed.ptest | 9 ++
| test/parser_data/field_access_record_deep.ptest | 15 ++++
| test/parser_data/field_access_record_double.ptest | 4 +
| test/parser_data/field_access_record_single.ptest | 3 +
| test/parser_data/field_access_tuple_single.ptest | 3 +
| .../malformed_invalid_byte_string.ptest | 5 ++
| .../malformed_invalid_caret_character.ptest | 5 ++
| .../parser_data/malformed_invalid_codepoint.ptest | 5 ++
| test/parser_data/malformed_invalid_digit.ptest | 5 ++
| test/parser_data/malformed_invalid_radix.ptest | 5 ++
| .../malformed_invalid_string_escape.ptest | 5 ++
| .../malformed_overlong_named_character.ptest | 5 ++
| .../malformed_unknown_character_name.ptest | 5 ++
| test/test_parser.ml | 91 ++++++++-------------
| 21 files changed, 128 insertions(+), 59 deletions(-)
|
* commit 205a80869d8bd578219b074f9787a0b38b946307
| Author: awsmith <[email protected]>
| Date: Fri Apr 29 09:29:43 2022 -0500
|
| [syntax] Implemented parsing of field and tuple accesses
|
| Implemented a parser for record field and tuple index accesses using dot
| syntax (x.y). I have also set up the infrastructure for a Pratt parser,
| which I shall use to parse all other expression types.
|
| Known issue: consecutive tuple field accesses of the form x.0.1 lex to
| the sequence [Identifier; Period; Decimal], meaning that they do not
| register as field accesses. Since the very concept of implicitly
| unwrapping a nested tuple in this way feels somewhat improper, I
| consider this restriction to be a feature rather than a bug. If
| absolutely necessary, such expressions may be explicitly parenthesised:
| (x.0).1
|
| src/prelude/reporting.ml | 3 +-
| src/prelude/reporting_intf.ml | 3 +-
| src/syntax/cst.ml | 96 +++++++++++++------------
| src/syntax/parser.ml | 155 ++++++++++++++++++++++++++++------------
| src/syntax/parser.mli | 3 +-
| src/syntax/token.ml | 32 +++++----
| test/test_parser.ml | 81 +++++++++++----------
| 7 files changed, 230 insertions(+), 143 deletions(-)
|
* commit 55d74768e3ba1674d6fe1a04af983ef34f55e366
| Author: awsmith <[email protected]>
| Date: Thu Apr 28 09:49:23 2022 -0500
|
| [prelude, syntax] Add modular structure to Cst, Sexp, Token
|
| Added an additional layer of modular structure to Cst and Token,
| avoiding the excessive pollution of their global namespaces by to_sexp
| and equal functions. To aid in defining pretty-print functions,
| Prelude.Sexp now provides a functor Enhance whose results are intended
| to be included in modules that have to_sexp functions defined.
|
| Furthermore, I decided to keep ppx_deriving.eq as a dependency to avoid
| writing an excessive amount of boilerplate for equality predicates.
|
| src/prelude/extensions.ml | 71 ++++++++---
| src/syntax/cst.ml | 75 +++++-------
| src/syntax/dune | 2 +-
| src/syntax/lexer.ml | 26 ++--
| src/syntax/lexer.mli | 4 +-
| src/syntax/parser.ml | 10 +-
| src/syntax/parser.mli | 2 +-
| src/syntax/token.ml | 293 +++++++++++++++++++++++---------------------
| test/test_lexer.ml | 7 +-
| test/test_parser.ml | 10 +-
| 10 files changed, 269 insertions(+), 231 deletions(-)
|
* commit ee5e1f06ecff5b8dcf3570df4c5765050da2edf9
| Author: awsmith <[email protected]>
| Date: Wed Apr 27 20:23:27 2022 -0500
|
| [syntax] Migrate ppx_deriving.show to s-expressions
|
| In an effort to remove ppx_deriving as a dependency since it is no
| longer actively maintained and does not really allow AST nodes to be
| formatted in a reasonable way, I am migrating all uses of it to
| handwritten functions. In this commit, I have migrated all uses of
| ppx_deriving.show to use Containers' Sexp module, allowing for both
| pretty-printing and the construction of s-expressions for other
| purposes.
|
| src/prelude/extensions.ml | 14 ++++-
| src/syntax/cst.ml | 43 ++++++++++++---
| src/syntax/lexer.ml | 3 +-
| src/syntax/token.ml | 124 +++++++++++++++++++++++++++++++++++++++++---
| test/test_lexer.ml | 5 +-
| 5 files changed, 170 insertions(+), 19 deletions(-)
|
* commit 683c0696588e0a59ca76bbfd81c47e8a138b6755
| Author: awsmith <[email protected]>
| Date: Wed Apr 27 18:43:44 2022 -0500
|
| [syntax] Implement parsing of named expressions
|
| Implemented the parsing of named expressions, which consist of
| identifiers and dot accesses (x.y.z). Also reworked the reporting
| infrastructure slightly to allow for errors from both the lexer and
| parser to be reported, which further required me to normalise the Lexer
| interface to always return Source_location.t rather than
| Lexgen_intf.location. Should these changes be split into multiple
| commits? Probably, but eh...
|
| src/prelude/reporting.ml | 7 ++--
| src/prelude/reporting.mli | 6 ++--
| src/prelude/reporting_intf.ml | 9 +++--
| src/syntax/cst.ml | 15 +++++----
| src/syntax/lexer.ml | 25 +++++++++-----
| src/syntax/lexer.mli | 5 ++-
| src/syntax/parser.ml | 73 ++++++++++++++++++++++++++++-------------
| src/syntax/token.ml | 4 +--
| test/test_lexer.ml | 7 ++--
| test/test_parser.ml | 49 +++++++++++++++++++--------
| 10 files changed, 131 insertions(+), 69 deletions(-)
|
* commit a4eeca9b7e9d5105fe6374b94c85eda55b72ea35
| Author: awsmith <[email protected]>
| Date: Wed Apr 27 13:48:10 2022 -0500
|
| [syntax] Add modules Syntax.Cst.{Lex,Syn}
|
| Added some child modules to the Cst module to allow for some additional
| structure in the main CST nodes. This encapsulation will become
| increasingly necessary as more node types are defined, so it is
| beneficial to add this structure now. Furthermore, this additional
| degree of separation between node types allows for the amount of mutual
| recursion in the CST type definitions to be reduced substantially.
|
| src/prelude/prelude.ml | 1 +
| src/syntax/cst.ml | 54 +++++++++++++++++++++++++++++++++++++-----------
| src/syntax/parser.ml | 18 +++++++++-------
| src/syntax/token.ml | 4 ++--
| test/test_parser.ml | 5 ++---
| 5 files changed, 57 insertions(+), 25 deletions(-)
|
* commit bdb3f2b8543706739ecb72f8e32bcc52beb7b60f
| Author: awsmith <[email protected]>
| Date: Tue Apr 26 23:52:31 2022 -0500
|
| [syntax] Restructure CST nodes
|
| Removed the common structure for CST nodes, since it will be more useful
| to be able to differentiate between constituent tokens than to group
| them together into one list. This change may also remove a level of
| indirection in pattern matching CST nodes, which will substantially