From b0c8619ac72dae04537d02b70d7665a0361f2798 Mon Sep 17 00:00:00 2001 From: laurentlb Date: Tue, 3 Jul 2018 12:38:06 -0700 Subject: Skylark spec: -x is not an Operand, but a UnaryExpr PiperOrigin-RevId: 203167019 --- site/docs/skylark/spec.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'site') diff --git a/site/docs/skylark/spec.md b/site/docs/skylark/spec.md index ecd84a6427..13cad173ea 100644 --- a/site/docs/skylark/spec.md +++ b/site/docs/skylark/spec.md @@ -12,7 +12,7 @@ domain-specific functions and data types beyond those provided by the core language. For example, Skylark is embedded within (and was originally developed for) the [Bazel build tool](https://bazel.build), and [Bazel's build language](https://docs.bazel.build/versions/master/skylark/language.html) is based on Skylark. -Another implementation in Go can be found here: https://github.com/google/skylark/ +Another implementation in Go can be found here: [https://github.com/google/skylark/](https://github.com/google/skylark/) This document was derived from the [description of the Go implementation](https://github.com/google/skylark/blob/master/doc/spec.md) @@ -23,7 +23,7 @@ and the Go specification, Copyright 2009–2017, The Go Authors. It is now maintained by the Bazel team. The name "Skylark" is a code name of the Bazel project. -We plan to rename the language before the end of 2017 to reflect its +We plan to rename the language soon to reflect its applicability to projects unrelated to Bazel. @@ -1149,8 +1149,6 @@ CallSuffix = '(' [Arguments [',']] ')' . SliceSuffix = '[' [Expression] [':' Test [':' Test]] ']' . ``` -TODO: resolve position of -x, and 'not x' in grammar: Operand or UnaryExpr? - ### Identifiers ```text @@ -1272,7 +1270,7 @@ There are two unary operators, both appearing before their operand: `-`, and `not`. ```text -UnaryExpr = '-' PrimaryExpr +UnaryExpr = '-' Test | 'not' Test . ``` @@ -3211,7 +3209,6 @@ Operand = identifier | ListExpr | ListComp | DictExpr | DictComp | '(' [Expression [',']] ')' - | '-' PrimaryExpr . DotSuffix = '.' identifier . @@ -3232,7 +3229,9 @@ Entry = Test ':' Test . CompClause = 'for' LoopVariables 'in' Test | 'if' Test . -UnaryExpr = 'not' Test . +UnaryExpr = '-' Test + | 'not' Test + . BinaryExpr = Test {Binop Test} . -- cgit v1.2.3