Skip to content

Commit d98d6f2

Browse files
authored
Merge pull request #73 from mkantor/miscellanea
Miscellaneous minor improvements
2 parents 3be414a + 4cb4bc2 commit d98d6f2

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

examples/.snapshot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exports[`examples > fibonacci.plz --input="not a number" > stderr 1`] = `
33
`;
44

55
exports[`examples > fibonacci.plz --input="not a number" > stdout 1`] = `
6-
"input must be a natural number"
6+
"--input must be a natural number"
77

88
`;
99

@@ -12,7 +12,7 @@ exports[`examples > fibonacci.plz --input=-1 > stderr 1`] = `
1212
`;
1313

1414
exports[`examples > fibonacci.plz --input=-1 > stdout 1`] = `
15-
"input must be a natural number"
15+
"--input must be a natural number"
1616

1717
`;
1818

@@ -57,7 +57,7 @@ exports[`examples > fibonacci.plz > stderr 1`] = `
5757
`;
5858

5959
exports[`examples > fibonacci.plz > stdout 1`] = `
60-
"missing input argument"
60+
"missing --input argument"
6161

6262
`;
6363

examples/fibonacci.plz

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
fibonacci: n =>
33
@if {
4-
condition: :n < 2
4+
:n < 2
55
then: :n
66
else: :fibonacci(:n - 1) + :fibonacci(:n - 2)
77
}
88

99
input: @runtime { context =>
10+
// read --input from command-line arguments
1011
:context.arguments.lookup(input)
1112
}
1213

1314
output: :input match {
14-
none: _ => "missing input argument"
15+
none: _ => "missing --input argument"
1516
some: input => @if {
16-
condition: :natural_number.is(:input)
17+
:natural_number.is(:input)
1718
then: :fibonacci(:input)
18-
else: "input must be a natural number"
19+
else: "--input must be a natural number"
1920
}
2021
}
2122
}.output

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"type": "module",
55
"bin": {
6-
"please": "./please"
6+
"please": "please"
77
},
88
"scripts": {
99
"0": "node ./dist/language/cli/0.js",

src/language/parsing/atom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
zeroOrMore,
1212
} from '@matt.kantor/parsing'
1313
import {
14+
arrow,
1415
atSign,
1516
backslash,
1617
closingBlockCommentDelimiter,
@@ -32,6 +33,7 @@ import { whitespace } from './trivia.js'
3233
export type Atom = string
3334

3435
const atomComponentsRequiringQuotation = [
36+
arrow,
3537
atSign,
3638
backslash,
3739
closingBlockCommentDelimiter,
@@ -46,10 +48,8 @@ const atomComponentsRequiringQuotation = [
4648
singleLineCommentDelimiter,
4749
whitespace,
4850

49-
// Reserved to allow symbols like `=>` to not be conflated with atoms:
50-
literal('='),
51-
5251
// Reserved for future use:
52+
literal('='),
5353
literal('['),
5454
literal(']'),
5555
literal('#'),

0 commit comments

Comments
 (0)