-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcommands.t
59 lines (40 loc) · 1.17 KB
/
commands.t
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
Testing parsing of commands, on the command line:
$ narya -e 'axiom A : Type'
$ narya -e 'axiom A : Type axiom a : A'
$ narya -e 'def A : Type := Type'
$ narya -e 'axiom A : Type' -e 'axiom a : A'
$ narya -e 'axiom A : Type' -e 'def B : Type := A'
$ narya -e 'axiom A : Type' -e 'echo A'
A
: Type
And in files:
$ cat >test.ny <<EOF
> axiom A:Type
> axiom a:A
> def B : Type := A
> echo B
> EOF
Now we run it:
$ narya test.ny
A
: Type
Can we parse empty things?
$ narya -e ''
$ cat >test.ny <<EOF
> EOF
$ narya test.ny
Redefining commands.
If the two strings are *identical*, then I think OCaml represents them
as the same object in memory, causing Asai to think they are the same
input source, producing a confusing message. I think this is unlikely
to ever arise in practice, so it's not worth trying to fix; for our
test we just add some spaces to one of them to make them different.
$ narya -e 'axiom A:Type' -e 'axiom A : Type'
→ error[E2100]
■ command-line exec string
1 | axiom A : Type
^ name already defined: A
■ command-line exec string
1 | axiom A:Type
^ previous definition
[1]