mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-10-03 18:27:13 +03:00
Merge pull request #13 from NoamDev/ascii-alternatives
Ascii alternatives to forall and lambda
This commit is contained in:
commit
80e3ff76c2
@ -82,9 +82,15 @@ impl<'i> KindParser<'i> {
|
||||
//println!("parsing ||{}", self.input[self.index..].replace("\n",""));
|
||||
|
||||
// ALL ::= ∀(<name>: <term>) <term>
|
||||
if self.starts_with("∀") {
|
||||
// "forall" can be used as an ascii alternative to "∀"
|
||||
if self.starts_with("∀") || self.starts_with("forall") {
|
||||
let ini = *self.index() as u64;
|
||||
if self.starts_with("∀") {
|
||||
self.consume("∀")?;
|
||||
} else if self.starts_with("forall") {
|
||||
self.consume("forall")?;
|
||||
}
|
||||
self.skip_spaces();
|
||||
self.consume("(")?;
|
||||
let nam = self.parse_name()?;
|
||||
self.consume(":")?;
|
||||
@ -97,9 +103,15 @@ impl<'i> KindParser<'i> {
|
||||
}
|
||||
|
||||
// LAM ::= λ<name> <term>
|
||||
if self.starts_with("λ") {
|
||||
// "lambda" can be used as an ascii alternative to "λ"
|
||||
if self.starts_with("λ") || self.starts_with("lambda") {
|
||||
let ini = *self.index() as u64;
|
||||
if self.starts_with("λ") {
|
||||
self.consume("λ")?;
|
||||
} else if self.starts_with("lambda") {
|
||||
self.consume("lambda")?;
|
||||
}
|
||||
self.skip_spaces();
|
||||
// Annotated
|
||||
if self.peek_one() == Some('(') {
|
||||
self.consume("(")?;
|
||||
|
Loading…
Reference in New Issue
Block a user