Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Simon Spies
Iris
Commits
8239ab05
Commit
8239ab05
authored
Nov 24, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProofMode intro patterns: accept _ as part of variable names
parent
d0743f7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
proofmode/intro_patterns.v
proofmode/intro_patterns.v
+2
-3
proofmode/spec_patterns.v
proofmode/spec_patterns.v
+1
-0
No files found.
proofmode/intro_patterns.v
View file @
8239ab05
...
...
@@ -29,7 +29,6 @@ Module intro_pat.
Inductive
token
:
=
|
TName
:
string
→
token
|
TAnom
:
token
|
TDrop
:
token
|
TFrame
:
token
|
TBar
:
token
|
TBracketL
:
token
...
...
@@ -55,7 +54,6 @@ Fixpoint tokenize_go (s : string) (k : list token) (kn : string) : list token :=
match
s
with
|
""
=>
rev
(
cons_name
kn
k
)
|
String
"?"
s
=>
tokenize_go
s
(
TAnom
::
cons_name
kn
k
)
""
|
String
"_"
s
=>
tokenize_go
s
(
TDrop
::
cons_name
kn
k
)
""
|
String
"$"
s
=>
tokenize_go
s
(
TFrame
::
cons_name
kn
k
)
""
|
String
"["
s
=>
tokenize_go
s
(
TBracketL
::
cons_name
kn
k
)
""
|
String
"]"
s
=>
tokenize_go
s
(
TBracketR
::
cons_name
kn
k
)
""
...
...
@@ -77,6 +75,7 @@ Fixpoint tokenize_go (s : string) (k : list token) (kn : string) : list token :=
|
String
a
s
=>
if
is_space
a
then
tokenize_go
s
(
cons_name
kn
k
)
""
else
tokenize_go
s
k
(
String
a
kn
)
(* TODO: Complain about invalid characters, to future-proof this against making more characters special. *)
end
.
Definition
tokenize
(
s
:
string
)
:
list
token
:
=
tokenize_go
s
[]
""
.
...
...
@@ -129,9 +128,9 @@ Fixpoint close_conj_list (k : stack)
Fixpoint
parse_go
(
ts
:
list
token
)
(
k
:
stack
)
:
option
stack
:
=
match
ts
with
|
[]
=>
Some
k
|
TName
"_"
::
ts
=>
parse_go
ts
(
SPat
IDrop
::
k
)
|
TName
s
::
ts
=>
parse_go
ts
(
SPat
(
IName
s
)
::
k
)
|
TAnom
::
ts
=>
parse_go
ts
(
SPat
IAnom
::
k
)
|
TDrop
::
ts
=>
parse_go
ts
(
SPat
IDrop
::
k
)
|
TFrame
::
ts
=>
parse_go
ts
(
SPat
IFrame
::
k
)
|
TBracketL
::
ts
=>
parse_go
ts
(
SList
::
k
)
|
TBar
::
ts
=>
parse_go
ts
(
SBar
::
k
)
...
...
proofmode/spec_patterns.v
View file @
8239ab05
...
...
@@ -42,6 +42,7 @@ Fixpoint tokenize_go (s : string) (k : list token) (kn : string) : list token :=
|
String
a
s
=>
if
is_space
a
then
tokenize_go
s
(
cons_name
kn
k
)
""
else
tokenize_go
s
k
(
String
a
kn
)
(* TODO: Complain about invalid characters, to future-proof this against making more characters special. *)
end
.
Definition
tokenize
(
s
:
string
)
:
list
token
:
=
tokenize_go
s
[]
""
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment