- Added commentary for TOK_DEFSHARP nodes explaining pn_kid's purpose.

- Don't over-commend nearby #endifs at the expense of legibility.
This commit is contained in:
brendan%netscape.com 1998-09-10 20:13:06 +00:00
Родитель a68dfaf6ec
Коммит 0b411ad632
2 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -2420,11 +2420,11 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
*/ */
oldflags = tc->flags; oldflags = tc->flags;
tc->flags &= ~TCF_IN_FOR_INIT; tc->flags &= ~TCF_IN_FOR_INIT;
#endif /* JS_HAS_IN_OPERATOR */ #endif
pn2 = Expr(cx, ts, tc); pn2 = Expr(cx, ts, tc);
#if JS_HAS_IN_OPERATOR #if JS_HAS_IN_OPERATOR
tc->flags = oldflags; tc->flags = oldflags;
#endif /* JS_HAS_IN_OPERATOR */ #endif
if (!pn2) if (!pn2)
return NULL; return NULL;
@ -2438,7 +2438,7 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
case TOK_STRING: case TOK_STRING:
#if JS_HAS_SHARP_VARS #if JS_HAS_SHARP_VARS
notsharp = JS_TRUE; notsharp = JS_TRUE;
#endif /* JS_HAS_SHARP_VARS */ #endif
/* FALL THROUGH */ /* FALL THROUGH */
case TOK_NAME: case TOK_NAME:
case TOK_OBJECT: case TOK_OBJECT:
@ -2463,7 +2463,7 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
pn->pn_dval = ts->token.t_dval; pn->pn_dval = ts->token.t_dval;
#if JS_HAS_SHARP_VARS #if JS_HAS_SHARP_VARS
notsharp = JS_TRUE; notsharp = JS_TRUE;
#endif /* JS_HAS_SHARP_VARS */ #endif
break; break;
case TOK_PRIMARY: case TOK_PRIMARY:
@ -2473,7 +2473,7 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
pn->pn_op = ts->token.t_op; pn->pn_op = ts->token.t_op;
#if JS_HAS_SHARP_VARS #if JS_HAS_SHARP_VARS
notsharp = JS_TRUE; notsharp = JS_TRUE;
#endif /* JS_HAS_SHARP_VARS */ #endif
break; break;
#if !JS_HAS_EXPORT_IMPORT #if !JS_HAS_EXPORT_IMPORT
@ -2508,7 +2508,7 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
defsharp->pn_kid = pn; defsharp->pn_kid = pn;
return defsharp; return defsharp;
} }
#endif /* JS_HAS_SHARP_VARS */ #endif
return pn; return pn;
} }

Просмотреть файл

@ -125,6 +125,9 @@ PR_BEGIN_EXTERN_C
* each has pn_left: property id, pn_right: value * each has pn_left: property id, pn_right: value
* #n={...} produces TOK_DEFSHARP at head of list * #n={...} produces TOK_DEFSHARP at head of list
* TOK_DEFSHARP unary pn_num: jsint value of n in #n= * TOK_DEFSHARP unary pn_num: jsint value of n in #n=
* pn_kid: null for #n=[...] and #n={...}, primary
* if #n=primary for function, paren, name, object
* literal expressions
* TOK_USESHARP nullary pn_num: jsint value of n in #n# * TOK_USESHARP nullary pn_num: jsint value of n in #n#
* TOK_RP unary pn_kid: parenthesized expression * TOK_RP unary pn_kid: parenthesized expression
* TOK_NAME, name pn_atom: name, string, or object atom * TOK_NAME, name pn_atom: name, string, or object atom