Skip to content

Commit

Permalink
🦛
Browse files Browse the repository at this point in the history
  • Loading branch information
AlephAlpha committed Aug 27, 2024
1 parent 318c93d commit e32ad9e
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* New builtin: `\lastValue`.
* A new mode `last` is added. It outputs the last possible result. You can switch to this mode by the `-t` flag in the command line or the `\Mode last` command in the REPL.
* Now input can have leading and trailing spaces. The interpreter will trim them when parsing.

### Breaking changes

Expand Down
1 change: 1 addition & 0 deletions analysis/corpus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ oĉ~z
Ħ±
ᵉᵑ{ˣ∙ɔᵈç}T
ᵐĈ
ˡ{v¦
Ṁ→ᵒÇ∏ƃ
ʷ{į1?-ň
O:Ŝ≡$Ðål
Expand Down
8 changes: 4 additions & 4 deletions analysis/freq_1gram.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ : 82
{ : 83
$ : 56
= : 55
: : 50
Expand Down Expand Up @@ -61,6 +61,7 @@ q : 12
∆ : 12
_ : 12
ʷ : 11
ˡ : 11
Ţ : 11
Q : 11
r : 11
Expand All @@ -69,7 +70,6 @@ r : 11
∏ : 11
J : 11
ũ : 10
ˡ : 10
E : 10
≥ : 10
ŋ : 10
Expand Down Expand Up @@ -100,6 +100,7 @@ H : 8
£ : 8
Ø : 8
ɗ : 8
¦ : 8
ƒ : 8
4 : 8
¿ : 8
Expand All @@ -109,10 +110,10 @@ H : 8
/ : 7
Ħ : 7
Ĭ : 7
¦ : 7
Ĉ : 7
ä : 7
Ř : 7
v : 7
¢ : 7
ᵏ : 6
Ö : 6
Expand All @@ -136,7 +137,6 @@ D : 6
0 : 6
B : 6
b : 6
v : 6
ƀ : 5
I : 5
y : 5
Expand Down
5 changes: 3 additions & 2 deletions analysis/freq_2gram.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ᶦ{ : 12
ᵖ{ : 11
ʷ{ : 9
ˡ{ : 8
ˡ{ : 9
ᶠ{ : 7
{$ : 6
ᵑ{ : 6
Expand Down Expand Up @@ -184,6 +184,7 @@ $đ : 2
∙+ : 2
ᵖf : 2
_= : 2
{v : 2
-ň : 2
0* : 2
$ᶻ : 2
Expand Down Expand Up @@ -637,6 +638,7 @@ j1 : 1
ç} : 1
}T : 1
ᵐĈ : 1
v¦ : 1
→ᵒ : 1
ᵒÇ : 1
Ç∏ : 1
Expand Down Expand Up @@ -1329,7 +1331,6 @@ h= : 1
Ť$ : 1
$ḟ : 1
0ʷ : 1
{v : 1
v< : 1
<Ë : 1
Ë} : 1
Expand Down
2 changes: 2 additions & 0 deletions analysis/freq_3gram.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ j1Ĉ : 1
ɔᵈç : 1
ᵈç} : 1
ç}T : 1
ˡ{v : 1
{v¦ : 1
Ṁ→ᵒ : 1
→ᵒÇ : 1
ᵒÇ∏ : 1
Expand Down
1 change: 1 addition & 0 deletions analysis/freq_4gram.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ oĉ~z : 1
∙ɔᵈç : 1
ɔᵈç} : 1
ᵈç}T : 1
ˡ{v¦ : 1
Ṁ→ᵒÇ : 1
→ᵒÇ∏ : 1
ᵒÇ∏ƃ : 1
Expand Down
2 changes: 1 addition & 1 deletion analysis/particles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ particle : with "{" / total
ᵏ : 4 / 6
ᶠ : 7 / 10
ʸ : 3 / 4
ˡ : 8 / 10
ˡ : 9 / 11
ʷ : 9 / 11
ᶦ : 12 / 13
8 changes: 7 additions & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ data RunOnce = RunOnce
}

optRunOnce :: Parser RunOnce
optRunOnce = RunOnce <$> optCode <*> optInput <*> optMode <*> optMultiple <*> optLimit
optRunOnce =
RunOnce
<$> optCode
<*> optInput
<*> optMode
<*> optMultiple
<*> optLimit

data Opts = Opts RunOnce | Repl | DocBuiltin | DocCodePage | Version

Expand Down
11 changes: 6 additions & 5 deletions src/Nekomata/Parser/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ parseData' =
-- | Parse a Nekomata input
parseInput :: Parser [Data]
parseInput =
parseData
`endBy` (try (spaces >> char ',' >> spaces) <|> spaces)
<* spaces
<* eof
<?> "Nekomata input"
spaces
>> parseData
`endBy` (try (spaces >> char ',' >> spaces) <|> spaces)
<* spaces
<* eof
<?> "Nekomata input"
12 changes: 12 additions & 0 deletions test/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,18 @@ testEval = describe "Solutions to Code Golf Stack Exchange challenges" $ do
, ("[1,2,2,4,4,4,4]", all_ ["[1,2,2,4,4,4,4]"])
, ("[1,2,2,1,4,8,1]", all_ ["[3,2,2,3,1,1,3]"])
]
describe "q224278: Count the trailing zeros" $ do
specEval
"ˡ{v¦"
[ ("512 2", all_ ["9"])
, ("248 2", all_ ["3"])
, ("364 265", all_ ["0"])
, ("764 2", all_ ["2"])
, ("336 284", all_ ["0"])
, ("517 422", all_ ["0"])
, ("554 37", all_ ["0"])
, ("972 3", all_ ["5"])
]
describe "q225203: Delannoy numbers" $ do
specEval
"Ṁ→ᵒÇ∏ƃ"
Expand Down

0 comments on commit e32ad9e

Please sign in to comment.