3 ms·
> Spock being impressive DSLs, very natural/readable The Spock syntax isn't a DSL, it hacks the ossified restrictions of the Antlr 2 based Groovy syntax to pul
by vorg 12y ago
> Spock being impressive DSLs, very natural/readable
The Spock syntax isn't a DSL, it hacks the ossified restrictions of the Antlr 2 based Groovy syntax to pull off tricks like overloading the | operator to give the appearance of tables, and the break/continue labels via an AST plugin to replace function calls with sections, as in this oft-quoted example from their website:
expect:
Math.max(a, b) == c
where:
a | b | c
1 | 3 | 3
7 | 4 | 4
0 | 0 | 0