Fix parameter/field lists and #import #include syntax

This commit is contained in:
Ginger Bill
2017-01-02 00:26:28 +00:00
parent 9202bd1b06
commit ce89a1428e
17 changed files with 623 additions and 788 deletions
+7 -7
View File
@@ -9,7 +9,7 @@ SURROGATE_MIN :: 0xd800;
SURROGATE_MAX :: 0xdfff;
Accept_Range :: struct {
lo, hi u8;
lo, hi: u8;
}
accept_ranges := [5]Accept_Range{
@@ -40,7 +40,7 @@ accept_sizes := [256]byte{
0x34, 0x04, 0x04, 0x04, 0x44, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xf0-0xff
};
encode_rune :: proc(r rune) -> ([4]byte, int) {
encode_rune :: proc(r: rune) -> ([4]byte, int) {
buf: [4]byte;
i := r as u32;
mask: byte : 0x3f;
@@ -74,7 +74,7 @@ encode_rune :: proc(r rune) -> ([4]byte, int) {
return buf, 4;
}
decode_rune :: proc(s string) -> (rune, int) {
decode_rune :: proc(s: string) -> (rune, int) {
n := s.count;
if n < 1 {
return RUNE_ERROR, 0;
@@ -119,7 +119,7 @@ decode_rune :: proc(s string) -> (rune, int) {
}
valid_rune :: proc(r rune) -> bool {
valid_rune :: proc(r: rune) -> bool {
if r < 0 {
return false;
} else if SURROGATE_MIN <= r && r <= SURROGATE_MAX {
@@ -130,7 +130,7 @@ valid_rune :: proc(r rune) -> bool {
return true;
}
valid_string :: proc(s string) -> bool {
valid_string :: proc(s: string) -> bool {
n := s.count;
for i := 0; i < n; {
si := s[i];
@@ -163,7 +163,7 @@ valid_string :: proc(s string) -> bool {
return true;
}
rune_count :: proc(s string) -> int {
rune_count :: proc(s: string) -> int {
count := 0;
n := s.count;
for i := 0; i < n; count++ {
@@ -200,7 +200,7 @@ rune_count :: proc(s string) -> int {
}
rune_size :: proc(r rune) -> int {
rune_size :: proc(r: rune) -> int {
match {
case r < 0: return -1;
case r <= 1<<7 - 1: return 1;