Commit Graph

9 Commits

Author SHA1 Message Date
David Ungar
7a0e0ffc8a Store current primary in diagnostic engine, pass it down via handleDiagnostic. Unformmated. 2019-04-02 00:43:28 -07:00
Xi Ge
a970d13d9f SyntaxParser: avoid evaluating pound conditions in the new in-process parser. 2019-03-18 12:09:22 -07:00
Xi Ge
a86f89da48 SwiftSyntax Parser: expose parser diagnostics via C API.
This allows SwiftSyntax to listen to emitted diagnostics during
parsing.

rdar://48439271
2019-03-01 15:22:21 -08:00
Xi Ge
e07a8cf2a6 SyntaxParser: set up a C API to get a hash value indicating the node declaration set
To ensure SwiftSyntax calls a compatible parser library, this patch sets
up a C API that returns a constant string calculated during compilation time to indicate
the version of syntax node declarations. The same hash will be calculated
in the SwiftSyntax (client) side as well by using the same algorithm.

During runtime, SwiftSyntax will verify its hash value is identical to the
result of calling swiftparse_node_declaration_hash before actual
parsing happens.

This patch only sets the API up. The actual implementation of the
hashing algorithm will come later.
2019-02-06 17:33:48 -08:00
Argyrios Kyrtzidis
5bef4c704c [Parse] Optimize syntax parsing: Disable name lookups during parsing
This eliminates the overhead of doing name lookups during parsing (which is unncessary during syntactic parsing) by enabling the `EnableASTScopeLookup` lang option.
2019-01-17 12:24:17 -08:00
Argyrios Kyrtzidis
57c1f72cc3 [Parse] Optimize syntax parsing: Make ParsedRawSyntaxNode a POD type
This eliminates the overhead of ParsedRawSyntaxNode needing to do memory management.
If ParsedRawSyntaxNode needs to point to some data the memory is allocated from a bump allocator.

There are also some improvements on how the ParsedSyntaxBuilders work.
2019-01-17 12:17:28 -08:00
Argyrios Kyrtzidis
c7ac859310 [Parse] Optimize syntax parsing: Speed-up Lexer::lexTrivia()
Introduce ParsedTrivia which is a more efficient structure to use during lexing than syntax::Trivia.
2019-01-17 12:10:27 -08:00
Argyrios Kyrtzidis
94aeea5db9 [libSwiftSyntaxParser] Pass SynParser to CLibParseActions to use as container for the node handling blocks 2019-01-10 16:13:44 -08:00
Argyrios Kyrtzidis
1dc288fb23 Introduce C parser library
Add a shared library with a C API that provides access to the syntactic parser with callbacks for the inference of raw syntax nodes.
This is primarily intended to be used by SwiftSyntax to speed-up source code parsing for it.
2019-01-09 18:30:45 -08:00