Skip to content

Commit

Permalink
For loopssssssssssssssssssssssss
Browse files Browse the repository at this point in the history
  • Loading branch information
camdenorrb committed Jan 4, 2022
1 parent 5b3cd6b commit d2081ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- [x] Variables
- [x] While loops
- [x] String interpolation
- [ ] For loops
- [x] For loops
- [ ] Structs
- [ ] Impl
- [ ] Traits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ internal class CrescentLexerTests {
VAL, Key("x"), COMMA, Key("y"), COMMA, Key("z"), ASSIGN, Data.Number(0.toByte()),
Key("println"), Parenthesis.OPEN, Data.String("\$x\$y\$z"), Parenthesis.CLOSE,

FOR, Key("x"), COMMA, Key("y"), COMMA, Key("z"), CONTAINS, Data.Number(0.toByte()), RANGE_TO, Data.Number(10.toByte()), Bracket.OPEN,
FOR, Key("x"), COMMA, Key("y"), COMMA, Key("z"), CONTAINS, Data.Number(0.toByte()), RANGE_TO, Data.Number(9.toByte()), Bracket.OPEN,
Key("println"), Parenthesis.OPEN, Data.String("\$x\$y\$z"), Parenthesis.CLOSE,
Bracket.CLOSE,

FOR, Key("x"), COMMA, Key("y"), COMMA, Key("z"), CONTAINS, Data.Number(0.toByte()), RANGE_TO, Data.Number(10.toByte()), COMMA, Data.Number(0.toByte()), RANGE_TO, Data.Number(10.toByte()), COMMA, Data.Number(0.toByte()), RANGE_TO, Data.Number(10.toByte()), Bracket.OPEN,
FOR, Key("x"), COMMA, Key("y"), COMMA, Key("z"), CONTAINS, Data.Number(0.toByte()), RANGE_TO, Data.Number(9.toByte()), COMMA, Data.Number(0.toByte()), RANGE_TO, Data.Number(9.toByte()), COMMA, Data.Number(0.toByte()), RANGE_TO, Data.Number(9.toByte()), Bracket.OPEN,
Key("println"), Parenthesis.OPEN, Data.String("\$x\$y\$z"), Parenthesis.CLOSE,
Bracket.CLOSE,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ internal class CrescentParserTests {

Statement.For(
listOf(Identifier("x"), Identifier("y"), Identifier("z")),
listOf(Statement.Range(I8(0), I8(10))),
listOf(Statement.Range(I8(0), I8(9))),
Statement.Block(listOf(
IdentifierCall("println", listOf(Expression(listOf(String(""), Identifier("x"), ADD, Identifier("y"), ADD, Identifier("z"), ADD)))),
))
),
Statement.For(
listOf(Identifier("x"), Identifier("y"), Identifier("z")),
listOf(Statement.Range(I8(0), I8(10)), Statement.Range(I8(0), I8(10)), Statement.Range(I8(0), I8(10))),
listOf(Statement.Range(I8(0), I8(9)), Statement.Range(I8(0), I8(9)), Statement.Range(I8(0), I8(9))),
Statement.Block(listOf(
IdentifierCall("println", listOf(Expression(listOf(String(""), Identifier("x"), ADD, Identifier("y"), ADD, Identifier("z"), ADD)))),
))
Expand Down

0 comments on commit d2081ff

Please sign in to comment.