Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

parse mult. comparisons, like (0 < $x <= $y < 256) #401

Open
@rurban

Description

@rurban

into a series of RELOP's with log && in-between. Idea by David Nielson, perl6 has it.

if (0 < $x < 256) { ...} => if ((0 < $x) && ($x < 256)) { ...}

term RELOP term RELOP term =>
   $$ = AND (RELOP(1, 3), RELOP(3, 5))

The only problem for this simple feature is that the middle op $3 must be cloned in the 2nd part of AND, because it cannot be re-used. Wrong next and parent links.
Saving it to an intermediate result scalar would also be possible.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions