Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
grumpy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
grumpy
Commits
6e5155c4
Commit
6e5155c4
authored
Dec 31, 2016
by
Dylan Trotter
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:google/grumpy
parents
f0115d46
afaf3008
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
13 deletions
+42
-13
.gitignore
.gitignore
+1
-0
Makefile
Makefile
+13
-13
runtime/code.go
runtime/code.go
+14
-0
runtime/code_test.go
runtime/code_test.go
+14
-0
No files found.
.gitignore
View file @
6e5155c4
build
errors.err
*.swp
Makefile
View file @
6e5155c4
...
...
@@ -63,6 +63,8 @@ BENCHMARK_BINS := $(patsubst %,build/%_benchmark,$(BENCHMARKS))
TOOL_BINS
=
$(
patsubst
%,build/bin/%,benchcmp coverparse diffrange
)
GOLINT_BIN
=
build/bin/golint
all
:
$(COMPILER) $(RUNTIME) $(STDLIB) $(TOOL_BINS)
benchmarks
:
$(BENCHMARK_BINS)
...
...
@@ -72,16 +74,13 @@ clean:
# Convenient wrapper around grumprun that avoids having to set up PATH, etc.
run
:
$(RUNNER)
@
grumprun
@
$(RUNNER_BIN)
test
:
$(ACCEPT_PASS_FILES) $(COMPILER_PASS_FILES) $(COMPILER_EXPR_VISITOR_PASS_FILES) $(COMPILER_STMT_PASS_FILES) $(RUNTIME_PASS_FILE) $(STDLIB_PASS_FILES)
# Run 'make test' whenever the the source code changes.
watch
:
-
@
$(MAKE)
test
@
while
inotifywait
-q
-e
modify
--exclude
'^\./(build|\.git)/'
--recursive
.
;
do
sleep
0.2
;
$(MAKE)
test
;
done
precommit
:
cover lint test
.PHONY
:
all benchmarks clean cover lint
run test watch
.PHONY
:
all benchmarks clean cover lint
precommit run test
# ------------------------------------------------------------------------------
# grumpc compiler
...
...
@@ -139,26 +138,27 @@ $(RUNTIME_COVER_FILE): $(RUNTIME) $(filter %_test.go,$(RUNTIME_SRCS))
cover
:
$(RUNTIME_COVER_FILE) $(TOOL_BINS)
@
bash
-c
'comm -12 <(coverparse $< | sed "s/^grumpy/runtime/" | sort) <(git diff --dst-prefix=
$(DIFF_COMMIT)
| diffrange | sort)'
|
sort
-t
':'
-k1
,1
-k2n
,2 |
sed
's/$$/: missing coverage/'
|
tee
errors.err
@
test
!
-s
errors.err
build/bin/golint
:
$(GOLINT_BIN)
:
@
go get
-u
github.com/golang/lint/golint
lint
:
build/bin/golint
@
golint
runtime
lint
:
$(GOLINT_BIN)
@
$(GOLINT_BIN)
-set_exit_status
runtime
# ------------------------------------------------------------------------------
# Standard library
# ------------------------------------------------------------------------------
$(STDLIB_PASS_FILES)
:
$(PKG_DIR)/grumpy/lib/%.pass: $(PKG_DIR)/grumpy/lib/%.a
@
grumprun
-m
`
echo
$*
|
tr
/ .
`
@
$(RUNNER_BIN)
-m
`
echo
$*
|
tr
/ .
`
@
touch
$@
@
echo
'lib/$* PASS'
define
GRUMPY_STDLIB
build/src/grumpy/lib/$(2)/module.go
:
$(1) $(COMPILER)
@
mkdir
-p
build/src/grumpy/lib/
$(2)
@
grumpc
-modname
=
$(
notdir
$(2)
)
$(1)
>
$$
@
@
$(COMPILER_BIN)
-modname
=
$(
notdir
$(2)
)
$(1)
>
$$
@
build/src/grumpy/lib/$(2)/module.d
:
$(1)
@
mkdir
-p
build/src/grumpy/lib/
$(2)
...
...
@@ -180,7 +180,7 @@ $(eval $(foreach x,$(shell seq $(words $(STDLIB_SRCS))),$(call GRUMPY_STDLIB,$(w
$(patsubst %_test,build/%.go,$(ACCEPT_TESTS))
:
build/%.go: %_test.py $(COMPILER)
@
mkdir
-p
$
(
@D
)
@
grumpc
$<
>
$@
@
$(COMPILER_BIN)
$<
>
$@
# TODO: These should not depend on stdlibs and should instead build a .d file.
$(patsubst %,build/%,$(ACCEPT_TESTS))
:
build/%_test: build/%.go $(RUNTIME) $(STDLIB)
...
...
@@ -194,7 +194,7 @@ $(ACCEPT_PASS_FILES): build/%_test.pass: build/%_test
$(patsubst %,build/%.go,$(BENCHMARKS))
:
build/%.go: %.py $(COMPILER)
@
mkdir
-p
$
(
@D
)
@
grumpc
$<
>
$@
@
$(COMPILER_BIN)
$<
>
$@
$(BENCHMARK_BINS)
:
build/benchmarks/%_benchmark: build/benchmarks/%.go $(RUNTIME) $(STDLIB)
@
mkdir
-p
$
(
@D
)
...
...
runtime/code.go
View file @
6e5155c4
// 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
grumpy
import
(
...
...
runtime/code_test.go
View file @
6e5155c4
// 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
grumpy
import
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment