Removed runes from parser

This commit is contained in:
Sasha Koshka 2022-10-04 17:07:31 -04:00
parent c42f4f46fc
commit b6d3c04acd
7 changed files with 12 additions and 27 deletions

View File

@ -12,7 +12,6 @@ var validArgumentStartTokens = []lexer.TokenKind {
lexer.TokenKindUInt,
lexer.TokenKindFloat,
lexer.TokenKindString,
lexer.TokenKindRune,
lexer.TokenKindLBracket,
lexer.TokenKindLParen,
@ -78,11 +77,6 @@ func (parser *ParsingOperation) parseArgument () (argument Argument, err error)
argument.value = parser.token.Value().(string)
parser.nextToken()
case lexer.TokenKindRune:
argument.kind = ArgumentKindRune
argument.value = parser.token.Value().(rune)
parser.nextToken()
case lexer.TokenKindLBracket:
argument.kind = ArgumentKindPhrase
argument.value, err = parser.parseArgumentLevelPhrase()

View File

@ -153,13 +153,7 @@ func (argument Argument) ToString (indent int, breakLine bool) (output string) {
case ArgumentKindString:
output += doIndent (
indent,
"\"" + argument.value.(string) + "\"")
if breakLine { output += "\n" }
case ArgumentKindRune:
output += doIndent (
indent,
"'" + string(argument.value.(rune)) + "'")
"'" + argument.value.(string) + "'")
if breakLine { output += "\n" }
}

View File

@ -123,11 +123,8 @@ const (
// 0.44
ArgumentKindFloat
// "hello world"
// 'hello world'
ArgumentKindString
// 'S'
ArgumentKindRune
)
// Argument represents a value that can be placed anywhere a value goes. This

View File

@ -5,11 +5,11 @@ require "io"
---
# this is a global variable
data pv helloText:String "Hello, world!"
data pv helloText:String 'Hello, world!'
# this is a struct definition
objt ro Greeter:Obj
rw text:String "Hi."
rw text:String 'Hi.'
# this is a function
func ro main

View File

@ -1,7 +1,7 @@
:arf
author "Sasha Koshka"
license "GPLv3"
require "./some/local/module"
require "/some/absolute/path/to/someModule"
require "someLibraryInstalledInStandardLocation"
author 'Sasha Koshka'
license 'GPLv3'
require './some/local/module'
require '/some/absolute/path/to/someModule'
require 'someLibraryInstalledInStandardLocation'
---

View File

@ -7,7 +7,7 @@ data ro aExternalData:Int
data ro bSingleValue:Int 342
data ro cNestedObject:Obj (
(324 "hello world")
(324 'hello world')
(123.8439 9328.21348239)
)

View File

@ -9,7 +9,7 @@ type ro bBitFields:Obj
ro this:Int 298 & 24
type ro cInit:Obj
ro that:String "hello world"
ro that:String 'hello world'
ro this:Int 23
# the semantic analyzer should let these sections restrict the permissions of
@ -24,7 +24,7 @@ type ro eInitAndDefine:aBasic
ro born:Int 4
ro in:Int
ro the:Int:3 (9348 92384 92834)
ro walls:String "live in the walls, die in the walls."
ro walls:String 'live in the walls, die in the walls.'
type ro fBasic:Int