aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/Parser.java
Commit message (Collapse)AuthorAge
* Cleanup in the parserGravatar Laurent Le Brun2016-10-26
| | | | | | | | | | - Move break/continue check from ValidationEnvironment to the Parser - Remove some differences between BUILD / Skylark parsing mode - Fix location off-by-one error in the break/continue tokens - Remove duplicated error message ('for loops are not allowed on top-level') -- MOS_MIGRATED_REVID=137259929
* Refactoring for LoadStatementGravatar Laurent Le Brun2016-10-13
| | | | | | | | | | Use StringLiteral instead of String+Location. This improves consistency. getRawImports() now returns StringLiterals, which makes possible to show location in error messages. -- MOS_MIGRATED_REVID=136019586
* Automated cleanupGravatar Laurent Le Brun2016-10-12
| | | | | -- MOS_MIGRATED_REVID=135816105
* Improve error message when 'del' keyword is usedGravatar Laurent Le Brun2016-10-11
| | | | | -- MOS_MIGRATED_REVID=135784854
* Remove support for "Python" parsing mode.Gravatar Laurent Le Brun2016-10-07
| | | | | | | It was unused in Bazel. -- MOS_MIGRATED_REVID=135483937
* Index and slice calls are implemented as separate AST nodes rather than specialGravatar Vladimir Moskva2016-09-15
| | | | | | | function calls. -- MOS_MIGRATED_REVID=133259901
* Move SkylarkImport from LoadStatement to BuildFileASTGravatar Miguel Alcon Pinto2016-08-22
| | | | | | | This allow us to skip the import validation in non-build usages. -- MOS_MIGRATED_REVID=130936612
* Remove static checks from the parser.Gravatar Laurent Le Brun2016-08-04
| | | | | -- MOS_MIGRATED_REVID=129313959
* Preliminary cleanup for removing Blaze-specific code from the environmentGravatar Laurent Le Brun2016-08-03
| | | | | | | | The goal is to remove parse and eval functions from Environment, as well as isSkylark boolean. -- MOS_MIGRATED_REVID=129202204
* Fix private symbols, clean up load parsingGravatar Jon Brandvein2016-07-29
| | | | | -- MOS_MIGRATED_REVID=128699330
* Add support for more augmented-assignment operators.Gravatar Googler2016-06-03
| | | | | | | | | based on my limited understanding of python syntax, the only things we don't support is //= and **=, but it looks like skylark doesn't support the corresponding infix operators. RELNOTES[NEW]: add support for the '-=', '*=', '/=', and'%=' operators to skylark. Notably, we do not support '|=' because the semantics of skylark sets are sufficiently different from python sets. -- MOS_MIGRATED_REVID=123889776
* Add error message for skylark for-else statement, and fix error message for ↵Gravatar Yue Gan2016-04-07
| | | | | | | single else statement. -- MOS_MIGRATED_REVID=119260729
* Remove syntactic sugar when assigning to a dict item.Gravatar Laurent Le Brun2016-01-07
| | | | | | | | | | | | | | e.g. a['key'] = value is handled through a proper lvalue, instead of using syntactic sugar. Benefits include: - better error messages (reference to the '+' operator was cryptic) - more robust, e.g. it is compatible with the += operator - can be used in a tuple, e.g. a[1], a[2] = 3, 4 - it is a step towards mutable dict -- MOS_MIGRATED_REVID=111597545
* Add the source location of the import string to the LoadStatement AST node, ↵Gravatar John Field2016-01-04
| | | | | | | for use in tools. -- MOS_MIGRATED_REVID=111142252
* Enable label-based Skylark loading. In particular, such labels may reference ↵Gravatar John Field2015-12-22
| | | | | | | | | | | | | | | | | | | files in external repositories. In addition: - Cleaned up and refactored some tests to reflect the new loading behavior. Deferred to future CLs: - Updating Bazel Skylark documentation to reflect the new load form. - Enabling command-line loading of Aspects via labels. RELNOTES: Skylark load statements may now reference .bzl files via build labels, in addition to paths. In particular, such labels can be used to reference Skylark files in external repositories; e.g., load("@my_external_repo//some_pkg:some_file.bzl", ...). Path-based loads are now deprecated and may be disabled in the future. Caveats: Skylark files currently do not respect package visibility; i.e., all Skylark files are effectively public. Also, loads may not reference the special //external package. -- MOS_MIGRATED_REVID=110786452
* Skylark: Slice operations now accept a step argument.Gravatar Florian Weikert2015-12-17
| | | | | -- MOS_MIGRATED_REVID=110446625
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Fix location for Break and Continue AST nodes.Gravatar Laurent Le Brun2015-10-27
| | | | | -- MOS_MIGRATED_REVID=106291132
* Fixed wrong error message when using class definitions in Skylark / BUILD files.Gravatar Florian Weikert2015-10-16
| | | | | -- MOS_MIGRATED_REVID=105585492
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Open source some skylark tests.Gravatar Han-Wen Nienhuys2015-09-22
| | | | | -- MOS_MIGRATED_REVID=103652672
* Skylark: Unified ListComprehension and DictComprehension.Gravatar Florian Weikert2015-09-21
| | | | | | | As a result, complex dict comprehensions (nested + with conditions) can be used. -- MOS_MIGRATED_REVID=103374493
* Allow construct "a, = [1]" in parser.Gravatar Laurent Le Brun2015-09-21
| | | | | | | | | This is equivalent to: (a,) = [1] which puts the element of a 1-element list in the variable. -- MOS_MIGRATED_REVID=103371728
* Remove support for the deprecated include() statement in order to be able to ↵Gravatar Lukacs Berki2015-09-21
| | | | | | | | | separate Skylark from the rest of the code so that Label parsing can be simplified. This is another go at []: now that the tests were fixed in [] and [] it can be submitted again. -- MOS_MIGRATED_REVID=103364881
* Rollback of commit 4e5037520e3067f9d8784e1c59f9545b96111cd4.Gravatar Lukacs Berki2015-09-17
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke tests, I mistakenly assumed it was flakiness. *** Original change description *** Remove support for the deprecated include() statement. This is part of the crusade to eliminate as every dependency in Skylark on the rest of the code so that it can be moved deeper in the dependency graph. RELNOTES: The include() statement in BUILD files is not supported anymore. -- MOS_MIGRATED_REVID=103284257
* Remove support for the deprecated include() statement.Gravatar Lukacs Berki2015-09-17
| | | | | | | | | This is part of the crusade to eliminate as every dependency in Skylark on the rest of the code so that it can be moved deeper in the dependency graph. RELNOTES: The include() statement in BUILD files is not supported anymore. -- MOS_MIGRATED_REVID=103279943
* Parse the label syntax "@//a:b" so that eventually we can make that the ↵Gravatar Lukacs Berki2015-09-15
| | | | | | | | | syntax that means "refer to the main repository". There isn't an overarching plan for what we are going to do with the cmdline package, which seems to be separated from the .syntax one in all sorts of awkward ways. -- MOS_MIGRATED_REVID=103088960
* Remove dead code, set private visibilityGravatar Laurent Le Brun2015-09-14
| | | | | -- MOS_MIGRATED_REVID=102986851
* Allow tuples inside square brackets (for list/dict indexing).Gravatar Laurent Le Brun2015-09-11
| | | | | -- MOS_MIGRATED_REVID=102841541
* LoadStatement: Keep the location of the path argument.Gravatar Laurent Le Brun2015-09-11
| | | | | -- MOS_MIGRATED_REVID=102743954
* Fix bug in the parser when a block was silently skipped.Gravatar Laurent Le Brun2015-09-11
| | | | | | | Some cosmetic changes with EnumSets. -- MOS_MIGRATED_REVID=102742596
* Keep function parameters in the AST.Gravatar Laurent Le Brun2015-09-04
| | | | | -- MOS_MIGRATED_REVID=102330569
* Fix a bug in SyntaxTreeVisitor to handle return statements.Gravatar Laurent Le Brun2015-09-03
| | | | | -- MOS_MIGRATED_REVID=102237430
* Add profiling for Skylark lexer, parser, user- and built-in functions.Gravatar Googler2015-08-28
| | | | | -- MOS_MIGRATED_REVID=101769963
* Introduce '|' operator for set union.Gravatar Laurent Le Brun2015-08-25
| | | | | -- MOS_MIGRATED_REVID=101363350
* Allow return without expression, AST-equivalent to return None.Gravatar Googler2015-08-11
| | | | | -- MOS_MIGRATED_REVID=100268427
* Skylark: load() allows the loading of symbols via an alias.Gravatar Florian Weikert2015-07-27
| | | | | | | E.g. load("/foo/bla", my_rule = "old_name") will introduce the symbol "my_rule" as an alias for "old_name". -- MOS_MIGRATED_REVID=98933635
* Renamed Ident to Identifier, added some helper methods and refactored two ↵Gravatar Florian Weikert2015-07-23
| | | | | | | methods. -- MOS_MIGRATED_REVID=98922811
* Invalid double slashes in load statements are now also discovered in BUILD modeGravatar Florian Weikert2015-07-10
| | | | | -- MOS_MIGRATED_REVID=97951248
* Make globs work in remote repositories.Gravatar Lukacs Berki2015-07-08
| | | | | | | | | | | This involved quite a few changes, mainly changing a bunch of places where we refer to packages by a PathFragment to PackageIdentifier. The only wart is the code in PathPackageLocator: ideally, it would just call into PackageLookupFunction. Unfortunately, it is (through globbing and Parser.include) called from within a Skyframe function, and we don't want to have two eval() calls going on at the same time, so we cannot use that. There is a potential correctness issue there: PathPackageLocator now assumes where external repositories are put and assumes that they are there when it gets control, but my understanding is that the associated RepositoryValue is always evaluated before, so it works out okay. -- MOS_MIGRATED_REVID=97751539
* Rollback of accidentally submitted change.Gravatar Lukacs Berki2015-07-07
| | | | | -- MOS_MIGRATED_REVID=97648982
* Make globs work in remote repositories.Gravatar Lukacs Berki2015-07-07
| | | | | | | | | | | This involved quite a few changes, mainly changing a bunch of places where we refer to packages by a PathFragment to PackageIdentifier. The only wart is the code in PathPackageLocator: ideally, it would just call into PackageLookupFunction. Unfortunately, it is (through globbing and Parser.include) called from within a Skyframe function, and we don't want to have two eval() calls going on at the same time, so we cannot use that. There is a potential correctness issue there: PathPackageLocator now assumes where external repositories are put and assumes that they are there when it gets control, but my understanding is that the associated RepositoryValue is always evaluated before, so it works out okay. -- MOS_MIGRATED_REVID=97647787
* Update parser error message.Gravatar Laurent Le Brun2015-06-30
| | | | | -- MOS_MIGRATED_REVID=97224936
* Fix NullPointerException in parser.Gravatar Laurent Le Brun2015-06-16
| | | | | | | Location was not set. -- MOS_MIGRATED_REVID=96096088
* Skylark: Forbid break/continue in BUILD files.Gravatar Laurent Le Brun2015-06-16
| | | | | -- MOS_MIGRATED_REVID=96095253
* Skylark: First argument of load() may no longer start with two slashes ("//")Gravatar Florian Weikert2015-06-15
| | | | | -- MOS_MIGRATED_REVID=95833265
* Remove Path from Location, ParserInputSource and bunch of other low-level ↵Gravatar Lukacs Berki2015-06-12
| | | | | | | | | | | | | | | | | classes. This makes the code cleaner because a lot of places never read the file and thus never needed a Path in the first place. I got to this change in a bit convoluted way: - I wanted the default tools in Android rules to point to //external: - I wanted to make sure that that doesn't cause an error is no Android rules are built, thus I had to add some binding for them in the default WORKSPACE file - I wanted the Android rules not to depend on Bazel core with an eye towards eventually moving them to a separate jar / Skylark code - The default WORKSPACE file is currently composed from files extracted by the Bazel launcher which would make the Android rules depend on a very core mechanism - I couldn't simply pass in jdk.WORKSPACE as a String because Location, ParserInputSource and a bunch of other things needed a Path, which a simple string doesn't have. Thus, this change. -- MOS_MIGRATED_REVID=95828839
* Skylark: implemented 'break' and 'continue'Gravatar Florian Weikert2015-06-10
| | | | | | | | Fixes #233. https://github.com/google/bazel/issues/233 -- MOS_MIGRATED_REVID=95632067
* Parser cleanup: Introduce an enum instead of the booleansGravatar Laurent Le Brun2015-05-28
| | | | | -- MOS_MIGRATED_REVID=94649435
* Forbid **kwargs and *args in BUILD files.Gravatar Laurent Le Brun2015-05-27
| | | | | | | | | Rationale: it makes BUILD files less declarative and makes harder to do automated changes on BUILD files. It is however still allowed in .bzl files. -- MOS_MIGRATED_REVID=94577442