Commit Graph
17 Commits
Author SHA1 Message Date
6c812db05c Clarify name bindings in namespaces. (#3407)
-   Require namespace members be declared in the same name scope as the
    namespace is declared.
-   Allow binding patterns to directly declare names in namespaces.
-   Disallow using different namespaces in the same binding pattern.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2023-11-22 22:52:08 +00:00
Jon Ross-PerkinsandChandler Carruth 5943208f75 Change Main//default to an api file (#3403)
When there is no `package` directive, default to `Main//default api`
instead of
`Main//default impl`. This means:

- The extension will be `.carbon`, not `.impl.carbon`.
- There can only be one such file when compiling.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2023-11-16 18:57:45 +00:00
ea982ad2c8 Simplified package declaration for the Main package (#2550)
Make the preamble of simple programs more ergonomic, by removing the
`package Main` from the main package and removing the `package`
declaration
entirely from the main source file. Imports within a single package no
longer
need to, and are not permitted to, specify the package name.

Partially covers #2001 / #1136.
Covers #1869.
Supersedes #2265.
Addresses design idea #2323.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2023-07-06 21:55:54 +00:00
Josh Soref 066b103881 Spelling (#1580)
This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/carbon-lang/commit/38a1c1640151899fd6da0442a92557f9543b6280#commitcomment-79197316

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/carbon-lang/commit/173c8f9083a68aa61f7cfe94f720f1e5dc7f1ea3

Note: this PR does not include the action. If you're interested in running a spell check on every PR and push, that can be offered separately.

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-22 16:14:21 -07:00
Ryan Russell aa4ce80907 docs(design): improve readability (#1431)
Readability improvements focused on `docs/design/.md`

Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-07-19 17:45:45 -04:00
josh11b 9863cb98bb Make C++ import syntax match what we've been using in examples (#1397) 2022-07-15 13:47:37 -07:00
josh11b 16f9d82541 Fix binding syntax to be id: Type (#1381) 2022-07-12 10:14:11 -07:00
Jon Meowandjosh11b 24b763c7e8 Fix or remove invalid anchor links, adding pre-commit (#997)
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-01-05 15:00:02 -08:00
Jon MeowandChandler Carruth 6d33a80988 api file default public (#752)
Replace library public-like `api` behavior with explicit `private` behavior, mirroring #665 

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-09-21 09:33:32 -07:00
Jon Meow eb61412c79 Explicitly disallow self-imports by libraries (#794) 2021-09-03 17:01:52 -07:00
Geoff Romer e08beccc66 Use "package directive" and "import directive" (#808)
These aren't really statements (because they're not executed at run time), and it's debatable whether they're declarations, since their primary purpose isn't to introduce a name. On Discord, "directive" seemed to be the consensus choice for an alternate term.
2021-09-03 11:54:41 -07:00
Jon Meow c33994d1d1 Rewrite code and name organization alternatives/references (#724)
Alternatives just link to the proposal PR due to the legacy decision of putting alternatives in the doc.
2021-08-12 08:18:39 -07:00
Jon MeowandRichard Smith 231264e0c0 Remove : in variable declarations (#503)
Starting to apply #339

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2021-05-17 15:24:20 -07:00
Chandler CarruthandJon Meow a9c70c1057 Clean up references to the carbon-toolchain repository. (#226)
Now that we've centralized on a monorepo, tidy up some lingering
references.

For the `pr_comments.py` script, I've left the flag in place to select
a repository as it seems useful functionality to have available even if
we don't expect to need it in the near term. That said, I can pull it
out if folks prefer.

I haven't updated any of the *proposals* because it seems better to
leave those as-is from when they were written. The references seem
unlikely to be confusing to me. Happy for suggestions if needed there
though.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2020-12-15 16:27:31 -08:00
Jon Meow 79a9b51d07 Update pre-commits, add and address flake8 (#195)
Adopts new copyright and markdown toc checks.

The new toc check generates the toc header, so that's why all the md files changed (this had felt better to me for the long-term, more auto-generated content)
2020-11-13 16:34:23 -08:00
Jon Meow 94e065d9d2 Automated fixes using check-google-doc-style (#193)
With one manual ignore in the markdown style proposal, because it's explicitly listing disallowed terms.
2020-11-12 10:31:26 -08:00
Richard Smith ee7a108da4 Incorporate proposals #142 and #143 into the design
Add design text based on the contents of two proposals:

#142 Unicode source files
#143 Numeric literals
2020-11-03 16:39:05 -08:00