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

Add class-name highlighting for Eiffel #471

Merged
merged 2 commits into from
Sep 9, 2017
Merged

Conversation

Conaclos
Copy link
Contributor

Hi!

The creation of external theme, in particular a themes, in particular the EiffelStudio IDE theme, the Eiffel language definition must enable highlighting of the class-names.

I based the regex on the unanimously used Eiffel convention for class naming (i.e. class-names are always all upper-case characters).
The only known issue is that the formal generics are considered as class names...

Thanks.

@LeaVerou
Copy link
Member

How big of an issue is that? What are formal generics? Is there anything to distinguish them on the syntax level?

(also, thanks!)

@Conaclos
Copy link
Contributor Author

Formal generic parameters and class-names

Eiffel Standard (ECMA 367) 8.12:

The genericity mechanism, still based on classes, gives us a new level of flexibility through type parameterization. You may for example define a class as LIST [G], yielding not just one type but many: LIST [INTEGER], LIST [AIRPLANE] and so on, parameterized by G.

The only way to know if the identifier is a class-name or a formal generic parameter is to know the class declaration.
e.g.

deferred class
    A [G]

feature
    items: G
        deferred  end

end

The declaration class A [G] enables to say that G is a formal generic parameter. All occurrences of G in the class denotes this generic.

@Conaclos
Copy link
Contributor Author

Conaclos commented Jan 21, 2015

@LeaVerou

Is it really an issue?

Using the same CSS class for class-names and formal generic parameter names is not really a problem. The notion are related...

@Conaclos
Copy link
Contributor Author

@Golmote Hi!

A new commit from @carlfriess is now integrated (See #827).

Eiffel users which use Prism for Eiffel highlighting gave me a positive feedback about this PR.
For example http://eiffel-guide.com/ uses a modified version of Prism in order to benefit of these changes.

@Golmote Golmote merged commit 39f48c9 into PrismJS:gh-pages Sep 9, 2017
@Golmote
Copy link
Contributor

Golmote commented Sep 9, 2017

Sorry for the long time waiting. Thank you for contributing!

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

Successfully merging this pull request may close these issues.

4 participants