\
'
"
tree -I 'venv|build'
: display all directories execpt venv
and build
.alias ccg="gcc -Wall -Wextra -Werror -pedantic -std=c99 -g -fsanitize=address -o out"
bash --posix
in terminal.command
_XOPEN_SOURCE >= 500
)
gcc -Isrc
)
conftest.py
(Renamed if needed) and move it to test folder. (not needed as pierre did it for us)python -m venv venv
to create env. ( in root of dir)source venv/bin/activate
pip install pytest pyyaml
pip install cmake-format
(cmake-format -i CMakeLists.txt
)pytest
.yaml
file (see conftest.py
for syntax).deactivate
source venv/bin/activate
pytest
deactivate
To run criterion testsuite:
ctest --verbose
ormake check
(if implemented).
├── CMakeLists.txt (1)
├── src
│ ├── CMakeLists.txt (2)
│ ├── lexer
│ │ ├── CMakeLists.txt (3)
│ │ ├── lexer.c
│ │ ├── lexer.h
│ │ ├── token.c
│ │ └── token.h
└── tests
└── utests
├── CMakeLists.txt (4)
├── lexer
│ └── lexer_1.c
CMakeLists.txt (1)
, make sure to have:
add_subdirectory(src/lexer)
CMakeLists.txt (2)
, make sure to have:
target_link_libraries(42sh PRIVATE ${READLINE_LIB} common_options lexer)
CMakeLists.txt (3)
, make sure to have:add_library(lexer STATIC <--- THIS
lexer.c
lexer.h
token.c
token.h
)
target_include_directories(lexer PUBLIC .) <--- THIS
target_link_libraries(lexer PRIVATE common_options) <--- THIS
CMakeLists.txt (4)
, make sure to have:find_library(CRITERION_LIB criterion)
add_executable(test_criterion utests_1.c lexer/lexer_1.c)
^
`--- THIS
target_link_libraries(test_criterion PRIVATE
${CRITERION_LIB}
common_options
lexer <-- THIS
)
lexer/lexer_1.c
, only need to include #include "token.h"
.git/config
[core]
pager = less -S
[alias]
tree = log --graph --decorate --pretty=oneline --abbrev-commit
git tree
: view commit in tree-like view.git config --global pull.rebase true
: Enable pull rebase.git branch
: Display all existing branches.git checkout <branch>
: switch branchgit checkout -b <branch>
: create branch + switch branchgit push --set-upstream origin <branch>
: Tells git to push to <branch>
and not master.git checkout master
git pull
git merge <name_branch>
Test(....)
by int main(void)
make debug
, an executable named utest_criterion
will be created.gdb utest_criterion
.make clean
+ rm utest_criterion
utest_criterion
at the root is a copy from the one in test. Thus make clean
won't see it.mkdir build/
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
(This should run version without fsanitize=address)mkdir debug/
cd debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
(This should run version with fsanitize=address)-Wl,--start-group
and -Wl,--end-group
to stop worrying about libraries ordering.target_link_libraries(
utest_criterion
PRIVATE ${CRITERION_LIB}
common_options
"-Wl,--start-group"
ast
execution
option_parser
parser
lexer
data-structure
utils
"-Wl,--end-group")
groff -man -Tascii doc/42sh.man | less
Token Recogntion
&& Shell Grammar
sectionsor
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing