github-linguist / github-linguist/linguist

Alex and Happy

Open
#5,822 2 comments 4 reactions 0 assignees View on GitHub
Add Language Good First Issue
Dominant language
Ruby
Stars
13.7k
Forks
5.4k
Avg merge
1d 15h
Merged PRs (30d)
17

Description

Previous discussions: #2446 #4302

[Alex](https://www.haskell.org/alex/) and [Happy](https://www.haskell.org/happy/) are lexer and parser generators (respectively) for Haskell, based on Lex and Yacc for C. They also share extensions with Lex and Yacc, and as such are misclassified as them currently:

[~200 Alex files misclassified as Lex](https://github.com/search?l=&o=desc&q=%25wrapper++language%3ALex&s=&type=Code)
[~1250 Happy files misclassified as Yacc](https://github.com/search?l=&q=%25monad+language%3AYacc&type=code)

Additionally, #4952 introduced [an Alex file](https://github.com/github/linguist/blob/3c3b037910006fc2f1a9bb34b2c4e9cde062206c/samples/Lex/filenames/Lexer.x) as a sample file for Lex, which is incorrect.

Below are the templates for both Alex and Happy. The reason this is an issue and not a PR is that I'm not aware of any TextMate grammars for either of them. Currently however they are using Lex and Yacc's grammars, which result in nonsense highlighting. If they can be added without having grammars I can open a PR for them.

___

## Language name
Alex

## URL of example repository
https://github.com/haskell/alex/blob/master/src/Scan.x

## Most popular extensions
- .x

## Detected language
- Lex
- Logos
___

## Language name
Happy

## URL of example repository
https://github.com/haskell/alex/blob/master/src/Parser.y

## Most popular extensions
- .y

## Detected language
- Yacc

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.