Skip to content

Commit 43dda85

Browse files
committed
Reformat after capitalization of type literals fixed
1 parent 3911105 commit 43dda85

7 files changed

Lines changed: 24 additions & 24 deletions

File tree

src/block.moo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ object BLOCK
1414
result = {};
1515
for line_no in [1..length(this)]
1616
content = this[line_no];
17-
if (typeof(content) == str)
17+
if (typeof(content) == STR)
1818
result = {@result, content};
19-
elseif (typeof(content) == flyweight)
19+
elseif (typeof(content) == FLYWEIGHT)
2020
result = {@result, content:render_as(@args)};
2121
else
2222
raise(E_TYPE);

src/event.moo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ object EVENT
2929
endif
3030
results = {};
3131
for entry in (this)
32-
if (typeof(entry) == flyweight)
32+
if (typeof(entry) == FLYWEIGHT)
3333
entry = entry:render_as(render_for, content_type, this);
3434
endif
35-
if (typeof(entry) == str)
35+
if (typeof(entry) == STR)
3636
results = entry:append_to_paragraph(@results);
37-
elseif (typeof(entry) == list)
37+
elseif (typeof(entry) == LIST)
3838
for index in [1..length(entry)]
3939
results = {@(entry[index]):append_to_paragraph(@results)};
4040
if (index != length(entry))
@@ -50,7 +50,7 @@ object EVENT
5050

5151
verb validate (this none this) owner: HACKER flags: "rxd"
5252
"Validate that the event has all the correct fields. Return false if not.";
53-
if (typeof(this) != flyweight)
53+
if (typeof(this) != FLYWEIGHT)
5454
return false;
5555
endif
5656
try

src/list.moo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object LIST
2424
for t in (lst)
2525
if (t[indx] == target)
2626
"... do this test first since it's the most likely to fail; this needs -d";
27-
if (typeof(t) == list && length(t) >= indx)
27+
if (typeof(t) == LIST && length(t) >= indx)
2828
return t;
2929
endif
3030
endif
@@ -36,7 +36,7 @@ object LIST
3636
"assoc_prefix(list, target[,index]) returns the first element of `list' whose own index-th element has target as a prefix. Index defaults to 1.";
3737
{lst, target, ?indx = 1} = args;
3838
for t in (lst)
39-
if (typeof(t) == list && (length(t) >= indx && index(t[indx], target) == 1))
39+
if (typeof(t) == LIST && (length(t) >= indx && index(t[indx], target) == 1))
4040
return t;
4141
endif
4242
endfor
@@ -48,7 +48,7 @@ object LIST
4848
"Make sure all elements of <list> are of a given <type>.";
4949
"<type> can be either one of LIST, STR, OBJ, NUM, ERR, or a list of same.";
5050
"return true if all elements check, otherwise 0.";
51-
typelist = typeof(args[2]) == list ? args[2] | {args[2]};
51+
typelist = typeof(args[2]) == LIST ? args[2] | {args[2]};
5252
for element in (args[1])
5353
if (!(typeof(element) in typelist))
5454
return false;

src/look.moo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object LOOK
4242
endverb
4343

4444
verb validate (this none this) owner: HACKER flags: "rxd"
45-
if (typeof(this) != flyweight)
45+
if (typeof(this) != FLYWEIGHT)
4646
return false;
4747
endif
4848
try
@@ -58,10 +58,10 @@ object LOOK
5858
!look:validate() && raise(E_ASSERT, "Invalid $look: " + toliteral(look));
5959
event = look:into_event();
6060
!event:validate() && raise(E_ASSERT, "Invalid event");
61-
!(typeof(event) == flyweight) && raise(E_ASSERT, "look event should be a flyweight");
61+
!(typeof(event) == FLYWEIGHT) && raise(E_ASSERT, "look event should be a flyweight");
6262
event.dobj != $first_room && raise(E_ASSERT, "look event dobj is wrong");
6363
content = event:transform_for(player);
64-
typeof(content) != list && raise(E_ASSERT, "Produced content is invalid: " + toliteral(content));
64+
typeof(content) != LIST && raise(E_ASSERT, "Produced content is invalid: " + toliteral(content));
6565
length(content) != 3 && raise(E_ASSERT, "Produced content is wrong length: " + toliteral(content) + " from " + toliteral(event));
6666
endverb
6767
endobject

src/password.moo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ object PASSWORD
66

77
verb mk (this none this) owner: ARCH_WIZARD flags: "rxd"
88
"mk(password) => <$password, { <encrypted_password> }>; return an argon2 encrypted password";
9-
if (typeof(this) == flyweight)
9+
if (typeof(this) == FLYWEIGHT)
1010
raise(E_INVARG);
1111
endif
1212
if (length(args) != 1)
1313
raise(E_ARGS);
1414
endif
1515
{password} = args;
16-
if (typeof(password) != str)
16+
if (typeof(password) != STR)
1717
raise(E_INVARG);
1818
endif
1919
salt_str = salt();
@@ -22,15 +22,15 @@ object PASSWORD
2222
endverb
2323

2424
verb challenge (this none this) owner: ARCH_WIZARD flags: "rxd"
25-
if (typeof(this) != flyweight)
25+
if (typeof(this) != FLYWEIGHT)
2626
raise(E_INVARG);
2727
endif
2828
if (length(args) != 1)
2929
raise(E_ARGS);
3030
endif
3131
{password} = args;
3232
encrypted = this[1];
33-
if (typeof(encrypted) != str)
33+
if (typeof(encrypted) != STR)
3434
raise(E_PERM);
3535
endif
3636
return argon2_verify(encrypted, password);

src/player.moo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ object PLAYER
4343
verb tell (this none this) owner: ARCH_WIZARD flags: "rxd"
4444
set_task_perms(this);
4545
{events, ?content_type = "text/plain"} = args;
46-
if (typeof(events) != list)
46+
if (typeof(events) != LIST)
4747
events = {events};
4848
endif
4949
for event in (events)
5050
if (typeof(event) == STR)
51-
content = event;
51+
content = event;
5252
else
53-
!event:validate() && raise(E_INVARG);
54-
content = event:transform_for(this, content_type);
53+
!event:validate() && raise(E_INVARG);
54+
content = event:transform_for(this, content_type);
5555
endif
56-
if (typeof(content) == list)
56+
if (typeof(content) == LIST)
5757
{ notify(this, line, content_type) for line in (content) };
5858
else
5959
notify(this, content, content_type);

src/string.moo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ object STRING
8080
break properties;
8181
endif
8282
endwhile
83-
if (typeof(object) == obj)
83+
if (typeof(object) == OBJ)
8484
return object;
8585
else
8686
return $failed_match;
@@ -99,7 +99,7 @@ object STRING
9999
"space(len,fill) returns a string of length abs(len) consisting of copies of fill. If len is negative, fill is anchored on the right instead of the left.";
100100
"len has an upper limit of 100,000.";
101101
{n, ?fill = " "} = args;
102-
if (typeof(n) == str)
102+
if (typeof(n) == STR)
103103
n = length(n);
104104
endif
105105
if ((n = abs(n)) > 100000)
@@ -284,7 +284,7 @@ object STRING
284284
!(object && verbname) && return false;
285285
if (object[1] == "$" && 0)
286286
pname = object[2..length(object)];
287-
if (!(pname in properties(#0)) || typeof(object = #0.(pname)) != obj)
287+
if (!(pname in properties(#0)) || typeof(object = #0.(pname)) != OBJ)
288288
return false;
289289
endif
290290
object = tostr(object);

0 commit comments

Comments
 (0)