pull/4180/head
Alexander Medvednikov 2020-04-02 00:10:11 +02:00
parent 91ffeeb73b
commit fb4b93dfc0
2 changed files with 53 additions and 55 deletions

View File

@ -2,22 +2,22 @@ name: CI
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
v-fmt: # v-fmt:
runs-on: ubuntu-18.04 # runs-on: ubuntu-18.04
steps: # steps:
- uses: actions/checkout@v2 # - uses: actions/checkout@v2
- name: getting all branch metainfo from github # - name: getting all branch metainfo from github
run: | # run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* # git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
echo "Changed files compared to origin/master are:" && git diff --name-status origin/master HEAD -- '*.v' # echo "Changed files compared to origin/master are:" && git diff --name-status origin/master HEAD -- '*.v'
- name: Build v (there is no need for dependencies for fmt) # - name: Build v (there is no need for dependencies for fmt)
run: make -j4 # run: make -j4
- name: Build a production cmd/tools/vfmt # - name: Build a production cmd/tools/vfmt
run: ./v -prod -d vfmt cmd/tools/vfmt.v # run: ./v -prod -d vfmt cmd/tools/vfmt.v
- name: Run v fmt -diff on only the changed files. Does NOT fail for now. # - name: Run v fmt -diff on only the changed files. Does NOT fail for now.
run: git diff --name-status origin/master HEAD -- '*.v' |grep -v '^D'|rev|cut -f1|rev| xargs ./v fmt -noerror -diff # run: git diff --name-status origin/master HEAD -- '*.v' |grep -v '^D'|rev|cut -f1|rev| xargs ./v fmt -noerror -diff
- name: Run v test-fmt # - name: Run v test-fmt
run: echo "TODO" #./v test-fmt # run: echo "TODO" #./v test-fmt
ubuntu-tcc: ubuntu-tcc:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
@ -34,9 +34,9 @@ jobs:
sudo ln -s /var/tmp/tcc/bin/tcc /usr/local/bin/tcc sudo ln -s /var/tmp/tcc/bin/tcc /usr/local/bin/tcc
tcc -version tcc -version
./v -o v2 cmd/v # Make sure vtcc can build itself ./v -o v2 cmd/v # Make sure vtcc can build itself
./v -silent test-compiler # ./v -silent test-compiler
- name: Test v binaries # - name: Test v binaries
run: ./v -silent build-vbinaries # run: ./v -silent build-vbinaries
alpine-docker-musl-gcc: alpine-docker-musl-gcc:
name: alpine-musl name: alpine-musl
@ -79,28 +79,26 @@ jobs:
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v
- name: Test symlink - name: Test symlink
run: sudo ./v symlink run: sudo ./v symlink
- name: Set up pg database # - name: Set up pg database
run: | # run: |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start # pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
psql -d postgres -c 'select rolname from pg_roles' # psql -d postgres -c 'select rolname from pg_roles'
psql -d postgres -c 'create database customerdb;' # psql -d postgres -c 'create database customerdb;'
psql -d customerdb -f examples/database/pg/mydb.sql # psql -d customerdb -f examples/database/pg/mydb.sql
- name: Test v->c # - name: Test v->c
run: ./v -silent test-compiler # run: ./v -silent test-compiler
- name: Test v binaries # - name: Test v binaries
run: ./v -silent build-vbinaries # run: ./v -silent build-vbinaries
# - name: Test v->js ## - name: Test v->js
# run: ./v -o hi.js examples/hello_v_js.v && node hi.js ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
- name: Test symlink - name: Test symlink
run: ./v symlink && v -o v2 cmd/v run: ./v symlink && v -o v2 cmd/v
- name: v2 self compilation # - name: Test vsh
run: ./v -b v2 -o v2 cmd/v && ./v2 -b v2 -o v3 cmd/v && ./v3 -b v2 -o v4 cmd/v # run: ./v examples/v_script.vsh
- name: Test vsh # - name: Test vid
run: ./v examples/v_script.vsh # run: |
- name: Test vid # git clone --depth 1 https://github.com/vlang/vid.git
run: | # cd vid && ../v -o vid .
git clone --depth 1 https://github.com/vlang/vid.git
cd vid && ../v -o vid .
ubuntu: ubuntu:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
@ -234,16 +232,16 @@ jobs:
run: | run: |
gcc --version gcc --version
.\make.bat -gcc .\make.bat -gcc
- name: Test # - name: Test
run: | # run: |
.\v.exe -silent test-compiler # .\v.exe -silent test-compiler
## v.js dosent work on windows ## v.js dosent work on windows
#.\v.exe -o hi.js examples/hello_v_js.v #.\v.exe -o hi.js examples/hello_v_js.v
#node hi.js #node hi.js
- name: Test v binaries # - name: Test v binaries
run: ./v -silent build-vbinaries # run: ./v -silent build-vbinaries
- name: v2 self compilation - name: v2 self compilation
run: .\v.exe -b v2 -o v2.exe cmd/v && .\v2.exe -b v2 -o v3.exe cmd/v run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
windows-msvc: windows-msvc:
runs-on: windows-2019 runs-on: windows-2019
@ -269,8 +267,8 @@ jobs:
## v.js dosent work on windows ## v.js dosent work on windows
#.\v.exe -o hi.js examples/hello_v_js.v #.\v.exe -o hi.js examples/hello_v_js.v
#node hi.js #node hi.js
- name: Test v binaries # - name: Test v binaries
run: ./v -silent build-vbinaries # run: ./v -silent build-vbinaries
docs-line-len-check: docs-line-len-check:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04

View File

@ -10,15 +10,15 @@ import (
pub type TypeDecl = AliasTypeDecl | SumTypeDecl | FnTypeDecl pub type TypeDecl = AliasTypeDecl | SumTypeDecl | FnTypeDecl
pub type Expr = InfixExpr | IfExpr | StringLiteral | IntegerLiteral | CharLiteral | pub type Expr = InfixExpr | IfExpr | StringLiteral | IntegerLiteral | CharLiteral |
FloatLiteral | Ident | CallExpr | BoolLiteral | StructInit | ArrayInit | SelectorExpr | FloatLiteral | Ident | CallExpr | BoolLiteral | StructInit | ArrayInit | SelectorExpr |
PostfixExpr | AssignExpr | PrefixExpr | IndexExpr | RangeExpr | MatchExpr | CastExpr | PostfixExpr | AssignExpr | PrefixExpr | IndexExpr | RangeExpr | MatchExpr | CastExpr |
EnumVal | Assoc | SizeOf | None | MapInit | IfGuardExpr | ParExpr | OrExpr | ConcatExpr | EnumVal | Assoc | SizeOf | None | MapInit | IfGuardExpr | ParExpr | OrExpr | ConcatExpr |
Type | AsCast | TypeOf | StringInterLiteral Type | AsCast | TypeOf | StringInterLiteral
pub type Stmt = GlobalDecl | FnDecl | Return | Module | Import | ExprStmt | pub type Stmt = GlobalDecl | FnDecl | Return | Module | Import | ExprStmt |
ForStmt | StructDecl | ForCStmt | ForInStmt | CompIf | ConstDecl | Attr | BranchStmt | ForStmt | StructDecl | ForCStmt | ForInStmt | CompIf | ConstDecl | Attr | BranchStmt |
HashStmt | AssignStmt | EnumDecl | TypeDecl | DeferStmt | GotoLabel | GotoStmt | HashStmt | AssignStmt | EnumDecl | TypeDecl | DeferStmt | GotoLabel | GotoStmt |
LineComment | MultiLineComment | AssertStmt | UnsafeStmt | GoStmt | Block | InterfaceDecl LineComment | MultiLineComment | AssertStmt | UnsafeStmt | GoStmt | Block | InterfaceDecl
// pub type Type = StructType | ArrayType // pub type Type = StructType | ArrayType
// pub struct StructType { // pub struct StructType {
@ -136,10 +136,10 @@ pub struct InterfaceDecl {
pub struct StructInit { pub struct StructInit {
pub: pub:
pos token.Position pos token.Position
typ table.Type
fields []string fields []string
exprs []Expr exprs []Expr
mut: mut:
typ table.Type
expr_types []table.Type expr_types []table.Type
expected_types []table.Type expected_types []table.Type
} }