Created
October 24, 2018 18:14
-
-
Save Dubhead/84a1d9a6fcef57d8448265f8f90880b9 to your computer and use it in GitHub Desktop.
term-rewriting rule in Kit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cat src/test.kit | |
rules AddOne { | |
(ADD_ONE(${x: Int})) => x + 1; | |
} | |
using rules AddOne; | |
function main() { | |
var foo = ADD_ONE(42_i); | |
} | |
% | |
% kitc test | |
[2018-10-25 03:11:49.492853] ===> parsing and building module graph | |
[2018-10-25 03:11:49.508318] ===> processing C includes | |
[2018-10-25 03:11:49.666179] ===> resolving module types | |
[2018-10-25 03:11:49.691016] ===> typing module content | |
---------------------------------------- | |
Error: src/test.kit:7: Unknown identifier: ADD_ONE | |
@src/test.kit:7:15-21 | |
7 var foo = ADD_ONE(42_i); | |
^^^^^^^ | |
[2018-10-25 03:11:49.709233] ===> total time: 0.216120481s | |
[2018-10-25 03:11:49.709540] ERR: compilation failed (1 errors) | |
% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment