Removed runes from parser
This commit is contained in:
parent
c42f4f46fc
commit
b6d3c04acd
@ -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()
|
||||||
|
@ -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" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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'
|
||||||
---
|
---
|
||||||
|
@ -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)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user