// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.

// Symbol.go
package expr

type Symbol int16

const (
	SymUnknown         Symbol = iota - 1 //  -1: Unknown symbol
	SymNone                              //   0: Null value for variable of type symbol
	SymError                             //   1: Error reading from stream
	SymEos                               //   2: End of stream
	SymMinus                             //   3: '-'
	SymMinusEqual                        //   4: '-='
	SymDoubleMinus                       //   5: '--'
	SymPlus                              //   6: '+'
	SymPlusEqual                         //   7: '+='
	SymDoublePlus                        //   8: '++'
	SymStar                              //   9: '*'
	SymDoubleStar                        //  10: '**'
	SymSlash                             //  11: '/'
	SymBackSlash                         //  12: '\'
	SymVertBar                           //  13: '|'
	SymDoubleVertBar                     //  14: '||'
	SymComma                             //  15: ','
	SymColon                             //  16: ':'
	SymSemiColon                         //  17: ';'
	SymDot                               //  18: '.'
	SymDotSlash                          //  19: './'
	SymQuote                             //  20: '\''
	SymDoubleQuote                       //  21: '"'
	SymBackTick                          //  22: '`'
	SymExclamation                       //  23: '!'
	SymQuestion                          //  24: '?'
	SymAmpersand                         //  25: '&'
	SymDoubleAmpersand                   //  26: '&&'
	SymPercent                           //  27: '%'
	SymAt                                //  28: '@'
	SymUndescore                         //  29: '_'
	SymEqual                             //  30: '='
	SymDoubleEqual                       //  31: '=='
	SymLess                              //  32: '<'
	SymLessOrEqual                       //  33: '<='
	SymGreater                           //  34: '>'
	SymGreaterOrEqual                    //  35: '>='
	SymLessGreater                       //  36: '<>'
	SymNotEqual                          //  37: '!='
	SymDollar                            //  38: '$'
	SymHash                              //  39: '#'
	SymOpenRound                         //  40: '('
	SymClosedRound                       //  41: ')'
	SymOpenSquare                        //  42: '['
	SymClosedSquare                      //  43: ']'
	SymOpenBrace                         //  44: '{'
	SymClosedBrace                       //  45: '}'
	SymTilde                             //  46: '~'
	SymDoubleQuestion                    //  47: '??'
	SymQuestionEqual                     //  48: '?='
	SymQuestionExclam                    //  49: '?!'
	SymDoubleAt                          //  50: '@@'
	SymDoubleColon                       //  51: '::'
	SymInsert                            //  52: '>>'
	SymAppend                            //  53: '<<'
	SymCaret                             //  54: '^'
	SymDollarRound                       //  55: '$('
	SymOpenClosedRound                   //  56: '()'
	SymDoubleDollar                      //  57: '$$'
	SymDoubleDot                         //  58: '..'
	SymTripleDot                         //  59: '...'
	SymChangeSign
	SymUnchangeSign
	SymIdentifier
	SymBool
	SymInteger
	SymVariable
	SymFloat
	SymFraction
	SymString
	SymIterator
	SymOr
	SymAnd
	SymNot
	SymComment
	SymFuncCall
	SymFuncDef
	SymList
	SymDict
	SymIndex
	SymExpression
	SymSelector     // <selector> ::= <expr> "?" <selector-case> {":" <selector-case>} ["::" <default-selector-case>]
	SymSelectorCase // <selector-case> ::= [<list>] "{" <multi-expr> "}"
	// SymOpenComment                       //   0: '/*'
	// SymClosedComment                     //   0: '*/'
	// SymOneLineComment                    //   0: '//'
	keywordBase
)
const (
	SymKwAnd = keywordBase + iota
	SymKwNot
	SymKwOr
	SymKwBut
	SymKwFunc
	SymKwBuiltin
	SymKwPlugin
	SymKwIn
	SymKwInclude
	SymKwNil
)

var keywords map[string]Symbol

func init() {
	//keywords = make(map[string]Symbol)
	keywords = map[string]Symbol{
		"AND":     SymKwAnd,
		"BUILTIN": SymKwBuiltin,
		"PLUGIN":  SymKwPlugin,
		"BUT":     SymKwBut,
		"FUNC":    SymKwFunc,
		"IN":      SymKwIn,
		"INCLUDE": SymKwInclude,
		"NOT":     SymKwNot,
		"OR":      SymKwOr,
		"NIL":     SymKwNil,
	}
}
