Skip to content

Commit

Permalink
Finish 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Apr 21, 2021
2 parents 6dc692e + 963685e commit 2c3938c
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 157 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: nZpCGeEQmrpsuh3Er4qfKarr00VUGU5Lx
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.

name: CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
tests:
name: Ruby ${{ matrix.ruby }}
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
runs-on: ubuntu-latest
env:
CI: true
strategy:
fail-fast: false
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- ruby-head
- jruby
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rspec spec

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ rvm:
- 2.5
- 2.6
- 2.7
- ruby-head
- jruby
cache: bundler
sudo: false
matrix:
allow_failures:
- rvm: jruby
- rvm: ruby-head
dist: trusty
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"

group :development do
gem 'rdf-spec', github: "ruby-rdf/rdf-spec", branch: "develop"
gem "nokogumbo", platforms: :mri
gem "byebug", platforms: :mri
gem 'psych', platforms: [:mri, :rbx]
gem "redcarpet", platforms: :mri
Expand All @@ -16,5 +17,4 @@ end
group :development, :test do
gem 'simplecov', platforms: :mri
gem 'coveralls', '~> 0.8', platforms: :mri
gem 'awesome_print', github: 'MatthiasWinkelmann/awesome_print'
end
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
[EBNF][] parser and generic parser generator.

[![Gem Version](https://badge.fury.io/rb/ebnf.png)](https://badge.fury.io/rb/ebnf)
[![Build Status](https://secure.travis-ci.org/dryruby/ebnf.png?branch=master)](https://travis-ci.org/dryruby/ebnf)
[![Coverage Status](https://coveralls.io/repos/dryruby/ebnf/badge.svg)](https://coveralls.io/r/dryruby/ebnf)
[![Build Status](https://github.com/dryruby/ebnf/workflows/CI/badge.svg?branch=develop)](https://github.com/dryruby/ebnf/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/dryruby/ebnf/badge.svg?branch=develop)](https://coveralls.io/r/dryruby/ebnf?branch=develop)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)

## Description
This is a [Ruby][] implementation of an [EBNF][] and [BNF][] parser and parser generator.
Expand Down Expand Up @@ -92,7 +93,7 @@ Inevitably while implementing a parser for some specific grammar, a developer wi

The {EBNF::Writer} class can be used to write parsed grammars out, either as formatted text, or HTML. Because grammars are written from the Abstract Syntax Tree, represented as [S-Expressions][S-Expression], this provides a means of transforming between grammar formats (e.g., W3C [EBNF][] to [ABNF][]), although with some potential loss in semantic fidelity (case-insensitive string matching vs. case-sensitive matching).

The formatted HTML results are designed to be appropriate for including in specifications.
The formatted HTML results are designed to be appropriate for including in specifications. If the [Nokogumbo](https://rubygems.org/gems/nokogumbo) gem list available, the resulting HTML encoded grammar will also be validated.

### Parser Errors
On a parsing failure, and exception is raised with information that may be useful in determining the source of the error.
Expand Down
Empty file modified Rakefile
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.2
2.1.3
10 changes: 5 additions & 5 deletions bin/ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OPT_ARGS = [
["--prefix", "-p", GetoptLong::REQUIRED_ARGUMENT,"Prefix to use when generating Turtle"],
["--progress", "-v", GetoptLong::NO_ARGUMENT, "Detail on execution"],
["--renumber", GetoptLong::NO_ARGUMENT, "Renumber parsed reules"],
["--validate", GetoptLong::NO_ARGUMENT, "Validate grammar"],
["--validate", GetoptLong::NO_ARGUMENT, "Validate grammar and any generated HTML"],
["--help", "-?", GetoptLong::NO_ARGUMENT, "This message"]
]
def usage
Expand Down Expand Up @@ -67,7 +67,7 @@ opts.each do |opt, arg|
end
options[:format] = arg.to_sym
when '--format'
unless %w(abnf abnfh ebnf html isoebnf isoebnfh rb sxp).include?(arg)
unless %w(abnf abnfh ebnf html isoebnf isoebnfh rb sxp ttl).include?(arg)
STDERR.puts("unrecognized output format #{arg}")
usage
end
Expand Down Expand Up @@ -99,11 +99,11 @@ ebnf.renumber! if options[:renumber]

res = case options[:output_format]
when :abnf then ebnf.to_s(format: :abnf)
when :abnfh then ebnf.to_html(format: :abnf)
when :abnfh then ebnf.to_html(format: :abnf, validate: options[:validate])
when :ebnf then ebnf.to_s
when :html then ebnf.to_html
when :html then ebnf.to_html(validate: options[:validate])
when :isoebnf then ebnf.to_s(format: :isoebnf)
when :isoebnfh then ebnf.to_html(format: :isoebnf)
when :isoebnfh then ebnf.to_html(format: :isoebnf, validate: options[:validate])
when :sxp then ebnf.to_sxp
when :ttl then ebnf.to_ttl(options[:prefix], options[:namespace])
when :rb then ebnf.to_ruby(out, grammarFile: ARGV[0], **options)
Expand Down
6 changes: 4 additions & 2 deletions ebnf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
gem.name = "ebnf"
gem.homepage = "https://github.com/dryruby/ebnf"
gem.license = 'Unlicense'
gem.summary = "EBNF parser and parser generator."
gem.summary = "EBNF parser and parser generator in Ruby."
gem.description = %q{EBNF is a Ruby parser for W3C EBNF and a parser generator for PEG and LL(1). Also includes parsing modes for ISO EBNF and ABNF.}

gem.authors = ['Gregg Kellogg']
Expand All @@ -28,11 +28,13 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'scanf', '~> 1.0'
gem.add_runtime_dependency 'rdf', '~> 3.1' # Required by sxp
gem.add_runtime_dependency 'htmlentities', '~> 4.3'
gem.add_runtime_dependency 'unicode-types', '~> 1.6'
gem.add_runtime_dependency 'amazing_print', '~> 1.2'
gem.add_development_dependency 'rdf-spec', '~> 3.1'
gem.add_development_dependency 'rdf-turtle', '~> 3.1'
gem.add_development_dependency 'nokogiri', '~> 1.10'
gem.add_development_dependency 'erubis', '~> 2.7'
gem.add_development_dependency 'rspec', '~> 3.9'
gem.add_development_dependency 'rspec', '~> 3.10'
gem.add_development_dependency 'rspec-its', '~> 1.3'
gem.add_development_dependency 'yard', '~> 0.9'
gem.add_development_dependency 'rake', '~> 13.0'
Expand Down
5 changes: 1 addition & 4 deletions etc/doap.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
doap:name "ebnf" ;
doap:homepage <https://github.com/dryruby/ebnf> ;
doap:license <https://unlicense.org/1.0/> ;
doap:shortdesc "EBNF parser and parser generator"@en ;
doap:shortdesc "EBNF parser and parser generator in Ruby."@en ;
doap:description "EBNF is a Ruby parser for W3C EBNF and a parser generator for PEG and LL(1). Also includes parsing modes for ISO EBNF and ABNF."@en ;
doap:created "2011-08-29"^^xsd:date ;
doap:programming-language "Ruby" ;
Expand All @@ -34,7 +34,4 @@
doap:maintainer <https://greggkellogg.net/foaf#me> ;
doap:documenter <https://greggkellogg.net/foaf#me> ;
foaf:maker <https://greggkellogg.net/foaf#me> ;
dc:title "ebnf" ;
dc:description "EBNF is a Ruby parser for W3C EBNF and a parser generator for PEG and LL(1). Also includes parsing modes for ISO EBNF and ABNF."@en ;
dc:date "2011-08-29"^^xsd:date ;
dc:creator <https://greggkellogg.net/foaf#me> .
Loading

0 comments on commit 2c3938c

Please sign in to comment.