Skip to content

Commit

Permalink
fixing a small issue with unicode whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Dec 23, 2012
1 parent 010f9c8 commit e06486b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rascal/src/io/bibtex/Parser.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ alias BibLib = list[BibEntry];
alias BibEntry = tuple[str kind, str name, map[str,str] attrs];

public BibLib loc2bib(loc l) = str2bib(readFile(l));
BibLib str2bib(str s) = library2list(parse(#BibLibrary,trim(replaceAll(s,"\uC2A0"," "))));
BibLib str2bib(str s) = library2list(parse(#BibLibrary,trim(s)));

BibLib library2list(BibLibrary b) = [mapEntry(e) | OneBibEntry e <- b.es];
Expand Down
4 changes: 2 additions & 2 deletions rascal/src/io/bibtex/Syntax.rsc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@contributor{Vadim Zaytsev - vadim@grammarware.net - SWAT, CWI}
module io::bibtex::Syntax

layout L = WS;
lexical WS = [\uC2A0 \ \n\r\t]* !>> [\uC2A0 \ \n\r\t]; // note the nonbreakable space (0xC2A0 in Unicode)
layout L = WS* !>> [\u0009-\u000D \u0020 \u0085 \u00A0 \u1680 \u180E \u2000-\u200A \u2028 \u2029 \u202F \u205F \u3000];
lexical WS = [\u0009-\u000D \u0020 \u0085 \u00A0 \u1680 \u180E \u2000-\u200A \u2028 \u2029 \u202F \u205F \u3000];

syntax OneBibEntry = BibEntryType kind "{" BibEntryName name "," {BibPair ","}+ pairs ","? "}";
lexical BibEntryType = "@" [a-zA-Z]+ name;
Expand Down

0 comments on commit e06486b

Please sign in to comment.