Skip to content

Commit

Permalink
allow @ in identifiers
Browse files Browse the repository at this point in the history
Identifiers can contain the @ symbol, a typical example is
```
put @resources << /ColorSpace @pgfcolorspaces >>
```
as found in documents created with LaTeX package pgf and colorspaces.

At the moment a pdf containing the above will trigger an error:
```
pdfminer.psparser.PSSyntaxError: Invalid dictionary construct: [/'ColorSpace', /b'@', /b'pgfcolorspaces']
```
since @ is parsed as separate token.
  • Loading branch information
norbusan committed Feb 15, 2024
1 parent 9cc4d1d commit 700f8d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdfminer/psparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _parse_main(self, s: bytes, i: int) -> int:
self._curtoken = c
self._parse1 = self._parse_float
return j + 1
elif c.isalpha():
elif c.isalpha() or c == b"@":
self._curtoken = c
self._parse1 = self._parse_keyword
return j + 1
Expand Down

0 comments on commit 700f8d9

Please sign in to comment.