From: mike lowis Date: Fri, 9 Apr 2021 18:27:09 +0000 (-0400) Subject: Changed SET to Set X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=e9bfc2b226df9e903917f5d2a94460065a4b186a;p=proto%2Fobnc.git Changed SET to Set --- diff --git a/lib/obnc/Files.c b/lib/obnc/Files.c index 0680fd0..a80ec30 100644 --- a/lib/obnc/Files.c +++ b/lib/obnc/Files.c @@ -307,7 +307,7 @@ void Files__GetDate_(Files__File_ file, OBNC_INTEGER *t, OBNC_INTEGER *d) } -void Files__Set_(Files__Rider_ *r, const OBNC_Td *rTD, Files__File_ f, OBNC_INTEGER pos) +void Files__SetPos_(Files__Rider_ *r, const OBNC_Td *rTD, Files__File_ f, OBNC_INTEGER pos) { OBNC_C_ASSERT(r != NULL); OBNC_C_ASSERT(f != NULL); diff --git a/lib/obnc/Files.obn b/lib/obnc/Files.obn index d3fec23..f86eba8 100644 --- a/lib/obnc/Files.obn +++ b/lib/obnc/Files.obn @@ -71,10 +71,10 @@ Implements the basic library module from "The Oakwood Guidelines for Oberon-2 Co end GetDate; - procedure Set*(var r: Rider; f: File; pos: Int); + procedure SetPos*(var r: Rider; f: File; pos: Int); (**sets the rider r to position pos in file f. The field r.eof is set to false. The operation requires that 0 <= pos <= Length(f)*) - end Set; + end SetPos; procedure Pos*(var r: Rider): Int; @@ -113,7 +113,7 @@ operation requires that 0 <= pos <= Length(f)*) end ReadString; - procedure ReadSet*(var r: Rider; var s: SET); + procedure ReadSet*(var r: Rider; var s: Set); (**reads a set s from rider r and advances r accordingly*) end ReadSet; @@ -153,7 +153,7 @@ operation requires that 0 <= pos <= Length(f)*) end WriteString; - procedure WriteSet*(var r: Rider; s: SET); + procedure WriteSet*(var r: Rider; s: Set); (**writes the set s to rider r and advances r accordingly*) end WriteSet; diff --git a/lib/obnc/FilesTest.obn b/lib/obnc/FilesTest.obn index b703e04..d0712d5 100644 --- a/lib/obnc/FilesTest.obn +++ b/lib/obnc/FilesTest.obn @@ -58,7 +58,7 @@ module FilesTest; f := Files.New("RegisterTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.Write(r, 37); Files.Close(f); Files.Register(f); @@ -78,7 +78,7 @@ module FilesTest; begin f := Files.New("CloseTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.Write(r, 65); ASSERT(Files.Length(f) <= 1); Files.Close(f); @@ -92,7 +92,7 @@ module FilesTest; begin f := Files.New("PurgeTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.Write(r, 65); Files.Purge(f); ASSERT(Files.Length(f) = 0) @@ -179,15 +179,15 @@ module FilesTest; end TestDate; - procedure TestSet; + procedure TestSetPos; var f: Files.File; r: Files.Rider; begin f := Files.New("SetTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); ASSERT(~r.eof) - end TestSet; + end TestSetPos; procedure TestPos; @@ -196,7 +196,7 @@ module FilesTest; begin f := Files.New("PosTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); ASSERT(Files.Pos(r) = 0) end TestPos; @@ -207,7 +207,7 @@ module FilesTest; begin f := Files.New("BaseTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); ASSERT(Files.Base(r) = f) end TestBase; @@ -219,11 +219,11 @@ module FilesTest; begin f := Files.New("ReadWriteTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.Write(r, 65); Files.Close(f); ASSERT(Files.Length(f) = 1); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.Read(r, b); ASSERT(~r.eof); ASSERT(b = 65); @@ -239,12 +239,12 @@ module FilesTest; f := Files.New("ReadWriteIntTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteInt(r, 100); Files.WriteInt(r, -1000); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadInt(r, i); ASSERT(~r.eof); ASSERT(i = 100); @@ -264,12 +264,12 @@ module FilesTest; f := Files.New("ReadWriteRealTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteReal(r, 3.14); Files.WriteReal(r, -3.14); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadReal(r, x); ASSERT(~r.eof); ASSERT(ABS(x - 3.14) < 1.0E-6); @@ -289,12 +289,12 @@ module FilesTest; f := Files.New("ReadWriteNumTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteNum(r, 100); Files.WriteNum(r, -1000); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadNum(r, i); ASSERT(~r.eof); ASSERT(i = 100); @@ -314,13 +314,13 @@ module FilesTest; f := Files.New("ReadWriteStringTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteString(r, "hello"); Files.WriteString(r, "there"); Files.WriteString(r, ""); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadString(r, s); ASSERT(~r.eof); ASSERT(s = "hello"); @@ -338,18 +338,18 @@ module FilesTest; procedure TestReadWriteSet; var f: Files.File; r: Files.Rider; - s: SET; + s: Set; begin f := Files.New("ReadWriteSetTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteSet(r, {}); Files.WriteSet(r, {0}); Files.WriteSet(r, {0, 1}); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadSet(r, s); ASSERT(~r.eof); ASSERT(s = {}); @@ -372,12 +372,12 @@ module FilesTest; f := Files.New("ReadWriteBoolTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteBool(r, true); Files.WriteBool(r, false); Files.Close(f); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadBool(r, b); ASSERT(~r.eof); ASSERT(b); @@ -400,14 +400,14 @@ module FilesTest; f := Files.New("ReadWriteBytesTest"); ASSERT(f # nil); - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.WriteBytes(r, buf, LEN(buf)); Files.WriteBytes(r, buf, LEN(buf)); Files.Close(f); for i := 0 to LEN(buf) - 1 do buf[i] := 0 end; - Files.Set(r, f, 0); + Files.SetPos(r, f, 0); Files.ReadBytes(r, buf, LEN(buf)); ASSERT(~r.eof); @@ -437,7 +437,7 @@ begin if SYSTEM.SIZE(Int) >= 4 then TestDate end; - TestSet; + TestSetPos; TestPos; TestBase; TestReadWrite; diff --git a/lib/obnc/Input.obn b/lib/obnc/Input.obn index 10986c1..77f5339 100644 --- a/lib/obnc/Input.obn +++ b/lib/obnc/Input.obn @@ -24,7 +24,7 @@ Implements the basic library module from "The Oakwood Guidelines for Oberon-2 Co (**returns (and removes) the next character from the keyboard buffer. If the buffer is empty, Read waits until a key is pressed.*) end Read; - procedure Mouse*(var keys: SET; var x, y: Int); + procedure Mouse*(var keys: Set; var x, y: Int); (**returns the current mouse position (x, y) in pixels relative to the lower left corner of the screen. keys is the set of the currently pressed mouse keys (left = 2, middle = 1, right = 0).*) end Mouse; diff --git a/lib/obnc/InputTest.obn b/lib/obnc/InputTest.obn index 6f9e6f4..67d5359 100644 --- a/lib/obnc/InputTest.obn +++ b/lib/obnc/InputTest.obn @@ -55,7 +55,7 @@ module InputTest; procedure TestButton(button: Int); var buttonLabels: array 3, 8 of Char; - buttons: SET; x, y: Int; + buttons: Set; x, y: Int; begin buttonLabels[0] := "right"; buttonLabels[1] := "middle"; diff --git a/lib/obnc/XYplane.obn b/lib/obnc/XYplane.obn index c85f4c8..4c88ee8 100644 --- a/lib/obnc/XYplane.obn +++ b/lib/obnc/XYplane.obn @@ -67,7 +67,7 @@ module drawpixels; var x, y: Int; - keys: SET; + keys: Set; begin XYplane.Open; diff --git a/src/Table.c b/src/Table.c index d09e36e..3a33876 100644 --- a/src/Table.c +++ b/src/Table.c @@ -101,7 +101,7 @@ void Table_Init(void) {"PACK", TREES_PROCEDURE_KIND, TREES_PACK_PROC}, {"ROR", TREES_PROCEDURE_KIND, TREES_ROR_PROC}, {"Real", TREES_TYPE_KIND, TREES_REAL_TYPE}, - {"SET", TREES_TYPE_KIND, TREES_SET_TYPE}, + {"Set", TREES_TYPE_KIND, TREES_SET_TYPE}, {"UNPK", TREES_PROCEDURE_KIND, TREES_UNPK_PROC} }; diff --git a/tests/obnc/passing/A.obn b/tests/obnc/passing/A.obn index 826dd0b..741c7a8 100644 --- a/tests/obnc/passing/A.obn +++ b/tests/obnc/passing/A.obn @@ -60,7 +60,7 @@ module A; intVar*: Int; realVar* : Real; byteVar*: Byte; - setVar*: SET; + setVar*: Set; strVar*: String; recVar*, recVar1: record f*: Int diff --git a/tests/obnc/passing/T1ConstantDeclarations.obn b/tests/obnc/passing/T1ConstantDeclarations.obn index 54c67b4..c0335ae 100644 --- a/tests/obnc/passing/T1ConstantDeclarations.obn +++ b/tests/obnc/passing/T1ConstantDeclarations.obn @@ -41,7 +41,7 @@ module T1ConstantDeclarations; i: Int; x: Real; j: Byte; - A: SET; + A: Set; begin p := null; diff --git a/tests/obnc/passing/T4Expressions.obn b/tests/obnc/passing/T4Expressions.obn index 366080d..6f7ce7c 100644 --- a/tests/obnc/passing/T4Expressions.obn +++ b/tests/obnc/passing/T4Expressions.obn @@ -26,7 +26,7 @@ module T4Expressions; end IncReturnZero; - procedure IncReturnEmpty(var x: Int): SET; + procedure IncReturnEmpty(var x: Int): Set; begin INC(x) return {} @@ -69,7 +69,7 @@ module T4Expressions; procedure TestSetConstructors; var a, b, i, j: Int; - A: SET; + A: Set; begin a := 4; b := 6; @@ -96,7 +96,7 @@ Out.Integer(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln; i, j, n: Int; x: Real; y: Byte; - A, B: SET; + A, B: Set; str: array 24 of Char; strs: array 2, 32 of Char; t: T; @@ -253,7 +253,7 @@ Out.Integer(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln; n: Int; x: Real; y: Byte; - A: SET; + A: Set; begin (*booleans*) ASSERT(true or true); @@ -321,7 +321,7 @@ Out.Integer(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln; i, j, n: Int; x: Real; y: Byte; - A: SET; + A: Set; begin (*booleans*) ASSERT(true & true); @@ -394,7 +394,7 @@ Out.Integer(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln; i, j, k: Int; r: Real; x: Byte; - s: SET; + s: Set; begin ASSERT(ABS(-1) = 1); ASSERT(ABS(0) = 0); diff --git a/tests/obnc/passing/T5Statements.obn b/tests/obnc/passing/T5Statements.obn index b0bcbab..db6d924 100644 --- a/tests/obnc/passing/T5Statements.obn +++ b/tests/obnc/passing/T5Statements.obn @@ -47,7 +47,7 @@ module T5Statements; n, n1: Int; x, x1: Real; y, y1: Byte; - A, A1: SET; + A, A1: Set; begin b := true; b1 := false; @@ -296,7 +296,7 @@ module T5Statements; procedure TestPredeclaredProperProcedures; const eps = 0.01; var n, i, j: Int; - A: SET; + A: Set; x: Real; a: array 1 of Real; b: array 1 of Int; diff --git a/tests/obnc/passing/T5SystemStatements.obn b/tests/obnc/passing/T5SystemStatements.obn index 558f187..32c8d2a 100644 --- a/tests/obnc/passing/T5SystemStatements.obn +++ b/tests/obnc/passing/T5SystemStatements.obn @@ -29,7 +29,7 @@ module T5SystemStatements; r, r1: Real; x, x1: Byte; xs: array 2 of Byte; - s, s1: SET; + s, s1: Set; a, a1: Array; a2: array SYSTEM.SIZE(Array) + 1 of Int; begin