# HG changeset patch # User lost # Date 1237742719 0 # Node ID 716879fc67900f1a4231255b41598780b1788caf # Parent bfd0fb0a85c264bddadf74153be8295aa9560140 Allow $ to be a local symbol and allow symbols with $ to start with a digit diff -r bfd0fb0a85c2 -r 716879fc6790 lwasm/symbol.c --- a/lwasm/symbol.c Sun Mar 22 16:28:40 2009 +0000 +++ b/lwasm/symbol.c Sun Mar 22 17:25:19 2009 +0000 @@ -62,16 +62,19 @@ // [a-zA-Z0-9._$?@] and any byte value larger than 0x7F // although symbols should be restricted to the 7 bit range // symbols must start with [a-zA-Z._] - if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._@?", *sym)) + if (!strchr(sym, '$')) { - register_error(as, l, 1, "Bad symbol: %s", sym); - return -1; - } + if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._@?", *sym)) + { + register_error(as, l, 1, "Bad symbol: %s", sym); + return -1; + } - if (*sym == '@' && isdigit(sym[1])) - { - register_error(as, l, 1, "Bad symbol: %s", sym); - return -1; + if (*sym == '@' && isdigit(sym[1])) + { + register_error(as, l, 1, "Bad symbol: %s", sym); + return -1; + } } for (p = sym; *p; p++) @@ -82,7 +85,7 @@ return -1; } // flag local symbols while we're at it... - if (*p == '?' || *p == '@') + if (*p == '?' || *p == '@' || *p == '$') scontext = as -> context; }