aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2019-08-09 11:37:24 +0200
committerDimitri Sokolyuk <demon@dim13.org>2019-08-09 11:37:24 +0200
commitab8724ea61f7efa8073932b716285c3bd09d31cf (patch)
tree855fc6e66c50206012d636f1fb87c074e1583e1f
parentb766d2119ae0503e402f305fdf034ccafa4fdae9 (diff)
remove manual codegen commentHEADmaster
-rw-r--r--calc.go36
-rw-r--r--calc.y2
2 files changed, 17 insertions, 21 deletions
diff --git a/calc.go b/calc.go
index 672d063..8ac53dd 100644
--- a/calc.go
+++ b/calc.go
@@ -1,13 +1,11 @@
// Code generated by goyacc -o calc.go calc.y. DO NOT EDIT.
//line calc.y:2
-// Code generated by yacc. DO NOT EDIT.
-
package main
import __yyfmt__ "fmt"
-//line calc.y:4
+//line calc.y:2
import (
"math"
@@ -22,7 +20,7 @@ var reg = map[string]float64{
const last = "_"
-//line calc.y:21
+//line calc.y:19
type yySymType struct {
yys int
fval float64
@@ -59,7 +57,7 @@ const yyEofCode = 1
const yyErrCode = 2
const yyInitialStackSize = 16
-//line calc.y:64
+//line calc.y:62
func init() {
rand.Seed(time.Now().UnixNano())
@@ -492,86 +490,86 @@ yydefault:
case 2:
yyDollar = yyS[yypt-1 : yypt+1]
-//line calc.y:40
+//line calc.y:38
{
reg[last] = yyDollar[1].fval
yylex.(*yyLex).result = yyDollar[1].fval
}
case 3:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:44
+//line calc.y:42
{
reg[yyDollar[1].sval] = yyDollar[3].fval
}
case 6:
yyDollar = yyS[yypt-1 : yypt+1]
-//line calc.y:50
+//line calc.y:48
{
yyVAL.fval = reg[yyDollar[1].sval]
}
case 7:
yyDollar = yyS[yypt-1 : yypt+1]
-//line calc.y:51
+//line calc.y:49
{
yyVAL.fval = reg[last]
}
case 8:
yyDollar = yyS[yypt-1 : yypt+1]
-//line calc.y:52
+//line calc.y:50
{
yyVAL.fval = rand.Float64()
}
case 9:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:53
+//line calc.y:51
{
yyVAL.fval = yyDollar[1].fval + yyDollar[3].fval
}
case 10:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:54
+//line calc.y:52
{
yyVAL.fval = yyDollar[1].fval - yyDollar[3].fval
}
case 11:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:55
+//line calc.y:53
{
yyVAL.fval = yyDollar[1].fval * yyDollar[3].fval
}
case 12:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:56
+//line calc.y:54
{
yyVAL.fval = yyDollar[1].fval / yyDollar[3].fval
}
case 13:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:57
+//line calc.y:55
{
yyVAL.fval = math.Mod(yyDollar[1].fval, yyDollar[3].fval)
}
case 14:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:58
+//line calc.y:56
{
yyVAL.fval = math.Pow(yyDollar[1].fval, yyDollar[3].fval)
}
case 15:
yyDollar = yyS[yypt-2 : yypt+1]
-//line calc.y:59
+//line calc.y:57
{
yyVAL.fval = -yyDollar[2].fval
}
case 16:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:60
+//line calc.y:58
{
yyVAL.fval = yyDollar[2].fval
}
case 17:
yyDollar = yyS[yypt-3 : yypt+1]
-//line calc.y:61
+//line calc.y:59
{
yyVAL.fval = math.Abs(yyDollar[2].fval)
}
diff --git a/calc.y b/calc.y
index 9f81d6c..61aad26 100644
--- a/calc.y
+++ b/calc.y
@@ -1,6 +1,4 @@
%{
-// Code generated by yacc. DO NOT EDIT.
-
package main
import (