improve ast check on pipe expressions

This commit is contained in:
Irmen de Jong 2022-04-14 00:49:06 +02:00
parent 7dbff5b9e6
commit 0f4a197e34
3 changed files with 8 additions and 4 deletions

View File

@ -1103,9 +1103,15 @@ internal class AstChecker(private val program: Program,
}
}
override fun visit(pipe: PipeExpression) = process(pipe)
override fun visit(pipe: PipeExpression) {
process(pipe)
super.visit(pipe)
}
override fun visit(pipe: Pipe) = process(pipe)
override fun visit(pipe: Pipe) {
process(pipe)
super.visit(pipe)
}
private fun process(pipe: IPipe) {
if(pipe.source in pipe.segments)

View File

@ -3,7 +3,6 @@ TODO
For next release
^^^^^^^^^^^^^^^^
- "999 as ubyte" won't be const folded away and gives compiler crash
- pipe operator: allow non-unary function calls in the pipe that specify the other argument(s) in the calls.
- createAssemblyAndAssemble(): make it possible to actually get rid of the VarDecl nodes by fixing the rest of the code mentioned there.
- allow "xxx" * constexpr (where constexpr is not a number literal), now gives expression error not same type

View File

@ -6,7 +6,6 @@
main {
sub start() {
uword qq = 999 as ubyte |> abs() |> abs()
txt.print_uw(qq)
txt.nl()