about summary refs log blame commit diff stats
path: root/018constant.cc
blob: 97239bbe9c243ce0558cd7ebd9ea8e94986d2e19 (plain) (tree)
1
2
3
4
5
6
7
8
9

                            

                                                                                


                                        

          



                        
                                               









                                                                    
 

           



                         
                                                









                                                                     


          


                                        



                               
                                               









                                                                    
//: A few literal constants.

:(scenarios load)  // use 'load' instead of 'run' in all scenarios in this layer

:(before "End Mu Types Initialization")
put(Type_ordinal, "literal-boolean", 0);

//: 'true'

:(scenario true)
def main [
  1:boolean <- copy true
]
+parse:   ingredient: {true: "literal-boolean"}

:(before "End Parsing reagent")
if (name == "true") {
  if (type != NULL) {
    raise << "'true' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-boolean");
  set_value(1);
}

//: 'false'

:(scenario false)
def main [
  1:boolean <- copy false
]
+parse:   ingredient: {false: "literal-boolean"}

:(before "End Parsing reagent")
if (name == "false") {
  if (type != NULL) {
    raise << "'false' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-boolean");
  set_value(0);
}

//: 'null'

:(before "End Mu Types Initialization")
put(Type_ordinal, "literal-address", 0);

:(scenario null)
def main [
  1:address:number <- copy null
]
+parse:   ingredient: {null: "literal-address"}

:(before "End Parsing reagent")
if (name == "null") {
  if (type != NULL) {
    raise << "'null' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-address");
  set_value(0);
}
/ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

# IDE
.codelite/
profanity.mk
profanity.project
profanity.workspace
compile_commands.json
.tern-port
.tern-project

# autotools
.libs/
/Makefile
/Makefile.in
_configs.sed
aclocal.m4
autom4te.cache/
build-aux/
config.log
config.status
configure
libprofanity.la
libtool
m4/
**/.deps/
**.dirstamp
src/config.h
src/config.h.in
src/config.h.in~
src/gitversion.h
src/gitversion.h.in
src/stamp-h1
src/plugins/profapi.lo

# binaries
profanity
**/*.o

# test output
tests/functionaltests/functionaltests
tests/functionaltests/functionaltests.log
tests/functionaltests/functionaltests.trs
tests/unittests/unittests
tests/unittests/unittests.log
tests/unittests/unittests.trs
test-suite.log

# local scripts
clean-test.sh
gen_docs.sh
gitpushall.sh

# website files
main_fragment.html
toc_fragment.html

# valgrind files
valgrind.out

# Generate docs
apidocs/python/_build/
apidocs/python/modules.rst
apidocs/python/prof.rst
apidocs/python/src/prof.pyc
apidocs/python/plugin.rst
apidocs/python/src/plugin.pyc
apidocs/c/html/
apidocs/c/doxygen_sqlite3.db

# Temp Vim files
**/*.swp

# Virtual envs
python2/
python3/

.DS_Store
*.bak
breaks

*.tar.*
*.zip