Skip to content

Commit 80d5402

Browse files
authored
Merge pull request #36 from mkantor/housekeeping
Miscellaneous housekeeping
2 parents 95665f8 + 8694413 commit 80d5402

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ data representation implied by the fact that a value is an atom (e.g. the atom
4949
`2` may be an integer in memory).
5050

5151
Bare words not containing any
52-
[reserved character sequences](./src/language/parsing/atom.ts#L24-L46) are
52+
[reserved character sequences](./src/language/parsing/atom.ts#L19-L41) are
5353
atoms:
5454

5555
```
@@ -210,8 +210,8 @@ languages:
210210

211211
`plz` has a specific textual representation, but `plo` & `plt` could be encoded
212212
in any format in which hierarchial key/value pairs of strings are representable
213-
(currently only JSON is implemented, but YAML, TOML, HOCON, BSON, MessagePack,
214-
etc could be supported).
213+
(currently only JSON is implemented, but YAML, TOML, HOCON, BSON, S-expressions,
214+
MessagePack, CBOR, etc could be supported).
215215

216216
Take this example `plz` program:
217217

src/end-to-end.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,17 @@ testCases(endToEnd, code => code)('end-to-end tests', [
120120
[':flow({ :atom.append(a) :atom.append(b) })(z)', either.makeRight('zab')],
121121
[
122122
`{
123-
// foo: bar
124-
"static data":"blah blah blah"
125-
"evaluated data": {
126-
0:@runtime
127-
function:{
128-
0:@apply
129-
function:{0:@lookup query:{0:object 1:lookup}}
130-
argument:"key which does not exist in runtime context"
131-
}
123+
// foo: bar
124+
"static data":"blah blah blah"
125+
"evaluated data": {
126+
0:@runtime
127+
function:{
128+
0:@apply
129+
function:{0:@lookup query:{0:object 1:lookup}}
130+
argument:"key which does not exist in runtime context"
132131
}
133-
}`,
132+
}
133+
}`,
134134
either.makeRight({
135135
'static data': 'blah blah blah',
136136
'evaluated data': { tag: 'none', value: {} },

src/language/parsing/atom.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ import { whitespace } from './trivia.js'
1616

1717
export type Atom = string
1818

19-
export const isAtom = (value: unknown): value is Atom =>
20-
typeof value === 'string'
21-
22-
export const unit = '' as const
23-
2419
const atomComponentsRequiringQuotation = [
2520
whitespace,
2621
literal('"'),

src/language/parsing/molecule.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import { trivia } from './trivia.js'
2020

2121
export type Molecule = { readonly [key: Atom]: Molecule | Atom }
2222

23-
export const unit: Molecule = {}
24-
2523
export const moleculeParser: Parser<Molecule> = lazy(
2624
() => potentiallySugaredMolecule,
2725
)

src/language/semantics/function-node.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {
77
UnserializableValueError,
88
} from '../errors.js'
99
import type { Atom } from '../parsing.js'
10+
import type { ObjectNode } from './object-node.js'
1011
import {
1112
nodeTag,
1213
serialize,
@@ -21,7 +22,7 @@ export type FunctionNode = ((
2122
readonly [nodeTag]: 'function'
2223
readonly parameterName: Option<Atom>
2324
readonly signature: FunctionType['signature']
24-
readonly serialize: () => Either<UnserializableValueError, SemanticGraph>
25+
readonly serialize: () => Either<UnserializableValueError, ObjectNode>
2526
}
2627

2728
export const isFunctionNode = (node: SemanticGraph) =>

0 commit comments

Comments
 (0)