Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
Release: com.io7m.jsx 2.0.0
Change: Publish services (Ticket: #5)
Change: (Backwards incompatible) Make exceptions implement LexicalType (Ticket: #7)
  • Loading branch information
io7m committed Dec 7, 2017
2 parents fd9ca7d + 7694dd4 commit d4d24d6
Show file tree
Hide file tree
Showing 23 changed files with 108 additions and 32 deletions.
18 changes: 16 additions & 2 deletions README-CHANGES.xml
Expand Up @@ -70,12 +70,26 @@
</c:change>
</c:changes>
</c:release>
<c:release date="2017-11-28T12:16:00+00:00" ticket-system="com.github.io7m.jsx" version="1.0.0">
<c:release date="2017-11-28T00:00:00+00:00" ticket-system="com.github.io7m.jsx" version="1.0.0">
<c:changes>
<c:change compatible="false" date="2017-11-26T00:00:00+00:00" summary="Use URIs instead of Paths in lexical information"/>
<c:change compatible="false" date="2017-11-26T00:00:00+00:00" summary="Use immutable value types in the definitions of SExpressionType"/>
<c:change compatible="false" date="2017-11-26T00:00:00+00:00" summary="SExpressionListType is now Iterable"/>
<c:change compatible="false" date="2017-11-28T12:16:00+00:00" summary="Lexical information for SExpressionType is no longer Optional"/>
<c:change compatible="false" date="2017-11-28T00:00:00+00:00" summary="Lexical information for SExpressionType is no longer Optional"/>
</c:changes>
</c:release>
<c:release date="2017-12-07T21:17:41+00:00" ticket-system="com.github.io7m.jsx" version="2.0.0">
<c:changes>
<c:change compatible="false" date="2017-12-07T00:00:00+00:00" summary="Make exceptions implement LexicalType">
<c:tickets>
<c:ticket id="7"/>
</c:tickets>
</c:change>
<c:change date="2017-12-07T21:17:41+00:00" summary="Publish services">
<c:tickets>
<c:ticket id="5"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.checkstyle/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.checkstyle</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.cmdline/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.cmdline</artifactId>

Expand Down
Expand Up @@ -305,8 +305,7 @@ private void showErrors(
{
if (!errors.isEmpty()) {
for (final JSXParserException e : errors) {
final LexicalPosition<URI> lex =
e.getLexicalInformation();
final LexicalPosition<URI> lex = e.lexical();
LOG.error(
"parse error: {}:{}:{}: {}",
lex.file().orElse(URI.create("urn:unknown")),
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.combinators/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.combinators</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.core/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.core</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.documentation/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.documentation</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.parser.api/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.parser.api</artifactId>

Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.io7m.jsx.api.lexer;

import com.io7m.jlexing.core.LexicalPosition;
import com.io7m.jlexing.core.LexicalType;
import com.io7m.jsx.JSXException;

import java.net.URI;
Expand All @@ -26,7 +27,8 @@
* The type of exceptions raised by the lexer.
*/

public abstract class JSXLexerException extends JSXException
public abstract class JSXLexerException
extends JSXException implements LexicalType<URI>
{
private static final long serialVersionUID = -5821503109066196034L;
private final LexicalPosition<URI> lex;
Expand All @@ -46,11 +48,8 @@ public JSXLexerException(
this.lex = Objects.requireNonNull(in_lex, "Lexical information");
}

/**
* @return The lexical information for the exception
*/

public final LexicalPosition<URI> lexicalInformation()
@Override
public final LexicalPosition<URI> lexical()
{
return this.lex;
}
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.io7m.jsx.api.parser;

import com.io7m.jlexing.core.LexicalPosition;
import com.io7m.jlexing.core.LexicalType;
import com.io7m.jsx.JSXException;

import java.net.URI;
Expand All @@ -26,7 +27,8 @@
* The type of exceptions raised by the parser.
*/

public abstract class JSXParserException extends JSXException
public abstract class JSXParserException
extends JSXException implements LexicalType<URI>
{
private static final long serialVersionUID = -5821503109066196034L;
private final LexicalPosition<URI> lex;
Expand Down Expand Up @@ -65,11 +67,8 @@ public JSXParserException(
this.lex = Objects.requireNonNull(in_lex, "Lexical information");
}

/**
* @return The lexical information for the exception
*/

public final LexicalPosition<URI> getLexicalInformation()
@Override
public final LexicalPosition<URI> lexical()
{
return this.lex;
}
Expand Down
Expand Up @@ -38,7 +38,7 @@ public JSXParserLexicalException(
final JSXLexerException in_cause)
{
super(
in_cause.lexicalInformation(),
in_cause.lexical(),
Objects.requireNonNull(in_cause.getMessage(), "Message"),
in_cause);
}
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.parser/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.parser</artifactId>

Expand Down
Expand Up @@ -71,7 +71,7 @@ public static void main(
} catch (final JSXLexerException e) {
System.err.println(
"error: lexical error: "
+ e.lexicalInformation()
+ e.lexical()
+ ": "
+ e.getMessage());
}
Expand Down
Expand Up @@ -93,7 +93,7 @@ public static void main(
} catch (final JSXParserException x) {
System.err.println(
"error: parse error: "
+ x.getLexicalInformation()
+ x.lexical()
+ ": "
+ x.getMessage());
}
Expand Down
Expand Up @@ -18,15 +18,21 @@

import com.io7m.jsx.api.serializer.JSXSerializerSupplierType;
import com.io7m.jsx.api.serializer.JSXSerializerType;
import org.osgi.service.component.annotations.Component;

/**
* A supplier that supplies trivial serializers.
*/

public final class JSXSerializerTrivialSupplier implements
JSXSerializerSupplierType
@Component
public final class JSXSerializerTrivialSupplier
implements JSXSerializerSupplierType
{
private JSXSerializerTrivialSupplier()
/**
* Instantiate a supplier.
*/

public JSXSerializerTrivialSupplier()
{

}
Expand Down
7 changes: 7 additions & 0 deletions com.io7m.jsx.parser/src/main/java/module-info.java
Expand Up @@ -31,4 +31,11 @@
exports com.io7m.jsx.parser;
exports com.io7m.jsx.serializer;
exports com.io7m.jsx.lexer;

provides com.io7m.jsx.api.lexer.JSXLexerSupplierType
with com.io7m.jsx.lexer.JSXLexerSupplier;
provides com.io7m.jsx.api.parser.JSXParserSupplierType
with com.io7m.jsx.parser.JSXParserSupplier;
provides com.io7m.jsx.api.serializer.JSXSerializerSupplierType
with com.io7m.jsx.serializer.JSXSerializerTrivialSupplier;
}
@@ -0,0 +1 @@
com.io7m.jsx.lexer.JSXLexerSupplier
@@ -0,0 +1 @@
com.io7m.jsx.parser.JSXParserSupplier
@@ -0,0 +1 @@
com.io7m.jsx.serializer.JSXSerializerTrivialSupplier
2 changes: 1 addition & 1 deletion com.io7m.jsx.prettyprint/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.prettyprint</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jsx.tests/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.jsx.tests</artifactId>

Expand Down
@@ -0,0 +1,49 @@
/*
* Copyright © 2016 <code@io7m.com> http://io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

package com.io7m.jsx.tests;

import com.io7m.jsx.api.lexer.JSXLexerSupplierType;
import com.io7m.jsx.api.parser.JSXParserSupplierType;
import com.io7m.jsx.api.serializer.JSXSerializerSupplierType;
import org.junit.Assert;
import org.junit.Test;

import java.util.ServiceLoader;

public final class ServicesTest
{
@Test
public void testLexer()
{
Assert.assertTrue(ServiceLoader.load(JSXLexerSupplierType.class)
.findFirst().isPresent());
}

@Test
public void testParser()
{
Assert.assertTrue(ServiceLoader.load(JSXParserSupplierType.class)
.findFirst().isPresent());
}

@Test
public void testSerializerTrivial()
{
Assert.assertTrue(ServiceLoader.load(JSXSerializerSupplierType.class)
.findFirst().isPresent());
}
}
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -13,7 +13,7 @@

<groupId>com.io7m.jsx</groupId>
<artifactId>com.io7m.jsx</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>

<packaging>pom</packaging>
<name>com.io7m.jsx</name>
Expand Down

0 comments on commit d4d24d6

Please sign in to comment.