File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ exports[`examples > fibonacci.plz --input="not a number" > stderr 1`] = `
33`;
44
55exports[`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
1414exports[`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
5959exports[`examples > fibonacci.plz > stdout 1`] = `
60- "missing input argument"
60+ "missing -- input argument"
6161
6262`;
6363
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 zeroOrMore ,
1212} from '@matt.kantor/parsing'
1313import {
14+ arrow ,
1415 atSign ,
1516 backslash ,
1617 closingBlockCommentDelimiter ,
@@ -32,6 +33,7 @@ import { whitespace } from './trivia.js'
3233export type Atom = string
3334
3435const 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 ( '#' ) ,
You can’t perform that action at this time.
0 commit comments