Skip to content

Commit

Permalink
refator logic a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
xasopheno committed Dec 29, 2024
1 parent 1fe0572 commit 98081ad
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions parser/src/socool.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,22 @@ BracedOvertone: Term = {
}



Parenthesized<T>: T = {
<t: T> => t,
"(" <t: T> ")" => t,
};

Lets<T>: Vec<T> = {
<v:(<T>)*> => v
};
Overtones = Comma<Overtone>;
Compose = Pipe<Operation>;
Operations = Comma<Operation>;
CoefStart: (i64, i64) = {
<n: Int> "|" <d:Int> => (n, d),
}


Comma<T>: Vec<T> = {
<v:(<T> ",")*> <e:T?> => match e {
Expand All @@ -420,16 +435,6 @@ Comma<T>: Vec<T> = {
}
};

Parenthesized<T>: T = {
<t: T> => t,
"(" <t: T> ")" => t,
};


Lets<T>: Vec<T> = {
<v:(<T>)*> => v
};

Pipe<T>: Vec<T> = {
<v:(<T> "|")+> <e:T?> => match e {
None=> v,
Expand All @@ -452,10 +457,6 @@ Concat<T>: Vec<T> = {
}
};

Compose = Pipe<Operation>;

Operations = Comma<Operation>;

Ints = Comma<Int>;

Rational: Rational64 = {
Expand All @@ -466,9 +467,6 @@ Rational: Rational64 = {
};


CoefStart: (i64, i64) = {
<n: Int> "|" <d:Int> => (n, d),
}


Axis: Axis = {
Expand Down

0 comments on commit 98081ad

Please sign in to comment.