Skip to content

Commit

Permalink
Merge pull request #898 from jamesnvc/patch-1
Browse files Browse the repository at this point in the history
Add % as single-line comment for Prolog lexer
  • Loading branch information
dblessing committed Aug 10, 2018
2 parents 3d2dc84 + 6843831 commit 443c6c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rouge/lexers/prolog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Prolog < RegexLexer
state :basic do
rule /\s+/, Text
rule /^#.*/, Comment::Single
rule /%.*/, Comment::Single
rule /\/\*/, Comment::Multiline, :nested_comment

rule /[\[\](){}|.,;!]/, Punctuation
Expand Down
4 changes: 4 additions & 0 deletions spec/visual/samples/prolog
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ turing(Tape0, Tape) :-
* This is a multiline comment.
*/

% This is a single-line comment

A is 1. % This is a trailing comment

perform(qf, Ls, Ls, Rs, Rs) :- !.
perform(Q0, Ls0, Ls, Rs0, Rs) :-
symbol(Rs0, Sym, RsRest),
Expand Down

0 comments on commit 443c6c5

Please sign in to comment.