Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Commit cd75f8b

Browse files
committed
chore: update lean-toolchain
1 parent 0488054 commit cd75f8b

File tree

5 files changed

+58
-20
lines changed

5 files changed

+58
-20
lines changed

LeanInk/Analysis/DataTypes.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Positional (α : Type u) where
1717
tailPos : α -> String.Pos
1818

1919
namespace Positional
20-
def length { α : Type u } [Positional α] (self : α) : Nat := (Positional.tailPos self) - (Positional.headPos self)
20+
def length { α : Type u } [Positional α] (self : α) : String.Pos := (Positional.tailPos self) - (Positional.headPos self)
2121

2222
def smallest? { α : Type u } [Positional α] (list : List α) : Option α := List.foldl (λ a y =>
2323
let y : α := y -- We need to help the compiler a bit here otherwise it thinks `y : Option α`

LeanInk/Analysis/SemanticToken.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace SemanticTraversalInfo
4848

4949
def highlightKeyword (headPos tailPos : String.Pos) (stx: Syntax) : AnalysisM (List Token) := do
5050
if let Syntax.atom info val := stx then
51-
if (val.length > 0 && val[0].isAlpha) || (val.length > 1 && val[0] = '#' && val[1].isAlpha) then
51+
if (val.length > 0 && val[0].isAlpha) || (val.length > 1 && val[0] = '#' && val[1].isAlpha) then
5252
return genSemanticToken stx SemanticTokenType.keyword
5353
return []
5454

LeanInk/Annotation/Alectryon.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def minPos (x y : String.Pos) := if x < y then x else y
151151
def maxPos (x y : String.Pos) := if x > y then x else y
152152

153153
partial def genTokens (contents : String) (head : String.Pos) (offset : String.Pos) (l : List Token) (compounds : List (Compound Analysis.Token)) : AnalysisM (List Token) := do
154-
let textTail := contents.utf8ByteSize + offset
154+
let textTail := contents.utf8ByteSize + offset
155155
let mut head : String.Pos := head
156156
let mut tokens : List Token := []
157157
for x in compounds do
@@ -171,7 +171,7 @@ partial def genTokens (contents : String) (head : String.Pos) (offset : String.P
171171
match text with
172172
| none => logInfo s!"Empty 1 {text} {x.headPos} {tail}"
173173
| some text => tokens := { raw := text }::tokens
174-
match extractContents offset contents head (contents.utf8ByteSize + offset) with
174+
match extractContents offset contents head (contents.utf8ByteSize + offset) with
175175
| none => return tokens.reverse
176176
| some x => return ({ raw := x }::tokens).reverse
177177

@@ -233,7 +233,7 @@ Generates AlectryonFragments for the given CompoundFragments and input file cont
233233
def annotateFileWithCompounds (l : List Alectryon.Fragment) (contents : String) : List Annotation -> AnalysisM (List Fragment)
234234
| [] => pure l
235235
| x::[] => do
236-
let fragment ← genFragment x contents.utf8ByteSize (contents.extract x.sentence.headPos contents.utf8ByteSize)
236+
let fragment ← genFragment x contents.utf8ByteSize (contents.extract x.sentence.headPos contents.utf8ByteSize)
237237
return l.append [fragment]
238238
| x::y::ys => do
239239
let fragment ← genFragment x y.sentence.headPos (contents.extract x.sentence.headPos (y.sentence.headPos))

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:nightly-2022-03-07
1+
leanprover/lean4:nightly-2022-03-21

test/bench/Basic.lean.leanInk.expected

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3637,7 +3637,7 @@
36373637
"docstring": null,
36383638
"_type": "token"},
36393639
{"typeinfo":
3640-
{"type": "{α : Type ?u.2688} → [self : BEq α] → α → α → Bool",
3640+
{"type": "{α : Type ?u.2646} → [self : BEq α] → α → α → Bool",
36413641
"name": "BEq.beq",
36423642
"_type": "typeinfo"},
36433643
"semanticType": null,
@@ -20864,11 +20864,23 @@
2086420864
"_type": "token"},
2086520865
{"typeinfo": null,
2086620866
"semanticType": null,
20867-
"raw": ", _, ",
20867+
"raw": ", ",
2086820868
"link": null,
2086920869
"docstring": null,
2087020870
"_type": "token"},
20871-
{"typeinfo": {"type": "0 < x✝", "name": "h", "_type": "typeinfo"},
20871+
{"typeinfo": {"type": "Nat", "name": "_", "_type": "typeinfo"},
20872+
"semanticType": null,
20873+
"raw": "_",
20874+
"link": null,
20875+
"docstring": null,
20876+
"_type": "token"},
20877+
{"typeinfo": null,
20878+
"semanticType": null,
20879+
"raw": ", ",
20880+
"link": null,
20881+
"docstring": null,
20882+
"_type": "token"},
20883+
{"typeinfo": {"type": "0 < ?m.13614", "name": "h", "_type": "typeinfo"},
2087220884
"semanticType": "Name.Variable",
2087320885
"raw": "h",
2087420886
"link": null,
@@ -21046,7 +21058,7 @@
2104621058
"docstring": null,
2104721059
"_type": "token"},
2104821060
{"typeinfo": {"type": "a < b", "name": "this", "_type": "typeinfo"},
21049-
"semanticType": "Name.Variable",
21061+
"semanticType": "Keyword",
2105021062
"raw": "this",
2105121063
"link": null,
2105221064
"docstring": null,
@@ -22734,7 +22746,7 @@
2273422746
"_type": "token"},
2273522747
{"typeinfo":
2273622748
{"type": "Exists fun k => n + k = m", "name": "this", "_type": "typeinfo"},
22737-
"semanticType": "Name.Variable",
22749+
"semanticType": "Keyword",
2273822750
"raw": "this",
2273922751
"link": null,
2274022752
"docstring": null,
@@ -22769,7 +22781,7 @@
2276922781
"link": null,
2277022782
"docstring": null,
2277122783
"_type": "token"},
22772-
{"typeinfo": {"type": "succ n ≤ succ m", "name": "h", "_type": "typeinfo"},
22784+
{"typeinfo": {"type": "n + k = m", "name": "h", "_type": "typeinfo"},
2277322785
"semanticType": "Name.Variable",
2277422786
"raw": "h",
2277522787
"link": null,
@@ -31340,7 +31352,7 @@
3134031352
"link": null,
3134131353
"docstring": null,
3134231354
"_type": "token"},
31343-
{"typeinfo": {"type": "m * n = k * m", "name": "h", "_type": "typeinfo"},
31355+
{"typeinfo": {"type": "n * m = k * m", "name": "h", "_type": "typeinfo"},
3134431356
"semanticType": "Name.Variable",
3134531357
"raw": "h",
3134631358
"link": null,
@@ -32437,7 +32449,7 @@
3243732449
"link": null,
3243832450
"docstring": null,
3243932451
"_type": "token"},
32440-
{"typeinfo": {"type": "i ≤ j", "name": "h", "_type": "typeinfo"},
32452+
{"typeinfo": {"type": "i ≤ succ j", "name": "h", "_type": "typeinfo"},
3244132453
"semanticType": "Name.Variable",
3244232454
"raw": "h",
3244332455
"link": null,
@@ -32724,7 +32736,7 @@
3272432736
"_type": "token"},
3272532737
{"typeinfo":
3272632738
{"type": "n ^ i * 1 ≤ n ^ j * n", "name": "this", "_type": "typeinfo"},
32727-
"semanticType": "Name.Variable",
32739+
"semanticType": "Keyword",
3272832740
"raw": "this",
3272932741
"link": null,
3273032742
"docstring": null,
@@ -35295,7 +35307,7 @@
3529535307
"link": null,
3529635308
"docstring": null,
3529735309
"_type": "token"},
35298-
{"typeinfo": {"type": "i < succ a", "name": "h", "_type": "typeinfo"},
35310+
{"typeinfo": {"type": "succ i = succ a", "name": "h", "_type": "typeinfo"},
3529935311
"semanticType": "Name.Variable",
3530035312
"raw": "h",
3530135313
"link": null,
@@ -35693,7 +35705,7 @@
3569335705
"link": null,
3569435706
"docstring": null,
3569535707
"_type": "token"},
35696-
{"typeinfo": {"type": "succ i < succ a", "name": "h", "_type": "typeinfo"},
35708+
{"typeinfo": {"type": "i < succ a", "name": "h", "_type": "typeinfo"},
3569735709
"semanticType": "Name.Variable",
3569835710
"raw": "h",
3569935711
"link": null,
@@ -41670,7 +41682,20 @@
4167041682
"_type": "token"},
4167141683
{"typeinfo": null,
4167241684
"semanticType": null,
41673-
"raw": "\n | _, ",
41685+
"raw": "\n | ",
41686+
"link": null,
41687+
"docstring": null,
41688+
"_type": "token"},
41689+
{"typeinfo":
41690+
{"type": "Exists fun k => a - b + k = c", "name": "_", "_type": "typeinfo"},
41691+
"semanticType": null,
41692+
"raw": "_",
41693+
"link": null,
41694+
"docstring": null,
41695+
"_type": "token"},
41696+
{"typeinfo": null,
41697+
"semanticType": null,
41698+
"raw": ", ",
4167441699
"link": null,
4167541700
"docstring": null,
4167641701
"_type": "token"},
@@ -42142,7 +42167,7 @@
4214242167
"link": null,
4214342168
"docstring": null,
4214442169
"_type": "token"},
42145-
{"typeinfo": {"type": "d + (a - b) = c", "name": "hd", "_type": "typeinfo"},
42170+
{"typeinfo": {"type": "a - b + d = c", "name": "hd", "_type": "typeinfo"},
4214642171
"semanticType": "Name.Variable",
4214742172
"raw": "hd",
4214842173
"link": null,
@@ -43716,7 +43741,20 @@
4371643741
"_type": "token"},
4371743742
{"typeinfo": null,
4371843743
"semanticType": null,
43719-
"raw": "\n | _, ",
43744+
"raw": "\n | ",
43745+
"link": null,
43746+
"docstring": null,
43747+
"_type": "token"},
43748+
{"typeinfo":
43749+
{"type": "Exists fun k => a + k = c + b", "name": "_", "_type": "typeinfo"},
43750+
"semanticType": null,
43751+
"raw": "_",
43752+
"link": null,
43753+
"docstring": null,
43754+
"_type": "token"},
43755+
{"typeinfo": null,
43756+
"semanticType": null,
43757+
"raw": ", ",
4372043758
"link": null,
4372143759
"docstring": null,
4372243760
"_type": "token"},

0 commit comments

Comments
 (0)