diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-18 09:44:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-18 09:44:10 -0300 |
commit | e15f1f2bb7a38a3c94519294d031e48508d65006 (patch) | |
tree | 1528b4a73da045e4d1617c1a276e66c056ba7686 | |
parent | b5c65705ca78560cd2735778737122ea5f858bd0 (diff) | |
download | lua-5.4.5.tar.gz lua-5.4.5.tar.bz2 lua-5.4.5.zip |
Detailsv5.4.5
Typos in comments and details in the manual.
-rw-r--r-- | ldebug.c | 4 | ||||
-rw-r--r-- | llex.c | 2 | ||||
-rw-r--r-- | llimits.h | 2 | ||||
-rw-r--r-- | lparser.c | 8 | ||||
-rw-r--r-- | lstrlib.c | 2 | ||||
-rw-r--r-- | lua.c | 2 | ||||
-rw-r--r-- | manual/manual.of | 8 |
7 files changed, 14 insertions, 14 deletions
@@ -659,7 +659,7 @@ static const char *funcnamefromcall (lua_State *L, CallInfo *ci, | |||
659 | ** Check whether pointer 'o' points to some value in the stack frame of | 659 | ** Check whether pointer 'o' points to some value in the stack frame of |
660 | ** the current function and, if so, returns its index. Because 'o' may | 660 | ** the current function and, if so, returns its index. Because 'o' may |
661 | ** not point to a value in this stack, we cannot compare it with the | 661 | ** not point to a value in this stack, we cannot compare it with the |
662 | ** region boundaries (undefined behaviour in ISO C). | 662 | ** region boundaries (undefined behavior in ISO C). |
663 | */ | 663 | */ |
664 | static int instack (CallInfo *ci, const TValue *o) { | 664 | static int instack (CallInfo *ci, const TValue *o) { |
665 | int pos; | 665 | int pos; |
@@ -848,7 +848,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) { | |||
848 | if (p->lineinfo == NULL) /* no debug information? */ | 848 | if (p->lineinfo == NULL) /* no debug information? */ |
849 | return 0; | 849 | return 0; |
850 | if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */ | 850 | if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */ |
851 | int delta = 0; /* line diference */ | 851 | int delta = 0; /* line difference */ |
852 | int pc = oldpc; | 852 | int pc = oldpc; |
853 | for (;;) { | 853 | for (;;) { |
854 | int lineinfo = p->lineinfo[++pc]; | 854 | int lineinfo = p->lineinfo[++pc]; |
@@ -128,7 +128,7 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) { | |||
128 | ** ensuring there is only one copy of each unique string. The table | 128 | ** ensuring there is only one copy of each unique string. The table |
129 | ** here is used as a set: the string enters as the key, while its value | 129 | ** here is used as a set: the string enters as the key, while its value |
130 | ** is irrelevant. We use the string itself as the value only because it | 130 | ** is irrelevant. We use the string itself as the value only because it |
131 | ** is a TValue readly available. Later, the code generation can change | 131 | ** is a TValue readily available. Later, the code generation can change |
132 | ** this value. | 132 | ** this value. |
133 | */ | 133 | */ |
134 | TString *luaX_newstring (LexState *ls, const char *str, size_t l) { | 134 | TString *luaX_newstring (LexState *ls, const char *str, size_t l) { |
@@ -82,7 +82,7 @@ typedef signed char ls_byte; | |||
82 | #if defined(UINTPTR_MAX) /* even in C99 this type is optional */ | 82 | #if defined(UINTPTR_MAX) /* even in C99 this type is optional */ |
83 | #define L_P2I uintptr_t | 83 | #define L_P2I uintptr_t |
84 | #else /* no 'intptr'? */ | 84 | #else /* no 'intptr'? */ |
85 | #define L_P2I uintmax_t /* use the largerst available integer */ | 85 | #define L_P2I uintmax_t /* use the largest available integer */ |
86 | #endif | 86 | #endif |
87 | #else /* C89 option */ | 87 | #else /* C89 option */ |
88 | #define L_P2I size_t | 88 | #define L_P2I size_t |
@@ -521,12 +521,12 @@ static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) { | |||
521 | 521 | ||
522 | /* | 522 | /* |
523 | ** Solves the goto at index 'g' to given 'label' and removes it | 523 | ** Solves the goto at index 'g' to given 'label' and removes it |
524 | ** from the list of pending goto's. | 524 | ** from the list of pending gotos. |
525 | ** If it jumps into the scope of some variable, raises an error. | 525 | ** If it jumps into the scope of some variable, raises an error. |
526 | */ | 526 | */ |
527 | static void solvegoto (LexState *ls, int g, Labeldesc *label) { | 527 | static void solvegoto (LexState *ls, int g, Labeldesc *label) { |
528 | int i; | 528 | int i; |
529 | Labellist *gl = &ls->dyd->gt; /* list of goto's */ | 529 | Labellist *gl = &ls->dyd->gt; /* list of gotos */ |
530 | Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ | 530 | Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ |
531 | lua_assert(eqstr(gt->name, label->name)); | 531 | lua_assert(eqstr(gt->name, label->name)); |
532 | if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ | 532 | if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ |
@@ -580,7 +580,7 @@ static int newgotoentry (LexState *ls, TString *name, int line, int pc) { | |||
580 | /* | 580 | /* |
581 | ** Solves forward jumps. Check whether new label 'lb' matches any | 581 | ** Solves forward jumps. Check whether new label 'lb' matches any |
582 | ** pending gotos in current block and solves them. Return true | 582 | ** pending gotos in current block and solves them. Return true |
583 | ** if any of the goto's need to close upvalues. | 583 | ** if any of the gotos need to close upvalues. |
584 | */ | 584 | */ |
585 | static int solvegotos (LexState *ls, Labeldesc *lb) { | 585 | static int solvegotos (LexState *ls, Labeldesc *lb) { |
586 | Labellist *gl = &ls->dyd->gt; | 586 | Labellist *gl = &ls->dyd->gt; |
@@ -601,7 +601,7 @@ static int solvegotos (LexState *ls, Labeldesc *lb) { | |||
601 | /* | 601 | /* |
602 | ** Create a new label with the given 'name' at the given 'line'. | 602 | ** Create a new label with the given 'name' at the given 'line'. |
603 | ** 'last' tells whether label is the last non-op statement in its | 603 | ** 'last' tells whether label is the last non-op statement in its |
604 | ** block. Solves all pending goto's to this new label and adds | 604 | ** block. Solves all pending gotos to this new label and adds |
605 | ** a close instruction if necessary. | 605 | ** a close instruction if necessary. |
606 | ** Returns true iff it added a close instruction. | 606 | ** Returns true iff it added a close instruction. |
607 | */ | 607 | */ |
@@ -570,7 +570,7 @@ static const char *match_capture (MatchState *ms, const char *s, int l) { | |||
570 | static const char *match (MatchState *ms, const char *s, const char *p) { | 570 | static const char *match (MatchState *ms, const char *s, const char *p) { |
571 | if (l_unlikely(ms->matchdepth-- == 0)) | 571 | if (l_unlikely(ms->matchdepth-- == 0)) |
572 | luaL_error(ms->L, "pattern too complex"); | 572 | luaL_error(ms->L, "pattern too complex"); |
573 | init: /* using goto's to optimize tail recursion */ | 573 | init: /* using goto to optimize tail recursion */ |
574 | if (p != ms->p_end) { /* end of pattern? */ | 574 | if (p != ms->p_end) { /* end of pattern? */ |
575 | switch (*p) { | 575 | switch (*p) { |
576 | case '(': { /* start capture */ | 576 | case '(': { /* start capture */ |
@@ -666,7 +666,7 @@ int main (int argc, char **argv) { | |||
666 | l_message(argv[0], "cannot create state: not enough memory"); | 666 | l_message(argv[0], "cannot create state: not enough memory"); |
667 | return EXIT_FAILURE; | 667 | return EXIT_FAILURE; |
668 | } | 668 | } |
669 | lua_gc(L, LUA_GCSTOP); /* stop GC while buidling state */ | 669 | lua_gc(L, LUA_GCSTOP); /* stop GC while building state */ |
670 | lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ | 670 | lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ |
671 | lua_pushinteger(L, argc); /* 1st argument */ | 671 | lua_pushinteger(L, argc); /* 1st argument */ |
672 | lua_pushlightuserdata(L, argv); /* 2nd argument */ | 672 | lua_pushlightuserdata(L, argv); /* 2nd argument */ |
diff --git a/manual/manual.of b/manual/manual.of index 6d19e251..ac1d7e60 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -20,7 +20,7 @@ making it ideal for configuration, scripting, | |||
20 | and rapid prototyping. | 20 | and rapid prototyping. |
21 | 21 | ||
22 | Lua is implemented as a library, written in @emphx{clean C}, | 22 | Lua is implemented as a library, written in @emphx{clean C}, |
23 | the common subset of @N{Standard C} and C++. | 23 | the common subset of @N{standard C} and C++. |
24 | The Lua distribution includes a host program called @id{lua}, | 24 | The Lua distribution includes a host program called @id{lua}, |
25 | which uses the Lua library to offer a complete, | 25 | which uses the Lua library to offer a complete, |
26 | standalone Lua interpreter, | 26 | standalone Lua interpreter, |
@@ -2963,7 +2963,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, | |||
2963 | return realloc(ptr, nsize); | 2963 | return realloc(ptr, nsize); |
2964 | } | 2964 | } |
2965 | } | 2965 | } |
2966 | Note that @N{Standard C} ensures | 2966 | Note that @N{ISO C} ensures |
2967 | that @T{free(NULL)} has no effect and that | 2967 | that @T{free(NULL)} has no effect and that |
2968 | @T{realloc(NULL,size)} is equivalent to @T{malloc(size)}. | 2968 | @T{realloc(NULL,size)} is equivalent to @T{malloc(size)}. |
2969 | 2969 | ||
@@ -5780,7 +5780,7 @@ with @id{tname} in the registry. | |||
5780 | 5780 | ||
5781 | Creates a new Lua state. | 5781 | Creates a new Lua state. |
5782 | It calls @Lid{lua_newstate} with an | 5782 | It calls @Lid{lua_newstate} with an |
5783 | allocator based on the @N{standard C} allocation functions | 5783 | allocator based on the @N{ISO C} allocation functions |
5784 | and then sets a warning function and a panic function @see{C-error} | 5784 | and then sets a warning function and a panic function @see{C-error} |
5785 | that print messages to the standard error output. | 5785 | that print messages to the standard error output. |
5786 | 5786 | ||
@@ -6898,7 +6898,7 @@ including if necessary a path and an extension. | |||
6898 | @id{funcname} must be the exact name exported by the @N{C library} | 6898 | @id{funcname} must be the exact name exported by the @N{C library} |
6899 | (which may depend on the @N{C compiler} and linker used). | 6899 | (which may depend on the @N{C compiler} and linker used). |
6900 | 6900 | ||
6901 | This function is not supported by @N{Standard C}. | 6901 | This functionality is not supported by @N{ISO C}. |
6902 | As such, it is only available on some platforms | 6902 | As such, it is only available on some platforms |
6903 | (Windows, Linux, Mac OS X, Solaris, BSD, | 6903 | (Windows, Linux, Mac OS X, Solaris, BSD, |
6904 | plus other Unix systems that support the @id{dlfcn} standard). | 6904 | plus other Unix systems that support the @id{dlfcn} standard). |