--
---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/5ec10747-9614-41fb-b2fa-086ae035557dn%40googlegroups.com.
Hi Youssef,
Congratulations: tree-sitter-ring is an impressive piece of work, and the kind that widens what is possible around a language rather than just adding to it.
I spent some time inside the grammar rather than only reading the announcement, and what convinced me is a small thing: the identifier class defined by exclusion. It matches Ring's own scanner character for character (the sort of detail you only get right by reading the sources). The same care shows in using an external scanner for the same-line rules, and in putting your own corpus tests next to the real test suite and a few thousand samples.
I have been poking at Ring from a different angle for a while, and that has meant checking a good many of the language's finer points against the interpreter. Two of them touch your grammar, so let me put them on the table plainly.
1) The same-line rule for postfix. In Ring the end of a line does not always close an expression: after the closing parenthesis of a call, or the closing bracket of an index, the parser keeps looking for a further index or call on the lines that follow, and neither a semicolon nor a blank line stops it, since for the scanner they are the same token. After an identifier, a string, a number or a ++ it does stop; and the bracket that closes a list literal does not arm it either, which is why general/test110 in the suite parses the way it does. So the restriction you enforce holds in most positions and is a little too strict after those two closers. Nothing in the suite depends on the difference. It would begin to matter for the formatter and the structural search-and-replace you list among the use cases, where the tree decides what gets rewritten.
2) The counter-guarded keywords. I suspect that limitation may be removable. Ring blocks the demotion of ok, but, on, case, off, catch, done, again, else and other using the parser's own nesting counters (compile-time state, the same kind your external scanner already keeps for parentheses) rather than anything from the running program. The rule, as far as I have been able to check it, is that one of those words stays a keyword for the whole extent of the construct that uses it, its condition included, and it stays one inside nested constructs of other kinds; else and other need both the if and the switch nesting to be closed. There is one fixed exception: in load again "file.ring" the word again is always part of the command.
Best wishes for the editor integrations: that is where most people will feel the difference.
Cesare G. Fanelli
(the G could be Y :D )
Hi Youssef,
Glad it was useful, and good luck with the work.
It is a pleasure to read the announcements of your projects: they are very interesting and useful, and I am already curious about the next one.
Best regards,
Cesare