Commit Graph

19 Commits

Author SHA1 Message Date
parrt 38a95da397 manual edits of 4.7.1 -> 4.7.2 2018-12-17 14:32:39 -08:00
Ewan Mellor ba392be1af
Remove use of deprecated String functions in StringExtension.
Remove some functions that are no longer used, and update the
rest to Swift 4's String API.  lastIndexOf changes to lastIndex(of: ),
matching the standard library naming conventions, and returns a
String.Index? instead of an Int.

Add an implementation of Substring.hasPrefix for Linux; this
is in the Apple standard library but not the Linux one.
https://bugs.swift.org/browse/SR-5627

Add unit tests for StringExtension.

Bump the Swift download for the Travis Linux tests from 4.0
to 4.0.2.  There is a bug in Substring.range(of:) in 4.0.0
(https://bugs.swift.org/browse/SR-5663) that we need to avoid.
2017-11-07 17:06:15 -08:00
Ewan Mellor 08ba9379d8
Added tests for RuntimeMetaData.getMajorMinorVersion. 2017-11-07 17:06:14 -08:00
Ewan Mellor fd8fd175a6
Fix ParseTreePatternMatcher.split in the Swift runtime.
Fix the parsing inside ParseTreePatternMatcher.split.  It was trivially
broken in a number of ways, with bugs that aren't in the Java version
that it was ported from, so it's obviously never been run before.

This adds unit tests for ParseTreePatternMatcher.split, and makes Chunk
implement Equatable, so that it we can compare Chunk instances in the
tests.

Tidy up the description implementations at the same time.
2017-11-07 17:05:22 -08:00
Ewan Mellor 70db334a58
Improve MurmurHash in a number of ways:
Use Swift's overflowing operators rather than multipliedReportingOverflow
etc.

Use UInt32 for the hash values.  This matches how MurmurHash3 is generally
defined (e.g. on Wikipedia).

Add support for decoding Strings (UTF-8, then little-endian) and hashing
the resultant UInt32 values.

Add a test set, using test patterns from Ian Boyd (public domain).
2017-10-21 15:23:27 -07:00
Ewan Mellor 8a292c0f4f
Migrate the Swift runtime to Swift 4.
Remove a number of generic type constraints, since these can now
be inferred by the compiler.

Match the syntax change when passing a tuple into a function (adding
an extra set of parens).

Change filterPrecedencePredicates to avoid a now-illegal cast.

Match the renames truncatingBitPattern -> truncatingIfNeeded,
multiplyWithOverflow -> multipliedReportingOverflow, etc.  In
some cases the multiplyWithOverflow calls are replaced by
overflowing operators (e.g. &*) instead.
2017-10-20 10:12:46 -07:00
Hanzhou Shi a879297bb5 swift build & swift test support Linux platform 2017-06-03 22:57:21 -07:00
Hanzhou Shi b5caa8e945 Migrating to Swift 3.1. 2017-04-01 22:47:45 -07:00
parrt b5648f405b tweak documentation about various targets 2017-03-30 10:44:28 -07:00
Hanzhou Shi e334b0df86 Adding visitor tests. 2017-03-23 22:51:21 -07:00
Hanzhou Shi c3dc1b0d68 Update grammar name to align with JAVA tests. 2017-03-23 22:51:21 -07:00
Hanzhou Shi 2dab85ce2b Fixed printing of RewriteOps, now tests are passing. 2017-03-23 22:51:21 -07:00
Hanzhou Shi cefd2c6528 Adding TokenStreamRewriterTests. 2017-03-23 22:51:20 -07:00
Hanzhou Shi b66ffe86f9 Remove generated parser files and added testRig.
Current version of swift package manager doesn't support shell command
or any mechanism that we can leverage to generate parser files. Adding
a python script to kick off the unit tests.
2017-03-05 20:44:22 -08:00
parrt 6215f18ec3 rename 4.6.1 to 4.7 everywhere 2017-02-23 14:48:58 -08:00
Ivan Kochurkin 8359a998b6 Updated generated files. 2017-01-31 00:34:10 +03:00
Hanzhou Shi 7c24680e3c Reset fetchedEOF in BufferedTokenStream after setTokenSource is called. Fixes #1584. 2017-01-16 00:39:01 -08:00
Hanzhou Shi 139225f76c convert documentation to Swift style 2017-01-16 00:23:26 -08:00
Hanzhou Shi ee82046201 Reorg Swift runtime file structure. 2017-01-16 00:23:25 -08:00