diff options
author | 2017-01-18 00:32:12 +0100 | |
---|---|---|
committer | 2017-01-20 22:20:36 +0100 | |
commit | 1ae3e29ea3fd90e5df31d52c5d3860fde7f3cbac (patch) | |
tree | e32ddf77ae8408a1aea8d7abb15f5048bba3ed81 /src/lib/netlist/nl_parser.cpp | |
parent | d0b6742563ac7f9ed626a89ebd022d09c64dfa4d (diff) |
Assume string literals are UTF8 in netlist code.
At the same time, any char pointer has to be explicitly converted to
pstring by specifying an encoding. Not yet optimal, but certainly better
than what was there before.
Removed unneeded methods from pstring. (nw)
Diffstat (limited to 'src/lib/netlist/nl_parser.cpp')
-rw-r--r-- | src/lib/netlist/nl_parser.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index 15f185ea712..5f0bcaa395d 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -29,13 +29,8 @@ bool parser_t::parse(const pstring nlname) { set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"); set_number_chars(".0123456789", "0123456789eE-."); //FIXME: processing of numbers - char ws[5]; - ws[0] = ' '; - ws[1] = 9; - ws[2] = 10; - ws[3] = 13; - ws[4] = 0; - set_whitespace(ws); + //const char ws[5] = { ' ', 9, 10, 13, 0 }; + set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); set_comment("/*", "*/", "//"); m_tok_param_left = register_token("("); m_tok_param_right = register_token(")"); @@ -404,7 +399,7 @@ void parser_t::device(const pstring &dev_type) nl_double parser_t::eval_param(const token_t tok) { - static const char *macs[6] = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"}; + static pstring macs[6] = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"}; static nl_double facs[6] = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12}; int i; int f=0; |