Skip to content

Commit

Permalink
Merge upstream 'master' into frozen-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Sep 7, 2018
2 parents d690911 + 27a4bfb commit 473d1d1
Show file tree
Hide file tree
Showing 67 changed files with 2,858 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -13,8 +13,8 @@ cache:
bundler: true
bundler_args: --without development
before_install:
- gem install bundler
- gem update --system
- gem update bundler
script:
- bundle exec rake
- bundle exec rubocop
52 changes: 52 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,58 @@ This log summarizes the changes in each released version of rouge. The versionin
we use is semver, although we will often release new lexers in minor versions, as a
practical matter.

## version 3.2.1: (2018/08/16)

https://github.com/jneen/rouge/compare/v3.2.0...v3.2.1

* Perl Lexer
* Allow any non-whitespace character to delimit regexes ([#974](https://github.com/jneen/rouge/pull/974) by dblessing)
* Details: In specific cases where a previously unsupported regex delimiter was
used, a later rule could cause a backtrack in the regex system.
This resulted in Rouge hanging for an unspecified amount of time.

## version 3.2.0: (2018/08/02)

https://github.com/jneen/rouge/compare/v3.1.1...v3.2.0

* General
* Load pastie theme ([#809](https://github.com/jneen/rouge/pull/809) by rramsden)
* Fix build failures ([#892](https://github.com/jneen/rouge/pull/892) by olleolleolle)
* Update CLI style help text ([#923](https://github.com/jneen/rouge/pull/923) by nixpulvis)
* Fix HTMLLinewise formatter documentation in README.md ([#910](https://github.com/jneen/rouge/pull/910) by rohitpaulk)
* Terraform Lexer (NEW - [#917](https://github.com/jneen/rouge/pull/917) by lowjoel)
* Crystal Lexer (NEW - [#441](https://github.com/jneen/rouge/pull/441) by splattael)
* Scheme Lexer
* Allow square brackets ([#849](https://github.com/jneen/rouge/pull/849) by EFanZh)
* Haskell Lexer
* Support for Quasiquotations ([#868](https://github.com/jneen/rouge/pull/868) by enolan)
* Java Lexer
* Support for Java 10 `var` keyword ([#888](https://github.com/jneen/rouge/pull/888) by lc-soft)
* VHDL Lexer
* Fix `time_vector` keyword typo ([#911](https://github.com/jneen/rouge/pull/911) by ttobsen)
* Perl Lexer
* Recognize `.t` as valid file extension ([#918](https://github.com/jneen/rouge/pull/918) by miparnisari)
* Nix Lexer
* Improved escaping sequences for indented strings ([#926](https://github.com/jneen/rouge/pull/926) by veprbl)
* Fortran Lexer
* Recognize `.f` as valid file extension ([#931](https://github.com/jneen/rouge/pull/931) by veprbl)
* Igor Pro Lexer
* Update functions and operations for Igor Pro 8 ([#921](https://github.com/jneen/rouge/pull/921) by t-b)
* Julia Lexer
* Various improvements and fixes ([#912](https://github.com/jneen/rouge/pull/912) by ararslan)
* Kotlin Lexer
* Recognize `.kts` as valid file extension ([#908](https://github.com/jneen/rouge/pull/908) by mkobit)
* CSS Lexer
* Minor fixes ([#916](https://github.com/jneen/rouge/pull/916) by miparnisari)
* HTML Lexer
* Minor fixes ([#916](https://github.com/jneen/rouge/pull/916) by miparnisari)
* Javascript Lexer
* Minor fixes ([#916](https://github.com/jneen/rouge/pull/916) by miparnisari)
* Markdown Lexer
* Images may not have alt text ([#904](https://github.com/jneen/rouge/pull/904) by Himura2la)
* ERB Lexer
* Fix greedy comment matching ([#902](https://github.com/jneen/rouge/pull/902) by ananace)

## version 3.1.1: 2018/01/31

https://github.com/jneen/rouge/compare/v3.1.0...v3.1.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -43,9 +43,9 @@ Builtin formatters include:
* `Rouge::Formatters::HTMLInline.new(theme)` - will render your code with no class names, but
instead inline the styling options into the `style=` attribute. This is good for emails and
other systems where CSS support is minimal.
* `Rouge::Formatters::HTMLLinewise.new(formatter, class_format: 'line-%i')`
* `Rouge::Formatters::HTMLLinewise.new(formatter, class: 'line-%i')`
This formatter will split your code into lines, each contained in its own div. The
`class_format` option will be used to add a class name to the div, given the line
`class` option will be used to add a class name to the div, given the line
number.
* `Rouge::Formatters::HTMLPygments.new(formatter, css_class='codehilite')`
wraps the given formatter with div wrappers generally expected by stylesheets designed for
Expand Down
1 change: 1 addition & 0 deletions lib/rouge.rb
Expand Up @@ -81,3 +81,4 @@ def highlight(text, lexer, formatter, &b)
load load_dir.join('rouge/themes/monokai_sublime.rb')
load load_dir.join('rouge/themes/gruvbox.rb')
load load_dir.join('rouge/themes/tulip.rb')
load load_dir.join('rouge/themes/pastie.rb')
4 changes: 3 additions & 1 deletion lib/rouge/cli.rb
Expand Up @@ -305,7 +305,9 @@ def self.doc
yield %|usage: rougify style [<theme-name>] [<options>]|
yield %||
yield %|Print CSS styles for the given theme. Extra options are|
yield %|passed to the theme. Theme defaults to thankful_eyes.|
yield %|passed to the theme. To select a mode (light/dark) for the|
yield %|theme, append '.light' or '.dark' to the <theme-name>|
yield %|respectively. Theme defaults to thankful_eyes.|
yield %||
yield %|options:|
yield %| --scope (default: .highlight) a css selector to scope by|
Expand Down
45 changes: 45 additions & 0 deletions lib/rouge/demos/crystal
@@ -0,0 +1,45 @@
lib LibC
WNOHANG = 0x00000001

@[ReturnsTwice]
fun fork : PidT
fun getpgid(pid : PidT) : PidT
fun kill(pid : PidT, signal : Int) : Int
fun getpid : PidT
fun getppid : PidT
fun exit(status : Int) : NoReturn

ifdef x86_64
alias ClockT = UInt64
else
alias ClockT = UInt32
end

SC_CLK_TCK = 3

struct Tms
utime : ClockT
stime : ClockT
cutime : ClockT
cstime : ClockT
end

fun times(buffer : Tms*) : ClockT
fun sysconf(name : Int) : Long
end

class Process
def self.exit(status = 0)
LibC.exit(status)
end

def self.pid
LibC.getpid
end

def self.getpgid(pid : Int32)
ret = LibC.getpgid(pid)
raise Errno.new(ret) if ret < 0
ret
end
end
7 changes: 7 additions & 0 deletions lib/rouge/demos/hcl
@@ -0,0 +1,7 @@
service {
key = "value"
}

variable "ami" {
description = "the AMI to use"
}
29 changes: 29 additions & 0 deletions lib/rouge/demos/jsp
@@ -0,0 +1,29 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.time.LocalDateTime" %>

<%! int day = 3; %>

<!DOCTYPE html>
<html>
<head>
<title>Simple JSP Application</title>
</head>
<body>
<%-- This is a JSP comment --%>
<h1>Hello world!</h1>
<h2>Current time is <%= LocalDateTime.now() %></h2>

<% if (day == 1 || day == 7) { %>
<p> Today is weekend</p>
<% } else { %>
<p> Today is not weekend</p>
<% } %>

h2>Using JavaBeans in JSP</h2>
<jsp:useBean id="test" class="action.TestBean" />
<jsp:setProperty name="test" property="message" value="Hello JSP..." />

<p>Got message:</p>
<jsp:getProperty name="test" property="message" />
</body>
</html>
16 changes: 16 additions & 0 deletions lib/rouge/demos/m68k
@@ -0,0 +1,16 @@
initialize: ; go into super user mode
clr.l -(a7)
move.w #32,-(a7)
trap #1
addq.l #6,a7
move.l d0,oldstack
rts

restore: ; go back into user mode
move.l oldstack,-(a7)
move.w #32,-(a7)
trap #1
addq.l #6,a7
rts

oldstack dc.l 0
8 changes: 8 additions & 0 deletions lib/rouge/demos/mathematica
@@ -0,0 +1,8 @@
(* Fibonacci numbers with memoization *)

fib::usage = "f[n] calculates the n'th Fibonacci number.";
fib[0] = fib[1] = 1;
fib[n_Integer?Positive]:= fib[n] = fib[n-1] + fib[n-2];

In[4]:= fib[42]
Out[4]= 433494437
14 changes: 14 additions & 0 deletions lib/rouge/demos/sqf
@@ -0,0 +1,14 @@
// Creates a dot marker at the given position
#include "script_component.hpp"
params ["_pos", "_txt"];

if (isNil QGVAR(markerID)) then {
GVAR(markerID) = 0;
};

_markerstr = createMarker [QGVAR(marker) + str GVAR(markerID), _pos];
_markerstr setMarkerShape "ICON";
_markerstr setMarkerType "hd_dot";
_markerstr setMarkerText _txt;

GVAR(markerID) = GVAR(markerID) + 1;
31 changes: 31 additions & 0 deletions lib/rouge/demos/terraform
@@ -0,0 +1,31 @@
# From: https://github.com/terraform-providers/terraform-provider-aws/blob/master/examples/count/main.tf

# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
}

resource "aws_elb" "web" {
name = "terraform-example-elb"

# The same availability zone as our instances
availability_zones = ["${aws_instance.web.*.availability_zone}"]

listener {
instance_port = 80
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}

# The instances are registered automatically
instances = ["${aws_instance.web.*.id}"]
}

resource "aws_instance" "web" {
instance_type = "m1.small"
ami = "${lookup(var.aws_amis, var.aws_region)}"

# This will create 4 instances
count = 4
}
3 changes: 3 additions & 0 deletions lib/rouge/guessers/disambiguation.rb
Expand Up @@ -83,6 +83,9 @@ def match?(filename)
next ObjectiveC if matches?(/@(end|implementation|protocol|property)\b/)
next ObjectiveC if contains?('@"')

next Mathematica if contains?('(*')
next Mathematica if contains?(':=')

next Matlab if matches?(/^\s*?%/)
end

Expand Down

0 comments on commit 473d1d1

Please sign in to comment.