Any valid name beginning with `#` that isn't already a preprocessor
macro is now considered a freestanding macro. Previously, only
preprocessor macros were handled in the vim syntax file, e.g. `#if`.
For example, this properly handles the syntax for the `#expect` and the
`#require` macros used in Swift Testing.
The problem with `is_escaping_closure` was that it didn't consume its operand and therefore reference count checks were unreliable.
For example, copy-propagation could break it.
As this instruction was always used together with an immediately following `destroy_value` of the closure, it makes sense to combine both into a `destroy_not_escaped_closure`.
It
1. checks the reference count and returns true if it is 1
2. consumes and destroys the operand
This removes the implementation of the `swift-indent` tool, its
associated documentation, and utilities. This tool was never completed
and has much better alternatives with `swift-format` which is more
flexible and actually maintained.
The `__future__` we relied on is now, where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):
* absolute_import
* print_function
* unicode_literals
* division
These import statements are no-ops and are no longer necessary.
Introduce a new instruction `dealloc_stack_ref ` and remove the `stack` flag from `dealloc_ref`.
The `dealloc_ref [stack]` was confusing, because all it does is to mark the deallocation of the stack space for a stack promoted object.
This commit adds standard conventions for Vim filetype plugins:
- Allows users to opt out of using the provided ftplugin file, if they
choose to install and use another set of runtime files for Swift
(which offers its own version of ftplugin for Swift), It also prevents
this ftplugin file from being sourced again if a ftplugin file for
Swift was already sourced. Vim's documentation on this recommends
offering users this option as well, under the "DISABLING" section
of `:help write-filetype-plugin`).
- Adds the `b:undo_ftplugin` buffer local variable, which is used to
undo the filetype settings when the `:setfiletype` command is used
(See :help `undo_ftplugin`). Also prefer using the full names for Vim
settings instead of short ones as they are more readable.
The above conventions are in place in many of the ftplugin files
shipped with Vim, so they can be used as a reference, as well.
This change is motivated by highlighting for
test/Interpreter/SDK/lib.swift. It contains the line
// CHECK: the magic word is ///* magic *///
which without this change leaves the rest of the file highlighted as
commented out. swiftComment cannot contain swiftLineComment, or else
this:
/* // */ hello
gets incorrectly highlighted as if "hello" was commented out.
Similarly, swiftLineComment cannot contain swiftComment, or else this:
// /*
*/
gets incorrectly highlighted as if */ was closing a comment, when
actually it should be a syntax error.
This improves the detection of syntax so that the identifier for a
typealias is identified as an identifier, the `=` is identified as a
delimiter, and the type that is aliased is identified as a type.
CMake supports the notion of installation components. Right now we have some
custom code for supporting swift components. I think that for installation
purposes, it would be nice to use the CMake component system.
This should be a non-functional change. We should still only be generating
install rules for targets and files in components we want to install, and we
still use the install ninja target to install everything.
Will be used to verify that withoutActuallyEscaping's block does not
escape the closure.
``%escaping = is_escaping_closure %closure`` tests the reference count. If the
closure is not uniquely referenced it prints out and error message and
returns true. Otherwise, it returns false. The returned result can be
used with a ``cond_fail %escaping`` instruction to abort the program.
rdar://35525730
* Implement #warning and #error
* Fix #warning/#error in switch statements
* Fix AST printing for #warning/#error
* Add to test case
* Add extra handling to ParseDeclPoundDiagnostic
* fix dumping
* Consume the right paren even in the failure case
* Diagnose extra tokens on the same line after a diagnostic directive
* vim-syntax: fix highlighting for indirect case/enum
without skipwhite, `indirect enum` never gets highlighted. this
commit also adds the `indirect case` multiword keyword.
* vim-syntax: allow whitespace before type parameters
Added skipwhite to multiple match groups so that whitespace can be used
before type parameters (`Type <Param>`). This matches Xcode's behavior.
* vim-syntax: update last change line
* vim-syntax: remove indirect case from multiword type def group