• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
            • Parse-expressions
            • Parse-udps
            • Parse-statements
            • Parse-property
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
              • Defparser
              • Vl-endinfo-p
              • Vl-match-token
              • Vl-match-some-token
              • Vl-match-any-except
              • Vl-parse-error
              • Vl-match
              • Vl-type-of-matched-token
              • Vl-tokstream-backup-p
              • Vl-maybe-match-token
              • Vl-parse-warning
              • Vl-match-any
              • Vl-linestart-indent
                • Vl-current-loc
                • Vl-choose-parse-error
                • Vl-parse-endblock-name
                • Vl-tokenlist-fix
                • Vl-lookahead-is-some-token?
                • Vl-tokstream-fix
                • Vl-is-token?
                • Vl-is-some-token?
                • Vl-add-context-to-parser-warning
                • Vl-lookahead-is-token?
                • Vl-tokstream-save
                • Vl-tokstream->tokens
                • Vl-tokstream-restore
                • Vl-tokstream-add-warning
                • Vl-tokstream->pstate
                • Vl-tokstream->position
                • Expand-defparsers
                • Vl-tokstream-pop
                • *vl-default-token*
              • Parse-insts
              • Parse-functions
              • Parse-assignments
              • Parse-clocking
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-netdecls
              • Parse-asserts
              • Vl-maybe-parse-lifetime
              • Parse-dpi-import-export
              • Parse-ports
              • Parse-timeunits
              • Seq
              • Parse-packages
              • Parse-eventctrl
            • Vl-load-merge-descriptions
            • Vl-find-basename/extension
            • Vl-load-file
            • Vl-loadresult
            • Scope-of-defines
            • Vl-find-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-read-file
            • Vl-includeskips-report-gather
            • Vl-load-main
            • Extended-characters
            • Vl-load
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-preprocess-debug
            • Vl-write-preprocessor-debug-file
            • Vl-read-file-report-gather
            • Vl-load-descriptions
            • Vl-load-files
            • Translate-off
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parse-utils

    Vl-linestart-indent

    Compatible with seq. If we are at the first token on a line, return its column number. Otherwise return NIL.

    Signature
    (vl-linestart-indent &key (tokstream 'tokstream)) 
      → 
    (mv errmsg startcol new-tokstream)
    Returns
    errmsg — Type (not errmsg).
    startcol — Type (maybe-natp startcol).
    new-tokstream — Type (equal new-tokstream tokstream).

    Definitions and Theorems

    Function: vl-linestart-indent-fn

    (defun vl-linestart-indent-fn (tokstream)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard t))
      (let ((__function__ 'vl-linestart-indent))
        (declare (ignorable __function__))
        (b* ((tokens (vl-tokstream->tokens))
             ((unless (and (consp tokens)
                           (vl-token->breakp (car tokens))))
              (mv nil nil tokstream))
             (echar1 (car (vl-token->etext (car tokens))))
             (col1 (vl-echarpack->col (vl-echar-raw->pack echar1))))
          (mv nil col1 tokstream))))

    Theorem: not-of-vl-linestart-indent.errmsg

    (defthm not-of-vl-linestart-indent.errmsg
      (b* (((mv ?errmsg ?startcol ?new-tokstream)
            (vl-linestart-indent-fn tokstream)))
        (not errmsg))
      :rule-classes :rewrite)

    Theorem: maybe-natp-of-vl-linestart-indent.startcol

    (defthm maybe-natp-of-vl-linestart-indent.startcol
      (b* (((mv ?errmsg ?startcol ?new-tokstream)
            (vl-linestart-indent-fn tokstream)))
        (maybe-natp startcol))
      :rule-classes :type-prescription)

    Theorem: return-type-of-vl-linestart-indent.new-tokstream

    (defthm return-type-of-vl-linestart-indent.new-tokstream
      (b* (((mv ?errmsg ?startcol ?new-tokstream)
            (vl-linestart-indent-fn tokstream)))
        (equal new-tokstream tokstream))
      :rule-classes :rewrite)