I'm working on lesson 10 of the K introduction. Can't figure out an error I'm getting. I have the file lesson-10.k
with the following contents (simplified for now to demonstrate the error):
module LESSON-10
imports STRING
syntax String ::= nonsentence(String) [function]
rule nonsentence(S) => substrString(S, 0, 5)
rule nonsentence(_) => " ." [owise]
endmodule
When I try to compile it as follows:
kompile lesson-10.k
I get this error - compiler seems to be flagging the argument 0
to substrString
as unexpected:
[Error] Inner Parser: Scanner error: unexpected character sequence '0'.
Source(/home/bhandalc/k/lesson-10/lesson-10.k)
Location(5,42,5,43)
[Error] Compiler: Had 1 parsing errors.
I'm working on WSL with Ubuntu focal.