Browse Source

Add parser files

master
champii 1 year ago
parent
commit
16ed9234f0
7 changed files with 588 additions and 572 deletions
  1. 1
    1
      Makefile
  2. BIN
      lib/std/.og/template
  3. 1
    1
      parser/Og.interp
  4. 581
    558
      parser/og_parser.go
  5. BIN
      tests/exemples/.og/template
  6. 3
    3
      tests/exemples/generics.og
  7. 2
    9
      tests/og_test.go

+ 1
- 1
Makefile View File

@@ -74,7 +74,7 @@ new:
74 74
 
75 75
 test:
76 76
 	@$(call section_title,Testing)
77
-	@go test og/tests
77
+	@go test ./tests
78 78
 
79 79
 doc:
80 80
 	@docsify serve ./docs

BIN
lib/std/.og/template View File


+ 1
- 1
parser/Og.interp
File diff suppressed because it is too large
View File


+ 581
- 558
parser/og_parser.go
File diff suppressed because it is too large
View File


BIN
tests/exemples/.og/template View File


+ 3
- 3
tests/exemples/generics.og View File

@@ -10,9 +10,9 @@ struct Foo<T>
10 10
 
11 11
 main ->
12 12
   fmt.Println(a<int>(1))
13
-  fmt.Println(a<string>(1))
13
+  fmt.Println(a<string>("a"))
14 14
   a := Foo<int>
15 15
     bar: 1
16 16
 
17
-  b := bar.Foo<int>
18
-    bar: 1
17
+#  b := bar.Foo<int>
18
+#    bar: 1

+ 2
- 9
tests/og_test.go View File

@@ -2,11 +2,10 @@ package main
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	"og/lib/og"
6
-
7 5
 	"testing"
8 6
 
9 7
 	"github.com/champii/og/lib/common"
8
+	"github.com/champii/og/lib/og"
10 9
 )
11 10
 
12 11
 func TestMain(t *testing.T) {
@@ -488,15 +487,9 @@ import (
488 487
 
489 488
 func main() {
490 489
 	fmt.Println(exemples_a_int(1))
491
-	fmt.Println(exemples_a_string(1))
490
+	fmt.Println(exemples_a_string("a"))
492 491
 	a := exemples_Foo_int{bar: 1}
493
-	b := bar_Foo_int{bar: 1}
494 492
 }
495
-
496
-type bar_Foo_int struct {
497
-	bar int
498
-}
499
-
500 493
 func exemples_a_int(t int) int {
501 494
 	return t
502 495
 }

Loading…
Cancel
Save