www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19910] New: ImportVisitor example fails to parse random files

https://issues.dlang.org/show_bug.cgi?id=19910

          Issue ID: 19910
           Summary: ImportVisitor example fails to parse random files
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: goalitium dissues.mail.kapsi.fi

The Import Visitor example (from here:
https://github.com/dlang/dmd/blob/master/src/examples/impvisitor.d ) with some
slight modifications (here:
https://gist.github.com/GoaLitiuM/841be5bf808a9b20f4b39ddcdf1edf70 )...

... Seems to fail parsing some files and usually print weird errors like these:
package.d(8): Error: Invalid trailing code unit
package.d(8): Error: Outside Unicode code space
package.d(8): Error: char 0x009b not allowed in identifier
package.d(8): Error: Outside Unicode code space
package.d(8): Error: character 0x9b is not a valid token
package.d(8): Error: character 0x02 is not a valid token
package.d(8): Error: no identifier for declarator `type`

Enabling garbage collector seems to cause different files to pass and other
files to fail instead, usually followed by a crash. I was also suggested to try
a slightly altered version of the example with the proper DMD initialization
and deinitialization, but it had no effect on this issue.

--
May 28 2019