diff --git a/ast.go b/ast.go index e6d3f13..9746600 100644 --- a/ast.go +++ b/ast.go @@ -1,3 +1,19 @@ +/* +Copyright 2016 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package jsonnet import ( diff --git a/lexer.go b/lexer.go index 3804c07..447345f 100644 --- a/lexer.go +++ b/lexer.go @@ -1,3 +1,18 @@ +/* +Copyright 2016 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package jsonnet import ( diff --git a/lexer_test.go b/lexer_test.go index 9a4f82d..2d96a7c 100644 --- a/lexer_test.go +++ b/lexer_test.go @@ -1,3 +1,18 @@ +/* +Copyright 2016 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package jsonnet import ( diff --git a/parser.go b/parser.go index 62f431b..6bf7b6b 100644 --- a/parser.go +++ b/parser.go @@ -1,3 +1,18 @@ +/* +Copyright 2016 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package jsonnet import ( @@ -90,7 +105,7 @@ func (p *parser) parseCommaList(end tokenKind, elementKind string) (*token, astN got_comma := false first := true for { - next := p.peek(); + next := p.peek() if !first && !got_comma { if next.kind == tokenComma { p.pop() @@ -205,10 +220,10 @@ func (p *parser) parse(prec precedence) (astNode, error) { return nil, err } return &astFunction{ - astNodeBase: astNodeBase{locFromTokenAST(begin, body)}, - parameters: params, + astNodeBase: astNodeBase{locFromTokenAST(begin, body)}, + parameters: params, trailingComma: got_comma, - body: body, + body: body, }, nil } else { return nil, makeStaticError(fmt.Sprintf("Expected ( but got %v", next), next.loc) diff --git a/static_error.go b/static_error.go index 8bd0c3e..f0f80e4 100644 --- a/static_error.go +++ b/static_error.go @@ -1,3 +1,18 @@ +/* +Copyright 2016 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package jsonnet import (