SpaceManiac / SpacemanDMM

A BYOND language smartness provider, map renderer, and more.
https://marketplace.visualstudio.com/items?itemName=platymuus.dm-langclient
GNU General Public License v3.0
83 stars 83 forks source link

Can't parse library inclusions #79

Open Kaiochao opened 5 years ago

Kaiochao commented 5 years ago

#include<author/library/library.dme> in a .dm file gives

unexpected token Punct(Less), expecting Token::String(path)
path separated by '.', should be '/'
got '>', expected one of: '/', '[', contents, newline, identifier
SpaceManiac commented 5 years ago

Was aware of this, but thanks for officially filing it

Kaiochao commented 5 years ago

Can't #include non-library .dme files either: unknown extension "dme"

SpaceManiac commented 5 years ago

.dme files are treated just like .dm files as of 574f1f780eed39be19e7aeb5cd04066980458740.

Library inclusion requires more work due to the way the parser is structured.

Cyberboss commented 4 years ago

What's the problem with this currently?

SpaceManiac commented 4 years ago

#include <a/b/c.dm> is tokenized as [Less, "a", Slash, "b", Slash, "c", Dot, "dm", Greater] and preprocessor chokes on it because it wants a single string literal

SpaceManiac commented 4 years ago

Note that there are two prongs to this:

  1. Changing the way the lexer and preprocessor interact so that the preprocessor can see <a/b/c.dm> as a single unit rather than a token stream
  2. Determining BYOND install locations so that a <> include can actually be located and parsed
UltraJohn commented 2 years ago

Is there a workaround to this? I just ran into the same problem. The parser cannot continue and all evaluation gets skipped.

SpaceManiac commented 2 years ago

The workaround is to copy-paste the libraries into your project's source tree instead of using BYOND's library system.