From c17d559155b3f666a729d6380d9b8236f67bc481 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 5 Apr 2015 19:18:32 -0700 Subject: 1019 - stupid error in 'new' --- cpp/013run | 2 +- cpp/029string | 3 ++- cpp/030length | 1 + cpp/string-test.mu | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp') diff --git a/cpp/013run b/cpp/013run index 7296d128..e5da06f3 100644 --- a/cpp/013run +++ b/cpp/013run @@ -89,7 +89,7 @@ if (argc > 1) { } Trace_stream = new trace_stream; -//? Trace_stream->dump_layer = "all"; //? 1 +//? Trace_stream->dump_layer = "all"; //? 2 transform_all(); recipe_number r = Recipe_number[string("main")]; if (r) run(r); diff --git a/cpp/029string b/cpp/029string index 6778a3c4..9a1a094e 100644 --- a/cpp/029string +++ b/cpp/029string @@ -61,7 +61,8 @@ if (instructions[pc].ingredients[0].properties[0].second[0] == "literal-string") result.push_back(Current_routine.alloc); write_memory(instructions[pc].products[0], result); // assume that all characters fit in a single location - Memory[Current_routine.alloc++] = instructions[0].name.size(); +//? cout << "new string literal: " << instructions[pc].ingredients[0].name << '\n'; //? 1 + Memory[Current_routine.alloc++] = instructions[pc].ingredients[0].name.size(); for (size_t i = 0; i < instructions[pc].ingredients[0].name.size(); ++i) { Memory[Current_routine.alloc++] = instructions[pc].ingredients[0].name[i]; } diff --git a/cpp/030length b/cpp/030length index 6a297dd3..f690d543 100644 --- a/cpp/030length +++ b/cpp/030length @@ -19,6 +19,7 @@ Next_recipe_number++; case LENGTH: { reagent x = canonize(instructions[pc].ingredients[0]); vector result; +//? cout << "length: " << x.value << '\n'; //? 1 result.push_back(Memory[x.value]); write_memory(instructions[pc].products[0], result); break; diff --git a/cpp/string-test.mu b/cpp/string-test.mu index 158c59fd..5470af60 100644 --- a/cpp/string-test.mu +++ b/cpp/string-test.mu @@ -1,6 +1,6 @@ recipe main [ default-space:address:space <- new location:type, 30:literal - x:address:array:character <- new [abcd] + x:address:array:character <- new [abc] y:address:array:character <- new [abc] 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character ] -- cgit 1.4.1-2-gfad0 1&id=08bc4ef99547537d645f6eaac5f0f04e5de5fe3d'>TODO
blob: 715ebc1b9fd268eab0e0dfb816f38b9b04cd754f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96