diff --git a/README.md b/README.md index afd6d67..a65f4db 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ void PlatformLibraryInit() ``` This code takes the structure definition in StructDefinition and runs the lexical -analyser over it. This returns some lexical tokens. Then we initialise the parser +analyser over it. This returns some lexical tokens. Then we initialize the parser and have it parse the type of the structure definition from the tokens we made. That's enough to define the structure in the system. Finally we free the tokens. diff --git a/cstdlib/stdio.c b/cstdlib/stdio.c index 300eab8..6824a30 100644 --- a/cstdlib/stdio.c +++ b/cstdlib/stdio.c @@ -42,7 +42,7 @@ struct StdVararg int NumArgs; }; -/* initialises the I/O system so error reporting works */ +/* initializes the I/O system so error reporting works */ void BasicIOInit(Picoc *pc) { pc->CStdOut = stdout; diff --git a/debug.c b/debug.c index ccd26c3..b2c1149 100644 --- a/debug.c +++ b/debug.c @@ -4,7 +4,7 @@ #define BREAKPOINT_HASH(p) (((unsigned long)(p)->FileName) ^ (((p)->Line << 16) | ((p)->CharacterPos << 16))) #ifdef DEBUGGER -/* initialise the debugger by clearing the breakpoint table */ +/* initialize the debugger by clearing the breakpoint table */ void DebugInit(Picoc *pc) { TableInitTable(&pc->BreakpointTable, &pc->BreakpointHashTable[0], diff --git a/heap.c b/heap.c index 02be3c5..5f21be4 100644 --- a/heap.c +++ b/heap.c @@ -18,7 +18,7 @@ void ShowBigList(Picoc *pc) } #endif -/* initialise the stack and heap storage */ +/* initialize the stack and heap storage */ void HeapInit(Picoc *pc, int StackOrHeapSize) { int Count; diff --git a/include.c b/include.c index e29f0a4..7359007 100644 --- a/include.c +++ b/include.c @@ -5,7 +5,7 @@ #include "interpreter.h" -/* initialise the built-in include libraries */ +/* initialize the built-in include libraries */ void IncludeInit(Picoc *pc) { IncludeRegister(pc, "ctype.h", NULL, &StdCtypeFunctions[0], NULL); diff --git a/interpreter.h b/interpreter.h index 725f9de..009770a 100644 --- a/interpreter.h +++ b/interpreter.h @@ -633,7 +633,7 @@ extern void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, /* the following are defined in picoc.h: * void PicocCallMain(int argc, char **argv); * int PicocPlatformSetExitPoint(); - * void PicocInitialise(int StackSize); + * void PicocInitialize(int StackSize); * void PicocCleanup(); * void PicocPlatformScanFile(const char *FileName); * extern int PicocExitValue; */ diff --git a/lex.c b/lex.c index 243b728..bee7f56 100644 --- a/lex.c +++ b/lex.c @@ -97,7 +97,7 @@ static struct ReservedWord ReservedWords[] = { -/* initialise the lexer */ +/* initialize the lexer */ void LexInit(Picoc *pc) { int Count; diff --git a/parse.c b/parse.c index 8930341..7d38bfb 100644 --- a/parse.c +++ b/parse.c @@ -5,7 +5,7 @@ static enum ParseResult ParseStatementMaybeRun(struct ParseState *Parser, int Condition, int CheckTrailingSemicolon); static int ParseCountParams(struct ParseState *Parser); -static int ParseArrayInitialiser(struct ParseState *Parser, +static int ParseArrayInitializer(struct ParseState *Parser, struct Value *NewVariable, int DoAssignment); static void ParseDeclarationAssignment(struct ParseState *Parser, struct Value *NewVariable, int DoAssignment); @@ -186,8 +186,8 @@ struct Value *ParseFunctionDefinition(struct ParseState *Parser, return FuncValue; } -/* parse an array initialiser and assign to a variable */ -int ParseArrayInitialiser(struct ParseState *Parser, struct Value *NewVariable, +/* parse an array initializer and assign to a variable */ +int ParseArrayInitializer(struct ParseState *Parser, struct Value *NewVariable, int DoAssignment) { int ArrayIndex = 0; @@ -200,7 +200,7 @@ int ParseArrayInitialiser(struct ParseState *Parser, struct Value *NewVariable, int NumElements; ParserCopy(&CountParser, Parser); - NumElements = ParseArrayInitialiser(&CountParser, NewVariable, false); + NumElements = ParseArrayInitializer(&CountParser, NewVariable, false); if (NewVariable->Typ->Base != TypeArray) AssignFail(Parser, "%t from array initializer", NewVariable->Typ, @@ -218,11 +218,11 @@ int ParseArrayInitialiser(struct ParseState *Parser, struct Value *NewVariable, #endif } - /* parse the array initialiser */ + /* parse the array initializer */ Token = LexGetToken(Parser, NULL, false); while (Token != TokenRightBrace) { if (LexGetToken(Parser, NULL, false) == TokenLeftBrace) { - /* this is a sub-array initialiser */ + /* this is a sub-array initializer */ int SubArraySize = 0; struct Value *SubArray = NewVariable; if (Parser->Mode == RunModeRun && DoAssignment) { @@ -245,7 +245,7 @@ int ParseArrayInitialiser(struct ParseState *Parser, struct Value *NewVariable, ProgramFail(Parser, "too many array elements"); } LexGetToken(Parser, NULL, true); - ParseArrayInitialiser(Parser, SubArray, DoAssignment); + ParseArrayInitializer(Parser, SubArray, DoAssignment); } else { struct Value *ArrayElement = NULL; @@ -281,7 +281,7 @@ int ParseArrayInitialiser(struct ParseState *Parser, struct Value *NewVariable, true, NewVariable); } - /* this is a normal expression initialiser */ + /* this is a normal expression initializer */ if (!ExpressionParse(Parser, &CValue)) ProgramFail(Parser, "expression expected"); @@ -318,11 +318,11 @@ void ParseDeclarationAssignment(struct ParseState *Parser, struct Value *CValue; if (LexGetToken(Parser, NULL, false) == TokenLeftBrace) { - /* this is an array initialiser */ + /* this is an array initializer */ LexGetToken(Parser, NULL, true); - ParseArrayInitialiser(Parser, NewVariable, DoAssignment); + ParseArrayInitializer(Parser, NewVariable, DoAssignment); } else { - /* this is a normal expression initialiser */ + /* this is a normal expression initializer */ if (!ExpressionParse(Parser, &CValue)) ProgramFail(Parser, "expression expected"); diff --git a/picoc.c b/picoc.c index b283658..b2ef12f 100644 --- a/picoc.c +++ b/picoc.c @@ -41,7 +41,7 @@ int main(int argc, char **argv) return 0; } - PicocInitialise(&pc, StackSize); + PicocInitialize(&pc, StackSize); if (strcmp(argv[ParamCount], "-s") == 0) { DontRunMain = true; diff --git a/picoc.h b/picoc.h index 24413bd..1d8aaa3 100644 --- a/picoc.h +++ b/picoc.h @@ -26,7 +26,7 @@ extern void PicocParseInteractive(Picoc *pc); /* platform.c */ extern void PicocCallMain(Picoc *pc, int argc, char **argv); -extern void PicocInitialise(Picoc *pc, int StackSize); +extern void PicocInitialize(Picoc *pc, int StackSize); extern void PicocCleanup(Picoc *pc); extern void PicocPlatformScanFile(Picoc *pc, const char *FileName); diff --git a/platform.c b/platform.c index b519afd..e111dc7 100644 --- a/platform.c +++ b/platform.c @@ -15,8 +15,8 @@ static int gEnableDebugger = false; #endif -/* initialise everything */ -void PicocInitialise(Picoc *pc, int StackSize) +/* initialize everything */ +void PicocInitialize(Picoc *pc, int StackSize) { memset(pc, '\0', sizeof(*pc)); PlatformInit(pc); @@ -255,7 +255,7 @@ void PlatformVPrintf(IOFILE *Stream, const char *Format, va_list Args) } /* make a new temporary name. takes a static buffer of char [7] as a parameter. - * should be initialised to "XX0000" + * should be initialized to "XX0000" * where XX can be any characters */ char *PlatformMakeTempName(Picoc *pc, char *TempNameBuffer) { diff --git a/table.c b/table.c index b8ef806..ce17f44 100644 --- a/table.c +++ b/table.c @@ -10,7 +10,7 @@ static struct TableEntry *TableSearch(struct Table *Tbl, const char *Key, static struct TableEntry *TableSearchIdentifier(struct Table *Tbl, const char *Key, int Len, int *AddAt); -/* initialise the shared string system */ +/* initialize the shared string system */ void TableInit(Picoc *pc) { TableInitTable(&pc->StringTable, &pc->StringHashTable[0], @@ -35,7 +35,7 @@ unsigned int TableHash(const char *Key, int Len) return Hash; } -/* initialise a table */ +/* initialize a table */ void TableInitTable(struct Table *Tbl, struct TableEntry **HashTable, int Size, int OnHeap) { diff --git a/tests/36_array_initialisers.c b/tests/36_array_initializers.c similarity index 100% rename from tests/36_array_initialisers.c rename to tests/36_array_initializers.c diff --git a/tests/36_array_initialisers.expect b/tests/36_array_initializers.expect similarity index 100% rename from tests/36_array_initialisers.expect rename to tests/36_array_initializers.expect diff --git a/tests/55_array_initialiser.c b/tests/55_array_initializer.c similarity index 100% rename from tests/55_array_initialiser.c rename to tests/55_array_initializer.c diff --git a/tests/55_array_initialiser.expect b/tests/55_array_initializer.expect similarity index 100% rename from tests/55_array_initialiser.expect rename to tests/55_array_initializer.expect diff --git a/tests/Makefile b/tests/Makefile index 4a94137..085a9c3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -33,7 +33,7 @@ TESTS= 00_assignment.test \ 33_ternary_op.test \ 34_array_assignment.test \ 35_sizeof.test \ - 36_array_initialisers.test \ + 36_array_initializers.test \ 37_sprintf.test \ 38_multiple_array_index.test \ 39_typedef.test \ @@ -49,7 +49,7 @@ TESTS= 00_assignment.test \ 51_static.test \ 52_unnamed_enum.test \ 54_goto.test \ - 55_array_initialiser.test \ + 55_array_initializer.test \ 56_cross_structure.test \ 57_macro_bug.test \ 58_return_outside.test \ diff --git a/type.c b/type.c index d41c9bd..efcfd75 100644 --- a/type.c +++ b/type.c @@ -136,7 +136,7 @@ void TypeAddBaseType(Picoc *pc, struct ValueType *TypeNode, enum BaseType Base, pc->UberType.DerivedTypeList = TypeNode; } -/* initialise the type system */ +/* initialize the type system */ void TypeInit(Picoc *pc) { struct IntAlign {char x; int y;} ia; diff --git a/variable.c b/variable.c index b62735b..bee984d 100644 --- a/variable.c +++ b/variable.c @@ -7,7 +7,7 @@ #define MAX_TMP_COPY_BUF (256) -/* initialise the variable system */ +/* initialize the variable system */ void VariableInit(Picoc *pc) { TableInitTable(&(pc->GlobalTable), &(pc->GlobalHashTable)[0],