Commit Graph

20 Commits

Author SHA1 Message Date
Aleksey Kladov
8c77e08fad Clarify the rule for leading trivia
The "contiguous sequence" is not necessary and is confusing.
2019-02-20 13:26:21 +03:00
Xi Ge
957155dd8f [Doc] Update libSyntax document for how to use it in Swift tools. NFC 2018-09-25 17:49:53 -07:00
Liigo Zhuang
15a539d6fd parse file contents
currentFile -> currentFileContents
2018-07-30 16:41:03 +08:00
Richard Wei
4de4f34329 Fix libsyntax doc
`gyb_syntax_support.py` does not exist. It's a directory.
2018-07-26 02:56:06 -07:00
Alan Zeino
b1f67720a9 Fix typo in code example in libSyntax README 2018-07-21 15:37:42 -07:00
Xi Ge
12e3d50ffa [Doc][Syntax] Update the documented code example since recent API change. rdar://37132409 2018-02-20 10:53:15 -08:00
Harlan
7eebf86d6e [Syntax] Fix and update 'Adding New Syntax Nodes' in README (#13602) 2017-12-23 08:15:32 -08:00
Xi Ge
f9f6be8afc [Doc] libSyntax: add the instruction for experimenting libSyntax APIs in an Xcode command line tool. (#13589) 2017-12-21 17:03:53 -08:00
Daniel Beard
a84926744b Add additional terminating | 2017-08-21 09:54:03 -07:00
Daniel Beard
ebfdab08c5 Fix SwiftSyntax README.md table layout.
The `Tokens` table had a misplaced `f` character which was preventing the table from laying out correctly.
2017-08-21 09:10:57 -07:00
Harlan
a5098e6b69 Generate libSyntax API (#10926)
* Generate libSyntax API

This patch removes the hand-rolled libSyntax API and replaces it with an
API that's entirely automatically generated. This means the API is
guaranteed to be internally stylistically and functionally consistent.
2017-07-25 18:19:58 -07:00
Harlan
70089a7bcc [Syntax] Represent TokenSyntax as a Syntax node (#10606)
Previously, users of TokenSyntax would always deal with RC<TokenSyntax>
which is a subclass of RawSyntax. Instead, provide TokenSyntax as a
fully-realized Syntax node, that will always exist as a leaf in the
Syntax tree.

This hides the implementation detail of RawSyntax and SyntaxData
completely from clients of libSyntax, and paves the way for future
generation of Syntax nodes.
2017-06-27 11:08:10 -07:00
Harlan Haskins
bbae4df4cf Update README to reflect new structure 2017-06-23 11:06:24 -07:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
practicalswift
33a5601ad1 [gardening] Fix typos 2017-02-23 22:46:40 +01:00
David Farler
52096534a6 [Syntax] Fix a few typos and language in Readme.md 2017-02-22 18:45:29 -08:00
David Farler
bd6959b274 [Syntax] Fix unconscionable typography 2017-02-20 17:56:26 -08:00
David Farler
2578ae3be1 [Syntax] Add example object diagram for a return statement
Add a little visualization for a code snippet showing the main
players in the Syntax tree, showing where the strong references
flow.

NFC - documentation only.
2017-02-20 17:53:31 -08:00
David Farler
a6df054ae0 [Syntax] Add README.md for lib/Syntax 2017-02-17 12:57:04 -08:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08:00