Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nial Lexer #1803

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4f19e91
base lexer, spec, demo
razetime Feb 9, 2022
d9f0a1b
name, char changes
razetime Feb 9, 2022
c1b2246
constant change, spec, sample
razetime Feb 9, 2022
fa13031
fix sample comment
razetime Feb 9, 2022
0e8e251
fix ops and punctuation
razetime Feb 10, 2022
67366f6
fix colon and braces
razetime Feb 10, 2022
d32cff2
# comment start of line
razetime Feb 15, 2022
8eff690
add tancnle suggestions
razetime Jun 30, 2022
bb5c7d2
convert indentation to 2 spaces
razetime Jun 30, 2022
19345c2
Run Rubocop and Profile CI on CI build once (#1805)
tancnle Feb 12, 2022
34d1142
Stop checking encoding names (#1806)
casperisfine Feb 20, 2022
c539158
Highlight shortened lists for syzlang DSL (#1808)
xairy Feb 24, 2022
14cea0a
initial support for lean 3 (#1798)
kunigami Mar 5, 2022
4023be7
Add new lexers to supported language doc (#1810)
tancnle Mar 5, 2022
cfce23d
Fix notation of named stages in multi-stage docker builds (#1809)
bartbroere Mar 8, 2022
7af9728
Add new Matlab keywords (fixes #1589) (#1669)
siko1056 Apr 19, 2022
a7a1ba5
Python: Support conversion specifiers in format strings (#1801)
chvp May 1, 2022
7f5706c
Oracle PLSQL lexer (suitable for Oracle SQL as well) (#1811)
lee-lindley May 2, 2022
0d4defc
Update Contributor Code of Conduct v2.1 (#1821)
tancnle May 14, 2022
9320358
Release v3.29.0 (#1828)
tancnle Jun 1, 2022
a707e30
Feature.isabelle lexer (#1682)
Dacit Jun 3, 2022
596d8ef
fix --help to show --formatter-preset and possible options (#1830)
jneen Jun 14, 2022
25fbc7f
PHP: support new syntax (constructor property promotion, readonly mod…
nsfisis Jun 21, 2022
d0d6f22
Support more Jenkins pipeline name variations in groovy lexer (#1836)
danilaml Jun 24, 2022
7078f96
Fix highlight of hex numbers in Pascal lexer (#1840)
tancnle Jun 26, 2022
4cf3826
Fix template highlight of braces in CPP lexer (#1839)
tancnle Jun 28, 2022
901d84e
Dart: Distinguish between punctuation and operators (#1838)
gareththackeray Jun 29, 2022
e09905c
add nial to docs
razetime Jun 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 43 additions & 24 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,61 @@ name: CI
on:
push:
# The `github-workflow-test` can be used to test changes without making a PR
branches: [ master, github-workflow-test ]
branches: [master, github-workflow-test]
pull_request:
branches: [ master ]
branches: [master]

jobs:
linelint:
name: Linelint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fernandrone/linelint@master
- uses: actions/checkout@v2
- uses: fernandrone/linelint@master

rubocop:
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.5"
bundler-cache: true
- name: Run RuboCop
run: bundle exec rake check:style

test:
name: Test ${{ matrix.ruby-version }}
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [ '2.5', '2.6', '2.7', '3.0', '3.1']
ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1"]

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
# runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- name: Run tests
run: bundle exec rake
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake check:specs

# Those are only run with the latest supported version
# Make sure to update the `if` when changing supported versions
- name: Profile Memory Allocation
if: matrix.ruby-version == '3.1'
run: bundle exec rake check:memory
- name: Interpreter Warnings Test
if: matrix.ruby-version == '3.1'
env:
RUBYOPT: '-w'
run: bundle exec rake check:specs
profile:
name: Profile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: Profile Memory Allocation
run: bundle exec rake check:memory
- name: Interpreter Warnings Test
env:
RUBYOPT: "-w"
run: bundle exec rake check:specs
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ This log summarizes the changes in each released version of Rouge.

Rouge follows [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).

## version 3.29.0: 2022-05-30

[Comparison with the previous version](https://github.com/rouge-ruby/rouge/compare/v3.28.0...v3.29.0)

- General
- Stop checking encoding names ([#1806](https://github.com/rouge-ruby/rouge/pull/1806) by casperisfine)
- Docker Lexer
- Fix notation of named stages in multi-stage docker builds ([#1809](https://github.com/rouge-ruby/rouge/pull/1809) by bartbroere)
- Idris Lexer
- Add support for Idris language ([#1464](https://github.com/rouge-ruby/rouge/pull/1464) by bmwant)
- Lean Lexer (**NEW**)
- Initial support for lean 3 ([#1798](https://github.com/rouge-ruby/rouge/pull/1798) by kunigami)
- Matlab Lexer
- Add new Matlab keywords (fixes #1589) ([#1669](https://github.com/rouge-ruby/rouge/pull/1669) by siko1056)
- PLSQL Lexer (**NEW**)
- Oracle PLSQL lexer (suitable for Oracle SQL as well) ([#1811](https://github.com/rouge-ruby/rouge/pull/1811) by lee-lindley)
- Python Lexer
- Python: Support conversion specifiers in format strings ([#1801](https://github.com/rouge-ruby/rouge/pull/1801) by chvp)
- Syzlang and Syzprog Lexer (**NEW**)
- Add lexers for syzkaller DSLs ([#1699](https://github.com/rouge-ruby/rouge/pull/1699) by xairy)
- Highlight shortened lists for syzlang DSL ([#1808](https://github.com/rouge-ruby/rouge/pull/1808) by xairy)
- Rouge CI
- Run Rubocop and Profile CI on CI build once ([#1805](https://github.com/rouge-ruby/rouge/pull/1805) by tancnle)
- Add linting for new lines ([#1790](https://github.com/rouge-ruby/rouge/pull/1790) by tancnle)
- Add Ruby 3.1 to CI ([#1791](https://github.com/rouge-ruby/rouge/pull/1791) by petergoldstein)
- Documentation
- Add Code of Conduct v2.1 ([#1821](https://github.com/rouge-ruby/rouge/pull/1821) by tancnle)
- Add new lexers to supported language doc ([#1810](https://github.com/rouge-ruby/rouge/pull/1810) by tancnle)

## version 3.28.0: 2022-01-26

[Comparison with the previous version](https://github.com/rouge-ruby/rouge/compare/v3.27.0...v3.28.0)
Expand Down
135 changes: 126 additions & 9 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,132 @@
# Contributor Code of Conduct
## Version 1.0
# Contributor Covenant Code of Conduct

(from [Coraline's awesome covenant](https://github.com/Bantik/contributor_covenant))
## Our Pledge

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.

We are committed to making participation in this project a harrasment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, nationality, age, or religion.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

Examples of unacceptable behavior by participants include the use of sexual langauge or imagery, derogatory comments or
personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
## Our Standards

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Examples of behavior that contributes to a positive environment for our
community include:

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
*[email protected]*.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
7 changes: 7 additions & 0 deletions docs/Languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@
- HTTP (`http`)
- HyLang (`hylang`)
- IDL (`idlang`)
- Idris (`idris`)
- IgorPro (`igorpro`)
- INI (`ini`)
- Io (`io`)
- Irb (`irb`)
- Irb_output (`irb_output`)
- Isabelle (`isabelle`)
- ISBL (`isbl`)
- J (`j`)
- Janet (`janet`)
Expand All @@ -106,6 +108,7 @@
- Julia (`julia`)
- Kotlin (`kotlin`)
- Lasso (`lasso`)
- Lean (`lean`)
- Liquid (`liquid`)
- Literate CoffeeScript (`literate_coffeescript`)
- Literate Haskell (`literate_haskell`)
Expand All @@ -129,6 +132,7 @@
- Nasm (`nasm`)
- NesAsm (`nesasm`)
- nginx (`nginx`)
- Nial (`nial`)
- Nim (`nim`)
- Nix (`nix`)
- Objective-C (`objective_c`)
Expand All @@ -142,6 +146,7 @@
- PHP (`php`)
- Plain Text (`plaintext`)
- Plist (`plist`)
- PLSQL (`plsql`)
- Pony (`pony`)
- PostScript (`postscript`)
- powershell (`powershell`)
Expand Down Expand Up @@ -185,6 +190,8 @@
- SuperCollider (`supercollider`)
- Swift (`swift`)
- Systemd (`systemd`)
- Syzlang (`syzlang`)
- Syzprog (`syzprog`)
- TAP (`tap`)
- Tcl (`tcl`)
- Terraform (`terraform`)
Expand Down
43 changes: 23 additions & 20 deletions lib/rouge/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,35 +174,38 @@ def self.doc
yield %[usage: rougify highlight <filename> [options...]]
yield %[ rougify highlight [options...]]
yield %[]
yield %[--input-file|-i <filename> specify a file to read, or - to use stdin]
yield %[--input-file|-i <filename> specify a file to read, or - to use stdin]
yield %[]
yield %[--lexer|-l <lexer> specify the lexer to use.]
yield %[ If not provided, rougify will try to guess]
yield %[ based on --mimetype, the filename, and the]
yield %[ file contents.]
yield %[--lexer|-l <lexer> specify the lexer to use.]
yield %[ If not provided, rougify will try to guess]
yield %[ based on --mimetype, the filename, and the]
yield %[ file contents.]
yield %[]
yield %[--formatter|-f <opts> specify the output formatter to use.]
yield %[ If not provided, rougify will default to]
yield %[ terminal256.]
yield %[--formatter-preset|-f <opts> specify the output formatter to use.]
yield %[ If not provided, rougify will default to]
yield %[ terminal256. options are: terminal256,]
yield %[ terminal-truecolor, html, html-pygments,]
yield %[ html-inline, html-line-table, html-table,]
yield %[ null/raw/tokens, or tex.]
yield %[]
yield %[--theme|-t <theme> specify the theme to use for highlighting]
yield %[ the file. (only applies to some formatters)]
yield %[--theme|-t <theme> specify the theme to use for highlighting]
yield %[ the file. (only applies to some formatters)]
yield %[]
yield %[--mimetype|-m <mimetype> specify a mimetype for lexer guessing]
yield %[--mimetype|-m <mimetype> specify a mimetype for lexer guessing]
yield %[]
yield %[--lexer-opts|-L <opts> specify lexer options in CGI format]
yield %[ (opt1=val1&opt2=val2)]
yield %[--lexer-opts|-L <opts> specify lexer options in CGI format]
yield %[ (opt1=val1&opt2=val2)]
yield %[]
yield %[--formatter-opts|-F <opts> specify formatter options in CGI format]
yield %[ (opt1=val1&opt2=val2)]
yield %[--formatter-opts|-F <opts> specify formatter options in CGI format]
yield %[ (opt1=val1&opt2=val2)]
yield %[]
yield %[--require|-r <filename> require a filename or library before]
yield %[ highlighting]
yield %[--require|-r <filename> require a filename or library before]
yield %[ highlighting]
yield %[]
yield %[--escape allow the use of escapes between <! and !>]
yield %[--escape allow the use of escapes between <! and !>]
yield %[]
yield %[--escape-with <l> <r> allow the use of escapes between custom]
yield %[ delimiters. implies --escape]
yield %[--escape-with <l> <r> allow the use of escapes between custom]
yield %[ delimiters. implies --escape]
end

# There is no consistent way to do this, but this is used elsewhere,
Expand Down
16 changes: 16 additions & 0 deletions lib/rouge/demos/isabelle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
theory demo imports Main begin

section ‹Inductive predicates for lists›

datatype 'a list = Nil ("[]") | Cons 'a "'a list" ("_ # _")

fun length :: "'a list ⇒ nat" where
"length [] = 0" | "length (x # xs) = 1 + length xs"

inductive ζ :: "'a list ⇒ nat ⇒ bool" where
Nil[intro!]: "ζ [] 0" |
Cons[intro]: "ζ xs l ⟹ ζ (x # xs) (1 + l)"

(* Not the answer? *)
lemma "ζ xs 42"
oops
8 changes: 8 additions & 0 deletions lib/rouge/demos/lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
open nat

def add : nat → nat → nat
| m zero := m
| m (succ n) := succ (add m n)

-- encode definition as an axiom
axiom add_zero (n : nat) : n + 0 = n
Loading