Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
The parser now handles Windows-1252
Browse files Browse the repository at this point in the history
  • Loading branch information
Idhrendur committed Oct 20, 2013
1 parent 9ff5a43 commit 231fd74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Data Files/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,7 @@ Revision Log Message
515 Add copyright and license to source files
516 Handle missing localisation when generating new countries
517 Commiting files not included in revision 516
518 Merge main into mod
518 Merge main into mod


520 The parser now handles Windows-1252
6 changes: 3 additions & 3 deletions Source/Parsers/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ struct Parser : public qi::grammar<Iterator, SkipComment<Iterator> > {
Parser() : Parser::base_type(root)
{
braces = lit('{') >> *(iso8859_1::space) >> lit('}');
str = lexeme[lit('"') >> raw[*(~iso8859_1::char_('"'))] >> lit('"')];
tolleaf = raw[+(~iso8859_1::char_("\"{}= \t\r\n"))];
leaf = raw[+(iso8859_1::alnum | iso8859_1::char_("-._:"))];
str = lexeme[lit('"') >> raw[*(~iso8859_1::char_('"') | lit(0x80) | lit(0x81) | lit(0x82) | lit(0x83) | lit(0x84) | lit(0x85) | lit(0x86) | lit(0x87) | lit(0x88) | lit(0x89) | lit(0x8A) | lit(0x8B) | lit(0x8C) | lit(0x8D) | lit(0x8E) | lit(0x8F) | lit(0x90) | lit(0x91) | lit(0x92) | lit(0x93) | lit(0x94) | lit(0x95) | lit(0x96) | lit(0x97) | lit(0x98) | lit(0x99) | lit(0x9A) | lit(0x9B) | lit(0x9C) | lit(0x9D) | lit(0x9E) | lit(0x9F))] >> lit('"')];
tolleaf = raw[+(~iso8859_1::char_("\"{}= \t\r\n") | lit(0x80) | lit(0x81) | lit(0x82) | lit(0x83) | lit(0x84) | lit(0x85) | lit(0x86) | lit(0x87) | lit(0x88) | lit(0x89) | lit(0x8A) | lit(0x8B) | lit(0x8C) | lit(0x8D) | lit(0x8E) | lit(0x8F) | lit(0x90) | lit(0x91) | lit(0x92) | lit(0x93) | lit(0x94) | lit(0x95) | lit(0x96) | lit(0x97) | lit(0x98) | lit(0x99) | lit(0x9A) | lit(0x9B) | lit(0x9C) | lit(0x9D) | lit(0x9E) | lit(0x9F))];
leaf = raw[+(iso8859_1::alnum | iso8859_1::char_("-._:") | lit(0x80) | lit(0x81) | lit(0x82) | lit(0x83) | lit(0x84) | lit(0x85) | lit(0x86) | lit(0x87) | lit(0x88) | lit(0x89) | lit(0x8A) | lit(0x8B) | lit(0x8C) | lit(0x8D) | lit(0x8E) | lit(0x8F) | lit(0x90) | lit(0x91) | lit(0x92) | lit(0x93) | lit(0x94) | lit(0x95) | lit(0x96) | lit(0x97) | lit(0x98) | lit(0x99) | lit(0x9A) | lit(0x9B) | lit(0x9C) | lit(0x9D) | lit(0x9E) | lit(0x9F))];
taglist = lit('{') >> omit[*(iso8859_1::space)] >> lexeme[( ( str | skip[tolleaf] ) % *(iso8859_1::space) )] >> omit[*(iso8859_1::space)] >> lit('}');
object = raw[lit('{') >> *(root) >> *(iso8859_1::space) >> lit('}')];
objlist = raw[lit('{') >> *( *(iso8859_1::space) >> object[&pushObj] ) >> *(iso8859_1::space) >> lit('}')];
Expand Down

0 comments on commit 231fd74

Please sign in to comment.