aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/Parser.java
Commit message (Collapse)AuthorAge
* 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
* Allow if filtering in list comprehensionsGravatar Laurent Le Brun2015-05-18
| | | | | -- MOS_MIGRATED_REVID=93881507
* Skylark: Functions don't need to be declared in order.Gravatar Laurent Le Brun2015-05-15
| | | | | -- MOS_MIGRATED_REVID=93515487
* Build language: Support 'not in' operator.Gravatar Laurent Le Brun2015-05-08
| | | | | -- MOS_MIGRATED_REVID=93129861
* Parser: Update code to prepare for list filtering.Gravatar Laurent Le Brun2015-04-22
| | | | | -- MOS_MIGRATED_REVID=91714318
* Build language: Implement integer divisionGravatar Laurent Le Brun2015-04-15
| | | | | -- MOS_MIGRATED_REVID=91192716
* Allow evaluation from StringGravatar Francois-Rene Rideau2015-04-13
| | | | | | | | | | | | | | | | | | | Lift the Evaluation code from the test files AbstractParserTestCase and AbstractEvaluationTestCase into new files EvaluationContext. Remove this code's dependency on FsApparatus (and thus to InMemoryFS), by making the Lexer accept null as filename. Also remove dependency on EventCollectionApparatus; parameterized by an EventHandler. Have the SkylarkSignatureProcessor use this Evaluation for defaultValue-s. While refactoring evaluation, have SkylarkShell use it, which fixes its ValidationEnvironment issues. TODO: refactor the tests to use this new infrastructure. -- MOS_MIGRATED_REVID=90824736
* Skylark: Remove superfluous error message.Gravatar Laurent Le Brun2015-04-03
| | | | | -- MOS_MIGRATED_REVID=90157406
* Parser: Make error recovery more conservative.Gravatar Laurent Le Brun2015-04-02
| | | | | | | | Reduce the number of error message after a parse error. Recover only when we have confidence we are in good state. -- MOS_MIGRATED_REVID=90147322
* Parser: Useful error messages when a Python keyword is used.Gravatar Laurent Le Brun2015-03-24
| | | | | -- MOS_MIGRATED_REVID=89307831
* Parser: Improve error messages (mention what was expected)Gravatar Laurent Le Brun2015-03-24
| | | | | -- MOS_MIGRATED_REVID=89296523
* Parser: Allow more complex expressions as for loop variables.Gravatar Laurent Le Brun2015-03-23
| | | | | | | Also, use LValue in ForStatement. -- MOS_MIGRATED_REVID=89122760
* Parser: Support tuples without parens.Gravatar Laurent Le Brun2015-03-20
| | | | | | | | | | | | | | | In Python, tuples normally don't need parens, e.g. a, b = c, d for i, j in e: pass However, they are sometimes required to avoid ambiguity: fct((x, y)) [(1, 2), (3, 4)] This distinction is handled with parseExpression vs parseNonTupleExpression. -- MOS_MIGRATED_REVID=89118478
* New class hierarchy for Skylark functionsGravatar Francois-Rene Rideau2015-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | * New hierarchy BaseFunction > UserModeFunction, BuiltinFunction. The old hierarchy still exists for now, to be deleted after migration: Function > AbstractFunction > MixedModeFunction > (UserModeFunction, SkylarkFunction > SimpleSkylarkFunction) (UserModeFunction is already migrated, and BaseFunction implements Function, for now.) * Function supports *args and **kwargs when calling functions, and mandatory named-only parameters in the style of Python 3. Notable difference with Python: *args binds the variable to a tuple, because a Skylark list would have to be monomorphic. * A better, simpler, safer FFI using reflection with BuiltinFunction. Handles typechecking, passes parameters in a more Java style. (Not used for now, will be used later.) * A new annotation @SkylarkSignature, intended to replace @SkylarkBuiltin, supports the full function call protocol, including default arguments. * Support for annotating function Factory-s rather than functions. -- MOS_MIGRATED_REVID=88958581
* Parser: Add the 'pass' keywordGravatar Laurent Le Brun2015-03-18
| | | | | -- MOS_MIGRATED_REVID=88857682
* Parser: allow multiple statements on the same line as the colonGravatar Laurent Le Brun2015-03-18
| | | | | | | | | e.g. def foo(x, y): print(x); print(y) Bug found when adding the pass statement. -- MOS_MIGRATED_REVID=88852710
* Skylark: Fix an infinite loop in the parserGravatar Laurent Le Brun2015-03-18
| | | | | -- MOS_MIGRATED_REVID=88830705