Skip to content

Commit 3460378

Browse files
committed
juledoc: update to latest AST
1 parent 48bb279 commit 3460378

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

builder/commentmap.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn BuildCommentMap(mut &tokens: []&token::Token): &CommentMap {
6363
mut i := 0
6464
for i < len(tokens) {
6565
token := tokens[i]
66-
if token.Id != token::Comment {
66+
if token.Id != token::COMMENT {
6767
i++
6868
continue
6969
}

builder/formatter.jule

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ impl formatter {
252252
match {
253253
| i == 0:
254254
self.write(" ")
255-
| arg.Id != token::RParent &&
256-
d.Args[i-1].Id != token::LParent &&
257-
d.Args[i-1].Id != token::Excl:
255+
| arg.Id != token::RPAREN &&
256+
d.Args[i-1].Id != token::LPAREN &&
257+
d.Args[i-1].Id != token::NOT:
258258
self.write(" ")
259259
}
260260
self.write(arg.Kind)
@@ -670,7 +670,7 @@ impl formatter {
670670
self.write("let ")
671671
} else if d.Const {
672672
self.write("const ")
673-
} else if d.Op == nil || d.Op.Id == token::Eq {
673+
} else if d.Op == nil || d.Op.Id == token::DEFINE {
674674
self.write("let ")
675675
}
676676
}
@@ -1635,26 +1635,26 @@ struct binaryFormatter {
16351635
impl binaryFormatter {
16361636
// Reports whether operator should take space for formatting.
16371637
fn isOp(op: int): bool {
1638-
ret op == token::DblVline ||
1639-
op == token::DblAmper ||
1640-
op == token::Gt ||
1641-
op == token::Lt ||
1642-
op == token::LtEq ||
1643-
op == token::GtEq ||
1644-
op == token::DblEq ||
1645-
op == token::NotEq
1638+
ret op == token::LOR ||
1639+
op == token::LAND ||
1640+
op == token::GTR ||
1641+
op == token::LSS ||
1642+
op == token::LEQ ||
1643+
op == token::GEQ ||
1644+
op == token::EQL ||
1645+
op == token::NEQ
16461646
}
16471647

16481648
// Reports whether the operator is have high formatting precedence.
16491649
// Returns 1 for high precedence, otherwise returns 0.
16501650
fn opPrec(op: int): int {
16511651
match op {
1652-
| token::Shl
1653-
| token::Shr
1654-
| token::Star
1655-
| token::Solidus
1656-
| token::Percent
1657-
| token::Amper:
1652+
| token::SHL
1653+
| token::SHR
1654+
| token::MUL
1655+
| token::QUO
1656+
| token::REM
1657+
| token::AND:
16581658
ret 1
16591659
|:
16601660
ret 0
@@ -1663,8 +1663,8 @@ impl binaryFormatter {
16631663

16641664
// Reports whether operator zips operands.
16651665
fn isHardZipOp(op: int): bool {
1666-
ret op == token::DblVline ||
1667-
op == token::DblAmper
1666+
ret op == token::LOR ||
1667+
op == token::LAND
16681668
}
16691669

16701670
fn write(&self, s: str) {

0 commit comments

Comments
 (0)