Skip to content

Commit 9967d65

Browse files
committed
0.19.2 - Add varargs '...' parser support and update 'jtext-parser' and 'jtext-tokenizer' dependencies.
1 parent 691c019 commit 9967d65

22 files changed

+163
-126
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@ This project does its best to adhere to [Semantic Versioning](http://semver.org/
44

55

66
--------
7-
### [0.19.1](N/A) - 2020-04-20
7+
### [0.19.2](N/A) - 2020-05-23
8+
__Parameter varargs parsing support__ (i.e. 'int...' in Java).
9+
#### Changed
10+
* Update dependency `[email protected]` and `[email protected]`
11+
* Classes combined, class names simplified, and unused classes and methods removed from libraries
12+
* Code identifier parser now provided by `jtext-tokenizer`
13+
* Several bug fixes around compound optional parser conditions
14+
* Added `char[] src, int srcOff, int srcLen` parameters to `CodeTokenizer.tokenizeDocument()`
15+
* Renamed `IdentifierTokenizer` `newIdentifierTokenizer()` to `createIdentifierTokenizer()`
16+
* Improved unit tests
17+
18+
#### Removed
19+
* `IdentifierTokenizer.createIdentifierTokenizer()`
20+
21+
22+
--------
23+
### [0.19.1](https://github.com/TeamworkGuy2/JParseCode/commit/691c019ee2b8a889bd44a8048957fdf86a02bcd4) - 2020-04-20
824
#### Changed
925
* Finish `CommentAndWhitespaceExtractor` and tests for it
1026
* `TextToken` interface now includes `hashCode()` and `equals(Object)`

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ JSON Result (printed to System.out):
177177

178178
## Command Line Interface (CLI)
179179

180-
A command line call looks like:
180+
A command line call looks like this:
181181
```
182182
path/to/java -jar path/to/jparse-code.jar
183183
-sources './src/java/Server/Services=1,[cs];./src/java/Server/Models=3,[cs]'
@@ -190,7 +190,7 @@ Where `./src/java/Server/**` is where source files are kept
190190
And the files in `./src/java/Server/Services` belong to the C# namespace `App.Services` and `./src/java/Server/Models` belong to the C# namespace `App.Entities`
191191

192192

193-
### Sources
193+
### -sources
194194
A semicolon separated list of paths set equal to a directory depth followed by a comma and a comma separated, brackets wrapped, list of file extensions.
195195
The path, child directory depth, and file extensions are used to create a file system filter and all matching files are parsed.
196196
The following formats are valid:
@@ -202,26 +202,26 @@ Example: ```/project/myApp/Models=3,[java,json]```
202202
Note: the brackets around the '[java,json]' file extension list are literal.
203203

204204

205-
### Destinations
205+
### -destinations
206206
A semicolon separated list of output file names associated with lists of namespaces. Each parsed file who's namespace falls into one of these lists is written to that file.
207207
The following format is valid:
208208
'path=[namespace,namespace,...]'
209209

210210
Example: ```/project/output/models.json=[MyApp.Models]```
211211

212212

213-
### Log
213+
### -log
214214
An optional log file name to write parser information to, in the format:
215215
'path'
216216

217217
Example: ```/project/output/parser-log.log```
218218

219219

220-
### Threads
220+
### -threads
221221
An optional number of threads to run parsing in parallel, 0 uses the logical number of processors on the current machine, default is 1
222222

223223

224-
### Debug
224+
### -debug
225225
An optional flag which causes extra debug and performance information to be logged
226226

227227

bin/jparse_code-with-tests.jar

-205 Bytes
Binary file not shown.

bin/jparse_code.jar

-4.24 KB
Binary file not shown.

package-lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version" : "0.19.1",
2+
"version" : "0.19.2",
33
"name" : "jparse-code",
44
"description" : "An in-progress suite of parsing/transpilation tools for C#, Java, and TypeScript code. Generates simple JSON ASTs.",
55
"homepage" : "https://github.com/TeamworkGuy2/JParseCode",

rsc/csharp/ParserExamples/Models/AlbumInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class AlbumInfo {
1616
public string AlbumName { get; set; }
1717

1818
/// <value>The track duration in milliseconds</value>
19-
public IList<TrackInfo> Tracks { get; set }
19+
public IList<TrackInfo> Tracks { get; set; }
2020

2121
}
2222

rsc/java/ParserExamples/Models/AlbumInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// <threadsafety>
99
/// This class is mutable. And it is not thread-safe.
1010
/// </threadsafety>
11-
[DataContract]
11+
@DataContract
1212
public class AlbumInfo {
1313

1414
/// <value>The track name.</value>

rsc/java/ParserExamples/Models/TrackInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// <threadsafety>
1111
/// This class is mutable. And it is not thread-safe.
1212
/// </threadsafety>
13-
[DataContract]
13+
@DataContract
1414
public class TrackInfo implements Serializable, Comparable<TrackInfo> {
1515

1616
/// <value>The track name.</value>

src/twg2/parser/codeParser/csharp/CsFileTokenizer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package twg2.parser.codeParser.csharp;
22

33
import twg2.collections.dataStructures.PairList;
4-
import twg2.parser.Inclusion;
54
import twg2.parser.codeParser.CommentStyle;
65
import twg2.parser.fragment.CodeTokenType;
76
import twg2.parser.language.CodeLanguageOptions;
@@ -13,7 +12,7 @@
1312
import twg2.parser.tokenizers.IdentifierTokenizer;
1413
import twg2.parser.tokenizers.NumberTokenizer;
1514
import twg2.text.tokenizer.CharParserFactory;
16-
import twg2.text.tokenizer.StringBoundedParserBuilder;
15+
import twg2.text.tokenizer.Inclusion;
1716
import twg2.text.tokenizer.StringParserBuilder;
1817

1918
import static twg2.parser.tokenizers.CodeTokenizer.ofType;
@@ -57,7 +56,7 @@ public static PairList<CharParserFactory, TextTransformer<CodeTokenType>> create
5756

5857

5958
public static CharParserFactory createAnnotationTokenizer() {
60-
CharParserFactory annotationParser = new StringBoundedParserBuilder("C# annotation")
59+
CharParserFactory annotationParser = new StringParserBuilder("C# annotation")
6160
.addStartEndNotPrecededByMarkers("block [ ]", '[', '[', ']', Inclusion.INCLUDE)
6261
.isCompound(true)
6362
.build();

src/twg2/parser/tokenizers/CodeBlockTokenizer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package twg2.parser.tokenizers;
22

3-
import twg2.parser.Inclusion;
43
import twg2.text.tokenizer.CharParserFactory;
5-
import twg2.text.tokenizer.StringBoundedParserBuilder;
4+
import twg2.text.tokenizer.Inclusion;
5+
import twg2.text.tokenizer.StringParserBuilder;
66

77
/**
88
* @author TeamworkGuy2
@@ -14,7 +14,7 @@ public class CodeBlockTokenizer {
1414

1515

1616
public static CharParserFactory createBlockTokenizer(char startChar, char endChar) {
17-
CharParserFactory commentParser = new StringBoundedParserBuilder("block")
17+
CharParserFactory commentParser = new StringParserBuilder("block")
1818
.addStartEndMarkers("block " + startChar + " " + endChar, startChar, endChar, Inclusion.INCLUDE)
1919
.isCompound(true)
2020
.build();

0 commit comments

Comments
 (0)