Skip to content

Commit d621702

Browse files
committed
Update parser to 0.10.1
- Add tuples - Transcriptions instead of quotations - New argument composition notation - Double colon notation - Editor improvements
1 parent 158f38f commit d621702

10 files changed

+1160
-922
lines changed

cm-modes/khi.js

+899-847
Large diffs are not rendered by default.

examples/aluminium.a

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
> chemical-symbol: Al
1111
> atomic-number: 13
12-
> stp-phase: solid
12+
> stp-phase: <Solid>
1313
> melting-point: 933.47
1414
> boiling-point: 2743
1515
> density: 2.7
1616
> electron-shells: [2; 8; 3]
1717

1818
# External references
1919
> ext-refs: {
20-
> wikipedia: "https://en.wikipedia.org/wiki/Aluminium"
21-
> snl: "https://snl.no/aluminium"
20+
> wikipedia: \https://en.wikipedia.org/wiki/Aluminium\
21+
> snl: \https://snl.no/aluminium\
2222
}
2323

2424
# Internal references
@@ -46,6 +46,6 @@
4646
<p> In nature, it occurs as the <@>:ion:ion <$>:{<Al>^{3+}}. It constitutes <$>:8.2%
4747
of the earth's crust, making it the most common <@>:metal:metal found there.
4848

49-
...
49+
For example:` ...
5050

5151
}

examples/equations.tex.khi

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ equations and matrices.
1515

1616
# Define a sum-range command.
1717
<def!>:<SumRn>:4:{ # def! is a macro that defines a LaTeX command.
18-
<sum>_{#1}^{`[#2`:#3`]} #4
18+
<sum>_{#1}^{[`#2:`#3]`} #4
1919
}
2020

21-
<def!>:<Log>:0:<>:<operatorname>:Log
21+
<def!>:<Log>:0: <operatorname>:Log
2222

2323
<begin>:equation* <begin>:split
2424

examples/frontpage.html.khi

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
<html>:{
55
<head>:{
66
<title>:{Hello world!}
7-
<script src:script.js>:{~} # {~} denotes an empty element.
7+
<script src:script.js>:{~} # {~} denotes a present but empty element.
88
}
99
<body>:{
1010
<h1 id:main-heading>:{Hello world!}
1111
<p>:{Hello world!}
1212
<img src:frontpage.jpg>
13-
<div class:dark-background>:<>:<p>:{
13+
<div class:dark-background>: <p>:{
1414
This is a paragraph <br>
1515
with a line break.
1616
<em class:italic>:{This text is italic.}
1717
}
18-
<pre>:<>:<code>:<>:<raw!>:<#>
18+
<pre>: <code>: <raw!>:<#>
1919
def fib(n):
2020
if n == 0:
2121
return 0

examples/server-log.khi

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# Server uptime log
22

3-
# This is an example of constructor notation.
4-
# a <> b <> c is equivalent to the tuple [a|b|c]
5-
6-
> 2023-Nov-11 <> 18.56.12 <> Start
7-
> 2023-Nov-13 <> 03.00.01 <> Restart
8-
> 2023-Nov-14 <> 03.00.01 <> Restart
9-
> 2023-Nov-15 <> 03.00.01 <> Restart
10-
> 2023-Nov-16 <> 03.00.02 <> Restart
11-
> 2023-Nov-17 <> 03.00.01 <> Restart
12-
> 2023-Nov-17 <> 19.30.59 <> Stop
13-
> 2023-Nov-20 <> 18.33.30 <> Start
14-
> 2023-Nov-22 <> 03.00.01 <> Restart
15-
> 2023-Nov-23 <> 03.00.01 <> Restart
16-
> 2023-Nov-24 <> 03.00.01 <> Restart
17-
> 2023-Nov-25 <> 03.00.00 <> Restart
18-
> 2023-Nov-25 <> 20.12.12 <> Stop
3+
> 2023-Nov-11 18.56.12 :: <Start>
4+
> 2023-Nov-13 03.00.01 :: <Restart>
5+
> 2023-Nov-14 03.00.01 :: <Restart>
6+
> 2023-Nov-15 03.00.01 :: <Restart>
7+
> 2023-Nov-16 03.00.02 :: <Restart>
8+
> 2023-Nov-17 03.00.01 :: <Restart>
9+
> 2023-Nov-17 19.30.59 :: <Stop>
10+
> 2023-Nov-20 18.33.30 :: <Start>
11+
> 2023-Nov-22 03.00.01 :: <Restart>
12+
> 2023-Nov-23 03.00.01 :: <Restart>
13+
> 2023-Nov-24 03.00.01 :: <Restart>
14+
> 2023-Nov-25 03.00.00 :: <Restart>
15+
> 2023-Nov-25 20.12.12 :: <Stop>

examples/style.khi

+54-29
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@
3636
]
3737
}
3838

39-
## Tuples
39+
## Rows
4040

41-
### Unit tuple
41+
### Empty row
4242
[]
4343

44-
### Singleline tuple, short inline entries
44+
### Singleline row, short inline entries
4545
[a|b|c|d|e]
4646

47-
### Singleline tuple, longer inline entries
48-
[a a a | b b b b | c | d d d d d d d | e]
47+
### Singleline row, longer inline entries
48+
[ a a a | b b b b | c | d d d d d d d | e ]
4949

50-
### Multiline tuple, singleline entries
50+
### Multiline row, singleline entries
5151
[
5252
> a a a
5353
| b b b
5454
| c c c
5555
]
5656

57-
### Multiline tuple, multiline entries
57+
### Multiline row, multiline entries
5858
[
5959
> [
6060
a a a
@@ -72,7 +72,7 @@
7272
]
7373
]
7474

75-
## Lists
75+
## Lists / Columns
7676

7777
### Empty list
7878
[]
@@ -133,9 +133,9 @@
133133

134134
### Multiline table, singleline rows, longer & mostly same width columns
135135
[
136-
| a | b b b| c c |
137-
| d | e e e e| f f |
138-
| g | h h h h| i i |
136+
| a | b b b | c c |
137+
| d | e e e e | f f |
138+
| g | h h h h | i i |
139139
]
140140

141141
### Multiline table, singleline rows, differing width columns
@@ -165,20 +165,35 @@
165165
| f
166166
]
167167

168-
## Pattern
168+
## Tagged value
169169

170-
### Inline pattern within expression
171-
<P>:a:{b b}:c
170+
### Inline tag
171+
<A>:a:{b b}:c
172172

173-
### Multiline pattern within expression
174-
<P>:a:{b b}:{
173+
### Multiline tag, singleline header
174+
<A>:a:{b b}:{
175175
c c c
176+
c c c
177+
}
178+
179+
### Tag composition
180+
<A>:b:c: <D>:e: <F>:g:h: <I>:{
181+
j j j j j
176182
}
177183

184+
### Singleline tag expression
185+
<A> :: a :: b b :: c
186+
187+
### Multiline tag, singleline header expression
188+
### :: are only on the first line.
189+
<A> :: a :: b b b b :: [
190+
c c c c c
191+
]
192+
178193
## Expressions
179194

180195
### Inline expression
181-
{a a a{} {c c c} d d d}
196+
{a a a[] {c c c} d d d}
182197

183198
### Multiline expression
184199
{
@@ -188,22 +203,32 @@
188203
k k k k
189204
}
190205

191-
## Constructor notation
206+
## Tuple
192207

193-
### Inline pattern constructor
194-
<P> <> a <> b b <> c
208+
### Inline tuple
209+
<>:a:{b b b}:[c]
195210

196-
### Multiline pattern constructor
197-
<P> <> a <> b b b b <> [
211+
### Multiline tuple, singleline header
212+
<>:a:{b b b}:[
198213
c c c c c
214+
c c c c c c
199215
]
200216

201-
### Singleline tuple constructor
202-
a a a <> b b <> c c c c c <> d <> e e e
217+
### Multiline tuple expression
218+
:: a a a
219+
:: {b b b}
220+
:: c
221+
:: {
222+
d d d d d
223+
d d d
224+
}
225+
:: e e e e
226+
227+
### Singleline tuple expression
228+
a a a :: {b b b} :: c c
203229

204-
### Multiline tuple constructor
205-
a a a <> {b b b} <> c <> d d <> {
206-
g g
207-
g g
208-
g g g
230+
### Multiline tuple, singleline header expression
231+
a a a :: {b b b} :: c :: {
232+
d d d d d
233+
d d d
209234
}

examples/words.khi

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
# Sample from grammatical word list
22

3-
> <Verb> <> clear <> <Regular> <> <Transitive> <> {
4-
> conjugation: <a>:to clear <> cleared <> cleared <> clearing
3+
> <Verb> :: clear :: {
4+
> regularity: <Regular>
5+
> transitivity: <Transitive>
6+
> conjugation: <a>:to clear :: cleared :: cleared :: clearing
57
> definitions: [
68
> To empty the contents of.
79
> To remove obstructions from.
810
> To make transparent.
911
]
1012
}
11-
> <Verb> <> burn <p>:down <> <Irregular> <> <Transitive> <> {
12-
> conjugation: <a>:to burn <p>:down <> burnt <p>:down <> burnt <p>:down <> burning <p>:down
13+
> <Verb> :: burn <p>:down :: {
14+
> regularity: <Irregular>
15+
> transitivity: <Transitive>
16+
> conjugation:
17+
:: <a>:to burn <p>:down
18+
:: burnt <p>:down
19+
:: burnt <p>:down
20+
:: burning <p>:down
1321
> definition: To burn completely.
1422
}
15-
> <Noun> <> firewood <> <Uncountable> <> {
16-
> declension: firewood <> firewood
23+
> <Noun> :: firewood :: {
24+
> countability: <Uncountable>
25+
> declension: firewood :: firewood
1726
> definition: Wood burned to fuel a fire.
1827
}

0 commit comments

Comments
 (0)