Skip to content

Commit

Permalink
fix(makefile) fix double relevance for assignments (#2278)
Browse files Browse the repository at this point in the history
* fix(makefile) fix double relevance for assignments

Closes #1976.

- Makefile was claiming 2 relevance for every `x =` pattern
- I'm not sure other grammars get points for assignment,
  so 2 seems off to me.
- Cleaning up the grammar and lowering this rule back to
  1 relevance.
  • Loading branch information
joshgoebel committed Nov 13, 2019
1 parent 93badf7 commit b53e78e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ New styles:
none.

Improvements:
- fix(makefile) fix double relevance for assigns, improves auto-detection (#2278)[Josh Goebel][]
- enh(xml) support for highlighting entities (#2260) [w3suli][]
- enh(gml) fix naming of keyword class (consistency fix) (#2254) [Liam Nobel][]
- enh(javascript): Add support for jsdoc comments (#2245) [Milutin Kristofic][]
Expand Down
14 changes: 3 additions & 11 deletions src/languages/makefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,8 @@ function(hljs) {
]
};
/* Variable assignment */
var VAR_ASSIG = {
begin: '^' + hljs.UNDERSCORE_IDENT_RE + '\\s*[:+?]?=',
illegal: '\\n',
returnBegin: true,
contains: [
{
begin: '^' + hljs.UNDERSCORE_IDENT_RE, end: '[:+?]?=',
excludeEnd: true,
}
]
var ASSIGNMENT = {
begin: '^' + hljs.UNDERSCORE_IDENT_RE + '\\s*(?=[:+?]?=)'
};
/* Meta targets (.PHONY) */
var META = {
Expand All @@ -80,7 +72,7 @@ function(hljs) {
VARIABLE,
QUOTE_STRING,
FUNC,
VAR_ASSIG,
ASSIGNMENT,
META,
TARGET,
]
Expand Down

0 comments on commit b53e78e

Please sign in to comment.