Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language grammar misses primitive types in parameter lists #46

Open
JayDaley opened this issue Aug 24, 2011 · 2 comments
Open

language grammar misses primitive types in parameter lists #46

JayDaley opened this issue Aug 24, 2011 · 2 comments

Comments

@JayDaley
Copy link

In the language grammar the following language rule is defined in such a way that it misses primitive types inside the parameter list and scopes them as an entity.name.class instead

parameter-list = {
  patterns = (
    { match = '([a-zA-Z$_][a-zA-Z0-9$_]*)\s*:\s*([A-Za-z0-9][\w|_|?|\.]*)?,?';
      captures = {
        1 = { name = 'variable.parameter'; };
        2 = { name = 'entity.name.class'; };
      };
    },
  );
};

I'm pretty sure that the way to fix this involves using

begin = '\(';
end = '\)';

and then recursively calling the storage and other language rules but I've no idea how to do that!

@mads-hartmann
Copy link
Owner

Hi Jay,

Yes I think you're right and there's probably room for improvements here. It would require quite a lot of testing though to make sure that it didn't break any highlighting so will have to wait for a day where I have more time :)

@mads-hartmann
Copy link
Owner

You can see how to apply rules recursively in 'block-comments' if you want to take a whack at it yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants