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.TokenKindUInt,
lexer.TokenKindFloat, lexer.TokenKindFloat,
lexer.TokenKindString, lexer.TokenKindString,
lexer.TokenKindRune,
lexer.TokenKindLBracket, lexer.TokenKindLBracket,
lexer.TokenKindLParen, lexer.TokenKindLParen,
@ -78,11 +77,6 @@ func (parser *ParsingOperation) parseArgument () (argument Argument, err error)
argument.value = parser.token.Value().(string) argument.value = parser.token.Value().(string)
parser.nextToken() parser.nextToken()
case lexer.TokenKindRune:
argument.kind = ArgumentKindRune
argument.value = parser.token.Value().(rune)
parser.nextToken()
case lexer.TokenKindLBracket: case lexer.TokenKindLBracket:
argument.kind = ArgumentKindPhrase argument.kind = ArgumentKindPhrase
argument.value, err = parser.parseArgumentLevelPhrase() argument.value, err = parser.parseArgumentLevelPhrase()

View File

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

View File

@ -123,11 +123,8 @@ const (
// 0.44 // 0.44
ArgumentKindFloat ArgumentKindFloat
// "hello world" // 'hello world'
ArgumentKindString ArgumentKindString
// 'S'
ArgumentKindRune
) )
// Argument represents a value that can be placed anywhere a value goes. This // 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 # this is a global variable
data pv helloText:String "Hello, world!" data pv helloText:String 'Hello, world!'
# this is a struct definition # this is a struct definition
objt ro Greeter:Obj objt ro Greeter:Obj
rw text:String "Hi." rw text:String 'Hi.'
# this is a function # this is a function
func ro main func ro main

View File

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

View File

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

View File

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