Commit Graph

11 Commits

Author SHA1 Message Date
Pavel Yaskevich
0625d56a24 [AST] NFC: Remove {TokenKinds, Attr}.def.gyb from CMakeLists 2023-08-17 09:42:43 -07:00
Alex Hoppen
ef8e4ac0f3 [AST] Remove gyb_syntax_support
We are no longer using these Python files to generate anything in SwiftSyntax. We can just remove them and instead commit the generated `.def` files.
2023-08-01 17:20:14 -07:00
Stéphan Kochen
7b460ce495 build: fix accidental cmake expansions
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:

- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
  expands to 1, where it would previously coerce to a string.

- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
  left-hand side expands twice.

In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:

- Quoted right-hand side of `STREQUAL` where I was confident it was
  intended to be a string literal.

- Removed manual variable expansion on left-hand side of `STREQUAL`,
  `MATCHES` and `IN_LIST` where I was confident it was unintended.

Fixes #65028.
2023-07-17 21:50:50 +02:00
Alex Hoppen
1ebe7ef6a2 Copy files from SwiftSyntax’s gyb_syntax_support that are relevant to the compiler to this repo
This allows us to evolve e.g. token kinds and how attributes are modelled independently between SwiftSyntax and the compiler. It also makes it easier to e.g. add an attribute because you don’t need to create PRs for two repositories.
2022-12-15 16:40:28 +01:00
Rintaro Ishizaki
d05f45b7f0 [CMake] Don't add unnecessary gyb support .py files
'add_gyb_target' can accept 'DEPENDS'. Utilize it.
2022-12-08 14:49:08 -08:00
Robert Widmann
91c262bcb7 Move TokenKinds.def.gyb to AST 2022-11-16 13:38:25 -08:00
Robert Widmann
a178cf9a00 Cede Ownership of Swift Attributes to swift-syntax
Replace Attr.def with a gyb file that reads from swift-syntax
to automatically generate the attribute nodes.

For now, only the Swift attributes have been migrated. SIL attributes
can be defined manually in Attr.def.gyb. To add new Swift attributes,
a paired pull request to swift-syntax is now necessary.
2022-09-13 17:30:29 -07:00
Pavel Yaskevich
91cd0f0884 [AST] Remove obsolete CMakeLists.txt used to install translations 2020-07-13 22:24:17 -07:00
Hassan ElDesouky
6a444433ec [Diag] Refactor DiagnosticEngine to use YAML files - Reopen (#32483)
Introduce localization support for diagnostics via file-per-language store in `YAML` format.
Add `LocalizationFormat` interface and its implementation `YAMLLocalizationProducer`.
Augment `DiagnosticEngine` to support localization when applicable.
2020-06-24 23:09:12 -07:00
Pavel Yaskevich
acd73a30a3 Revert "[GSoC] Refactor DiagnosticEngine to use YAML files" (#32460) 2020-06-18 22:08:22 -04:00
HassanElDesouky
f3a9708071 Use clang-format 2020-06-17 20:34:14 +02:00