ソースを参照

avoid '...' and "..." inside comments

Roberto Ierusalimschy 24 年 前
コミット
5f37134e64
12 ファイル変更60 行追加60 行削除
  1. 2 2
      lapi.c
  2. 3 3
      lbaselib.c
  3. 2 2
      ldebug.c
  4. 2 2
      ldo.c
  5. 2 2
      lgc.c
  6. 7 7
      llex.c
  7. 3 3
      lmathlib.c
  8. 20 20
      lparser.c
  9. 9 9
      lstrlib.c
  10. 2 2
      ltests.c
  11. 2 2
      ltm.c
  12. 6 6
      lvm.c

+ 2 - 2
lapi.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lapi.c,v 1.130 2001/02/14 17:04:11 roberto Exp roberto $
+** $Id: lapi.c,v 1.131 2001/02/20 18:15:33 roberto Exp roberto $
 ** Lua API
 ** See Copyright Notice in lua.h
 */
@@ -531,7 +531,7 @@ LUA_API int lua_ref (lua_State *L,  int lock) {
 
 
 /*
-** "do" functions (run Lua code)
+** `do' functions (run Lua code)
 ** (most of them are in ldo.c)
 */
 

+ 3 - 3
lbaselib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lbaselib.c,v 1.24 2001/02/20 18:29:54 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.25 2001/02/22 17:15:18 roberto Exp roberto $
 ** Basic library
 ** See Copyright Notice in lua.h
 */
@@ -447,7 +447,7 @@ static int luaB_tremove (lua_State *L) {
   luaL_checktype(L, 1, LUA_TTABLE);
   n = lua_getn(L, 1);
   pos = luaL_opt_int(L, 2, n);
-  if (n <= 0) return 0;  /* table is "empty" */
+  if (n <= 0) return 0;  /* table is `empty' */
   lua_rawgeti(L, 1, pos);  /* result = t[pos] */
   for ( ;pos<n; pos++) {
     lua_rawgeti(L, 1, pos+1);
@@ -545,7 +545,7 @@ static void auxsort (lua_State *L, int l, int u) {
     lua_rawgeti(L, 1, i);
     set2(L, u-1, i);  /* swap pivot (a[u-1]) with a[i] */
     /* a[l..i-1] <= a[i] == P <= a[i+1..u] */
-    /* adjust so that smaller "half" is in [j..i] and larger one in [l..u] */
+    /* adjust so that smaller half is in [j..i] and larger one in [l..u] */
     if (i-l < u-i) {
       j=l; i=i-1; l=i+2;
     }

+ 2 - 2
ldebug.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ldebug.c,v 1.66 2001/02/20 18:28:11 roberto Exp roberto $
+** $Id: ldebug.c,v 1.67 2001/02/21 16:52:09 roberto Exp roberto $
 ** Debug Interface
 ** See Copyright Notice in lua.h
 */
@@ -277,7 +277,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
   if (isactive)
     func = ar->_func;
   else {
-    what++;  /* skip the '>' */
+    what++;  /* skip the `>' */
     func = L->top - 1;
   }
   for (; *what; what++) {

+ 2 - 2
ldo.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ldo.c,v 1.124 2001/02/20 18:15:33 roberto Exp roberto $
+** $Id: ldo.c,v 1.125 2001/02/22 17:15:18 roberto Exp roberto $
 ** Stack and Call structure of Lua
 ** See Copyright Notice in lua.h
 */
@@ -276,7 +276,7 @@ static int parse_file (lua_State *L, const char *filename) {
   lua_pushliteral(L, "@");
   lua_pushstring(L, (filename == NULL) ? "(stdin)" : filename);
   lua_concat(L, 2);
-  filename = lua_tostring(L, -1);  /* filename = '@'..filename */
+  filename = lua_tostring(L, -1);  /* filename = `@'..filename */
   luaZ_Fopen(&z, f, filename);
   status = protectedparser(L, &z, bin);
   lua_remove(L, -2);  /* remove filename */

+ 2 - 2
lgc.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lgc.c,v 1.89 2001/02/20 18:15:33 roberto Exp roberto $
+** $Id: lgc.c,v 1.90 2001/02/20 18:28:11 roberto Exp roberto $
 ** Garbage Collector
 ** See Copyright Notice in lua.h
 */
@@ -18,7 +18,7 @@
 
 
 /*
-** optional "lock" for GC
+** optional lock for GC
 ** (when Lua calls GC tag methods it unlocks the regular lock)
 */
 #ifndef LUA_LOCKGC

+ 7 - 7
llex.c

@@ -1,5 +1,5 @@
 /*
-** $Id: llex.c,v 1.77 2001/02/09 20:22:29 roberto Exp roberto $
+** $Id: llex.c,v 1.78 2001/02/22 17:15:18 roberto Exp roberto $
 ** Lexical Analyzer
 ** See Copyright Notice in lua.h
 */
@@ -89,7 +89,7 @@ static void luaX_invalidchar (LexState *ls, int c) {
 
 
 static void inclinenumber (LexState *LS) {
-  next(LS);  /* skip '\n' */
+  next(LS);  /* skip `\n' */
   ++LS->linenumber;
   luaX_checklimit(LS, LS->linenumber, MAX_INT, "lines in a chunk");
 }
@@ -167,7 +167,7 @@ static void read_number (LexState *LS, int comma, SemInfo *seminfo) {
     save_and_next(L, LS, l);
   }
   if (LS->current == 'e' || LS->current == 'E') {
-    save_and_next(L, LS, l);  /* read 'E' */
+    save_and_next(L, LS, l);  /* read `E' */
     if (LS->current == '+' || LS->current == '-')
       save_and_next(L, LS, l);  /* optional exponent sign */
     while (isdigit(LS->current)) {
@@ -186,8 +186,8 @@ static void read_long_string (LexState *LS, SemInfo *seminfo) {
   int cont = 0;
   size_t l = 0;
   checkbuffer(L, 10, l);
-  save(L, '[', l);  /* save first '[' */
-  save_and_next(L, LS, l);  /* pass the second '[' */
+  save(L, '[', l);  /* save first `[' */
+  save_and_next(L, LS, l);  /* pass the second `[' */
   for (;;) {
     checkbuffer(L, 10, l);
     switch (LS->current) {
@@ -218,7 +218,7 @@ static void read_long_string (LexState *LS, SemInfo *seminfo) {
         save_and_next(L, LS, l);
     }
   } endloop:
-  save_and_next(L, LS, l);  /* skip the second ']' */
+  save_and_next(L, LS, l);  /* skip the second `]' */
   save(L, '\0', l);
   seminfo->ts = luaS_newlstr(L, G(L)->Mbuffer+2, l-5);
 }
@@ -237,7 +237,7 @@ static void read_string (LexState *LS, int del, SemInfo *seminfo) {
         luaX_error(LS, "unfinished string", TK_STRING);
         break;  /* to avoid warnings */
       case '\\':
-        next(LS);  /* do not save the '\' */
+        next(LS);  /* do not save the `\' */
         switch (LS->current) {
           case 'a': save(L, '\a', l); next(LS); break;
           case 'b': save(L, '\b', l); next(LS); break;

+ 3 - 3
lmathlib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lmathlib.c,v 1.33 2000/12/04 18:33:40 roberto Exp roberto $
+** $Id: lmathlib.c,v 1.34 2001/02/02 19:02:40 roberto Exp roberto $
 ** Standard mathematical library
 ** See Copyright Notice in lua.h
 */
@@ -166,8 +166,8 @@ static int math_max (lua_State *L) {
 
 
 static int math_random (lua_State *L) {
-  /* the '%' avoids the (rare) case of r==1, and is needed also because on
-     some systems (SunOS!) "rand()" may return a value larger than RAND_MAX */
+  /* the `%' avoids the (rare) case of r==1, and is needed also because on
+     some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */
   lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX;
   switch (lua_gettop(L)) {  /* check number of arguments */
     case 0: {  /* no arguments */

+ 20 - 20
lparser.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lparser.c,v 1.135 2001/02/20 18:15:33 roberto Exp roberto $
+** $Id: lparser.c,v 1.136 2001/02/20 18:28:11 roberto Exp roberto $
 ** LL(1) Parser and code generator for Lua
 ** See Copyright Notice in lua.h
 */
@@ -26,7 +26,7 @@
 ** Constructors descriptor:
 ** `n' indicates number of elements, and `k' signals whether
 ** it is a list constructor (k = 0) or a record constructor (k = 1)
-** or empty (k = ';' or '}')
+** or empty (k = `;' or `}')
 */
 typedef struct Constdesc {
   int n;
@@ -381,7 +381,7 @@ Proto *luaY_parser (lua_State *L, ZIO *z) {
 
 
 static int explist1 (LexState *ls) {
-  /* explist1 -> expr { ',' expr } */
+  /* explist1 -> expr { `,' expr } */
   int n = 1;  /* at least one expression */
   expdesc v;
   expr(ls, &v);
@@ -400,7 +400,7 @@ static void funcargs (LexState *ls, int slf) {
   FuncState *fs = ls->fs;
   int slevel = fs->stacklevel - slf - 1;  /* where is func in the stack */
   switch (ls->t.token) {
-    case '(': {  /* funcargs -> '(' [ explist1 ] ')' */
+    case '(': {  /* funcargs -> `(' [ explist1 ] `)' */
       int line = ls->linenumber;
       int nargs = 0;
       next(ls);
@@ -442,7 +442,7 @@ static void funcargs (LexState *ls, int slf) {
 
 
 static void recfield (LexState *ls) {
-  /* recfield -> (NAME | '['exp1']') = exp1 */
+  /* recfield -> (NAME | `['exp1`]') = exp1 */
   switch (ls->t.token) {
     case TK_NAME: {
       luaK_kstr(ls, checkname(ls));
@@ -462,7 +462,7 @@ static void recfield (LexState *ls) {
 
 
 static int recfields (LexState *ls) {
-  /* recfields -> recfield { ',' recfield } [','] */
+  /* recfields -> recfield { `,' recfield } [`,'] */
   FuncState *fs = ls->fs;
   int n = 1;  /* at least one element */
   recfield(ls);
@@ -481,7 +481,7 @@ static int recfields (LexState *ls) {
 
 
 static int listfields (LexState *ls) {
-  /* listfields -> exp1 { ',' exp1 } [','] */
+  /* listfields -> exp1 { `,' exp1 } [`,'] */
   FuncState *fs = ls->fs;
   int n = 1;  /* at least one element */
   exp1(ls);
@@ -531,7 +531,7 @@ static void constructor_part (LexState *ls, Constdesc *cd) {
 
 
 static void constructor (LexState *ls) {
-  /* constructor -> '{' constructor_part [';' constructor_part] '}' */
+  /* constructor -> `{' constructor_part [`;' constructor_part] `}' */
   FuncState *fs = ls->fs;
   int line = ls->linenumber;
   int pc = luaK_code1(fs, OP_CREATETABLE, 0);
@@ -617,18 +617,18 @@ static void primaryexp (LexState *ls, expdesc *v) {
 
 static void simpleexp (LexState *ls, expdesc *v) {
   /* simpleexp ->
-        primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */
+        primaryexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
   primaryexp(ls, v);
   for (;;) {
     switch (ls->t.token) {
-      case '.': {  /* '.' NAME */
+      case '.': {  /* `.' NAME */
         next(ls);
         luaK_tostack(ls, v, 1);  /* `v' must be on stack */
         luaK_kstr(ls, checkname(ls));
         v->k = VINDEXED;
         break;
       }
-      case '[': {  /* '[' exp1 ']' */
+      case '[': {  /* `[' exp1 `]' */
         next(ls);
         luaK_tostack(ls, v, 1);  /* `v' must be on stack */
         v->k = VINDEXED;
@@ -636,7 +636,7 @@ static void simpleexp (LexState *ls, expdesc *v) {
         check(ls, ']');
         break;
       }
-      case ':': {  /* ':' NAME funcargs */
+      case ':': {  /* `:' NAME funcargs */
         next(ls);
         luaK_tostack(ls, v, 1);  /* `v' must be on stack */
         luaK_code1(ls->fs, OP_PUSHSELF, checkname(ls));
@@ -775,14 +775,14 @@ static void block (LexState *ls) {
 static int assignment (LexState *ls, expdesc *v, int nvars) {
   int left = 0;  /* number of values left in the stack after assignment */
   luaX_checklimit(ls, nvars, MAXVARSLH, "variables in a multiple assignment");
-  if (ls->t.token == ',') {  /* assignment -> ',' simpleexp assignment */
+  if (ls->t.token == ',') {  /* assignment -> `,' simpleexp assignment */
     expdesc nv;
     next(ls);
     simpleexp(ls, &nv);
     check_condition(ls, (nv.k != VEXP), "syntax error");
     left = assignment(ls, &nv, nvars+1);
   }
-  else {  /* assignment -> '=' explist1 */
+  else {  /* assignment -> `=' explist1 */
     int nexps;
     check(ls, '=');
     nexps = explist1(ls);
@@ -943,11 +943,11 @@ static void ifstat (LexState *ls, int line) {
 
 
 static void localstat (LexState *ls) {
-  /* stat -> LOCAL NAME {',' NAME} ['=' explist1] */
+  /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */
   int nvars = 0;
   int nexps;
   do {
-    next(ls);  /* skip LOCAL or ',' */
+    next(ls);  /* skip LOCAL or `,' */
     new_localvar(ls, str_checkname(ls), nvars++);
   } while (ls->t.token == ',');
   if (optional(ls, '='))
@@ -960,7 +960,7 @@ static void localstat (LexState *ls) {
 
 
 static int funcname (LexState *ls, expdesc *v) {
-  /* funcname -> NAME {'.' NAME} [':' NAME] */
+  /* funcname -> NAME {`.' NAME} [`:' NAME] */
   int needself = 0;
   singlevar(ls, str_checkname(ls), v);
   while (ls->t.token == '.') {
@@ -1083,7 +1083,7 @@ static int stat (LexState *ls) {
 
 
 static void parlist (LexState *ls) {
-  /* parlist -> [ param { ',' param } ] */
+  /* parlist -> [ param { `,' param } ] */
   int nparams = 0;
   short dots = 0;
   if (ls->t.token != ')') {  /* is `parlist' not empty? */
@@ -1100,7 +1100,7 @@ static void parlist (LexState *ls) {
 
 
 static void body (LexState *ls, int needself, int line) {
-  /* body ->  '(' parlist ')' chunk END */
+  /* body ->  `(' parlist `)' chunk END */
   FuncState new_fs;
   open_func(ls, &new_fs);
   new_fs.f->lineDefined = line;
@@ -1122,7 +1122,7 @@ static void body (LexState *ls, int needself, int line) {
 
 
 static void chunk (LexState *ls) {
-  /* chunk -> { stat [';'] } */
+  /* chunk -> { stat [`;'] } */
   int islast = 0;
   while (!islast && !block_follow(ls->t.token)) {
     islast = stat(ls);

+ 9 - 9
lstrlib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lstrlib.c,v 1.62 2001/02/02 19:02:40 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.63 2001/02/22 17:15:18 roberto Exp roberto $
 ** Standard library for string operations and pattern-matching
 ** See Copyright Notice in lua.h
 */
@@ -17,7 +17,7 @@
 #include "lualib.h"
 
 
-typedef long sint32;	/* a "signed" version for size_t */
+typedef long sint32;	/* a signed version for size_t */
 
 
 static int str_len (lua_State *L) {
@@ -128,7 +128,7 @@ static int str_char (lua_State *L) {
 
 typedef struct MatchState {
   const char *src_init;  /* init of source string */
-  const char *src_end;  /* end ('\0') of source string */
+  const char *src_end;  /* end (`\0') of source string */
   int level;  /* total number of captures (finished or unfinished) */
   struct {
     const char *init;
@@ -166,9 +166,9 @@ static const char *luaI_classend (MatchState *ms, const char *p) {
       return p+1;
     case '[':
       if (*p == '^') p++;
-      do {  /* look for a ']' */
+      do {  /* look for a `]' */
         if (*p == '\0') lua_error(ms->L, "malformed pattern (missing `]')");
-        if (*(p++) == ESC && *p != '\0') p++;  /* skip escapes (e.g. '%]') */
+        if (*(p++) == ESC && *p != '\0') p++;  /* skip escapes (e.g. `%]') */
       } while (*p != ']');
       return p+1;
     default:
@@ -200,7 +200,7 @@ static int matchbracketclass (char c, const char *p, const char *endclass) {
   int sig = 1;
   if (*(p+1) == '^') {
     sig = 0;
-    p++;  /* skip the '^' */
+    p++;  /* skip the `^' */
   }
   while (++p < endclass) {
     if (*p == ESC) {
@@ -342,7 +342,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) {
     case '\0':  /* end of pattern */
       return s;  /* match succeeded */
     case '$':
-      if (*(p+1) == '\0')  /* is the '$' the last char in pattern? */
+      if (*(p+1) == '\0')  /* is the `$' the last char in pattern? */
         return (s == ms->src_end) ? s : NULL;  /* check end of string */
       else goto dflt;
     default: dflt: {  /* it is a pattern item */
@@ -601,7 +601,7 @@ static int str_format (lua_State *L) {
           break;
         case 'q':
           luaI_addquoted(L, &b, arg);
-          continue;  /* skip the "addsize" at the end */
+          continue;  /* skip the `addsize' at the end */
         case 's': {
           size_t l;
           const char *s = luaL_check_lstr(L, arg, &l);
@@ -610,7 +610,7 @@ static int str_format (lua_State *L) {
                keep original string */
             lua_pushvalue(L, arg);
             luaL_addvalue(&b);
-            continue;  /* skip the "addsize" at the end */
+            continue;  /* skip the `addsize' at the end */
           }
           else {
             sprintf(buff, form, s);

+ 2 - 2
ltests.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ltests.c,v 1.69 2001/02/20 18:18:00 roberto Exp roberto $
+** $Id: ltests.c,v 1.70 2001/02/21 16:51:25 roberto Exp roberto $
 ** Internal Module for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 */
@@ -473,7 +473,7 @@ static int equal (lua_State *L) {
 
 /*
 ** {======================================================
-** function to test the API with C. It interprets a kind of "assembler"
+** function to test the API with C. It interprets a kind of assembler
 ** language with calls to the API, so the test can be driven by Lua code
 ** =======================================================
 */

+ 2 - 2
ltm.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ltm.c,v 1.66 2001/02/09 20:22:29 roberto Exp roberto $
+** $Id: ltm.c,v 1.67 2001/02/20 18:15:33 roberto Exp roberto $
 ** Tag methods
 ** See Copyright Notice in lua.h
 */
@@ -50,7 +50,7 @@ static int luaI_checkevent (lua_State *L, const char *name, int t) {
 
 
 /* events in LUA_TNIL are all allowed, since this is used as a
-*  'placeholder' for "default" fallbacks
+*  `placeholder' for default fallbacks
 */
 /* ORDER LUA_T, ORDER TM */
 static const lu_byte luaT_validevents[NUM_TAGS][TM_N] = {

+ 6 - 6
lvm.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lvm.c,v 1.169 2001/02/12 13:04:19 roberto Exp roberto $
+** $Id: lvm.c,v 1.170 2001/02/20 18:15:33 roberto Exp roberto $
 ** Lua virtual machine
 ** See Copyright Notice in lua.h
 */
@@ -237,13 +237,13 @@ static int luaV_strlessthan (const TString *ls, const TString *rs) {
   for (;;) {
     int temp = strcoll(l, r);
     if (temp != 0) return (temp < 0);
-    else {  /* strings are equal up to a '\0' */
-      size_t len = strlen(l);  /* index of first '\0' in both strings */
+    else {  /* strings are equal up to a `\0' */
+      size_t len = strlen(l);  /* index of first `\0' in both strings */
       if (len == lr)  /* r is finished? */
         return 0;  /* l is equal or greater than r */
       else if (len == ll)  /* l is finished? */
         return 1;  /* l is smaller than r (because r is not finished) */
-      /* both strings longer than `len'; go on comparing (after the '\0') */
+      /* both strings longer than `len'; go on comparing (after the `\0') */
       len++;
       l += len; ll -= len; r += len; lr -= len;
     }
@@ -600,7 +600,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
           luaD_error(L, "`for' limit must be a number");
         if (tonumber(top-3))
           luaD_error(L, "`for' initial value must be a number");
-        pc += -jmp;  /* "jump" to loop end (delta is negated here) */
+        pc += -jmp;  /* `jump' to loop end (delta is negated here) */
         goto forloop;  /* do not increment index */
       }
       case OP_FORLOOP: {
@@ -626,7 +626,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
         setnvalue(top-3, -1);  /* initial index */
         setnilvalue(top-2);
         setnilvalue(top-1);
-        pc += -jmp;  /* "jump" to loop end (delta is negated here) */
+        pc += -jmp;  /* `jump' to loop end (delta is negated here) */
         /* go through */
       }
       case OP_LFORLOOP: {