Commit Graph

6 Commits

Author SHA1 Message Date
Xi Ge
0c28b4c1a3 SyntaxNodes: implement the hash function for syntax nodes.
This hash function will concatenate all interesting pieces of information
of node definitions in a single string and call hash() on this string.
2019-02-07 16:58:26 -08:00
Marc Rasi
bf18697b4f parsing, typechecking, and SILGen for #assert
`#assert` is a new static assertion statement that will let us write
tests for the new constant evaluation infrastructure that we are working
on. `#assert` works by lowering to a `Builtin.poundAssert` SIL
instruction. The constant evaluation infrastructure will look for these
SIL instructions, const-evaluate their conditions, and emit errors if
the conditions are non-constant or false.

This commit implements parsing, typechecking and SILGen for `#assert`.
2018-11-07 16:34:17 -08:00
Arnold Schwaighofer
b102c7f6b4 Parser/Sema/SILGen changes for @_dynamicReplacement(for:)
Dynamic replacements are currently written in extensions as

extension ExtendedType {
  @_dynamicReplacement(for: replacedFun())
  func replacement() { }
}

The runtime implementation allows an implementation in the future where
dynamic replacements are gather in a scope and can be dynamically
enabled and disabled.

For example:

dynamic_extension_scope CollectionOfReplacements {
  extension ExtentedType {
    func replacedFun() {}
  }

  extension ExtentedType2 {
    func replacedFun() {}
  }
}

CollectionOfReplacements.enable()
CollectionOfReplacements.disable()
2018-11-06 09:58:36 -08:00
Mark Lacey
5e0cb1978a Fix libSyntax support for operator decl designated types. 2018-10-11 13:36:14 -07:00
John McCall
32c7e4bbfa Fix libSyntax support for yields with expression lists. 2018-10-09 15:34:54 -04:00
Alex Hoppen
280b186fa0 [libSyntax] Add a binary serialization format for syntax trees 2018-08-10 10:13:00 -07:00