Граф коммитов

123 Коммитов

Автор SHA1 Сообщение Дата
Adam Sapek 1e4ed55a1f Document the JSON representation of the schema AST 2015-03-31 22:46:30 -07:00
Adam Sapek 48e1a55847 Simplify the JSON representation of AST 2015-03-31 22:46:29 -07:00
Adam Sapek df910f48d3 Add documentation page for the compiler 2015-03-30 00:18:46 -07:00
Adam Sapek 15210207ea Add CMake project to build documentation
The documentation is compiled from the markdown sources to html using
`pandoc`. In order to install `pandoc` run:

        cabal install pandoc

The documentation build is optional and if `pandoc` is not found during
cmake project configuration the documentation build is skipped.
2015-03-24 22:28:16 -07:00
Adam Sapek 0944a12502 Improve errors when parsing invalid schema AST file 2015-03-24 03:38:55 -07:00
Adam Sapek c921a23cd0 Add support for using schema AST as compiler input
File(s) with the `.json` extension are assumed to contain the JSON
representation of schema abstract syntax tree in the format produced by
`gbc schema`
2015-03-20 03:21:57 -07:00
Adam Sapek 8555e498c4 Remove helper functions to modify MappingContext 2015-03-20 02:19:24 -07:00
Adam Sapek f7020b0d8f Customize JSON representation of Default 2015-03-20 02:19:23 -07:00
Adam Sapek 860c1084fd Hide parser environment and ReaderT behind parseBond 2015-03-20 02:19:20 -07:00
Adam Sapek 5881640769 Use standalone deriving Generic declarations
The Generic instance is needed only to derive generic implementations of
FromJSON and ToJSON typeclasses so we move the declarations to
Schema/JSON.hs and only derive Generic for data types that need it.
2015-03-20 02:19:19 -07:00
Adam Sapek ff01c24556 Add round-trip unit test for AST JSON representation
Derived show typeclass for schema types in order to support QuickCheck.
Added custom ShowPretty typeclass for printing Declarations in parser
error messages. Implemented custom JSON parsing for types that had
custom JSON serialization.
2015-03-20 02:19:18 -07:00
Adam Sapek e30c89854b Reduce code duplication around codegen 2015-03-20 02:19:16 -07:00
Adam Sapek 45a37d5bde Add compiler support for schema AST output
The schema AST is written in JSON format. We foresee two classes of
scenarios that will use it.

Tools that need to process Bond schema files using languages other than
Haskell can avoid recreating Bond parser. Example might be schema
repositories, lints, etc.

The schema AST will also be used to allow users to inject schema
transformations into codegen process. This in many cases can be a
lightweight alternative to custom codegen.
2015-03-20 02:19:15 -07:00
Adam Sapek f13b706f9b Improve parser error handling for user defined types 2015-03-20 02:19:14 -07:00
Adam Sapek c2adfae6ee Separate schema data definitions and helper functions 2015-03-19 01:30:29 -07:00
Adam Sapek f710ceb39f Add test suite to Bond compiler 2015-03-19 01:30:28 -07:00
Adam Sapek ae5d1ba872 Merge branch 'oliora-master' 2015-03-09 18:48:50 -07:00
Andrey Upadyshev e782093c8c Add `cabal update` for OS X in README.txt 2015-03-09 18:47:38 -07:00
Adam Sapek 2450f5fb73 Define type alias for mapping parsers 2015-03-05 00:46:12 -08:00
Adam Sapek a852f6a36b Merge branch 'qnikst-warning-cleanup' 2015-03-05 00:45:51 -08:00
Alexander Vershilov 312be3b73a Fix warnings in the Bond compiler code 2015-03-04 23:56:40 -08:00
Adam Sapek 93367714ae Merge pull request #32 from dnmiller/noexcept
Replace dynamic exception specifications with portable boost config specifier
2015-03-02 22:45:41 -08:00
Adam Sapek 1fdba699b4 Merge pull request #42 from ranrav/UpdateJsonExpression
Update JSON parser test expression
2015-02-28 01:58:12 -08:00
Ran Raviv 436736766e Update JSON parser test expression 2015-02-28 01:33:47 -08:00
Adam Sapek 7c84c4fa7e Merge pull request #40 from ranrav/master
Fix bug in JSON parsing when string value is a date
2015-02-27 08:15:33 -08:00
Adam Sapek ebf9175eef Switch AppVeyor to previous builder image
The new builder appears to have less memory and fails while building
Haskell libraries.
2015-02-27 02:01:47 -08:00
Adam Sapek 165c0727c3 Add `cabal update` to the Windows build instructions 2015-02-27 01:11:14 -08:00
Adam Sapek 1e3653a8dc Add comment explaining negative value for jobs number 2015-02-27 01:07:13 -08:00
Ran Raviv 3294b3e1d3 Fix bug in JSON parsing when string value is a date
When reading string fields, the SimpleJsonParser expects to find a JsonToken of
type String. But if the string value matches a date format, the actual JsonToken
that is seen is of type Date. To fix this, we are setting the JsonTextReader to not
try to parse strings as dates.

Also improve the exception text when reading unenxpected input to help know
what JsonToken was actually read, and fix a similar possible issue with parsing
doubles.
2015-02-26 13:31:52 -08:00
Adam Sapek ee7f382456 Update .gitignore for NuGet packages 2015-02-12 17:24:34 -08:00
Adam Sapek 5f532114cb Update the NuGet test for version 3.0.4 2015-02-12 17:05:26 -08:00
Adam Sapek 044f72dd88 Run gbc from BOND_COMPILER_PATH or the system path 2015-02-12 12:33:56 -08:00
Adam Sapek ac2c686e55 Remove MSTest residues from test projects 2015-02-12 12:33:34 -08:00
Adam Sapek cb336cfd57 Update repositories.config 2015-02-12 12:16:19 -08:00
Adam Sapek f5ed61e2e9 Run multiple gbc jobs when using Bond.CSharp.targets
By default the Bond.CSharp.targets will run 2 fewer concurrent jobs than
there are processor cores on the machine. User can override this
behaviour for their project by specifying a different `--jobs` option in
`BondOptions` property.
2015-02-12 12:16:15 -08:00
Adam Sapek c764d993e0 Avoid parsing the same import multiple times
In some scenarios the hierarchy of schemas may be very interconnected
and redundant parsing of the same imported files is a huge performance
overhead for code generation (this change showed 20x improvement when
compiling a sample set of ~900 interconnected schemas).
2015-02-12 12:16:12 -08:00
Adam Sapek 0c4d4ad4fd Add --jobs option to gbc
When compiling multiple .bond files at once, the `--jobs=[NUM]` command
line option can be used to specify how many jobs should be run
concurrently. When used without arguments, the default is to run as many
jobs as there are processors. The option also accepts negative numbers
to specify fewer jobs than the number of processors. Often the optimal
performance is achieved by leaving one or more cores for other processes
on the machine.
2015-02-12 12:16:08 -08:00
Adam Sapek 90f02657f8 Merge pull request #36 from xplicit/travis2
Add building cs.sln and running unit tests in Travis.CI
2015-02-12 11:32:35 -08:00
xplicit 8f2a8e57c8 Add building cs.sln and running unit tests in Travis.CI 2015-02-12 17:10:57 +06:00
Adam Sapek 87b098aacc Merge pull request #35 from xplicit/nunit-merge6
Convert unit tests from MSTest to NUnit
2015-02-11 23:40:19 -08:00
xplicit 235c3a0c5f Convert unit tests from MSTest to NUnit 2015-02-12 11:54:59 +06:00
Adam Sapek 72fa67e0f7 Remove CollectionInterfaces config from appveyor 2015-02-11 12:17:47 -08:00
Adam Sapek 40f3888362 Combine unit tests into fewer assemblies
Unit tests take a long time to run in CI. Building all tests with
--collection-interfaces flag is somewhat wasteful because a lot of tests
don't use collections at all. Furthermore this way we only tested
collection interfaces together with properties. This change removes the
separate test configuration for --collection-interfaces and instead uses
concrete/interface collection alternatively for different .bond files in
Fields/Properties configuration. This way every schema is tested with
both interfaces and concrete collections and both are also tested with
fields and properties. This gives better coverage while eliminating
redundant identical tests in different assemblies.
2015-02-11 11:52:19 -08:00
Adam Sapek 440dd3512d Use Array.Resize to grow OutputBuffer 2015-02-11 11:43:56 -08:00
Adam Sapek 9765915539 Disable Boost download in appveyor.yml 2015-02-09 21:38:37 -08:00
Adam Sapek 30399233f3 Use a smaller buffer when marshaling bonded<T>
When bonded<T> is serialized to untagged protocols like Simple Binary
it is first marshaled into a separate buffer using a tagged protocol and
then written as length prefixed blob to the untagged protocol.
OutputBuffer used for marshaling by default allocates 64KB which is
costly if the bonded<T> payload is small.
2015-02-09 18:55:25 -08:00
Adam Sapek 4bea59d783 Merge branch 'ramb0x-master' 2015-02-07 12:28:54 -08:00
ramb0x fdfa177203 Add syntax highlighting support for Notepad++ 2015-02-07 12:28:19 -08:00
Dan Miller 697198c15d Replace throw with noexcept 2015-02-07 11:03:39 -08:00
Adam Sapek d720a9782a Split tests by framework version 2015-02-06 21:41:39 -08:00