-
Notifications
You must be signed in to change notification settings - Fork 744
Comparing changes
Open a pull request
base repository: rouge-ruby/rouge
base: v3.19.0
head repository: rouge-ruby/rouge
compare: v3.20.0
- 19 commits
- 46 files changed
- 9 contributors
Commits on May 30, 2020
-
Fix erroneous brace matching rule in JavaScript lexer (#1526)
The JavaScript lexer contains a bug in the `:statement` state. This state contains a rule for lexing braces but this rule prevents Rouge from ever leaving the `:object` state. While this does not manifest itself in visible errors in most situations, it has the potential to cause subtle bugs and does not fit the mental model a user would have trying to understand how the JavaScript lexer is implemented. This commit fixes the problem by removing the rule.
Configuration menu - View commit details
-
Copy full SHA for 089a1e0 - Browse repository at this point
Copy the full SHA 089a1e0View commit details -
Change the way common methods are mixed in to TypeScript-based lexers (…
…#1527) Sometimes it makes sense for a Rouge lexer to inherit methods from more than one class. Ruby does not have multiple class inheritance and so the idiomatic solution in Rouge is to extract the methods that should be shared into a common module that can be mixed in to the relevant lexers. A Ruby module can be mixed in via either calling `include` or `extend`. If the module is mixed in via `include`, then the methods are added as instance methods of the mixing class. If the module is mixed in via `extend`, the methods are added to the singleton class of the mixing class. Given the way Rouge is architected, it is more correct for the common module to be extended (not doing so can cause issues with overloading methods). This commit updates the TypeScript and TSX lexers to mix in the `TypescriptCommon` module by calling `extend` rather than `include`.
Configuration menu - View commit details
-
Copy full SHA for e14b77a - Browse repository at this point
Copy the full SHA e14b77aView commit details -
Simplify JSX and TSX lexers (#1492)
The JSX lexer handles interpolation by running an embedded version of itself. This is not the manner in which other lexers handle interpolation and so makes maintenance difficult. It also greatly complicates subclassing the lexer (a practical concern because the TSX lexer subclasses the JSX lexer). To fix this, this commit rewrites the JSX lexer to simplify its structure. In particular, by specifying `:interpol` and `:interpol_inner` states, the need for an embedded version of the lexer is obviated.
Configuration menu - View commit details
-
Copy full SHA for 3b9c422 - Browse repository at this point
Copy the full SHA 3b9c422View commit details -
Permit use of trailing comma in generics in TSX lexer (#1528)
When TypeScript is used with React, the syntax for generics (`<T>`) causes conflicts. The solution is to include a trailing comma (`<T,>`). This commit updates the TSX lexer to support this use of a trailing comma.
Configuration menu - View commit details
-
Copy full SHA for c09cb89 - Browse repository at this point
Copy the full SHA c09cb89View commit details
Commits on Jun 1, 2020
-
Add new keywords to and fix bugs in OpenType feature file lexer (#1519)
This commit updates the OpenType feature file lexer with new keywords and fixes to identifiers, include paths, strings and numbers. It also adds additional examples to the visual sample.
Configuration menu - View commit details
-
Copy full SHA for 37ea838 - Browse repository at this point
Copy the full SHA 37ea838View commit details -
This commit adds a lexer for BibTeX. Co-authored-by: Alex Liheng Wang <alw1@GS17003.SP.CS.CMU.EDU> Co-authored-by: Michael Camilleri <mike@inqk.net>
Configuration menu - View commit details
-
Copy full SHA for 85e1a4a - Browse repository at this point
Copy the full SHA 85e1a4aView commit details
Commits on Jun 2, 2020
-
This commit adds a lexer for LiveScript. Co-authored-by: Michael Camilleri <mike@inqk.net>
Configuration menu - View commit details
-
Copy full SHA for 865cde6 - Browse repository at this point
Copy the full SHA 865cde6View commit details -
Move rules from TypeScript lexer to TypeScript common module (#1530)
The TypeScript lexer was refactored in a previous commit to move its memoisation methods into a module that could be mixed in by the TSX lexer. This is because the TSX lexer needs to inherit from both the TypeScript lexer and the JSX lexer but can't do that direclty because Ruby does not support multiple inheritance. While the memoisation methods were moved, changes to states of TypeScript lexer were not refactored out. This means that the TypeScript and TSX lexers can lex the same code differently. This commit fixes that problem by adopting the same approach used with the ObjectiveC common module: using Ruby's `Module#extended` hook.
Configuration menu - View commit details
-
Copy full SHA for 30fc93f - Browse repository at this point
Copy the full SHA 30fc93fView commit details -
Support nullish coalescing operator in TypeScript lexer (#1529)
TypeScript has added support for the nullish coalescing operator `??` as of version 3.7. This commit adds support by prepending a rule to the `:root` state of lexers that extend the TypeScript common module. When JavaScript adopts the operator, the rule should be moved into the `:root` state of the JavaScript lexer and removed from the TypeScript common module.
Configuration menu - View commit details
-
Copy full SHA for ce26fd9 - Browse repository at this point
Copy the full SHA ce26fd9View commit details
Commits on Jun 3, 2020
-
Fix erroneous detection in Diff lexer (#1532)
The `detect?` method in the Diff lexer currently returns true if the text contains a pair of `---` or a pair of `+++`. This causes erroneous matches with various types of text (e.g. certificates). This commit updates the method to only match alternating pairs.
Configuration menu - View commit details
-
Copy full SHA for 226a15a - Browse repository at this point
Copy the full SHA 226a15aView commit details -
Add *.cshtml file glob to HTML lexer (#1522)
�����This commit adds the `*.cshtml` file glob to the HTML lexer.
Configuration menu - View commit details
-
Copy full SHA for a5b35cf - Browse repository at this point
Copy the full SHA a5b35cfView commit details -
This commit adds a lexer for Augeas. Co-authored-by: Michael Camilleri <mike@inqk.net>
2Configuration menu - View commit details
-
Copy full SHA for 3bba568 - Browse repository at this point
Copy the full SHA 3bba568View commit details -
This commit adds a lexer for Zig. Co-authored-by: Michael Camilleri <mike@inqk.net>
Configuration menu - View commit details
-
Copy full SHA for 948008b - Browse repository at this point
Copy the full SHA 948008bView commit details -
Support scope resolution operator in C++ lexer (#1523)
The C++ lexer inherits the majority of its rules from the C lexer. While this approach reduces duplication, it can cause issues where assumptions that are correct in C, cause issues in C++. One such issue occurs when the scope resolution operator, `::`, is used in a case statement. The C lexer contains a rule that treats colons in a case statement as representing the 'end' of that state. While the assumption that a colon would not otherwise occur in a case statement is correct in C, that is not the case in C++. The scope resolution operator uses two colons and it can occur within a case statement. This commit creates a new `:case` state in the C++ lexer that uses a negative lookahead to avoid matching a scope resolution operator. A rule matching the scope resolution operator is also prepended to the `:statements` state.
Configuration menu - View commit details
-
Copy full SHA for 646e551 - Browse repository at this point
Copy the full SHA 646e551View commit details -
This commit adds a lexer for the Velocity templating language.
Configuration menu - View commit details
-
Copy full SHA for 128abf0 - Browse repository at this point
Copy the full SHA 128abf0View commit details -
Improve support for single quotes in Haskell lexer (#1524)
Haskell uses matching single quotes to express character literals (e.g. `'A'`). However, the unmatched single quote character, `'`, is also used for various purposes (e.g. as part of a variable name like `x'` or in the name of a promoted type like `'Bar`). Currently, Rouge's Haskell lexer permits the use of an unmatched single quote by having separate rules for naming and then a general rule of lower precedence for when the lexer encounters `'`. A better approach would be to only treat `'` as being part of a character literal if the lexer detects that there is a matching `'` within an appropriate number of characters. This commit does that and then creates a more general rule for matching names.
Configuration menu - View commit details
-
Copy full SHA for 60e4f8f - Browse repository at this point
Copy the full SHA 60e4f8fView commit details -
This commit adds a lexer for HLSL. Co-authored-by: Michael Camilleri <mike@inqk.net>
Configuration menu - View commit details
-
Copy full SHA for 45c3f41 - Browse repository at this point
Copy the full SHA 45c3f41View commit details
Commits on Jun 9, 2020
-
Fix incorrect predicate usage in PowerShell lexer (#1536)
The PowerShell lexer includes rules that use the existence of a nil value in a regular expression to decide whether to push new states onto the stack. The predicates for these rules were written incorrectly. This commit removes one of the predicates (which wasn't necessary) and uses `Object#nil?` in the other to match correctly.
Configuration menu - View commit details
-
Copy full SHA for 661386a - Browse repository at this point
Copy the full SHA 661386aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e21536 - Browse repository at this point
Copy the full SHA 2e21536View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v3.19.0...v3.20.0