Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shinanca committed Jan 4, 2022
1 parent c145a97 commit d6882f0
Show file tree
Hide file tree
Showing 66 changed files with 490 additions and 2,159 deletions.
6 changes: 3 additions & 3 deletions PITCHME.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

## Описание синтаксиса языка и примеры использования интерпретатора

[Документация находится здесь](https://github.com/covrom/gonec/wiki)
[Документация находится здесь](https://github.com/shinanca/gonec/wiki)


---
Expand Down Expand Up @@ -247,9 +247,9 @@ CALL "сообщить", ARGS r0, ARGS_COUNT 2, VARARG false, GO false, RETURN r
---
![Gonec Logo](/extra/gonec.png)

* [Скачать](https://github.com/covrom/gonec/releases)
* [Скачать](https://github.com/shinanca/gonec/releases)

* [Документация](https://github.com/covrom/gonec/wiki)
* [Документация](https://github.com/shinanca/gonec/wiki)

* [Попробовать онлайн](https://gonec.herokuapp.com)

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[![GitHub issues](https://img.shields.io/github/issues/covrom/gonec.svg)](https://github.com/covrom/gonec/issues) [![Travis](https://travis-ci.org/covrom/gonec.svg?branch=master)](https://github.com/covrom/gonec/releases)
[![GitHub issues](https://img.shields.io/github/issues/covrom/gonec.svg)](https://github.com/shinanca/gonec/issues) [![Travis](https://travis-ci.org/covrom/gonec.svg?branch=master)](https://github.com/shinanca/gonec/releases)

[![Gonec Logo](/extra/gonec.png)](https://github.com/covrom/gonec/releases)
[![Gonec Logo](/extra/gonec.png)](https://github.com/shinanca/gonec/releases)

[![Demo site](/extra/button_play.png)](https://gonec.herokuapp.com/)

[![Presentation](/extra/button_ppt.png)](https://gitpitch.com/covrom/gonec)
[![Docs](/extra/button_doc.png)](https://github.com/covrom/gonec/wiki)
[![Docs](/extra/button_doc.png)](https://github.com/shinanca/gonec/wiki)

## Цели

Платформа `Гонец:Микросервисы` создана для решения программистами 1С задач, связанных с высокопроизводительными распределенными вычислениями, создания микросервисов, вэб-сервисов и вэб-порталов для работы тысяч пользователей, работы с высокоэффективными базами данных, с использованием синтаксиса языка, похожего, но не ограниченного возможностями языка 1С. Для этого интерпретатор встраивается в решения на языке Go.

## Описание синтаксиса языка и примеры использования интерпретатора

[Документация находится здесь](https://github.com/covrom/gonec/wiki)
[Документация находится здесь](https://github.com/shinanca/gonec/wiki)

Пример приложения "Список задач":

[![Todo application](/extra/TODOApp.png)](https://github.com/covrom/gonec/wiki/%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D0%B7%D0%B0%D0%B4%D0%B0%D1%87)
[![Todo application](/extra/TODOApp.png)](https://github.com/shinanca/gonec/wiki/%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D0%B7%D0%B0%D0%B4%D0%B0%D1%87)

## Масштабируемость языка и платформы
Язык Гонец расширяется путем изменения правил синтаксиса в формате YACC, а так же написания библиотек структур и функций на Го, которые могут быть доступны как объекты метаданных в языке Гонец.
Expand Down
8 changes: 4 additions & 4 deletions ast/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package ast
import (
"reflect"

"github.com/covrom/gonec/bincode/binstmt"
"github.com/covrom/gonec/core"
"github.com/covrom/gonec/names"
"github.com/covrom/gonec/pos"
"github.com/shinanca/gonec/bincode/binstmt"
"github.com/shinanca/gonec/core"
"github.com/shinanca/gonec/names"
"github.com/shinanca/gonec/pos"
)

// Expr provides all of interfaces for expression.
Expand Down
8 changes: 4 additions & 4 deletions ast/stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"runtime"
"sync"

"github.com/covrom/gonec/bincode/binstmt"
"github.com/covrom/gonec/core"
"github.com/covrom/gonec/names"
"github.com/covrom/gonec/pos"
"github.com/shinanca/gonec/bincode/binstmt"
"github.com/shinanca/gonec/core"
"github.com/shinanca/gonec/names"
"github.com/shinanca/gonec/pos"
)

func StartStmtSimplifyWorkers(ch chan Stmt, wg *sync.WaitGroup, num int) {
Expand Down
2 changes: 1 addition & 1 deletion ast/token.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ast

import "github.com/covrom/gonec/pos"
import "github.com/shinanca/gonec/pos"

type Token struct {
pos.PosImpl // StmtImpl provide Pos() function.
Expand Down
14 changes: 7 additions & 7 deletions bincode/binregs.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package bincode

import (
"github.com/covrom/gonec/core"
"github.com/shinanca/gonec/core"
)

// Регистры виртуальной машины

type VMRegs struct {
Env *core.Env
Env *core.Env
// Reg []core.VMValuer // регистры значений
Labels []int // [label]=index в BinCode
TryLabel []int // последний элемент - это метка на текущий обработчик CATCH
TryRegErr []int // последний элемент - это регистр с ошибкой текущего обработчика
ForBreaks []int // последний элемент - это метка для break
ForContinues []int // последний элемент - это метка для continue
Labels []int // [label]=index в BinCode
TryLabel []int // последний элемент - это метка на текущий обработчик CATCH
TryRegErr []int // последний элемент - это регистр с ошибкой текущего обработчика
ForBreaks []int // последний элемент - это метка для break
ForContinues []int // последний элемент - это метка для continue
// ReturnTo []int // стек возвратов по RET
}

Expand Down
6 changes: 3 additions & 3 deletions bincode/binstmt/binstmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"reflect"
"time"

"github.com/covrom/gonec/core"
"github.com/covrom/gonec/names"
"github.com/covrom/gonec/pos"
"github.com/shinanca/gonec/core"
"github.com/shinanca/gonec/names"
"github.com/shinanca/gonec/pos"
)

type BinStmt interface {
Expand Down
3 changes: 1 addition & 2 deletions bincode/binstmt/binvmtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

posit "github.com/covrom/gonec/pos"
posit "github.com/shinanca/gonec/pos"
)

// Error provides a convenient interface for handling runtime error.
Expand Down Expand Up @@ -62,4 +62,3 @@ func (e *Error) String() string {
// учитываем вставку модуля _ по умолчанию - вычитаем 1 из номера строки
return e.Message
}

10 changes: 5 additions & 5 deletions bincode/binvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"strings"
"sync"

"github.com/covrom/gonec/ast"
"github.com/covrom/gonec/bincode/binstmt"
"github.com/covrom/gonec/core"
"github.com/covrom/gonec/names"
"github.com/covrom/gonec/parser"
"github.com/shinanca/gonec/ast"
"github.com/shinanca/gonec/bincode/binstmt"
"github.com/shinanca/gonec/core"
"github.com/shinanca/gonec/names"
"github.com/shinanca/gonec/parser"
)

func Interrupt(env *core.Env) {
Expand Down
2 changes: 1 addition & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/covrom/decnum"

"github.com/covrom/gonec/names"
"github.com/satori/go.uuid"
"github.com/shinanca/gonec/names"
)

// LoadAllBuiltins is a convenience function that loads all defineSd builtins.
Expand Down
2 changes: 1 addition & 1 deletion core/coreboltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/boltdb/bolt"
"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMBoltDB - группа ожидания исполнения горутин
Expand Down
2 changes: 1 addition & 1 deletion core/corebool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"reflect"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMInt для ускорения работы храним целочисленное представление отдельно от decimal
Expand Down
2 changes: 1 addition & 1 deletion core/corechan.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

import (
"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMChan - канал для передачи любого типа вирт. машины
Expand Down
2 changes: 1 addition & 1 deletion core/coreconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"strings"
"time"

"github.com/covrom/gonec/names"
uuid "github.com/satori/go.uuid"
"github.com/shinanca/gonec/names"
)

func NewVMConn(data VMValuer) *VMConn {
Expand Down
2 changes: 1 addition & 1 deletion core/coreenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sort"
"sync"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

const chunkValsPool = 16
Expand Down
2 changes: 1 addition & 1 deletion core/corehttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io/ioutil"
"net/http"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMHttpRequest запрос к http серверу
Expand Down
2 changes: 1 addition & 1 deletion core/coremap.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/json"
"reflect"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

type VMStringMap map[string]VMValuer
Expand Down
2 changes: 1 addition & 1 deletion core/coremetaobj.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/json"
"reflect"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMMetaObj корневая структура для системных функциональных структур Го, доступных из языка Гонец
Expand Down
2 changes: 1 addition & 1 deletion core/coreservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

"github.com/covrom/gonec/consulapi"
"github.com/shinanca/gonec/consulapi"
)

// VMMainServiceBus главный менеджер сервисов
Expand Down
2 changes: 1 addition & 1 deletion core/coreslice.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sort"
"sync"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

const ChunkVMSlicePool = 64
Expand Down
2 changes: 1 addition & 1 deletion core/coretime.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/coretypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"time"

"github.com/covrom/decnum"
"github.com/covrom/gonec/names"
"github.com/dchest/siphash"
"github.com/shinanca/gonec/names"
)

type VMOperation int
Expand Down
2 changes: 1 addition & 1 deletion core/corewaitgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"sync"

"github.com/covrom/gonec/names"
"github.com/shinanca/gonec/names"
)

// VMWaitGroup - группа ожидания исполнения горутин
Expand Down
2 changes: 1 addition & 1 deletion example/todo.gnc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

база = Новый ФайловаяБазаДанных
база.Открыть("todo.db")

тест = Новый массив()
// инициируем таблицу, если ее еще нет
тр = база.НачатьТранзакцию(Истина)
тр.Таблица("Задачи")
Expand Down
2 changes: 1 addition & 1 deletion extra/gonec_head_w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module github.com/shinanca/gonec

go 1.17

require (
github.com/Kelwing/mc-rcon v0.0.0-20191221214055-1f327b337f77
github.com/boltdb/bolt v1.3.1
github.com/covrom/decnum v0.0.0-20171025200506-7ae6a5b29284
github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc
github.com/dchest/siphash v1.2.0
github.com/hashicorp/go-cleanhttp v0.5.0
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90
github.com/hashicorp/serf v0.8.1
github.com/mattn/go-isatty v0.0.4
github.com/satori/go.uuid v1.2.0
)

require (
github.com/golangplus/testing v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.0.0 // indirect
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
35 changes: 35 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
github.com/Kelwing/mc-rcon v0.0.0-20191221214055-1f327b337f77 h1:4iotpbMl1dl6h/htbqKCnYQFCIxyV7F1ce+anGXLyCY=
github.com/Kelwing/mc-rcon v0.0.0-20191221214055-1f327b337f77/go.mod h1:wlXY/EO9CBjMViEh95JOQhp//RMnHs4ZUBhYhx43LdM=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/covrom/decnum v0.0.0-20171025200506-7ae6a5b29284 h1:XsKdPYWrLqzfMDc4QEBxIijkfyZgDaeWf1UrHkJ8VK0=
github.com/covrom/decnum v0.0.0-20171025200506-7ae6a5b29284/go.mod h1:8kEVH6C3L1fT7E0cL1+JZHdGdJKSvBUTTxs9DuaT5GA=
github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc h1:nqMZEdowWmtK9ysqvFibHJ56mTprkyE5c/6q8ZHwLc0=
github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE=
github.com/dchest/siphash v1.2.0 h1:YWOShuhvg0GqbQpMa60QlCGtEyf7O7HC1Jf0VjdQ60M=
github.com/dchest/siphash v1.2.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho=
github.com/golangplus/fmt v1.0.0/go.mod h1:zpM0OfbMCjPtd2qkTD/jX2MgiFCqklhSUFyDW44gVQE=
github.com/golangplus/testing v1.0.0 h1:+ZeeiKZENNOMkTTELoSySazi+XaEhVO0mb+eanrSEUQ=
github.com/golangplus/testing v1.0.0/go.mod h1:ZDreixUV3YzhoVraIDyOzHrr76p6NUh6k/pPg/Q3gYA=
github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 h1:VBj0QYQ0u2MCJzBfeYXGexnAl17GsH1yidnoxCqqD9E=
github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90/go.mod h1:o4zcYY1e0GEZI6eSEr+43QDYmuGglw1qSO6qdHUHCgg=
github.com/hashicorp/serf v0.8.1 h1:mYs6SMzu72+90OcPa5wr3nfznA4Dw9UyR791ZFNOIf4=
github.com/hashicorp/serf v0.8.1/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"strings"
"time"

"github.com/covrom/gonec/bincode"
"github.com/covrom/gonec/bincode/binstmt"
"github.com/covrom/gonec/core"
"github.com/covrom/gonec/parser"
"github.com/covrom/gonec/services/gonecsvc"
"github.com/covrom/gonec/version"
"github.com/daviddengcn/go-colortext"
"github.com/mattn/go-isatty"
uuid "github.com/satori/go.uuid"
"github.com/shinanca/gonec/bincode"
"github.com/shinanca/gonec/bincode/binstmt"
"github.com/shinanca/gonec/core"
"github.com/shinanca/gonec/parser"
"github.com/shinanca/gonec/services/gonecsvc"
"github.com/shinanca/gonec/version"

_ "net/http/pprof"
)
Expand Down
Loading

0 comments on commit d6882f0

Please sign in to comment.